/pdf/code/trunk/administrator/components/com_artofpdf/views/pdfs/view.html.php
PHP | 106 lines | 42 code | 19 blank | 45 comment | 4 complexity | fc64525e46cd61793f10a7ef2139fe76 MD5 | raw file
- <?php
- /**
- * @version $Id: view.html.php 289 2010-09-28 01:51:29Z eddieajau $
- * @package NewLifeInIT
- * @subpackage com_artofpdf
- * @copyright Copyright 2010 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License version 2 or later.
- * @link http://www.theartofjoomla.com
- */
- // No direct access
- defined('_JEXEC') or die;
- jimport('joomla.application.component.view');
- /**
- * ArtofPdf view.
- *
- * @package NewLifeInIT
- * @subpackage com_artofpdf
- * @since 1.0
- */
- class ArtofPdfViewPdfs extends JView
- {
- /**
- * @var array The array of records to display in the list.
- * @since 1.0
- */
- protected $items;
- /**
- * @var JPagination The pagination object for the list.
- * @since 1.0
- */
- protected $pagination;
- /**
- * @var JObject The model state.
- * @since 1.0
- */
- protected $state;
- /**
- * Prepare and display the Pdfs view.
- *
- * @return void
- * @since 1.0
- */
- public function display()
- {
- ArtofPdfHelper::addSubmenu($this->getName());
- // Initialise variables.
- $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;
- }
- // Add the toolbar and display the view layout.
- $this->addToolbar();
- parent::display();
- }
- /**
- * Add the page title and toolbar.
- *
- * @return void
- * @since 1.0
- */
- protected function addToolbar()
- {
- // Initialise variables.
- $state = $this->get('State');
- JToolBarHelper::title(JText::_('COM_ARTOFPDF_PDFS_TITLE'), 'logo');
- JToolBarHelper::custom('pdf.make', 'pdf', null, 'COM_ARTOFPDF_TOOLBAR_PDF', true);
- JToolBarHelper::addNew('pdf.add', 'JTOOLBAR_NEW');
- JToolBarHelper::editList('pdf.edit', 'JTOOLBAR_EDIT');
- JToolBarHelper::custom('pdfs.duplicate', 'copy', null, 'JTOOLBAR_COPY', true);
- JToolBarHelper::publishList('pdfs.publish', 'JTOOLBAR_PUBLISH');
- JToolBarHelper::unpublishList('pdfs.unpublish', 'JTOOLBAR_UNPUBLISH');
- if ($state->get('filter.state') == -2) {
- JToolBarHelper::deleteList('', 'pdfs.delete','JTOOLBAR_EMPTY_TRASH');
- }
- else {
- JToolBarHelper::trash('pdfs.trash','JTOOLBAR_TRASH');
- }
- JToolBarHelper::preferences('com_artofpdf');
- // We can't use the toolbar helper here because there is no generic popup button.
- JToolBar::getInstance('toolbar')
- ->appendButton('Popup', 'help', 'COM_ARTOFPDF_ABOUT', 'index.php?option=com_artofpdf&view=about&tmpl=component');
- }
- }