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


PHP CFactory::getToolbar方法代码示例

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


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

示例1: onSystemStart

 function onSystemStart()
 {
     if (!self::kunenaInstalled()) {
         return;
     }
     //initialize the toolbar object
     $toolbar = CFactory::getToolbar();
     // Kunena online check
     if (!Kunena::enabled()) {
         $toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENAMENU_KUNENA_OFFLINE'), JRoute::_('index.php?option=com_kunena'));
         return;
     }
     //adding new 'tab' 'Forum Settings' to JomSocial toolbar
     $toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENANENU_FORUM'), KunenaRoute::_('index.php?option=com_kunena&func=myprofile'));
     if ($this->params->get('sh_editprofile')) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_EDITPROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_EDITPROFILE'), KunenaRoute::_('index.php?option=com_kunena&func=myprofile&task=edit'));
     }
     if ($this->params->get('sh_myprofile')) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_PROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_PROFILE'), KunenaRoute::_('index.php?option=com_kunena&func=myprofile'));
     }
     if ($this->params->get('sh_myposts')) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_POSTS', JText::_('PLG_COMMUNITY_KUNENAMENU_POSTS'), KunenaRoute::_('index.php?option=com_kunena&func=latest&do=userposts'));
     }
     if ($this->params->get('sh_mysubscriptions')) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_SUBSCRIBES', JText::_('PLG_COMMUNITY_KUNENAMENU_SUBSCRIBTIONS'), KunenaRoute::_('index.php?option=com_kunena&func=latest&do=subscriptions'));
     }
     if ($this->params->get('sh_myfavorites')) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_FAVORITES', JText::_('PLG_COMMUNITY_KUNENAMENU_FAVORITES'), KunenaRoute::_('index.php?option=com_kunena&func=latest&do=favorites'));
     }
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:30,代码来源:kunenamenu.php

示例2: onSystemStart

 function onSystemStart()
 {
     if (!self::kunenaInstalled()) {
         return;
     }
     //initialize the toolbar object
     $toolbar = CFactory::getToolbar();
     $user = JFactory::getUser();
     // Kunena online check
     if (!KunenaForum::enabled()) {
         $toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENAMENU_KUNENA_OFFLINE'), KunenaRoute::_('index.php?option=com_kunena'));
         return;
     }
     //adding new 'tab' 'Forum Settings' to JomSocial toolbar
     $toolbar->addGroup('KUNENAMENU', JText::_('PLG_COMMUNITY_KUNENANENU_FORUM'), 'index.php?option=com_kunena&view=user&layout=default&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=user&layout=default'));
     if ($this->params->get('sh_editprofile', 1)) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_EDITPROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_EDITPROFILE'), 'index.php?option=com_kunena&view=user&layout=edit&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=user&layout=edit'));
     }
     if ($this->params->get('sh_myprofile', 1)) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_PROFILE', JText::_('PLG_COMMUNITY_KUNENAMENU_PROFILE'), 'index.php?option=com_kunena&view=user&layout=default&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=user&layout=default'));
     }
     if ($this->params->get('sh_myposts', 1)) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_POSTS', JText::_('PLG_COMMUNITY_KUNENAMENU_POSTS'), 'index.php?option=com_kunena&view=topics&layout=posts&mode=recent&userid=' . $user->id . '&sel=-1&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=topics&layout=posts&mode=recent&userid=' . $user->id . '&sel=-1'));
     }
     if ($this->params->get('sh_mysubscriptions', 1)) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_SUBSCRIBES', JText::_('PLG_COMMUNITY_KUNENAMENU_SUBSCRIBTIONS'), 'index.php?option=com_kunena&view=topics&layout=user&mode=subscriptions&sel=-1&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=topics&layout=user&mode=subscriptions&sel=-1'));
     }
     if ($this->params->get('sh_myfavorites', 1)) {
         $toolbar->addItem('KUNENAMENU', 'KUNENAMENU_FAVORITES', JText::_('PLG_COMMUNITY_KUNENAMENU_FAVORITES'), 'index.php?option=com_kunena&view=topics&layout=user&mode=favorites&sel=-1&Itemid=' . KunenaRoute::getItemid('index.php?option=com_kunena&view=topics&layout=user&mode=favorite&sel=-1s'));
     }
 }
