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


PHP SPLang::load方法代码示例

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


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

示例1: execute

 public function execute()
 {
     SPLang::load('com_sobipro.check');
     $task = $this->_task = strlen($this->_task) ? $this->_task : $this->_defTask;
     // this is need to delete all old cache after installation
     if (SPRequest::int('init')) {
         SPFactory::cache()->cleanAll();
     }
     switch ($this->_task) {
         case 'view':
             $this->view();
             break;
         case 'download':
             $this->download();
             break;
         default:
             if (method_exists($this, $this->_task)) {
                 SPFactory::mainframe()->cleanBuffer()->customHeader();
                 $this->{$task}();
                 exit;
             } else {
                 Sobi::Error('requirements', 'Task not found', SPC::WARNING, 404, __LINE__, __FILE__);
                 exit;
             }
             break;
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:27,代码来源:requirements.php

示例2: getFunctionsLabel

 protected function getFunctionsLabel()
 {
     if (isset($this->params->interpreter)) {
         $interpreter = explode('.', $this->params->interpreter);
         $function = array_pop($interpreter);
         $obj = SPFactory::Instance(implode('.', $interpreter));
         self::$functionsLabel = $obj->{$function}(self::$sid, self::$section);
     } elseif (isset($this->params->text)) {
         if (isset($this->params->loadTextFile)) {
             SPLang::load($this->params->loadTextFile);
         }
         self::$functionsLabel = Sobi::Txt($this->params->text);
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:14,代码来源:native.php

示例3: struct

 /**
  * @return array
  */
 public function struct()
 {
     if (!$this->dependency) {
         return parent::struct(true);
     }
     $selected = $this->getRaw();
     if (isset($this->_fData->options)) {
         $path = SPConfig::unserialize($this->_fData->options);
     } else {
         return null;
     }
     $selectedPath = array();
     $options = json_decode(SPFs::read(SOBI_PATH . '/etc/fields/select-list/definitions/' . str_replace('.xml', '.json', $this->dependencyDefinition)), true);
     if (isset($options['translation'])) {
         SPLang::load($options['translation']);
         $selected = Sobi::Txt(strtoupper($options['prefix']) . '.' . strtoupper($selected));
     }
     if (count($path) && isset($options['translation'])) {
         foreach ($path as $step) {
             $selectedPath[$step] = $selected = Sobi::Txt(strtoupper($options['prefix']) . '.' . strtoupper($step));
         }
     }
     $this->cleanCss();
     return array('_complex' => 1, '_data' => $selected, '_attributes' => array('class' => $this->cssClass), '_options' => array('path' => count($selectedPath) ? $selectedPath : $path));
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:28,代码来源:select.php

示例4: foreach

 /**
  * @param string $message
  * @param bool $translate
  * @param string $type
  * @param bool $display
  * @return SPMessage
  */
 public function &setMessage($message, $translate = true, $type = 'warning', $display = true)
 {
     if ($translate && !$this->langLoaded) {
         SPLang::load('com_sobipro.messages');
         $this->langLoaded = true;
     }
     if ($type == 'message') {
         $type = 'info';
     }
     if (is_array($message) && !is_string($message)) {
         foreach ($message as $msg) {
             $this->setMessage($msg['text'], $translate, $msg['type'], $display);
         }
     }
     $messageText = $translate ? Sobi::Txt(strtoupper($type) . '.' . $message) : $message;
     if ($display) {
         $this->messages[$type][$message] = $messageText;
     }
     $this->current = array('message' => $messageText, 'type' => $type, 'section' => array('id' => Sobi::Section(), 'name' => Sobi::Section(true)));
     $this->storeMessages();
     return $this;
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:29,代码来源:message.php

示例5: getState

 protected function getState()
 {
     $state = SPFactory::cache()->getVar('system_state');
     if (!$state) {
         SPLang::load('com_sobipro.messages');
         $state = array();
         $state['accelerator'] = array('type' => Sobi::Cfg('cache.l3_enabled', true) ? 'success' : 'error', 'label' => Sobi::Cfg('cache.l3_enabled', true) ? Sobi::Txt('ACCELERATOR_ENABLED') : Sobi::Txt('ACCELERATOR_DISABLED'));
         $state['xml-optimiser'] = array('type' => Sobi::Cfg('cache.xml_enabled', true) ? 'success' : 'error', 'label' => Sobi::Cfg('cache.xml_enabled', true) ? Sobi::Txt('XML_CACHE_ENABLED') : Sobi::Txt('XML_CACHE_DISABLED'));
         $state['javascript-cache'] = array('type' => Sobi::Cfg('cache.include_js_files', false) ? 'success' : 'warning', 'label' => Sobi::Cfg('cache.include_js_files', false) ? Sobi::Txt('JS_CACHE_ENABLED') : Sobi::Txt('JS_CACHE_DISABLED'));
         $state['css-cache'] = array('type' => Sobi::Cfg('cache.include_css_files', false) ? 'success' : 'warning', 'label' => Sobi::Cfg('cache.include_css_files', false) ? Sobi::Txt('CSS_CACHE_ENABLED') : Sobi::Txt('CSS_CACHE_DISABLED'));
         $state['display-errors'] = array('type' => Sobi::Cfg('debug.display_errors', false) ? 'error' : 'success', 'label' => Sobi::Cfg('debug.display_errors', false) ? Sobi::Txt('DISPLAY_ERRORS_ENABLED') : Sobi::Txt('DISPLAY_ERRORS_DISABLED'));
         $state['debug-level'] = array('type' => Sobi::Cfg('debug.level', 0) > 2 ? 'warning' : 'success', 'label' => Sobi::Cfg('debug.level', 0) > 2 ? Sobi::Txt('DEBUG_LEVEL_TOO_HIGH') : Sobi::Txt('DEBUG_LEVEL_OK'));
         $state['debug-xml'] = array('type' => Sobi::Cfg('debug.xml_raw', false) ? 'error' : 'success', 'label' => Sobi::Cfg('debug.xml_raw', false) ? Sobi::Txt('DEBUG_XML_ENABLED') : Sobi::Txt('DEBUG_XML_DISABLED'));
         //			uasort( $state, array( $this, 'sortMessages' ) );
         $messages = SPFactory::message()->getSystemMessages();
         $content = null;
         if (count($messages)) {
             foreach ($messages as $message) {
                 $url = Sobi::Url(array('sid' => $message['section']['id']));
                 $url = "<a href=\"{$url}\">{$message['section']['name']}</a> ";
                 $message['section']['link'] = $url;
                 $message['type-text'] = ucfirst(Sobi::Txt($message['type']));
                 $state['messages'][] = $message;
             }
         }
         SPFactory::cache()->addVar($state, 'system_state');
     }
     return $state;
 }
开发者ID:pelloq1,项目名称:SobiPro,代码行数:29,代码来源:front.php

示例6: loadLanguage

 /**
  * @param $xpath
  */
 protected function loadLanguage($xpath)
 {
     $files = $xpath->query('/definition/header/file[@type="language"]');
     if ($files->length) {
         foreach ($files as $file) {
             SPLang::load($file->attributes->getNamedItem('filename')->nodeValue);
         }
     }
 }
开发者ID:kishoreweblabs,项目名称:SobiPro,代码行数:12,代码来源:menu.php

示例7: xmlHeader

 /**
  * @param DOMNodeList $xml
  * @return void
  */
 protected function xmlHeader($xml)
 {
     foreach ($xml as $node) {
         /** @var DOMNode $node */
         switch ($node->nodeName) {
             case 'script':
                 SPFactory::header()->addJsCode($node->nodeValue);
                 break;
             case 'style':
                 SPFactory::header()->addCSSCode($node->nodeValue);
                 break;
             case 'language':
                 SPLang::load($node->nodeValue);
                 break;
             case 'file':
                 switch ($node->attributes->getNamedItem('type')->nodeValue) {
                     case 'style':
                         $this->loadCSSFile($node->attributes->getNamedItem('filename')->nodeValue, false);
                         break;
                     case 'script':
                         $this->loadJsFile($node->attributes->getNamedItem('filename')->nodeValue, false);
                         break;
                     case 'language':
                         SPLang::load($node->attributes->getNamedItem('filename')->nodeValue);
                         break;
                 }
                 break;
             case 'title':
                 $this->setTitle($node->attributes->getNamedItem('value')->nodeValue);
                 break;
         }
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:37,代码来源:view.php

示例8: __construct

    public function __construct()
    {
        static $loaded = false;
        if ($loaded) {
            return true;
        }
        $jConfig = JFactory::getConfig();
        defined('DS') || define('DS', DIRECTORY_SEPARATOR);
        require_once JPATH_SITE . '/components/com_sobipro/lib/sobi.php';
        if (method_exists($jConfig, 'getValue')) {
            Sobi::Init(JPATH_SITE, JFactory::getConfig()->getValue('config.language'));
        } else {
            Sobi::Init(JPATH_SITE, JFactory::getConfig()->get('config.language'));
        }
        if (!defined('SOBI_CMS')) {
            define('SOBI_CMS', version_compare(JVERSION, '3.0.0', 'ge') ? 'joomla3' : (version_compare(JVERSION, '1.6.0', 'ge') ? 'joomla16' : 'joomla15'));
        }
        SPLoader::loadClass('mlo.input');
        define('SOBIPRO_ADM', true);
        define('SOBI_ADM_PATH', JPATH_ADMINISTRATOR . '/components/com_sobipro');
        $adm = str_replace(JPATH_ROOT, null, JPATH_ADMINISTRATOR);
        define('SOBI_ADM_FOLDER', $adm);
        define('SOBI_ADM_LIVE_PATH', $adm . '/components/com_sobipro');
        SPLang::load('com_sobipro.sys');
        $head = SPFactory::header();
        if (SOBI_CMS == 'joomla3') {
            $head->addJsFile(array('sobipro', 'jqnc', 'adm.sobipro', 'adm.jmenu'));
        } else {
            $head->addJsFile(array('sobipro', 'jquery', 'adm.sobipro', 'adm.jmenu', 'jquery-migrate'));
        }
        if (SOBI_CMS != 'joomla3') {
            $head->addCssFile('bootstrap.bootstrap')->addJsFile(array('bootstrap'))->addCSSCode('
							#jform_request_SOBI_SELECT_SECTION-lbl { margin-top: 8px; }
                            #jform_request_cid-lbl { margin-top: 8px; }
                            #jform_request_eid-lbl { margin-top: 18px; }
                            #jform_request_sid-lbl { margin-top: 20px; }
                            #jform_request_sptpl-lbl { margin-top: 8px; }
                            .typeahead-width { width: 320px; }
					');
        } else {
            $head->addCSSCode('
                .typeahead-width { width: 70%; }
            ');
        }
        // Joomla! 1.5
        $this->cid = SPRequest::arr('cid');
        // Joomla! 1.6+
        if (!(count($this->cid) && is_numeric($this->cid[0]))) {
            $this->cid = SPRequest::int('id', 0);
        }
        $this->determineTask();
        $strings = array('objects' => array('entry' => Sobi::Txt('OTYPE_ENTRY'), 'category' => Sobi::Txt('OTYPE_CATEGORY'), 'section' => Sobi::Txt('OTYPE_SECTION')), 'labels' => array('category' => Sobi::Txt('SOBI_SELECT_CATEGORY'), 'entry' => Sobi::Txt('SOBI_SELECT_ENTRY')), 'task' => $this->task);
        $strings = json_encode($strings);
        $head->addJsCode("SPJmenuFixTask( '{$this->taskName}' );")->addJsFile('bootstrap.typeahead')->addJsCode("var SPJmenuStrings = {$strings}");
        if ($this->task != 'list.date') {
            if (SOBI_CMS == 'joomla3') {
                $head->addJsCode('SobiPro.jQuery( document ).ready( function () { SobiPro.jQuery( "#spCalendar" ).parent().parent().css( "display", "none" ); } );');
            } else {
                $head->addJsCode('SobiPro.jQuery( document ).ready( function () { SobiPro.jQuery( "#spCalendar" ).parent().css( "display", "none" ); } );');
            }
        } else {
            $head->addCSSCode('.SobiProCalendar .chzn-container {width: 100px!important; } ');
            $head->addCSSCode('.SobiProCalendar select {width: inherit;} ');
        }
        $head->send();
        parent::__construct();
        $loaded = true;
    }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:68,代码来源:spsection.php

示例9: LoadLang

 public static function LoadLang($lang)
 {
     SPLang::load($lang);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:4,代码来源:template.php


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