Beispiel #1
0
 public function display($cachable = true, $urlparams = false)
 {
     //error_log("IN AkrecipesControllerBrand::display ")		;
     $app = JFactory::getApplication();
     $view = $app->input->getCmd('view', 'brand');
     JFactory::getApplication()->input->set('view', $view);
     //error_log("Recipes Brand Param --> " . print_r($app->getParams(),true));
     $brand_id = $app->input->getInt('id');
     //error_log("brand_id --> " . $brand_id);
     JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_akrecipes/models');
     //$recipes_model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
     $recipes_model = JModelLegacy::getInstance('Recipes', 'AkrecipesModel', array());
     $num_recipes = (int) $app->getParams()->get('brandpage_num_recipes', 24);
     $app->input->set('limit', $num_recipes);
     $app->input->set('ignore_intro_leading', true);
     //$recipes_model->setState('list.limit',$num_recipes);
     $recipes_model->setState('filter.brand_id', $brand_id);
     $recipes_model->setState('catid.id', '');
     $app->input->set('filter_order', 'publish_up');
     $app->input->set('filter_order_Dir', 'DESC');
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $viewName = $this->input->get('view', $this->default_view);
     $viewLayout = $this->input->get('layout', 'default', 'string');
     $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));
     // // Get/Create the model
     // if ($model = $this->getModel($viewName))
     // {
     // 	// Push the model into the view (as default)
     // 	$view->setModel($model, true);
     // }
     $view->setModel($recipes_model);
     parent::display($cachable, $urlparams);
     return $this;
 }
Beispiel #2
0
 /**
  * Method to display a view.
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   mixed    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return  JController   This object to support chaining.
  *
  * @since    1.5
  */
 public function display($cachable = true, $urlparams = false)
 {
     //error_log("In AkrecipesControllerRecipesbyuser::display" ) ;
     require_once JPATH_COMPONENT . '/helpers/akrecipes.php';
     $app = JFactory::getApplication();
     $view = $app->input->getCmd('view', 'recipesbyuser');
     JFactory::getApplication()->input->set('view', $view);
     //$model = $view->getModel();
     $userid = $app->input->getInt('id');
     JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_content/models');
     //$articles_model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
     $articles_model = JModelLegacy::getInstance('Articles', 'ContentModel', array());
     $articles_model->setState('filter.author_id', $userid);
     // $articles_model->setState('list.ordering', 'publish_up');
     // $articles_model->setState('list.direction', 'DESC');
     $app->input->set('filter_order', 'publish_up');
     $app->input->set('filter_order_Dir', 'DESC');
     //error_log("Articles --> " . $articles_model->getName())		;
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $viewName = $this->input->get('view', $this->default_view);
     $viewLayout = $this->input->get('layout', 'default', 'string');
     $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));
     // // Get/Create the model
     // if ($model = $this->getModel($viewName))
     // {
     // 	// Push the model into the view (as default)
     // 	$view->setModel($model, true);
     // }
     //$view->setModel($articles_model);
     //error_log("User is :: " . $userid) ;
     parent::display($cachable, $urlparams);
     return $this;
 }
Beispiel #3
0
 /**
  * Proxy for getModel.
  *
  * @param   string  $name    The model name. Optional.
  * @param   string  $prefix  The class prefix. Optional
  * @param   array   $config  Configuration array for model. Optional
  *
  * @return object	The model
  *
  * @since	1.6
  */
 public function &getModel($name = 'Frontpage', $prefix = 'AkrecipesModel', $config = array())
 {
     //error_log("IN AkrecipesControllerFrontpage::getModel name = " . $name );
     $app->input->set('ignore_intro_leading', true);
     $model = parent::getModel($name, $prefix, $config);
     $model->setState('filter.json', 1);
     return $model;
 }
Beispiel #4
0
 public function display($cachable = false, $urlparams = false)
 {
     //error_log("In AkrecipesControllerRecipes::display cachable == " . $cachable . " $urlparams == " . print_r($urlparams,true) ) ;
     parent::display($cachable, $urlparams);
     return $this;
 }
Beispiel #5
0
 /**
  * Proxy for getModel.
  *
  * @param   string  $name    The model name. Optional.
  * @param   string  $prefix  The class prefix. Optional
  * @param   array   $config  Configuration array for model. Optional
  *
  * @return object	The model
  *
  * @since	1.6
  */
 public function &getModel($name = 'Cuisines', $prefix = 'AkrecipesModel', $config = array())
 {
     $model = parent::getModel($name, $prefix, array('ignore_request' => true));
     return $model;
 }
Beispiel #6
0
 /**
  * Proxy for getModel.
  *
  * @param   string  $name    The model name. Optional.
  * @param   string  $prefix  The class prefix. Optional
  * @param   array   $config  Configuration array for model. Optional
  *
  * @return object	The model
  *
  * @since	1.6
  */
 public function &getModel($name = 'Frontpage', $prefix = 'AkrecipesModel', $config = array())
 {
     //error_log("IN AkrecipesControllerFrontpage::getModel name = " . $name );
     $model = parent::getModel($name, $prefix, $config);
     return $model;
 }
Beispiel #7
0
 public function display($cachable = true, $urlparams = false)
 {
     parent::display($cachable, $safeurlparams);
 }