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


PHP JToolbar::setButtonPath方法代码示例

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


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

示例1: dirname

 function _initToolbar()
 {
     //		if (!class_exists('JToolBar')) {
     //            JLoader::register('JToolBar', JPATH_ADMINISTRATOR.'/libraries/joomla/html/toolbar.php');
     //            jimport('joomla.html.toolbar');
     //        }
     //require_once('rttoolbar.class.php');
     $bar = JToolBar::getInstance('toolbar');
     $buttons = $bar->getItems();
     //Toolbar is empty, attempt to see if it's a koowa toolbar
     //if it's not, then continue like always - TODO: find generic solution
     if (!$buttons && class_exists('KToolbarAbstract', false)) {
         $doc =& JFactory::getDocument();
         $buffer = $doc->getBuffer();
         if (is_array($buffer) && isset($buffer['modules']['toolbar'])) {
             $toolbar_buffer = $buffer['modules']['toolbar'];
             //use phpQuery to get the bits out
             if (!class_exists('phpQuery')) {
                 require_once dirname(__FILE__) . "/phpQuery.php";
             }
             $pq = phpQuery::newDocument($toolbar_buffer);
             $bits = pq('table')->find('a');
             $bar->addButtonPath($this->templatePath . DS . 'lib' . DS . 'buttons');
             foreach ($bits as $alink) {
                 $href = pq($alink)->attr('href');
                 $data = pq($alink)->attr('data');
                 $onclick = pq($alink)->attr('onclick');
                 $class = pq($alink)->attr('class');
                 $title = pq($alink)->find('span')->attr('title');
                 $bar->appendButton('koowa', $title, $href, $onclick, $data, $class);
             }
             $buttons = $bar->getItems();
         }
     }
     $newbar = array();
     $newhelp = array();
     $actions = array();
     $first = array();
     foreach ($buttons as $button) {
         if (strtolower($button[0]) == 'help') {
             $newhelp[] = $button;
         } elseif (isset($button[1]) && (strtolower($button[1]) == 'unarchive' or strtolower($button[1]) == 'archive' or strtolower($button[1]) == 'publish' or strtolower($button[1]) == 'unpublish' or strtolower($button[1]) == 'move' or strtolower($button[1]) == 'copy' or strtolower($button[1]) == 'trash' or strtolower($button[1]) == 'delete' or strtolower($button[1]) == 'tag')) {
             $actions[] = $button;
         } else {
             if (isset($button[1]) && (strtolower($button[1]) == 'new' or strtolower($button[1]) == 'apply' or strtolower($button[1]) == 'save')) {
                 $first[] = $button;
             } else {
                 $newbar[] = $button;
             }
         }
     }
     //create new toolbar object
     $toolbar = new JToolbar('toolbar');
     //$toolbar->_buttonPath[0] = $this->basePath.DS.'libraries'.DS.'joomla'.DS.'html'.DS.'toolbar'.DS.'button';
     $toolbar->setToolBar($newbar);
     //$toolbar->_bar = $newbar;
     $toolbar->setButtonPath($bar->getButtonPath());
     $toolbar->_actions = $actions;
     $toolbar->_first = $first;
     $this->toolbar = $toolbar;
     $this->actions = $actions;
     $this->first = $first;
     //new help button
     $helpbar = new JToolbar('help');
     //$helpbar->_buttonPath[0] = $this->basePath.DS.'libraries'.DS.'joomla'.DS.'html'.DS.'toolbar'.DS.'button';
     $helpbar->setToolbar($newhelp);
     $this->help = $helpbar;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:68,代码来源:rtcore.class.php

示例2: JToolbar

 function _initToolbar()
 {
     $bar = JToolBar::getInstance('toolbar');
     $buttons = $bar->getItems();
     $buffer = $this->document->getBuffer();
     //Toolbar is empty, attempt to see if it's a koowa toolbar
     //if it's not, then continue like always - TODO: find generic solution
     if (!$buttons && isset($buffer['modules']['toolbar'])) {
         $this->toolbar_output = $buffer['modules']['toolbar'];
         //new help button
         $helpbar = new JToolbar('help');
         $this->help = $helpbar;
         return;
     }
     $newbar = array();
     $newhelp = array();
     $actions = array();
     $first = array();
     foreach ($buttons as $button) {
         if (strtolower($button[0]) == 'help') {
             $newhelp[] = $button;
         } elseif (isset($button[1]) && (strtolower($button[1]) == 'unarchive' or strtolower($button[1]) == 'archive' or strtolower($button[1]) == 'publish' or strtolower($button[1]) == 'unpublish' or strtolower($button[1]) == 'move' or strtolower($button[1]) == 'copy' or strtolower($button[1]) == 'trash' or strtolower($button[1]) == 'delete' or strtolower($button[1]) == 'tag')) {
             $actions[] = $button;
         } else {
             if (isset($button[1]) && (strtolower($button[1]) == 'new' or strtolower($button[1]) == 'apply' or strtolower($button[1]) == 'save')) {
                 $first[] = $button;
             } else {
                 $newbar[] = $button;
             }
         }
     }
     //create new toolbar object
     $toolbar = new JToolbar('toolbar');
     $toolbar->setToolBar($newbar);
     $toolbar->setButtonPath($bar->getButtonPath());
     $toolbar->_actions = $actions;
     $toolbar->_first = $first;
     $this->toolbar = $toolbar;
     $this->actions = $actions;
     $this->first = $first;
     //new help button
     $helpbar = new JToolbar('help');
     $helpbar->setToolbar($newhelp);
     $this->help = $helpbar;
     $this->toolbar_output = $this->toolbar->render('toolbar');
 }
开发者ID:pitagon,项目名称:sandman-control,代码行数:46,代码来源:sccore.class.php


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