Пример #1
0
 /**
  * Event handler to re-parse request URI.
  *
  * @return  void
  */
 public function onAfterRoute()
 {
     // Get installed Joomla version
     $JVersion = new JVersion();
     $JVersion = $JVersion->getShortVersion();
     $option = trim((string) $this->option);
     if (self::$_app->isAdmin() && version_compare($JVersion, '3.0', '>=') && in_array($option, JSNVersion::$products)) {
         $manifestFile = JPATH_ADMINISTRATOR . '/components/' . $option . '/' . str_replace('com_', '', $option) . '.xml';
         if (file_exists($manifestFile)) {
             $xml = JSNUtilsXml::load($manifestFile);
             $attr = $xml->attributes();
             if (count($attr)) {
                 if (isset($attr['version']) && (string) $attr['version'] != '') {
                     $version = (string) $attr['version'];
                     if ($option == 'com_imageshow') {
                         $version = str_replace('.x', '.0', $version);
                     }
                     if (version_compare($version, '3.0', '<')) {
                         // Check if all JSN Extensions are compatible with Joomla 3.x, if not, redirect to index.php and show a warning message
                         self::$_app->enqueueMessage(JText::sprintf('You are running a Joomla 2.5 version of %1$s on Joomla 3.x. Please download %1$s for Joomla 3.x and reinstall via Joomla! Installer to fix the problem.', 'JSN ' . ucfirst(str_replace('com_', '', $option))), 'warning');
                         self::$_app->redirect('index.php');
                         return false;
                     }
                 }
             }
         }
     }
     // Make sure our onAfterRender event handler is the last one executed
     self::$_app->registerEvent('onAfterRender', 'jsnExtFrameworkFinalize');
 }
Пример #2
0
 /**
  * Registers a function to a particular event group
  *
  * @param string The event name
  * @param string The function name
  */
 function registerFunction($event, $function)
 {
     JApplication::registerEvent($event, $function);
 }
defined('_JEXEC') or die('Restricted access');
require_once JPATH_ADMINISTRATOR . '/components/com_docmanpaypal/docmanpaypal.class.php';
$lang = JFactory::getLanguage();
$l = substr($lang->_lang, 0, 2);
$langFile = 'components/com_docmanpaypal/lang/' . $l . '.php';
if (file_exists($langFile)) {
    include_once $langFile;
} else {
    include_once JPATH_ROOT . '/components/com_docmanpaypal/lang/en.php';
}
//if (file_exists($lang_file)) {
//	include_once($lang_file);
//} else {
//	$l = 'en-GB';
//}
JApplication::registerEvent('onFetchButtons', 'bot_docmanpaypalprices2');
function bot_docmanpaypalprices2($params)
{
    global $mainframe, $_DOCMAN, $_DMUSER, $currency_symbols;
    $database =& JFactory::getDBO();
    $my = JFactory::getUser();
    require_once $_DOCMAN->getPath('classes', 'button');
    require_once $_DOCMAN->getPath('classes', 'token');
    $_DOCMAN->loadLanguage('frontend');
    $doc =& $params['doc'];
    $file =& $params['file'];
    $objDBDoc = $doc->objDBTable;
    $buttonStaysBuyNow = false;
    $objFormatData = $doc->objFormatData;
    if ($objFormatData->id > 0) {
        $currency = docmanpaypal::cfg('currency');
Пример #4
0
<?php

/**
 * @version		$Id: standardbuttons.php 1034 2009-12-09 18:50:11Z tom $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
JApplication::registerEvent('onFetchButtons', 'bot_standardbuttons');
function bot_standardbuttons($params)
{
    global $_DOCMAN, $_DMUSER;
    require_once $_DOCMAN->getPath('classes', 'button');
    require_once $_DOCMAN->getPath('classes', 'token');
    $_DOCMAN->loadLanguage('frontend');
    $doc =& $params['doc'];
    $file =& $params['file'];
    $objDBDoc = $doc->objDBTable;
    $botParams = bot_standardbuttonsParams();
    $js = "javascript:if(confirm('" . _DML_ARE_YOU_SURE . "')) {window.location='%s'}";
    // format document links, ONLY those the user can perform.
    $buttons = array();
    if ($_DMUSER->canDownload($objDBDoc) and $botParams->get('download', 1)) {
        $buttons['download'] = new DOCMAN_Button('download', _DML_BUTTON_DOWNLOAD, $doc->_formatLink('doc_download'));
    }
    if ($_DMUSER->canDownload($objDBDoc) and $botParams->get('view', 1)) {
        $viewtypes = trim($_DOCMAN->getCfg('viewtypes'));
        if ($viewtypes != '' && ($viewtypes == '*' || stristr($viewtypes, $file->ext))) {
Пример #5
0
 /**
  * Event handler to re-parse request URI.
  *
  * @return  void
  */
 public function onAfterRoute()
 {
     // Make sure our onAfterRender event handler is the last one executed
     self::$_app->registerEvent('onAfterRender', 'jsnExtFrameworkFinalize');
 }