/contentmanager/code/trunk/administrator/components/com_contentmanager/views/templates/view.html.php
PHP | 78 lines | 48 code | 9 blank | 21 comment | 4 complexity | b9823143dde8903c0d91d5d96ef2b4b2 MD5 | raw file
- <?php
- /**
- * @version $Id: view.html.php 154 2009-07-01 05:48:13Z eddieajau $
- * @copyright Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
- * @link http://www.theartofjoomla.com
- */
-
- // no direct access
- defined('_JEXEC') or die;
-
- jimport('joomla.application.component.view');
-
- /**
- * @package TAOJ.ContentManager
- * @subpackage com_contentmanager
- */
- class ContentManagerViewTemplates extends JView
- {
- protected $state;
- protected $items;
- protected $pagination;
- protected $f_published;
-
- /**
- * Display the view
- */
- public function display($tpl = null)
- {
- $state = $this->get('State');
- $items = $this->get('Items');
- $pagination = $this->get('Pagination');
- // Check for errors.
- if (count($errors = $this->get('Errors'))) {
- JError::raiseError(500, implode("\n", $errors));
- return false;
- }
-
- $this->assignRef('state', $state);
- $this->assignRef('items', $items);
- $this->assignRef('pagination', $pagination);
-
- // Published filter
- $options = array();
- $options[] = JHtml::_('select.option', '*', 'Any');
- $options[] = JHtml::_('select.option', '1', 'Published');
- $options[] = JHtml::_('select.option', '0', 'Unpublished');
- $options[] = JHtml::_('select.option', '-2', 'Trash');
- $this->assign('f_published', $options);
-
- $this->_setToolbar();
- parent::display($tpl);
- }
-
- /**
- * Display the toolbar
- *
- * @access private
- */
- protected function _setToolbar()
- {
- $state = $this->get('State');
- JToolBarHelper::title(JText::_('ContMan_Page_Editor_Templates'), 'logo');
- JToolBarHelper::custom('templates.publish', 'publish.png', 'publish_f2.png', 'Publish', true);
- JToolBarHelper::custom('templates.unpublish', 'unpublish.png', 'unpublish_f2.png', 'Unpublish', true);
- if ($state->get('filter.published') == -2) {
- JToolBarHelper::deleteList('', 'templates.delete');
- }
- else {
- JToolBarHelper::trash('templates.trash');
- }
- JToolBarHelper::custom('template.edit', 'edit.png', 'edit_f2.png', 'Edit', true);
- JToolBarHelper::custom('template.edit', 'new.png', 'new_f2.png', 'New', false);
- JToolBarHelper::divider();
- JToolBarHelper::preferences('com_contentmanager', 400, 600, 'ContMan_Toolbar_options');
- }
- }