/** * Display the view */ public function display($tpl = null) { $app = JFactory::getApplication(); $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->fields_group = $this->get('FieldsGroup'); $this->fields = $this->get('FieldsName'); $this->canDo = AKHelper::getActions($this->option); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } parent::displayWithPanel($tpl); }
/** * Display the view */ public function display($tpl = null) { $app = JFactory::getApplication(); $this->params = JComponentHelper::getParams('com_remoteimage'); $this->canDo = AKHelper::getActions($this->option); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if (JRequest::getVar('tmpl') == 'component') { $this->modal = true; } else { $this->addToolbar(); } $this->notice(); parent::display($tpl); }
/** * Add the page title and toolbar. */ protected function addToolbar() { $app = JFactory::getApplication(); $state = $this->get('State'); $canDo = AKHelper::getActions($this->option); $user = JFactory::getUser(); $filter_state = $this->state->get('filter'); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); // Toolbar Buttons // ======================================================================== if ($canDo->get('core.create')) { JToolBarHelper::addNew($this->item_name . '.add'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList($this->item_name . '.edit'); } if ($canDo->get('core.create')) { JToolBarHelper::custom($this->list_name . '.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } if ($canDo->get('core.edit.state')) { JToolBarHelper::divider(); JToolBarHelper::publish($this->list_name . '.publish', 'JTOOLBAR_PUBLISH', true); JToolBarHelper::unpublish($this->list_name . '.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::checkin($this->list_name . '.checkin'); if ($this->state->get('items.nested')) { JToolBarHelper::custom($this->list_name . '.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false); } JToolBarHelper::divider(); } if (JArrayHelper::getValue($filter_state, 'a.published') == -2 && $canDo->get('core.delete') || $this->get('no_trash') || AKDEBUG) { JToolbarHelper::deleteList(JText::_('LIB_WINDWALKER_TOOLBAR_CONFIRM_DELETE'), $this->list_name . '.delete'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash($this->list_name . '.trash'); } // Add a batch modal button $batch = AKHelper::_('path.get', null, $this->option) . '/views/' . $this->list_name . '/tmpl/default_batch.php'; if ($canDo->get('core.edit') && JVERSION >= 3 && JFile::exists($batch)) { AKToolbarHelper::modal('JTOOLBAR_BATCH', 'batchModal'); } if ($canDo->get('core.admin') && $app->isAdmin()) { AKToolBarHelper::preferences($this->option); } }