Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     self::isLogin();
     @($pageNums = getConfig('PAGENUM'));
     $this->pageNum = !empty($pageNums) ? $pageNums : 11;
     $this->assign(array('APP' => APP, 'user' => $_SESSION['user']));
 }
Exemplo n.º 2
0
 public function render()
 {
     if ($this->getUser()) {
         if ($this->getActionView()) {
             $this->getActionView()->set('user', $this->getUser());
         }
         if ($this->getLayoutView()) {
             $this->getLayoutView()->set('user', $this->getUser());
         }
     }
     parent::render();
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     //获取配置文件中的分页数
     @($pageNums = getConfig('PAGENUM'));
     $this->pageNum = !empty($pageNums) ? $pageNums : 11;
     //输出导航信息
     $this->getNav();
     $this->getTag();
     $this->getHotArticle();
     $this->getLink();
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     if ($this->checkMobile()) {
         $this->theme = 'mobile';
         $this->mobile = true;
     }
     $this->assign('pageTitle', $this->pageTitle);
     $this->assign('pageKeywords', $this->pageKeywords);
     $this->assign('pageDescription', $this->pageDescription);
     //获取blog配置缓存
     $setting = $this->setting();
     $this->assign('setting', $setting);
 }
Exemplo n.º 5
0
 /**
  * Checks whether the user is set and then assign it to both the layout and action views.
  */
 public function render()
 {
     /* if the user and view(s) are defined, 
      * assign the user session to the view(s)
      */
     if ($this->user) {
         if ($this->actionView) {
             $key = "user";
             if ($this->actionView->get($key, false)) {
                 $key = "__user";
             }
             $this->actionView->set($key, $this->user);
         }
         if ($this->layoutView) {
             $key = "user";
             if ($this->layoutView->get($key, false)) {
                 $key = "__user";
             }
             $this->layoutView->set($key, $this->user);
         }
     }
     parent::render();
 }
Exemplo n.º 6
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     $database = Registry::get("database");
     $database->connect();
 }
Exemplo n.º 7
0
 /**
  * Override \Framework\Controller\render() and
  * assign the $_user to both action and layout views
  * @return void 
  */
 public function render()
 {
     if ($this->user) {
         if ($this->actionView) {
             $key = "user";
             if ($this->actionView->get($key, false)) {
                 $key = "__user";
             }
             $this->actionView->set($key, $this->user);
         }
         if ($this->layoutView) {
             $key = "user";
             if ($this->layoutView->get($key, false)) {
                 $key = "__user";
             }
             $this->layoutView->set($key, $this->user);
         }
     }
     // If the request was not XHR then render the view
     if (!$this->ajax) {
         parent::render();
     }
 }
Exemplo n.º 8
0
 function __construct(View $view, $config)
 {
     parent::__construct($view, $config);
     $this->_employeeManager = new EmployeeManager($this->config);
     $this->_ratesManager = new RatesManager();
 }
Exemplo n.º 9
0
 /**
  * Checks whether the user is set and then assign it to both the layout and action views.
  */
 public function render()
 {
     /* if the user and view(s) are defined, 
      * assign the user session to the view(s)
      */
     $session = Registry::get("session");
     $tracks = $session->get('User:$pListTracks');
     $current = $session->get('Users:$currentPlaylist');
     $playlists = $session->get('User:$playlists');
     if ($this->user) {
         if ($this->actionView) {
             $key = "user";
             if ($this->actionView->get($key, false)) {
                 $key = "__user";
             }
             $this->actionView->set($key, $this->user);
             if ($tracks) {
                 $this->actionView->set('current', $current);
                 $this->actionView->set('playlists', $playlists);
                 $this->actionView->set('plistTracks', $tracks);
             }
         }
         if ($this->layoutView) {
             $key = "user";
             if ($this->layoutView->get($key, false)) {
                 $key = "__user";
             }
             $this->layoutView->set($key, $this->user);
             if ($tracks) {
                 $this->layoutView->set('current', $current);
                 $this->layoutView->set('playlists', $playlists);
                 $this->layoutView->set('plistTracks', $tracks);
             }
         }
     }
     parent::render();
 }
Exemplo n.º 10
0
 public function __destruct()
 {
     $view = $this->layoutView;
     if ($view && !$view->get('seo')) {
         $view->set('seo', \Framework\Registry::get("seo"));
     }
     parent::__destruct();
 }