Ejemplo n.º 1
0
 /**
  * @param array $app
  * @param array $config
  */
 public function __construct($app, $config = array())
 {
     parent::__construct($app, $config);
     $this->app->jbdoc->noindex();
     $this->_jbmoney = $this->app->jbmoney;
     $this->_config = JBModelConfig::model()->getGroup('cart.config');
     $this->cart = JBCart::getInstance();
     $this->application = $this->app->zoo->getApplication();
     // load template
     $tmplName = $this->_config->get('tmpl_name', 'uikit');
     $templates = $this->application->getTemplates();
     $this->template = $this->application->getTemplate();
     if (isset($templates[$tmplName])) {
         $this->template = $templates[$tmplName];
     }
     if (!$this->_config->get('enable', 1)) {
         $this->app->jbnotify->error('JBZOO_CART_DISABLED');
     }
     if (!$this->cart->canAccess($this->app->user->get())) {
         $user = JFactory::getUser();
         if (empty($user->id)) {
             $url = 'index.php?option=com_users&view=login&return=' . base64_encode($this->app->jbenv->getCurrentUrl());
             $this->setRedirect($url, JText::_('JBZOO_CART_NEED_LOGIN'));
         } else {
             $this->app->jbnotify->error('JBZOO_CART_UNABLE_ACCESS');
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Wrapper for AppView init and rendering
  * @param string $tpl
  */
 public function renderView($tpl = null)
 {
     $this->_jbrequest->take('jbcart.' . strtolower($this->task) . '.element', 'element', $this->element, 'string');
     $this->_jbrequest->take('jbcart.' . strtolower($this->task) . '.layout', 'layout', $this->layout, 'string');
     parent::renderView($tpl);
 }
Ejemplo n.º 3
0
 /**
  * @param array $app
  * @param array $config
  */
 public function __construct($app, $config = array())
 {
     parent::__construct($app, $config);
     $this->app->path->register($this->app->path->path('jbviews:jborder'), 'renderer');
 }