Current File : /home/pacjaorg/public_html/km/administrator/components/com_djclassifieds/views/field/view.html.php |
<?php
/**
* @package DJ-Classifieds
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email: contact@dj-extensions.com
*/
defined('_JEXEC') or die('Restricted access');
class DJClassifiedsViewField extends JViewLegacy
{
protected $state;
protected $item;
protected $form;
public function display($tpl = null)
{
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
return false;
}
$this->addToolbar();
$this->bs_cl = DJClassifiedsTheme::getBSClasses();
parent::display($tpl);
}
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$isNew = ($this->item->id == 0);
$text = $isNew ? JText::_( 'COM_DJCLASSIFIEDS_NEW' ) : JText::_( 'COM_DJCLASSIFIEDS_EDIT' );
JToolBarHelper::title( JText::_( 'COM_DJCLASSIFIEDS_FIELD' ).': <small><small>[ ' . $text.' ]</small></small>', 'generic.png' );
JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
JToolBarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL');
}
}