[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_content/views/articles/ -> view.html.php (source)

   1  <?php
   2  /**
   3   * @package        Joomla.Administrator
   4   * @subpackage    com_content
   5   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   6   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   7   */
   8  
   9  // No direct access
  10  defined('_JEXEC') or die;
  11  
  12  jimport('joomla.application.component.view');
  13  
  14  /**
  15   * View class for a list of articles.
  16   *
  17   * @package        Joomla.Administrator
  18   * @subpackage    com_content
  19   * @since        1.6
  20   */
  21  class ContentViewArticles extends JView
  22  {
  23      protected $items;
  24      protected $pagination;
  25      protected $state;
  26  
  27      /**
  28       * Display the view
  29       *
  30       * @return    void
  31       */
  32  	public function display($tpl = null)
  33      {
  34          $this->items        = $this->get('Items');
  35          $this->pagination    = $this->get('Pagination');
  36          $this->state        = $this->get('State');
  37          $this->authors        = $this->get('Authors');
  38  
  39          // Check for errors.
  40          if (count($errors = $this->get('Errors'))) {
  41              JError::raiseError(500, implode("\n", $errors));
  42              return false;
  43          }
  44  
  45          // Levels filter.
  46          $options    = array();
  47          $options[]    = JHtml::_('select.option', '1', JText::_('J1'));
  48          $options[]    = JHtml::_('select.option', '2', JText::_('J2'));
  49          $options[]    = JHtml::_('select.option', '3', JText::_('J3'));
  50          $options[]    = JHtml::_('select.option', '4', JText::_('J4'));
  51          $options[]    = JHtml::_('select.option', '5', JText::_('J5'));
  52          $options[]    = JHtml::_('select.option', '6', JText::_('J6'));
  53          $options[]    = JHtml::_('select.option', '7', JText::_('J7'));
  54          $options[]    = JHtml::_('select.option', '8', JText::_('J8'));
  55          $options[]    = JHtml::_('select.option', '9', JText::_('J9'));
  56          $options[]    = JHtml::_('select.option', '10', JText::_('J10'));
  57  
  58          $this->assign('f_levels', $options);
  59  
  60          // We don't need toolbar in the modal window.
  61          if ($this->getLayout() !== 'modal') {
  62              $this->addToolbar();
  63          }
  64  
  65          parent::display($tpl);
  66      }
  67  
  68      /**
  69       * Add the page title and toolbar.
  70       *
  71       * @since    1.6
  72       */
  73  	protected function addToolbar()
  74      {
  75          $canDo    = ContentHelper::getActions($this->state->get('filter.category_id'));
  76          $user        = JFactory::getUser();
  77          JToolBarHelper::title(JText::_('COM_CONTENT_ARTICLES_TITLE'), 'article.png');
  78  
  79          if ($canDo->get('core.create') || (count($user->getAuthorisedCategories('com_content', 'core.create'))) > 0 ) {
  80              JToolBarHelper::addNew('article.add');
  81          }
  82  
  83          if (($canDo->get('core.edit')) || ($canDo->get('core.edit.own'))) {
  84              JToolBarHelper::editList('article.edit');
  85          }
  86  
  87          if ($canDo->get('core.edit.state')) {
  88              JToolBarHelper::divider();
  89              JToolBarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
  90              JToolBarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
  91              JToolBarHelper::custom('articles.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true);
  92              JToolBarHelper::divider();
  93              JToolBarHelper::archiveList('articles.archive');
  94              JToolBarHelper::checkin('articles.checkin');
  95          }
  96  
  97          if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
  98              JToolBarHelper::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
  99              JToolBarHelper::divider();
 100          }
 101          elseif ($canDo->get('core.edit.state')) {
 102              JToolBarHelper::trash('articles.trash');
 103              JToolBarHelper::divider();
 104          }
 105  
 106          if ($canDo->get('core.admin')) {
 107              JToolBarHelper::preferences('com_content');
 108              JToolBarHelper::divider();
 109          }
 110  
 111          JToolBarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER');
 112      }
 113  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1