| Current Path : /home/g/i/t/giteleslfp/www/administrator/components/com_templateck/views/font/ |
| Current File : /home/g/i/t/giteleslfp/www/administrator/components/com_templateck/views/font/view.html.php |
<?php
/**
* @name Template Creator CK
* @copyright Copyright (C) since 2011. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
*/
// No direct access
defined('TCK_LOADED') or die;
jimport('joomla.application.component.view');
/**
* View to edit
*/
class TemplateckViewFont extends JViewLegacy {
protected $state;
protected $item;
protected $form;
/**
* Display the view
*/
public function display($tpl = null) {
$this->item = $this->get('Item');
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*/
protected function addToolbar() {
// require_once JPATH_COMPONENT . '/helpers/templateck.php';
$app = JFactory::getApplication();
$app->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
if (isset($this->item->checked_out)) {
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
} else {
$checkedOut = false;
}
$canDo = TemplateckHelper::getActions();
JToolBarHelper::title(TCK_Text::_('COM_TEMPLATECK_TITLE_TEMPLATE'), 'template.png');
if ($this->_layout == 'edit') {
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || ($canDo->get('core.create')))) {
JToolBarHelper::apply('font.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('font.save', 'JTOOLBAR_SAVE');
}
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('font.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('font.cancel', 'JTOOLBAR_CLOSE');
}
}
}