Files
com_ajaxdemo/site/views/colour/view.html.php
alan 6356280cb1 Version 1.1.0 released
git-svn-id: svn://p-o.co.uk/p-o.co.uk/com_ajaxdemo@60 60e5ea7b-c093-dd11-ac13-000423648166
2012-03-29 11:21:27 +00:00

69 lines
1.5 KiB
PHP

<?php
/**
* Ajax demonstration component
*
* PHP version 5.3
*
* @category Joomla_Component
* @package Com_Ajaxdemo
* @subpackage View
* @author Alan Hicks <ahicks@p-o.co.uk>
* @copyright 2010-2012 Persistent Objects Ltd
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @link http://p-o.co.uk/
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
/**
* HTML View class for the Ajax demonstration component
*
* @category Joomla_Component
* @package Com_Ajaxdemo
* @subpackage Components
* @author Alan Hicks <ahicks@p-o.co.uk>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* @link http://p-o.co.uk/
*/
class AjaxdemoViewColour extends JView
{
protected $item;
protected $colours;
/**
* Display method for Colours
*
* @param string $tpl Template to display
*
* @return void
**/
function display($tpl = null)
{
// Get data from the model
$this->item = $this->get('Item');
$this->prev_colour = $this->get('PrevColour');
$this->next_colour = $this->get('NextColour');
$this->colours = $this->get('Colours');
if (JRequest::getMethod() == 'POST') {
JRequest::setVar('tmpl', 'component');
$this->setLayout('lightbox');
}
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode('<br />', $errors));
return false;
}
parent::display($tpl);
}
}