Пример #1
0
 function display($cachable = false, $urlparams = array())
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     if (empty(JFactory::getUser()->id)) {
         $url = JRoute::_("index.php?option=com_j2store&view=downloads");
         $redirect = "index.php?option=com_users&view=login&return=" . base64_encode($url);
         $redirect = JRoute::_($redirect, false);
         JFactory::getApplication()->redirect($redirect);
         return;
     }
     $params = JComponentHelper::getParams('com_j2store');
     $model = $this->getModel('downloads');
     $ns = 'com_j2store.downloads';
     $files = $model->getItems();
     $registry = new JRegistry();
     $registry->loadArray($files);
     $files = $registry->toObject();
     //print_r($files);
     //exit;
     //$freefiles=$model->getFreeFiles();
     //$files=$this->process($files,$freefiles);
     $view = $this->getView('downloads', 'html');
     $view->set('_controller', 'downloads');
     $view->set('_view', 'downloads');
     $view->set('_doTask', true);
     $view->set('hidemenu', false);
     $view->setModel($model, true);
     $view->assign('files', $files);
     $view->assign('params', $params);
     $view->setLayout('default');
     //	$view->display();
     parent::display();
 }
Пример #2
0
 /**
  * Method to show a j2store view
  *
  * @access	public
  * @since	1.5
  */
 function display()
 {
     // Set a default view if none exists
     if (!JRequest::getCmd('view')) {
         JRequest::setVar('view', 'mycart');
     }
     parent::display(true);
 }
Пример #3
0
 /**
  * display task
  *
  * @return void
  */
 function display($cachable = false, $urlparams = array())
 {
     // set default view if not set
     $app = JFactory::getApplication();
     $app->input->set('view', $app->input->getWord('view', 'cpanel'));
     // call parent behavior
     parent::display($cachable, $urlparams);
     return $this;
 }
Пример #4
0
 /**
  * Method to (non-PHPdoc)
  * @see J2StoreController::display()
  */
 function display($cachable = false, $urlparams = array())
 {
     $task = $this->getTask();
     if ($task == 'edit' || $task == 'add') {
         JRequest::setVar('hidemainmenu', 1);
         JRequest::setVar('layout', 'edit');
         JRequest::setVar('view', 'layout');
         JRequest::setVar('edit', true);
         $model = $this->getModel('layout');
     }
     parent::display();
 }
Пример #5
0
 function display($cachable = false, $urlparams = array())
 {
     switch ($this->getTask()) {
         case 'edit':
             JRequest::setVar('hidemainmenu', 1);
             JRequest::setVar('layout', 'form');
             JRequest::setVar('view', 'address');
             JRequest::setVar('edit', true);
             $model = $this->getModel('address');
             break;
     }
     parent::display();
 }
Пример #6
0
 function display($cachable = false, $urlparams = array())
 {
     switch ($this->getTask()) {
         case 'add':
             JRequest::setVar('hidemainmenu', 1);
             JRequest::setVar('layout', 'edit');
             JRequest::setVar('view', 'option');
             JRequest::setVar('edit', false);
             break;
         case 'edit':
             JRequest::setVar('hidemainmenu', 1);
             JRequest::setVar('layout', 'edit');
             JRequest::setVar('view', 'option');
             JRequest::setVar('edit', true);
             break;
     }
     parent::display();
 }
Пример #7
0
 function display($cachable = false, $urlparams = array())
 {
     $app = JFactory::getApplication();
     switch ($this->getTask()) {
         case 'add':
             $app->input->set('hidemainmenu', 1);
             $app->input->set('layout', 'edit');
             $app->input->set('view', 'coupon');
             $app->input->set('edit', false);
             break;
         case 'edit':
             $app->input->set('hidemainmenu', 1);
             $app->input->set('layout', 'edit');
             $app->input->set('view', 'coupon');
             $app->input->set('edit', true);
             break;
     }
     parent::display();
 }
Пример #8
0
 function display($cachable = false, $urlparams = array())
 {
     $app = JFactory::getApplication();
     switch ($this->getTask()) {
         case 'add':
             $msg = JText::_('J2STORE_AVAILABLE_IN_PRO_VERSION');
             $link = 'index.php?option=com_j2store&view=fields';
             $this->setRedirect($link, $msg);
             break;
         case 'edit':
             $field_id = $app->input->getInt('field_id');
             if (empty($field_id)) {
                 $msg = JText::_('J2STORE_AVAILABLE_IN_PRO_VERSION');
                 $link = 'index.php?option=com_j2store&view=fields';
                 $this->setRedirect($link, $msg);
             }
             $app->input->set('hidemainmenu', 1);
             $app->input->set('layout', 'edit');
             $app->input->set('view', 'field');
             $app->input->set('edit', true);
             break;
     }
     parent::display($cachable = false, $urlparams = array());
 }
Пример #9
0
 function display($cachable = false, $urlparams = array())
 {
     JRequest::setVar('view', 'Info');
     parent::display();
 }
Пример #10
0
 function display($cachable = false, $urlparams = array())
 {
     JFactory::getApplication()->input->set('view', 'cpanel');
     parent::display();
 }