示例#1
0
    /**
     * Configure the toolbar button set.
     *
     * @param   array   $buttonSet Customize button set.
     * @param   object  $canDo     Access object.
     *
     * @return  array
     */
    protected function configureToolbar($buttonSet = array(), $canDo = null)
    {
        // Get default button set.
        $buttonSet = parent::configureToolbar($buttonSet, $canDo);
        $buttonSet['trash']['access'] = false;
        $buttonSet['delete']['access'] = true;
        $buttonSet['batch']['access'] = false;
        $buttonSet['publish']['access'] = false;
        $buttonSet['unpublish']['access'] = false;
        $buttonSet['clear'] = array('handler' => function () {
            $msg = JText::_('COM_QUICKCONTENT_CLEAR_WHOLE_SITE_ALERT');
            $text = JText::_('COM_QUICKCONTENT_CLEAR_WHOLE_SITE');
            $html = <<<BTN
<button onclick="if (confirm('{$msg}')){Joomla.submitbutton('generator.deleteall');}" class="btn btn-small">
\t<span class="icon-delete text-error"></span>
\t<span class="text-error">{$text}</span>
</button>
BTN;
            $bar = JToolBar::getInstance('toolbar');
            $bar->appendButton('Custom', $html);
        });
        return $buttonSet;
    }
示例#2
0
 /**
  * Configure the toolbar button set.
  *
  * @param   array   $buttonSet Customize button set.
  * @param   object  $canDo     Access object.
  *
  * @return  array
  */
 protected function configureToolbar($buttonSet = array(), $canDo = null)
 {
     // Get default button set.
     $buttonSet = parent::configureToolbar($buttonSet, $canDo);
     // In debug mode, we remove trash button but use delete button instead.
     if (JDEBUG) {
         $buttonSet['trash']['access'] = false;
         $buttonSet['delete']['access'] = true;
     }
     return $buttonSet;
 }
示例#3
0
文件: html.php 项目: ForAEdesWeb/AEW3
 /**
  * Configure the toolbar button set.
  *
  * @param   array   $buttonSet Customize button set.
  * @param   object  $canDo     Access object.
  *
  * @return  array
  */
 protected function configureToolbar($buttonSet = array(), $canDo = null)
 {
     // Get default button set.
     $buttonSet = parent::configureToolbar($buttonSet, $canDo);
     // In debug mode, we remove trash button but use delete button instead.
     if (JDEBUG) {
         $buttonSet['trash']['access'] = false;
         $buttonSet['delete']['access'] = true;
     }
     // User config button
     $buttonSet['user_config'] = array('handler' => function () {
         \JToolbarHelper::preferences('com_users', 550, 875, 'COM_USERXTD_TOOLBAR_COM_USERS_CONFIG');
     }, 'access' => $this->container->get('user')->authorise('core.admin', 'com_users'));
     // Replace wrong task of checkin
     $buttonSet['checkin']['args'] = array($this->viewList . '.check.checkin');
     return $buttonSet;
 }