Example #1
0
 /**
  * set common data to template
  * 
  * @author Luvina
  * @access public
  * 
  * @return void
  */
 public function before()
 {
     parent::before();
     $aryMenuList = Model_Category::find('all');
     $this->template->menu = $aryMenuList;
     $this->template->base_url = Config::get('base_url');
 }
Example #2
0
 public function after($response)
 {
     View::set_global('__header__', View::forge('partials/header', $this->template->get()));
     View::set_global('__footer__', View::forge('partials/footer', $this->template->get()));
     //        View::set_global('__alertbox__', View::forge('partials/alertbox', array('_alert'=>\Messages::get())) );
     return parent::after($response);
 }
Example #3
0
 public function after($response)
 {
     if (!empty($this->view)) {
         $this->template->content = View::forge($this->view, $this->data);
     }
     return parent::after($response);
 }
Example #4
0
 public function before()
 {
     parent::before();
     if (Session::get('user_token')) {
         Response::redirect('fanpage/index');
     }
     $this->facebook = new Libs\Facebook();
 }
 public function after($response)
 {
     $response = parent::after($response);
     if (Uri::Current() != Uri::Create('login')) {
         if (Settings::get('maintenance_mode') === true) {
             if (!Auth::member(5)) {
                 $this->template->content = View::Forge('core/maintenance');
             } elseif (Uri::Current() != Uri::Create('admin/settings')) {
                 // YOUR GOOD
                 Response::Redirect(Uri::Create('admin/settings'));
             }
         }
     }
     return $response;
 }
Example #6
0
 public function before()
 {
     parent::before();
     $client_type = false;
     $ua = \Input::user_agent();
     if (preg_match('/MicroMessenger/i', $ua)) {
         //加载微信公众号信息
         $this->load_wx_account();
         //加载微信粉丝OPENID信息
         $this->load_wechat();
         $client_type = 'wechat';
     }
     $this->load_seller();
     $this->getToken();
     \View::set_global(['client_type' => $client_type]);
 }
Example #7
0
 public function before()
 {
     $parentReturn = parent::before();
     \Fuel\Core\Lang::load("global");
     \Fuel\Core\Lang::load("share");
     $this->template->jsVars = new JsVars();
     $this->template->jsVars->addVar("wsUrl", rtrim(Router::get("ws_" . $this->lang), "/") . "/");
     $this->template->jsVars->addVar("baseUrl", \Fuel\Core\Uri::base(FALSE));
     $this->template->css = array("fonts.css", "normalize.css", "definitions.css", "template.css", "sprites/generic.css");
     $this->template->js = array("libs/jquery-2.1.3.min.js", "libs/jquery-ui.min.js", "libs/mustache.js", "template.js");
     $this->template->header = "front_header";
     $this->template->set_global(array("menu_selected" => ""));
     $this->template->footer = "front_footer";
     $this->template->footer_options = array();
     $fbShare = array("share" => FALSE, "siteName" => '', "title" => '', "description" => '', "image" => '');
     $this->template->fbShare = $fbShare;
     return $parentReturn;
 }
Example #8
0
 /**
  * @param Response $response
  * @return mixed
  */
 public function after($response)
 {
     View::set_global('__header__', View::forge('partials/header', array()));
     View::set_global('__footer__', View::forge('partials/footer', array()));
     return parent::after($response);
 }
Example #9
0
 public function after($response)
 {
     View::set_global('__sidebar__', View::forge('partials/sidebar', $this->formatData($this->side_data)));
     View::set_global('__footer__', View::forge('partials/footer', $this->formatData($this->side_data)));
     return parent::after($response);
 }