public function display($tpl = null) { $context = 'field_id'; $uri = JFactory::getURI(); $app = JFactory::getApplication(); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_REDSHOP_FIELDS')); JToolBarHelper::title(JText::_('COM_REDSHOP_FIELDS_MANAGEMENT'), 'redshop_fields48'); JToolBarHelper::addNewX(); JToolBarHelper::editListX(); JToolBarHelper::deleteList(); JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); $fields = $this->get('Data'); $total = $this->get('Total'); $pagination = $this->get('Pagination'); $redtemplate = new Redtemplate(); $optiontype = $redtemplate->getFieldTypeSections(); $optionsection = $redtemplate->getFieldSections(); $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'field_id'); $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', ''); $filtertypes = $app->getUserStateFromRequest($context . 'filtertypes', 'filtertypes', 0); $filtersection = $app->getUserStateFromRequest($context . 'filtertypes', 'filtersection', 0); $lists['order'] = $filter_order; $lists['order_Dir'] = $filter_order_Dir; $lists['type'] = JHTML::_('select.genericlist', $optiontype, 'filtertypes', 'class="inputbox" size="1" onchange="document.adminForm.submit();" ', 'value', 'text', $filtertypes); $lists['section'] = JHTML::_('select.genericlist', $optionsection, 'filtersection', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filtersection); $this->lists = $lists; $this->fields = $fields; $this->pagination = $pagination; parent::display($tpl); }
public function display($tpl = null) { $extra_field = new extra_field(); $option = JRequest::getVar('option', '', 'request', 'string'); JToolBarHelper::title(JText::_('COM_REDSHOP_FIELDS_MANAGEMENT_DETAIL'), 'redshop_fields48'); $document = JFactory::getDocument(); $document->addScript('components/' . $option . '/assets/js/fields.js'); $uri = JFactory::getURI(); $this->setLayout('default'); $lists = array(); $detail = $this->get('data'); $filed_data = $extra_field->getFieldValue($detail->field_id); $isNew = $detail->field_id < 1; $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT'); JToolBarHelper::title(JText::_('COM_REDSHOP_FIELDS') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_fields48'); JToolBarHelper::apply(); JToolBarHelper::save(); if ($isNew) { JToolBarHelper::cancel(); } else { JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE')); } $redtemplate = new Redtemplate(); $optiontype = $redtemplate->getFieldTypeSections(); $optionsection = $redtemplate->getFieldSections(); $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published); $lists['show_in_front'] = JHTML::_('select.booleanlist', 'field_show_in_front', 'class="inputbox"', $detail->field_show_in_front); $lists['display_in_product'] = JHTML::_('select.booleanlist', 'display_in_product', 'class="inputbox"', $detail->display_in_product); $lists['display_in_checkout'] = JHTML::_('select.booleanlist', 'display_in_checkout', 'class="inputbox"', $detail->display_in_checkout); $lists['required'] = JHTML::_('select.booleanlist', 'required', 'class="inputbox"', $detail->required); $lists['type'] = JHTML::_('select.genericlist', $optiontype, 'field_type', 'class="inputbox" size="1" onchange="field_select(this.value)" ', 'value', 'text', $detail->field_type); $disable = ""; if ($detail->field_type == 15) { $disable = "disabled='disabled' "; } $lists['section'] = JHTML::_('select.genericlist', $optionsection, 'field_section', 'class="inputbox" size="1" ' . $disable . ' onchange="sectionValidation(this.value)"', 'value', 'text', $detail->field_section); $lists['extra_data'] = $filed_data; $this->lists = $lists; $this->detail = $detail; $this->request_url = $uri->toString(); parent::display($tpl); }
echo JText::_($row->field_title); ?> </a> </td> <td width="30%"> <?php echo str_replace('-', '_', $row->field_name); ?> </td> <td width="30%"><?php echo $redtemplate->getFieldTypeSections($row->field_type); ?> </td> <td class="order" width="30%"><?php echo $redtemplate->getFieldSections($row->field_section); ?> </td> <td class="order" width="30%"> <span><?php echo $this->pagination->orderUpIcon($i, $row->field_section == @$this->fields[$i - 1]->field_section, 'orderup', JText::_('JLIB_HTML_MOVE_UP'), $ordering); ?> </span> <span><?php echo $this->pagination->orderDownIcon($i, $n, $row->field_section == @$this->fields[$i + 1]->field_section, 'orderdown', JText::_('JLIB_HTML_MOVE_DOWN'), $ordering); ?> </span> <?php $disabled = @$ordering ? '' : 'disabled="disabled"'; ?>