| Current Path : /home/z/i/e/zieirix/www/administrator/components/com_faqbookpro/views/sections/ |
| Current File : /home/z/i/e/zieirix/www/administrator/components/com_faqbookpro/views/sections/view.html.php |
<?php
/**
* @title Minitek FAQ Book
* @copyright Copyright (C) 2011-2020 Minitek, All rights reserved.
* @license GNU General Public License version 3 or later.
* @author url https://www.minitek.gr/
* @developers Minitek.gr
*/
defined('_JEXEC') or die;
class FAQBookProViewSections extends JViewLegacy
{
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$utilities = new FAQBookProHelper();
$utilities->addSubmenu('sections');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
}
protected function addToolbar()
{
$canDo = FAQBookProHelper::getActions('com_faqbookpro', 'section', $this->state->get('filter.section_id'));
JToolbarHelper::title(JText::_('COM_FAQBOOKPRO_SECTIONS_TITLE'), 'list-2');
if ($canDo->get('core.create'))
{
JToolbarHelper::addNew('section.add');
}
if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own')))
{
JToolbarHelper::editList('section.edit');
}
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::publish('sections.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('sections.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('sections.archive');
JToolbarHelper::checkin('sections.checkin');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'sections.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('sections.trash');
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
JToolbarHelper::preferences('com_faqbookpro');
}
}
}