- md5
- 97435a516007376dd045dfe24fd54c8a
- sha1
- 725526db1d00b3e9b077d53a3a8bfe0be1166e39
- sha256
- 5a19c3dced9bf0536905da43dac18a4b16751fa6edb4b67ab2e5dbeb8f5b1b7a
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
<?php
/**
* @version $Id: view.html.php 21705 2011-06-28 21:19:50Z dextercowley $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
/**
* View class for a list of banners.
*
* @package Joomla.Administrator
* @subpackage com_banners
* @since 1.6
*/
class BannersViewBanners extends JView
{
protected $categories;
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
// Initialise variables.
$this->categories = $this->get('CategoryOrders');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
require_once JPATH_COMPONENT .'/models/fields/bannerclient.php';
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT.'/helpers/banners.php';
$canDo = BannersHelper::getActions($this->state->get('filter.category_id'));
$user = JFactory::getUser();
JToolBarHelper::title(JText::_('COM_BANNERS_MANAGER_BANNERS'), 'banners.png');
if (count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0) {
JToolBarHelper::addNew('banner.add');
}
if (($canDo->get('core.edit'))) {
JToolBarHelper::editList('banner.edit');
}
if ($canDo->get('core.edit.state')) {
if ($this->state->get('filter.state') != 2){
JToolBarHelper::divider();
JToolBarHelper::publish('banners.publish', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::unpublish('banners.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
if ($this->state->get('filter.state') != -1 ) {
JToolBarHelper::divider();
if ($this->state->get('filter.state') != 2) {
JToolBarHelper::archiveList('banners.archive');
}
else if ($this->state->get('filter.state') == 2) {
JToolBarHelper::unarchiveList('banners.publish');
}
}
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::checkin('banners.checkin');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('banners.trash');
}
if ( $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'banners.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_banners');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS');
}
}
No other release has this exact content. See every version of this file.