当前位置: 首页>>代码示例>>PHP>>正文


PHP OPCLang::loadLang方法代码示例

本文整理汇总了PHP中OPCLang::loadLang方法的典型用法代码示例。如果您正苦于以下问题:PHP OPCLang::loadLang方法的具体用法?PHP OPCLang::loadLang怎么用?PHP OPCLang::loadLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OPCLang的用法示例。


在下文中一共展示了OPCLang::loadLang方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 function store()
 {
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'language.php';
     // load basic stuff:
     OPCLang::loadLang();
     $user = JFactory::getUser();
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     jimport('joomla.filesystem.archive');
     jimport('joomla.archive.archive');
     $msg = '';
     $db = JFactory::getDBO();
     $data = JRequest::get('post');
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     foreach ($data as $k => $d) {
         if (strpos($k, 'tid_') !== false && strpos($k, 'payment_contentid') === false) {
             /* we have a standard variable:
             	  tid_special_, tid_ai_, tid_num_, tid_back_,  tid_forward_
             	  tid_nummax_, tid_itemmax_
             	  tid_type_
             	  */
             if (!defined($k)) {
                 $this->setTemplateSetting($k, $data[$k]);
                 //echo 'template setting: '.$k.'value: '.$data[$k];
                 define($k, $data[$k]);
             }
             $a = explode('_', $k);
             if (count($a) == 3) {
                 $tid = $a[2];
                 $checkboxes = array('tid_special_', 'tid_ai_', 'tid_num_', 'tid_forward_', 'tid_back_', 'tid_enabled_', 'tid_foreign_', 'tid_email_', 'tid_autocreate_');
                 foreach ($checkboxes as $ch) {
                     if (!isset($data[$ch . $tid]) && !defined($ch . $tid)) {
                         $this->setTemplateSetting($ch . $tid, 0);
                         define($ch . $tid, '0');
                         //echo ':'.$ch.$tid.' val: 0';
                     }
                 }
             }
         }
     }
     return true;
 }
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:43,代码来源:order_export.php

