the-art-of-joomla-archive /pdf/code/trunk/administrator/components/com_artofpdf/views/pdfs/view.html.php

Language PHP Lines 106
MD5 Hash fc64525e46cd61793f10a7ef2139fe76 Estimated Cost $920 (why?)
Repository https://bitbucket.org/eddieajau/the-art-of-joomla-archive View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
<?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');
	}
}
Back to Top