Пример #1
0
 /**
  * Display method
  *
  * @param string $tpl
  * @return null
  */
 public function display($tpl = null)
 {
     // Fetch this item
     $this->fetchItem();
     // Initialize the form-file
     $file = JPATH_ADMINISTRATOR . '/components/com_magebridge/models/product.xml';
     // Prepare the params-form
     $params = YireoHelper::toRegistry($this->item->params)->toArray();
     $params_form = JForm::getInstance('params', $file);
     $params_form->bind(array('params' => $params));
     $this->params_form = $params_form;
     // Prepare the actions-form
     $actions = YireoHelper::toRegistry($this->item->actions)->toArray();
     $actions_form = JForm::getInstance('actions', $file);
     JPluginHelper::importPlugin('magebridgeproduct');
     JFactory::getApplication()->triggerEvent('onMageBridgeProductPrepareForm', array(&$actions_form, (array) $this->item));
     $actions_form->bind(array('actions' => $actions));
     $this->actions_form = $actions_form;
     // Build the fields
     $this->lists['product'] = MageBridgeFormHelper::getField('magebridge.product', 'sku', $this->item->sku, null);
     // Check for a previous connector-value
     if (!empty($this->item->connector)) {
         $plugin = JPluginHelper::getPlugin('magebridgeproduct', $this->item->connector);
         if (empty($plugin)) {
             $plugin_warning = JText::sprintf('COM_MAGEBRIDGE_PRODUCT_PLUGIN_WARNING', $this->item->connector);
             JError::raiseWarning(500, $plugin_warning);
         }
     }
     parent::display($tpl);
 }
Пример #2
0
 /**
  * Helper method to get the HTML-formelement for a storegroup
  *
  * @param string $default
  * @return string
  */
 protected function getFieldStoregroup($default = null)
 {
     return MageBridgeFormHelper::getField('magebridge.storegroup', 'name', $value, null);
 }