示例2: checkLoad

 public static function checkLoad()
 {
     $app = JFactory::getApplication();
     // if we are not at FE, do not alter anything
     if ($app->getName() != 'site') {
         return false;
     }
     require_once JPATH_SITE . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'compatibility.php';
     // if (!class_exists('VmConfig'))
     //	  require(JPATH_ADMINISTRATOR.DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_virtuemart'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'config.php');
     if (!file_exists(JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'language.php')) {
         return false;
     }
     // test format:
     $format = JRequest::getVar('format', 'html');
     $option = JRequest::getCmd('option');
     $tmpl = JRequest::getVar('tmpl', '');
     if ($tmpl == 'component' && $format != 'opchtml') {
         return false;
     }
     // speed up json requests
     $okformat = array('opchtml', 'html');
     if (!in_array($format, $okformat)) {
         return false;
     }
     $doc = JFactory::getDocument();
     $class = get_class($doc);
     $class = strtolower($class);
     $format = str_replace('jdocument', '', $class);
     if (!in_array($format, $okformat)) {
         return;
     }
     if ($app->isAdmin()) {
         return false;
     }
     require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'language.php';
     // load basic stuff:
     OPCLang::loadLang();
     if (!defined('DS')) {
         define('DS', DIRECTORY_SEPARATOR);
     }
     if (!defined('JPATH_OPC')) {
         define('JPATH_OPC', JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage');
     }
     //VmConfig::loadConfig();
     return true;
 }
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:47,代码来源:plugin.php

示例3: store

    function store()
    {
        require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'language.php';
        require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'config.php';
        // load basic stuff:
        OPCLang::loadLang();
        $this->removeCache();
        $this->loadVmConfig();
        $user = JFactory::getUser();
        $this->storeRegistration();
        $opc_load_jquery = JRequest::getVar('opc_load_jquery', false);
        if (!empty($opc_load_jquery)) {
            $opc_load_jquery = true;
        }
        OPCConfig::store('opc_load_jquery', '', 0, $opc_load_jquery);
        if (!class_exists('JFile')) {
            require JPATH_LIBRARIES . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'filesystem' . DIRECTORY_SEPARATOR . 'file.php';
        }
        if (!class_exists('JFolder')) {
            require JPATH_LIBRARIES . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'filesystem' . DIRECTORY_SEPARATOR . 'folder.php';
        }
        $msg = '';
        $rename = JRequest::getVar('rename_to_custom', false);
        if ($rename) {
            $msg .= $this->renameTheme();
        }
        $db = JFactory::getDBO();
        $data = JRequest::get('post');
        $this->storeTY($data);
        $cfg = urldecode('%3C%3Fphp') . '
if( !defined( \'_VALID_MOS\' ) && !defined( \'_JEXEC\' ) ) die( \'Direct Access to \'.basename(__FILE__).\' is not allowed.\' );
/*
*      One Page Checkout configuration file
*      Copyright RuposTel s.r.o. under GPL license
*      Version 2 of date 31.March 2012
*      Feel free to modify this file according to your needs
*
*
*     @copyright Copyright (C) 2007 - 2012 RuposTel - All rights reserved.
*     @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*     One Page checkout is free software released under GNU/GPL and uses code from VirtueMart
*     VirtueMart is free software. This version may have been modified pursuant
*     to the GNU General Public License, and as distributed it includes or
*     is derivative of works licensed under the GNU General Public License or
*     other free or open source software licenses.
* 
*/




';
        $cfg .= '
		  if (!class_exists(\'VmConfig\'))
		  require(JPATH_ADMINISTRATOR.DS.\'components\'.DS.\'com_virtuemart\'.DS.\'helpers\'.DS.\'config.php\'); 
		  VmConfig::loadConfig(); 

';
        if (!empty($data['delete_ht'])) {
            if (JFile::delete(JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'assets' . DS . 'js' . DS . '.htaccess') === false) {
                $msg .= JText::sprintf('COM_VIRTUEMART_STRING_DELETED_ERROR', JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'assets' . DS . 'js' . DS . '.htaccess');
            }
        }
        if (!empty($data['opc_cr_type'])) {
            $cfg .= ' $opc_cr_type = \'' . $data['opc_cr_type'] . '\'; ';
        }
        $data['do_not_show_opcregistration'] = (int) $data['do_not_show_opcregistration'];
        if (!empty($data['do_not_show_opcregistration'])) {
            $cfg .= ' $do_not_show_opcregistration = 1; ';
        }
        if (isset($data['bt_fields_from'])) {
            $cfg .= ' $bt_fields_from = \'' . $data['bt_fields_from'] . '\'; ';
        }
        if (isset($data['op_default_shipping_search'])) {
            $cfg .= ' $op_default_shipping_search = array(); ';
            if (is_array($data['op_default_shipping_search'])) {
                $i = 0;
                foreach ($data['op_default_shipping_search'] as $key => $val) {
                    if (empty($val)) {
                        continue;
                    }
                    $cfg .= ' $op_default_shipping_search[' . $i . '] = "' . str_replace('"', '\\"', $val) . '"; ';
                    $i++;
                }
            } else {
                $cfg .= ' $op_default_shipping_search[0] = "' . str_replace('"', '\\"', $val) . '"; ';
            }
        }
        if (!empty($data['home_vat_countries'])) {
            $home = str_replace('"', '', $data['home_vat_countries']);
            $cfg .= ' $home_vat_countries = "' . $home . '"; ';
        }
        if (isset($data['opc_payment_refresh'])) {
            $cfg .= '$opc_payment_refresh = true;
    ';
        }
        if (isset($data['use_original_basket'])) {
            $cfg .= '$use_original_basket = true;
    ';
        } else {
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:config.php

示例4: opc

 function opc()
 {
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig();
     require_once JPATH_OPC . DS . 'helpers' . DS . 'loader.php';
     OPCloader::$debugMsg = '';
     //mobile handling:
     if (!defined('OPC_DETECTED_DEVICE')) {
         if (class_exists('OPCplugin')) {
             OPCplugin::detectMobile();
         }
     }
     if (!class_exists('OPCLang')) {
         require JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'language.php';
     }
     OPCLang::loadLang();
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'mini.php';
     require_once JPATH_SITE . DS . 'components' . DS . 'com_onepage' . DS . 'helpers' . DS . 'shoppergroups.php';
     //$this->setShopperGroups();
     $userModel = OPCmini::getModel('user');
     $cmd = JRequest::getVar('cmd', '');
     if ($cmd === 'checkbitvat') {
         $checkvat = $this->checkBitVat();
     }
     if ($cmd === 'checkvatopc') {
         $checkvat = $this->checkOPCVat();
     }
     OPCShopperGroups::setShopperGroupsController();
     if (method_exists($userModel, 'getCurrentUser')) {
         $user = $userModel->getCurrentUser();
         self::$shopper_groups = $user->shopper_groups;
         if (!empty($user->virtuemart_shipmentmethod_id)) {
             $user->virtuemart_shipmentmethod_id = 0;
             $user->virtuemart_paymentmethod_id = 0;
         }
     }
     $session = JFactory::getSession();
     $b = $session->set('eurobnk', null, 'vm');
     if (empty($euvat_shopper_group)) {
         jimport('joomla.html.parameter');
         if (class_exists('plgSystemBit_vm_change_shoppergroup')) {
             $session = JFactory::getSession();
             $sg = $session->get('vm_shoppergroups_add', array(), 'vm');
             $dispatcher = JDispatcher::getInstance();
             JPluginHelper::importPlugin('system', 'plgSystemBit_vm_change_shoppergroup', true, $dispatcher);
             // very important
             $document = JFactory::getDocument();
             JRequest::setVar('format_override', 'html');
             $_REQUEST['view'] = 'cart';
             $_REQUEST['option'] = 'com_virtuemart';
             $doctype = $document->getType();
             $dispatcher->trigger('onAfterRender');
             JRequest::setVar('format_override', 'raw');
             $sg = $session->get('vm_shoppergroups_add', array(), 'vm');
         }
     }
     JResponse::setBody('');
     // security:
     JRequest::setVar('virtuemart_shoppergroup_id', null, 'post');
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig(true);
     // since vm2.0.21a we need to load the language files here
     if (method_exists('VmConfig', 'loadJLang')) {
         $lang = JFactory::getLanguage();
         $extension = 'com_virtuemart';
         $lang->load($extension);
         //  when AJAX it needs to be loaded manually here >> in case you are outside virtuemart !!!
         VmConfig::loadJLang('com_virtuemart_orders', true);
         VmConfig::loadJLang('com_virtuemart_shoppers', true);
     }
     /// load shipping here
     $vars = JRequest::get('post');
     // custom tag test
     $cmd = JRequest::getVar('cmd', 'get_shipping');
     $doc = JFactory::getDocument();
     $type = get_class($doc);
     if ($type == 'JDocumentRAW') {
         //C:\Documents and Settings\Rupos\Local Settings\Temp\scp02371\srv\www\clients\client1\web90\web\vm2\components\com_onepage\overrides\
         //require_once(JPATH_SITE.DS.'components'.DS.'com_onepage'.DS.'overrides'.DS.'opchtml.php');
         //JFactory::$instance = new JDocumentOpchtml();
         //JFactory::$document = new JDocumentOpchtml();
     }
     /*
     	$doc->addCustomTag = create_function('$string', 'return;');  
     	$doc->addCustomTag( '<!-- This is a comment. -->' );
     */
     $c = JRequest::getVar('virtuemart_currency_id', 0);
     JRequest::setVar('virtuemart_currency_id', (int) JRequest::getVar('virtuemart_currency_id'));
     /* to test the currency: */
     $mainframe = Jfactory::getApplication();
     $virtuemart_currency_id = $mainframe->getUserStateFromRequest("virtuemart_currency_id", 'virtuemart_currency_id', JRequest::getInt('virtuemart_currency_id'));
     // end custom tag test
     $view = $this->getView('cart', 'html');
     $cmd = JRequest::getCmd('cmd', 'get_shipping');
     $return = array();
     $return['cmd'] = $cmd;
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:opc.php

示例5: display

 /**
  * Displays the view, collects needed data for the different layouts
  *
  * Okey I try now a completly new idea.
  * We make a function for every tab and the display is getting the right tabs by an own function
  * putting that in an array and after that we call the preparedataforlayoutBlub
  *
  * @author Oscar van Eijk
  * @author Max Milbers
  *
  *  Original code from: \components\com_virtuemart\views\user\view.html.php
  *
  */
 function display($tpl = null)
 {
     $useSSL = VmConfig::get('useSSL', 0);
     $useXHTML = true;
     $this->assignRef('useSSL', $useSSL);
     $this->assignRef('useXHTML', $useXHTML);
     $mainframe = JFactory::getApplication();
     $pathway = $mainframe->getPathway();
     $layoutName = $this->getLayout();
     if (!defined('OPC_IN_REGISTRATION_MODE')) {
         define('OPC_IN_REGISTRATION_MODE', 1);
     }
     require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'language.php';
     OPCLang::loadLang();
     $this->loadOPC();
     // 	vmdebug('layout by view '.$layoutName);
     if (empty($layoutName) or $layoutName == 'default') {
         $layoutName = JRequest::getWord('layout', 'edit');
         if ($layoutName == 'default') {
             $layoutName = 'edit';
         }
         $this->setLayout($layoutName);
     }
     if (empty($this->fTask)) {
         $ftask = 'saveUser';
         $this->assignRef('fTask', $ftask);
     }
     if (!class_exists('ShopFunctions')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     // 	vmdebug('my layoutname',$layoutName);
     if ($layoutName == 'login') {
         parent::display($tpl);
         return;
     }
     if (!class_exists('VirtuemartModelUser')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'user.php';
     }
     $this->_model = new VirtuemartModelUser();
     //		$this->_model->setCurrent(); //without this, the administrator can edit users in the FE, permission is handled in the usermodel, but maybe unsecure?
     $editor = JFactory::getEditor();
     //the cuid is the id of the current user
     $this->_currentUser = JFactory::getUser();
     $this->_cuid = $this->_lists['current_id'] = $this->_currentUser->get('id');
     $this->assignRef('userId', $this->_cuid);
     $this->_userDetails = $this->_model->getUser();
     $this->assignRef('userDetails', $this->_userDetails);
     $address_type = JRequest::getWord('addrtype', 'BT');
     $this->assignRef('address_type', $address_type);
     //New Address is filled here with the data of the cart (we are in the cart)
     if (!class_exists('VirtueMartCart')) {
         require JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php';
     }
     $cart = VirtueMartCart::getCart();
     $new = false;
     if (JRequest::getInt('new', '0') == 1) {
         $new = true;
     }
     if ($new) {
         $virtuemart_userinfo_id = 0;
     } else {
         $virtuemart_userinfo_id = JRequest::getString('virtuemart_userinfo_id', '0', '');
         if (empty($virtuemart_userinfo_id)) {
             require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_onepage' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'mini.php';
             $umodel = OPCmini::getModel('user');
             //new VirtuemartModelUser();
             $uid = JFactory::getUser()->id;
             $userDetails = $umodel->getUser();
             $virtuemart_userinfo_id = $umodel->getBTuserinfo_id();
         }
     }
     $this->assignRef('virtuemart_userinfo_id', $virtuemart_userinfo_id);
     $userFields = null;
     if ((strpos($this->fTask, 'cart') || strpos($this->fTask, 'checkout')) && empty($virtuemart_userinfo_id)) {
         $fieldtype = $address_type . 'address';
         if (method_exists($cart, 'prepareAddressDataInCart')) {
             $cart->prepareAddressDataInCart($address_type, $new);
         }
         if (method_exists($cart, 'prepareAddressFieldsInCart')) {
             $cart->prepareAddressFieldsInCart();
         }
         $userFields = $cart->{$fieldtype};
         $task = JRequest::getWord('task', '');
     } else {
         $userFields = $this->_model->getUserInfoInUserFields($layoutName, $address_type, $virtuemart_userinfo_id);
         if (!$new && empty($userFields[$virtuemart_userinfo_id])) {
             $virtuemart_userinfo_id = $this->_model->getBTuserinfo_id();
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:virtuemart.user.registration.view.html.php


注:本文中的OPCLang::loadLang方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。