- md5
- 523f05defcb93f6977cabdf85031c172
- sha1
- 46a0cd5670740573bf21ff5fb38b14e0e6b144cf
- sha256
- a0031f74c429521faec6cbd4cafed5e534095d3f028526c65fd421cdc6be29c6
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
<?php
/**
* @version $Id: view.html.php 20196 2011-01-09 02:40:25Z ian $
* @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');
/**
* @package Joomla.Administrator
* @subpackage com_content
*/
class ContentViewFeatured extends JView
{
protected $items;
protected $pagination;
protected $state;
/**
* Display the view
*/
public function display($tpl = null)
{
$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();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ContentHelper::getActions($this->state->get('filter.category_id'));
JToolBarHelper::title(JText::_('COM_CONTENT_FEATURED_TITLE'), 'featured.png');
if ($canDo->get('core.create')) {
JToolBarHelper::custom('article.add', 'new.png', 'new_f2.png','JTOOLBAR_NEW', false);
}
if ($canDo->get('core.edit')) {
JToolBarHelper::custom('article.edit', 'edit.png', 'edit_f2.png','JTOOLBAR_EDIT', true);
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::custom('articles.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('articles.unpublish', 'unpublish.png', 'unpublish_f2.png','JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::archiveList('articles.archive','JTOOLBAR_ARCHIVE');
JToolBarHelper::custom('articles.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
JToolBarHelper::custom('featured.delete','remove.png','remove_f2.png','JTOOLBAR_REMOVE', true);
}
if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'articles.delete','JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} else if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::trash('articles.trash','JTOOLBAR_TRASH');
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_content');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES');
}
}
The same content is in 7 releases, Joomla 1.6.0 to 1.6.6. See them all, or every version of this file.