public function browse($cachable = false) { // When groupbydate is set to 1 we force a JSON view which returns the // sales info (subscriptions, net amount) grouped by date. You can use // the since/until or other filter in the URL to filter the whole lot $groupbydate = $this->input->getInt('groupbydate', 0); $groupbylevel = $this->input->getInt('groupbylevel', 0); if ($groupbydate == 1 || $groupbylevel == 1) { if (JFactory::getUser()->guest) { return false; } else { $list = $this->getThisModel()->savestate(0)->limit(0)->limitstart(0)->getItemList(); header('Content-type: application/json'); echo json_encode($list); JFactory::getApplication()->close(); } } // Limit what a front-end user can do if (JFactory::getApplication()->isSite()) { if (JFactory::getUser()->guest) { return false; } else { $this->input->set('user_id', JFactory::getUser()->id); } } // If it's the back-end CSV view, force no limits if (JFactory::getApplication()->isAdmin() && $this->input->getCmd('format', 'html') == 'csv') { $this->getThisModel()->savestate(0)->limit(0)->limitstart(0); } return parent::browse($cachable); }
public function browse() { if (parent::browse()) { $config = J2Store::config(); $complete = $config->get('installation_complete', 0); if ($complete) { JFactory::getApplication()->redirect('index.php?option=com_j2store&view=cpanel', JText::_('J2STORE_POSTCONFIG_STORE_SETUP_DONE_ALREADY')); } return true; } return false; }
public function browse() { $app = JFactory::getApplication(); $model = $this->getThisModel(); $state = $this->getFilterStates(); foreach ($state as $key => $value) { $model->setState($key, $value); } //$product_types = $model->getProductTypes(); //array_unshift($product_types, JText::_('J2STORE_SELECT_OPTION')); $products = $model->getStockProductList(); $product_helper = J2Store::product(); foreach ($products as $product) { $product->product = $product_helper->setId($product->j2store_product_id)->getProduct(); } $view = $this->getThisView(); $view->setModel($model); $view->assign('products', $products); $view->assign('state', $model->getState()); //$view->assign('product_types',$product_types); return parent::browse(); }
public function import() { $this->layout = 'import'; parent::browse(); }