开发者ID:juanferden,项目名称:adoperp,代码行数:31,代码来源:kunenamenu.php

示例3: removeClone

	techjoomla.jQuery('#'+rId+pre +"  #com_socialads_add_button"+pre).remove();
	techjoomla.jQuery('#'+rId+pre +"  .clerfix").remove();
	techjoomla.jQuery('#'+rId+pre).append(removeButton);
	techjoomla.jQuery('#'+rId+pre).after(newElem);

}

       function removeClone(rId,rClass){
               jQuery('#'+rId).remove();
       }
</script>
<?php 
//newly added for JS toolbar inclusion
if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_community') and $socialads_config['show_js_toolbar'] == 1) {
    require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'toolbar.php';
    $toolbar = CFactory::getToolbar();
    $tool = CToolbarLibrary::getInstance();
    ?>
<style>
   <!--
      div#proimport-wrap #community-wrap { margin: 0;padding: 0; }
      div#proimport-wrap #community-wrap { min-height: 45px !important; }
      -->
</style>
<script src="<?php 
    echo JUri::root() . 'components/com_community/assets/bootstrap/bootstrap.min.js';
    ?>
" type="text/javascript"></script>
<div id="proimport-wrap">
   <div id="community-wrap">
      <?php 
开发者ID:politik86,项目名称:test2,代码行数:31,代码来源:default.php

示例4: showToolbar


//.........这里部分代码省略.........
        $js .= '/*<![CDATA[*/';
        $js .= 'var js_viewerId  = ' . $my->id . '; ';
        $js .= 'var js_profileId = ' . $user->id . ';';
        $js .= '/*]]>*/';
        $js .= '</script>';
        $mainframe->addCustomHeadTag($js);
        CFactory::load('libraries', 'template');
        CTemplate::addStylesheet('style');
        // Load rtl stylesheet
        if ($document->direction == 'rtl') {
            CTemplate::addStylesheet('style.rtl');
        }
        // FOr iPhone, we need to add the stylesheet AFTER the main stylesheet has been loaded
        // if(JRequest::getVar('screen')=='mobile')
        // {
        // 	$document->addStylesheet( JURI::root() . 'components/com_community/templates/default/css/style.mobile.css' );
        // }
        // This need to be loaded in main messaging library
        CFactory::load('libraries', 'window');
        CWindow::load();
        $template = new CTemplateHelper();
        $styleIE7 = $template->getTemplateAsset('styleIE7', 'css');
        $styleIE6 = $template->getTemplateAsset('styleIE6', 'css');
        $css = '<!-- Jom Social -->
				<!--[if IE 7.0]>
				<link rel="stylesheet" href="' . $styleIE7->url . '" type="text/css" />
				<![endif]-->
				<!--[if lte IE 6]>
				<link rel="stylesheet" href="' . $styleIE6->url . '" type="text/css" />
				<![endif]-->';
        $mainframe->addCustomHeadTag($css);
        $css = 'assets/autocomplete.css';
        CAssets::attach($css, 'css');
        // Load joms.ajax
        CTemplate::addScript('joms.ajax');
        $task = JRequest::getVar('task', '', 'GET');
        $groupId = JRequest::getInt('groupid', '', 'GET');
        // Hide the toolbar from unregistered user
        // but still show the mini header
        if (empty($my->id)) {
            if (!empty($groupId) && $task != 'viewgroup') {
                CFactory::load('libraries', 'miniheader');
                echo CMiniHeader::showGroupMiniHeader($groupId);
                return;
            }
            echo CMiniHeader::showMiniHeader($this->_showMiniHeaderUser);
            return;
        }
        /**
         * Inbox unread count
         */
        $inboxUnread = 0;
        if (!empty($data['inbox'])) {
            $inboxUnread = $data['inbox'];
        }
        /**
         * Notification alert
         */
        $notiAlert = 0;
        $notiAlert = $this->_newNotification();
        if (!empty($notiAlert) && $notiAlert > 0) {
            CFactory::load('libraries', 'window');
            CWindow::load();
        }
        $config = CFactory::getConfig();
        $logoutLink = CRoute::_('index.php?option=com_community&view=' . $config->get('redirect_logout'), false);
        $logoutLink = base64_encode($logoutLink);
        $isFacebookUser = false;
        if ($config->get('fbconnectkey') && $config->get('fbconnectsecret')) {
            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;
        }
        $groupMiniHeader = '';
        // Show miniheader
        if ($task != 'viewgroup') {
            CFactory::load('libraries', 'miniheader');
            $groupMiniHeader = CMiniHeader::showGroupMiniHeader($groupId);
        }
        $tmpl = new CTemplate();
        $tmpl->set('my', $my);
        $tmpl->set('isMine', COwnerHelper::isMine($my->id, $user->id));
        $tmpl->set('config', $config);
        $tmpl->set('inboxUnread', $inboxUnread);
        $tmpl->set('notiAlert', $notiAlert);
        $tmpl->set('miniheader', CMiniHeader::showMiniHeader($this->_showMiniHeaderUser));
        $tmpl->set('groupMiniHeader', $groupMiniHeader);
        $tmpl->set('showAdvanceSearch', $mySQLVer > 4.1 ? 1 : 0);
        $tmpl->set('logoutLink', $logoutLink);
        $tmpl->set('isFacebookUser', $isFacebookUser);
        $toolbar = CFactory::getToolbar();
        $tmpl->set('customToolbar', $toolbar);
        echo $tmpl->fetch('toolbar.index');
    }
