[ Indice ]

Riferimento incrociato di Joomla! 1.5.14 - VM 1.1.4

Servizio fornito da VMItalia
Classe:   Funzione:   Variabile:   Costante:  
Storico Ricerche +

titolo

Corpo

[chiudi]

/administrator/components/com_virtuemart/ -> compat.joomla1.5.php (sorgente)

   1  <?php 
   2  if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
   3  /**

   4  * This file provides compatibility for VirtueMart on Joomla! 1.0.x and Joomla! 1.5

   5  *

   6  *

   7  * @version $Id: compat.joomla1.5.php 1393 2008-05-02 11:42:19Z soeren_nb $

   8  * @package VirtueMart

   9  * @subpackage core

  10  * @copyright Copyright (C) 2004-2007 soeren - All rights reserved.

  11  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php

  12  * VirtueMart is free software. This version may have been modified pursuant

  13  * to the GNU General Public License, and as distributed it includes or

  14  * is derivative of works licensed under the GNU General Public License or

  15  * other free or open source software licenses.

  16  * See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.

  17  *

  18  * http://virtuemart.net

  19  */
  20  if( !defined('_VM_COMPAT_FILE_LOADED') ) {
  21      define( '_VM_COMPAT_FILE_LOADED', 1 );
  22  
  23      if( class_exists( 'JConfig' ) ) {
  24          
  25          // These are needed when the Joomla! 1.5 legacy plugin is not enabled

  26          if( !defined( '_JLEGACY' ) ) {
  27          // TODO: determine what else is needed to work without the legacy plugin

  28              if( !class_exists('JComponentHelper') && !isset($mainframe)) {            
  29                  define('JPATH_BASE', realpath(dirname(__FILE__).'/../..') );
  30                  
  31                  define( 'DS', DIRECTORY_SEPARATOR );
  32                  
  33                  require_once  ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
  34                  require_once  ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
  35                  $mainframe = JFactory::getApplication(defined('_VM_IS_BACKEND') ? 'administrator' : 'site');
  36              
  37              }
  38              jimport('joomla.application.component.helper');
  39              if( class_exists('JComponentHelper')) {
  40                  $usersConfig = &JComponentHelper::getParams( 'com_users' );
  41                  $contentConfig = &JComponentHelper::getParams( 'com_content' );    
  42                  // User registration settings

  43                  $mosConfig_allowUserRegistration = $GLOBALS['mosConfig_allowUserRegistration'] = $usersConfig->get('allowUserRegistration');
  44                  $mosConfig_useractivation = $GLOBALS['mosConfig_useractivation'] = $usersConfig->get('useractivation');
  45                  
  46                  // TODO: Do we need these? They are set in the template.

  47                  // Icon display settings

  48                  // (hide pdf, etc has been changed to *show* pdf, etc in J! 1.5)

  49                  $mosConfig_icons = $contentConfig->get('show_icons');
  50                  $mosConfig_hidePdf = 1- intval( $contentConfig->get('show_pdf_icon') );
  51                  $mosConfig_hidePrint = 1- intval( $contentConfig->get('show_print_icon') );
  52                  $mosConfig_hideEmail = 1- intval( $contentConfig->get('show_email_icon') );
  53              }
  54              $jconfig = new JConfig();
  55              
  56              // Settings from the Joomla! configuration file 

  57              foreach (get_object_vars($jconfig) as $k => $v) {
  58                  $name = 'mosConfig_'.$k;
  59                  $$name = $GLOBALS[$name] = $v;
  60              }
  61          
  62              // Paths

  63              if( isset($mainframe) && is_object($mainframe)) {
  64                  $url = $mainframe->isAdmin() ? $mainframe->getSiteURL() : JURI::base();
  65              } else {
  66                  $url = JURI::base();
  67              }
  68              $mosConfig_live_site = $GLOBALS['mosConfig_live_site']        = substr_replace($url, '', -1, 1);
  69              $mosConfig_absolute_path = $GLOBALS['mosConfig_absolute_path']    = JPATH_SITE;
  70              $mosConfig_cachepath = $GLOBALS['mosConfig_cachepath'] = JPATH_BASE.DS.'cache';
  71              
  72              if( !isset( $option ) ) {
  73                  $option = strtolower( JRequest::getCmd( 'option', 'com_virtuemart' ) );
  74              }
  75              
  76              // The selected language

  77              $lang =& JFactory::getLanguage();
  78              $mosConfig_lang = $GLOBALS['mosConfig_lang']          = strtolower( $lang->getBackwardLang() );
  79              $mosConfig_locale = $GLOBALS['mosConfig_locale']          = $lang->getTag();
  80              
  81              // $database is directly needed by some functions, so we need to create it here. 

  82              $GLOBALS['database'] = $database = JFactory::getDBO();
  83  
  84              // The $my (user) object

  85              $GLOBALS['my'] = & JFactory::getUser();
  86          
  87              // The permissions object

  88              $acl =& JFactory::getACL();
  89              $GLOBALS['acl'] =& $acl;
  90              
  91              // Version information

  92              $_VERSION = $GLOBALS['_VERSION'] = new JVersion();
  93              
  94              if( !function_exists( 'sefreltoabs')) {
  95  				function sefRelToAbs( $url ) {
  96                      //TODO!!!

  97                      //Create a file "router.php" inside /components/com_virtuemart/

  98                      //$router = JRouter::getInstance('virtuemart');

  99                      //return $router->build($url);

 100                      return $url;
 101                  }
 102              }
 103              if( !function_exists('editorArea')) {
 104  				function editorArea($name, $content, $hiddenField, $width, $height, $col, $row) {
 105                      jimport( 'joomla.html.editor' );
 106                      $editor =& JFactory::getEditor();
 107                      echo $editor->display($hiddenField, $content, $width, $height, $col, $row);
 108                  }
 109              }
 110              
 111              // Load the menu bar class

 112              JLoader::register('mosMenuBar'      , $mosConfig_absolute_path.DS.'plugins'.DS.'system'.DS.'legacy'.DS.'menubar.php');
 113              
 114              // Load the user class

 115              JLoader::register('mosUser'         , $mosConfig_absolute_path.DS.'plugins'.DS.'system'.DS.'legacy'.DS.'user.php');
 116          
 117          } else {
 118              // We need these even when the Joomla! 1.5 legacy plugin is enabled

 119      
 120              // We need to set these when we don't enter as a component or module (like in notify.php)

 121              if( !isset( $usersConfig ) ) {
 122                  $usersConfig = &JComponentHelper::getParams( 'com_users' );    
 123              }
 124              if( !isset( $contentConfig ) ) {
 125                  $contentConfig = &JComponentHelper::getParams( 'com_content' );
 126              }    
 127      
 128              // Paths

 129              // These are in the legacy plugin as globals, but we need them locally too

 130              $mosConfig_live_site = $GLOBALS['mosConfig_live_site'];
 131              $mosConfig_absolute_path = $GLOBALS['mosConfig_absolute_path'];
 132              $mosConfig_cachepath = $GLOBALS['mosConfig_cachepath'];
 133              
 134              // User registration settings

 135              $mosConfig_allowUserRegistration = $GLOBALS['mosConfig_allowUserRegistration'] = $usersConfig->get('allowUserRegistration');
 136              $mosConfig_useractivation = $GLOBALS['mosConfig_useractivation'] = $usersConfig->get('useractivation');
 137      
 138              // TODO: Do we need these? They are set in the template.

 139              // Icon display settings

 140              // hide pdf, etc has been changed to show pdf, etc in J! 1.5

 141              $mosConfig_icons = $contentConfig->get('show_icons');
 142              $mosConfig_hidePdf = 1- intval( $contentConfig->get('show_pdf_icon') );
 143              $mosConfig_hidePrint = 1- intval( $contentConfig->get('show_print_icon') );
 144              $mosConfig_hideEmail = 1- intval( $contentConfig->get('show_email_icon') );
 145              
 146              // TODO: Do we still need this in the latest J! 1.5 SVN?

 147              // Adjust the time offset

 148      //        $server_time = date( 'O' ) / 100;

 149      //        $offset = $mosConfig_offset - $server_time;

 150      //        $GLOBALS['mosConfig_offset'] = $offset;

 151      
 152              // Version information

 153              $_VERSION = $GLOBALS['_VERSION'];
 154          }
 155      }
 156  }
 157  ?>


Generato il: Mon Oct 19 20:29:27 2009 Generato con PHPXref 0.7