Exemple #1
0
 function edit()
 {
     JLoader::import('com_tienda.library.button', JPATH_ADMINISTRATOR . '/components');
     TiendaToolBarHelper::custom('save', 'save', 'save', 'COM_TIENDA_SAVE', false, 'shippingTask');
     TiendaToolBarHelper::custom('cancel', 'cancel', 'cancel', 'COM_TIENDA_CLOSE', false, 'shippingTask');
     $id = JRequest::getInt('id', '0');
     $sid = TiendaShippingPlugin::getShippingId();
     $this->includeCustomModel('UnexServices');
     $this->includeCustomTables();
     $model = JModel::getInstance('UnexServices', 'TiendaModel');
     if ($sid) {
         $model->setId((int) $sid);
         $item = $model->getItem();
     } else {
         $item = new JObject();
     }
     // Form
     $form = array();
     $form['action'] = $this->baseLink();
     $form['shippingTask'] = 'save';
     $view = $this->getView('shipping_unex', 'html');
     $view->hidemenu = true;
     $view->hidestats = true;
     $view->setModel($model, true);
     $view->assign('item', $item);
     $view->assign('form2', $form);
     $view->setLayout('edit');
     $view->display();
 }
Exemple #2
0
 function view($cachable = false, $urlparams = false)
 {
     JLoader::import('com_tienda.library.button', JPATH_ADMINISTRATOR . '/components');
     TiendaToolBarHelper::_custom('save', 'save', 'save', 'COM_TIENDA_SAVE', false, 'shippingTask');
     TiendaToolBarHelper::_custom('cancel', 'cancel', 'cancel', 'COM_TIENDA_CLOSE', false, 'shippingTask');
     $id = JRequest::getInt('id', '0');
     $sid = TiendaShippingPlugin::getShippingId();
     $this->includeCustomModel('ShippingMethods');
     $model = JModel::getInstance('ShippingMethods', 'TiendaModel');
     $model->setId((int) $sid);
     $item = $model->getItem();
     // Form
     $form = array();
     $form['action'] = $this->baseLink();
     $form['shippingTask'] = 'save';
     //We are calling a view from the ShippingMethods we isn't actually the same  controller this has, however since all it does is extend the base view it is
     // all good, and we don't need to remake getView()
     $view = $this->getView('ShippingMethods', 'html');
     $view->hidemenu = true;
     $view->hidestats = true;
     $view->setTask(true);
     $view->setModel($model, true);
     $view->assign('item', $item);
     $view->assign('form2', $form);
     $view->setLayout('view');
     $view->display();
 }
Exemple #3
0
 /**
  * Displays the admin-side configuration form for the plugin
  *
  */
 function viewConfig()
 {
     JLoader::import('com_tienda.library.button', JPATH_ADMINISTRATOR . '/components');
     // TODO Finish this
     //        TiendaToolBarHelper::custom( 'enabled.enable', 'publish', 'publish', JText::_('Enable'), true, 'shippingTask' );
     //        TiendaToolBarHelper::custom( 'enabled.disable', 'unpublish', 'unpublish', JText::_('Disable'), true, 'shippingTask' );
     TiendaToolBarHelper::cancel('close', 'COM_TIENDA_CLOSE');
     $vars = new JObject();
     $vars->state = $this->_getState();
     $id = JRequest::getInt('id', '0');
     $form = array();
     $form['action'] = "index.php?option=com_tienda&view=shipping&task=view&id={$id}";
     $vars->form = $form;
     $plugin = $this->_getMe();
     $plugin_id = $plugin->id;
     $vars = new JObject();
     $vars->link = "index.php?option=com_plugins&view=plugin&client=site&task=edit&cid[]={$plugin_id}";
     $vars->id = $plugin_id;
     $vars->list = $this->getFedexServices();
     $vars->services = $this->getServices();
     $html = $this->_getLayout('default', $vars);
     return $html;
 }
Exemple #4
0
 /**
  * Displays the admin-side configuration form for the plugin
  * 
  */
 function viewConfig()
 {
     JLoader::import('com_tienda.library.button', JPATH_ADMINISTRATOR . '/components');
     // TODO Finish this
     //        TiendaToolBarHelper::custom( 'enabled.enable', 'publish', 'publish', JText::_('Enable'), true, 'shippingTask' );
     //        TiendaToolBarHelper::custom( 'enabled.disable', 'unpublish', 'unpublish', JText::_('Disable'), true, 'shippingTask' );
     TiendaToolBarHelper::cancel('close', 'Close');
     $vars = new JObject();
     $vars->state = $this->_getState();
     $plugin = $this->_getMe();
     $plugin_id = $plugin->id;
     $vars->link = "index.php?option=com_plugins&view=plugin&client=site&task=edit&cid[]={$plugin_id}";
     $html = $this->_getLayout('default', $vars);
     return $html;
 }
 /**
  * Validates the data submitted based on the suffix provided
  * A controller for this plugin, you could say
  * 
  * @param $task
  * @return html
  */
 function viewList()
 {
     $html = "";
     JLoader::import('com_tienda.library.button', JPATH_ADMINISTRATOR . '/components');
     TiendaToolBarHelper::_custom('newMethod', 'new', 'new', 'COM_TIENDA_NEW', false, 'shippingTask');
     TiendaToolBarHelper::_custom('delete', 'delete', 'delete', 'COM_TIENDA_DELETE', false, 'shippingTask');
     TiendaToolBarHelper::cancel('close', 'COM_TIENDA_CLOSE');
     $vars = new JObject();
     $vars->state = $this->_getState();
     $this->includeCustomModel('ShippingMethods');
     $model = JModel::getInstance('ShippingMethods', 'TiendaModel');
     $list = $model->getList();
     $vars->list = $list;
     $id = JRequest::getInt('id', '0');
     $form = array();
     $form['action'] = "index.php?option=com_tienda&view=shipping&task=view&id={$id}";
     $vars->form = $form;
     $vars->sid = $id;
     $html = $this->_getLayout('default', $vars);
     return $html;
 }