开发者ID:bizanto,项目名称:Hooked,代码行数:101,代码来源:views.php

示例5: addLegacyToolbars

 public function addLegacyToolbars(&$menus)
 {
     // Retrieve legacy toolbars
     $legacyToolbar = CFactory::getToolbar();
     $defaultMenus = array('HOME', 'APP', 'INBOX', 'PROFILE', 'FRIEND');
     if (!is_array($legacyToolbar->_toolbar)) {
         return;
     }
     foreach ($legacyToolbar->_toolbar as $toolbar => $item) {
         if (is_object($item)) {
             if (in_array($toolbar, $defaultMenus)) {
                 foreach ($item->child as $position => $items) {
                     if (!empty($items)) {
                         foreach ($items as $item_id => $child) {
                             $obj = new stdClass();
                             $obj->item = new stdClass();
                             $obj->item->id = $item_id;
                             $obj->item->link = $child->link;
                             $obj->item->name = $child->caption;
                             $obj->item->script = $child->isScriptCall;
                             $menus[] = $obj;
                         }
                     }
                 }
             } else {
                 $obj = new stdClass();
                 $obj->item = new stdClass();
                 $obj->item->id = $toolbar;
                 $obj->item->name = $item->caption;
                 $obj->item->link = $item->link;
                 $obj->childs = array();
                 if (isset($item->child)) {
                     foreach ($item->child as $position => $items) {
                         if (!empty($items)) {
                             foreach ($items as $item_id => $child) {
                                 $childObj = new stdClass();
                                 $childObj->id = $item_id;
                                 $childObj->link = $child->link;
                                 $childObj->name = $child->caption;
                                 $childObj->script = $child->isScriptCall;
                                 $obj->childs[] = $childObj;
                             }
                         }
                     }
                 }
                 $menus[] = $obj;
             }
         }
     }
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:50,代码来源:toolbar.php

示例6: 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();		
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:controller.php

示例7: addLink

 /**
  * Helper-method to add a link to the JomSocial MageBridge-tab
  *
  * @access private
  * @param string $request
  * @param string $name
  * @param string $title
  * @return null
  */
 private function addLink($request, $name, $title)
 {
     $toolbar = CFactory::getToolbar();
     $toolbar->addItem('MAGEBRIDGE', 'MAGEBRIDGE_' . $name, $title, $this->getLink($request));
 }
开发者ID:apiceweb,项目名称:MageBridgeCore,代码行数:14,代码来源:magebridge.php


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