本文整理匯總了PHP中JCck::_setMultisite方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCck::_setMultisite方法的具體用法?PHP JCck::_setMultisite怎麽用?PHP JCck::_setMultisite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCck
的用法示例。
在下文中一共展示了JCck::_setMultisite方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: plgSystemCCK
function plgSystemCCK(&$subject, $config)
{
$app = JFactory::getApplication();
if ($app->isAdmin()) {
JFactory::getLanguage()->load('lib_cck', JPATH_SITE);
if (file_exists(JPATH_SITE . '/plugins/cck_storage_location/joomla_user_note/joomla_user_note.php')) {
$this->content_objects['joomla_user_note'] = 1;
}
}
jimport('joomla.filesystem.file');
jimport('cck.base.cck');
// deprecated
// Content
jimport('cck.content.article');
//jimport( 'cck.content.category' );
jimport('cck.content.content');
jimport('cck.content.user');
// Development
jimport('cck.development.database');
// deprecated
$this->multisite = JCck::_setMultisite();
if ($this->multisite === true) {
$this->site = null;
$this->site_cfg = new JRegistry();
if (JCck::isSite()) {
$this->site = JCck::getSite();
$this->site_cfg->loadString($this->site->configuration);
if ($app->isSite() && $this->site) {
// --- Redirect to Homepage
$homepage = $this->site_cfg->get('homepage', 0);
if ($homepage > 0) {
$current = JUri::current(true);
$len = strlen($current);
if ($current[$len - 1] == '/') {
$current = substr($current, 0, -1);
}
$current = str_replace(array('http://', 'https://'), '', $current);
if ($current == $this->site->host) {
$redirect_url = JRoute::_('index.php?Itemid=' . $homepage);
if ($redirect_url != JUri::root(true) . '/') {
JFactory::getApplication()->redirect($redirect_url);
}
}
}
// ---
$tag = $this->site_cfg->get('language');
if ($tag) {
JFactory::getConfig()->set('language', $tag);
JFactory::getLanguage()->setLanguage($tag);
}
}
}
}
parent::__construct($subject, $config);
}