本文整理汇总了PHP中CFactory::setCurrentURI方法的典型用法代码示例。如果您正苦于以下问题:PHP CFactory::setCurrentURI方法的具体用法?PHP CFactory::setCurrentURI怎么用?PHP CFactory::setCurrentURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFactory
的用法示例。
在下文中一共展示了CFactory::setCurrentURI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xdebug_memory_usage
// Trigger system start
if (function_exists('xdebug_memory_usage')) {
$mem = xdebug_memory_usage();
$tm = xdebug_time_index();
$db = JFactory::getDBO();
$db->debug(1);
}
require_once JPATH_COMPONENT . DS . 'libraries' . DS . 'apps.php';
$appsLib =& CAppPlugins::getInstance();
$appsLib->loadApplications();
// Only trigger applications and set active URI when needed
if ($tmpl != 'component') {
$args = array();
$appsLib->triggerEvent('onSystemStart', $args);
// Set active URI
CFactory::setCurrentURI();
}
// Normal call
// Component configuration
$config = array('name' => JString::strtolower(JRequest::getCmd('view', 'frontpage')));
// Create the controller
$viewController = JString::strtolower($config['name']);
if (JFile::exists(JPATH_COMPONENT . DS . 'controllers' . DS . $viewController . '.php')) {
// If the controller is one of our controller, include the file
// If not, it could be other 3rd party controller. Do not throw error message yet
require_once JPATH_COMPONENT . DS . 'controllers' . DS . $viewController . '.php';
}
$viewController = JString::ucfirst($viewController);
$viewController = 'Community' . $viewController . 'Controller';
// Trigger onBeforeControllerCreate (pass controller name by reference to allow override)
$args = array();
示例2: jomsocialtoolbar
function jomsocialtoolbar($template)
{
//Load Language file.
$toolbarstyling = 'components/com_community/templates/'.$template.'/css/style.css';
$lang =& JFactory::getLanguage();
$lang->load( 'com_community' );
require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php');
$my = CFactory::getUser();
// initiate toolbar
$customToolbar =& CFactory::getToolbar();
// get Jomsocial configuration
$config =& CFactory::getConfig();
// Include CAppPlugins library
require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'apps.php');
$appsLib =& CAppPlugins::getInstance();
$appsLib->loadApplications();
// Only trigger applications and set active URI when needed
$args = array();
$appsLib->triggerEvent( 'onSystemStart' , $args );
// Set active URI
CFactory::setCurrentURI();
// Include templates
require_once (JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries'.DS.'template.php');
// Include templates
require_once (JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries'.DS.'miniheader.php');
require_once(JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'tooltip.php');
require_once(JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'toolbar.php');
// Script needs to be here if they are
CFactory::load( 'libraries' , 'facebook' );
CFactory::load( 'models' , 'connect' );
// Once they reach here, we assume that they are already logged into facebook.
// Since CFacebook library handles the security we don't need to worry about any intercepts here.
$facebook = new CFacebook();
$connectTable =& JTable::getInstance( 'Connect' , 'CTable' );
$fbUser = $facebook->getUser();
$connectTable->load( $fbUser );
$isFacebookUser = ( $connectTable->userid == $my->id );
$logoutLink = CRoute::_( 'index.php?option=com_community&view=frontpage' , false );
$logoutLink = base64_encode( $logoutLink );
$document = & JFactory::getDocument();
if($toolbarstyling !== ""){$document->addStyleSheet( JURI::base() . $toolbarstyling );}
$document->addStyleSheet( JURI::base() . 'components/com_community/assets/autocomplete.css' );
$document->addStyleSheet( JURI::base() . 'components/com_community/assets/window.css' );
$document->addStyleSheet( JURI::base() . 'components/com_community/templates/default/css/style.green.css' );
//$document->addScript( JURI::base() . 'components/com_community/assets/jquery-1.3.2.pack.js' );
$document->addScript( JURI::base() . 'components/com_community/assets/joms.jquery.js' );
$document->addScript( JURI::base() . 'components/com_community/assets/joms.ajax.js' );
$document->addScript( JURI::base() . 'components/com_community/assets/window-1.0.pack.js' );
$document->addScript( JURI::base() . 'components/com_community/assets/script-1.2.pack.js' );
//$document->addScript( JURI::base() . 'components/com_community/assets/jquery.qtip-1.0.0-rc3.min.js' );
?>
<div id="community-wrap" style="display:inline">
<?php
$db =& JFactory::getDBO();
$query = 'SELECT ' . $db->nameQuote( 'params' ) . ' FROM ' . $db->nameQuote( '#__community_config' ) . ' WHERE ' . $db->nameQuote( 'name' ) . ' = ' . $db->quote('config');
$db->setQuery( $query );
$row = $db->loadResult();
//.........这里部分代码省略.........