| [ Index ] |
PHP Cross Reference of Joomla 2.5.4 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 4 * @license GNU General Public License version 2 or later; see LICENSE.txt 5 */ 6 7 // no direct access 8 defined('_JEXEC') or die; 9 10 jimport('joomla.application.component.view'); 11 12 /** 13 * @package Joomla.Administrator 14 * @subpackage com_content 15 */ 16 class ContentViewFeatured extends JView 17 { 18 protected $items; 19 protected $pagination; 20 protected $state; 21 22 /** 23 * Display the view 24 */ 25 public function display($tpl = null) 26 { 27 $this->items = $this->get('Items'); 28 $this->pagination = $this->get('Pagination'); 29 $this->state = $this->get('State'); 30 31 // Check for errors. 32 if (count($errors = $this->get('Errors'))) { 33 JError::raiseError(500, implode("\n", $errors)); 34 return false; 35 } 36 37 $this->addToolbar(); 38 parent::display($tpl); 39 } 40 41 /** 42 * Add the page title and toolbar. 43 * 44 * @since 1.6 45 */ 46 protected function addToolbar() 47 { 48 $state = $this->get('State'); 49 $canDo = ContentHelper::getActions($this->state->get('filter.category_id')); 50 51 JToolBarHelper::title(JText::_('COM_CONTENT_FEATURED_TITLE'), 'featured.png'); 52 53 if ($canDo->get('core.create')) { 54 JToolBarHelper::addNew('article.add'); 55 } 56 if ($canDo->get('core.edit')) { 57 JToolBarHelper::editList('article.edit'); 58 } 59 60 if ($canDo->get('core.edit.state')) { 61 JToolBarHelper::divider(); 62 JToolBarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true); 63 JToolBarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true); 64 JToolBarHelper::divider(); 65 JToolBarHelper::archiveList('articles.archive'); 66 JToolBarHelper::checkin('articles.checkin'); 67 JToolBarHelper::custom('featured.delete', 'remove.png', 'remove_f2.png', 'JTOOLBAR_REMOVE', true); 68 } 69 70 if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) { 71 JToolBarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH'); 72 JToolBarHelper::divider(); 73 } elseif ($canDo->get('core.edit.state')) { 74 JToolBarHelper::divider(); 75 JToolBarHelper::trash('articles.trash'); 76 } 77 78 if ($canDo->get('core.admin')) { 79 JToolBarHelper::preferences('com_content'); 80 JToolBarHelper::divider(); 81 } 82 JToolBarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES'); 83 } 84 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Apr 3 11:40:28 2012 | Cross-referenced by PHPXref 0.7.1 |