public function display($tpl = null) { $context = 'template_id'; $uri = JFactory::getURI(); $app = JFactory::getApplication(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_TEMPLATES')); JToolBarHelper::title(JText::_('COM_REDSHOP_TEMPLATES_MANAGEMENT'), 'redshop_templates48'); JToolBarHelper::addNewX(); JToolBarHelper::editListX(); JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', JText::_('COM_REDSHOP_TOOLBAR_COPY'), true); JToolBarHelper::deleteList(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); $context = 'template'; $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'template_id'); $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', ''); $template_section = $app->getUserStateFromRequest($context . 'template_section', 'template_section', 0); $lists['order'] = $filter_order; $lists['order_Dir'] = $filter_order_Dir; $templates = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $redtemplate = new Redtemplate(); $optionsection = $redtemplate->getTemplateSections(); $lists['section'] = JHTML::_('select.genericlist', $optionsection, 'template_section', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $template_section); $this->user = JFactory::getUser(); $this->lists = $lists; $this->templates = $templates; $this->pagination = $pagination; $this->request_url = $uri->toString(); parent::display($tpl); }
public function display($tpl = null) { $app = JFactory::getApplication(); JToolBarHelper::title(JText::_('COM_REDSHOP_TEMPLATES_MANAGEMET'), 'redshop_templates48'); $uri = JFactory::getURI(); jimport('joomla.html.pane'); $pane = JPane::getInstance('sliders'); $this->pane = $pane; $model = $this->getModel('template_detail'); $user = JFactory::getUser(); $redtemplate = new Redtemplate(); // fail if checked out not by 'me' if ($model->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_REDSHOP_THE_DETAIL'), $detail->title); $app->redirect('index.php?option=com_redshop&view=template', $msg); } $this->setLayout('default'); $lists = array(); $detail = $this->get('data'); $isNew = $detail->template_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_TEMPLATES') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_templates48'); JToolBarHelper::apply(); JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { // EDIT - check out the item $model->checkout($user->get('id')); JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE')); } // TEMPLATE MOVE DB TO FILE $post = JRequest::get('post'); if ($isNew && (isset($post['template_name']) && $post['template_name'] != "")) { $detail->template_name = $post['template_name']; $detail->template_section = $post['template_section']; $template_desc = JRequest::getVar('template_desc', '', 'post', 'string', JREQUEST_ALLOWRAW); $detail->template_desc = $template_desc; $detail->published = $post['published']; $detail->msg = JText::_('PLEASE_CHANGE_FILE_NAME_IT_IS_ALREADY_EXISTS'); } // TEMPLATE MOVE DB TO FILE END // Section can be added from here $optionsection = $redtemplate->getTemplateSections(); $lists['section'] = JHTML::_('select.genericlist', $optionsection, 'template_section', 'class="inputbox" size="1" onchange="showclicktellbox();"', 'value', 'text', $detail->template_section); $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox" ', $detail->published); $order_functions = new order_functions(); $paymentMethod = $order_functions->getPaymentMethodInfo(); $payment_methods = explode(',', $detail->payment_methods); $tmp = new stdClass(); $tmp = @array_merge($tmp, $payment_methods); $lists['payment_methods'] = JHTML::_('select.genericlist', $paymentMethod, 'payment_methods[]', 'class="inputbox" multiple="multiple" size="4" ', 'element', 'name', $payment_methods); $shippingMethod = $order_functions->getShippingMethodInfo(); $shipping_methods = explode(',', $detail->shipping_methods); $tmp = new stdClass(); $tmp = @array_merge($tmp, $shipping_methods); $lists['shipping_methods'] = JHTML::_('select.genericlist', $shippingMethod, 'shipping_methods[]', 'class="inputbox" multiple="multiple" size="4" ', 'element', 'name', $shipping_methods); $lists['order_status'] = $order_functions->getstatuslist('order_status', $detail->order_status, 'class="inputbox" multiple="multiple"'); $this->lists = $lists; $this->detail = $detail; $this->request_url = $uri->toString(); parent::display($tpl); }
?> " title="<?php echo JText::_('COM_REDSHOP_EDIT_TEMPLATES'); ?> "><?php echo $row->template_name; ?> </a> <?php } ?> </td> <td> <?php echo $redtemplate->getTemplateSections($row->template_section); ?> </td> <td align="center"> <?php echo $published; ?> </td> <td align="center"> <?php echo $row->template_id; ?> </td> </tr> <?php