本文整理汇总了PHP中Sobi::Init方法的典型用法代码示例。如果您正苦于以下问题:PHP Sobi::Init方法的具体用法?PHP Sobi::Init怎么用?PHP Sobi::Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sobi
的用法示例。
在下文中一共展示了Sobi::Init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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;
}