AAAAview.html.php 0000666 00000005132 15140120542 0007171 0 ustar 00 form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); } /** * Toolbar for product editing * * @copyright * @author RolandD * @todo * @see * @access protected * @param * @return void * @since 1.0 */ protected function addToolbar() { // Hide the mainmenu JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $isNew = ($this->item->id == 0); $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); JToolBarHelper::title(JText::_('COM_CSVI_PAGE_'.($checkedOut ? 'VIEW_TEMPLATETYPE' : ($isNew ? 'ADD_TEMPLATETYPE' : 'EDIT_TEMPLATETYPE'))), 'csvi_templates_48.png'); if (!$checkedOut) { JToolBarHelper::apply('templatetype.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('templatetype.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('templatetype.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } // If an existing item, can save to a copy. if (!$isNew) { JToolBarHelper::custom('templatetype.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('templatetype.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::cancel('templatetype.cancel', 'JTOOLBAR_CLOSE'); } } } ?> tmpl/edit.php 0000666 00000003050 15140120542 0007152 0 ustar 00