/contentmanager/code/trunk/administrator/components/com_contentmanager/views/splash/view.html.php
PHP | 78 lines | 47 code | 9 blank | 22 comment | 6 complexity | 0301dff0ec2072c2279669005ddc6b04 MD5 | raw file
- <?php
- /**
- * @version $Id: view.html.php 57 2009-05-25 12:21:31Z eddieajau $
- * @copyright Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
- * @link http://www.theartofjoomla.com
- */
-
- // no direct access
- defined('_JEXEC') or die;
-
- jimport('joomla.application.component.view');
-
- /**
- * @package TAOJ.ContentManager
- * @subpackage com_contentmanager
- */
- class ContentManagerViewSplash extends JView
- {
- /**
- * Display the view
- *
- * @access public
- */
- function display($tpl = null)
- {
- $state = $this->get('State');
- $item = $this->get('Item');
- $form = $this->get('Form');
- // Check for errors.
- if (count($errors = $this->get('Errors'))) {
- JError::raiseError(500, implode("\n", $errors));
- return false;
- }
- $form->setName('adminForm');
- $form->setAction(JRoute::_('index.php?option=com_contentmanager'));
- $form->loadObject($item);
- $this->assignRef('state', $state);
- $this->assignRef('item', $item);
- $this->assignRef('form', $form);
-
- $this->_setToolbar();
- parent::display($tpl);
- JRequest::setVar('hidemainmenu', true);
- }
-
- /**
- * Display the toolbar
- *
- * @access private
- */
- function _setToolbar()
- {
- $user = &JFactory::getUser();
- if (is_object($this->item)) {
- $isCheckedOut = JTable::isCheckedOut($user->get('id'), $this->item->checked_out);
- $isNew = ($this->item->id == 0);
- }
- else {
- $isCheckedOut = false;
- $isNew = true;
- }
-
- JToolBarHelper::title(JText::_('ContMan_Page_'.($isCheckedOut ? 'View_Splash_Page' : ($isNew ? 'Add_Splash_Page' : 'Edit_Splash_Page'))), 'logo');
- if (!$isNew) {
- JToolBarHelper::custom('splash.save2copy', 'copy.png', 'copy_f2.png', 'ContMan_Toolbar_Save_To_Copy', false);
- }
- if (!$isCheckedOut) {
- JToolBarHelper::custom('splash.save2new', 'new.png', 'new_f2.png', 'ContMan_Toolbar_Save_And_New', false);
- JToolBarHelper::save('splash.save');
- JToolBarHelper::apply('splash.apply');
- }
- JToolBarHelper::cancel('splash.cancel');
- }
- }