示例#1
0
 /**
  * Initializer.
  *
  * @access   public
  * @return BaseController
  */
 public function __construct()
 {
     $is_admin = Request::is('admin*');
     $is_backend = Request::is('backend*');
     /* Set middleware(s) based on route URLs */
     if ($is_admin || $is_backend) {
         $this->middleware('auth');
         if ($is_backend) {
             // Backend specific middleware
             $this->middleware('auth.backend');
         }
         $this->middleware('auth.permissions');
         if (!Request::is('*users/change-password')) {
             // No validation for stale password if password is being changed
             $this->middleware('auth.pw_6_months');
         }
     }
     list($this->link_type, $this->link, $this->layout, $this->current_theme) = current_section();
     View::share('link_type', $this->link_type);
     View::share('current_theme', $this->current_theme);
     $website_settings = Setting::lists('value', 'name')->all();
     View::share('website_settings', $website_settings);
     $locale = Setting::value('language');
     App::setLocale($locale);
     Lang::setLocale($locale);
     $this->user = current_user();
     View::share('current_user', $this->user);
     View::share('current_user_companies', current_user_companies());
 }
示例#2
0
 /**
  * Initializer.
  *
  * @access   public
  * @return BaseController
  */
 public function __construct()
 {
     list($this->link_type, $this->link, $this->layout, $this->current_theme) = current_section();
     View::share('link_type', $this->link_type);
     View::share('current_theme', $this->current_theme);
     $website_settings = Setting::lists('value', 'name');
     View::share('website_settings', $website_settings);
     $this->user = current_user();
     View::share('current_user', $this->user);
 }
示例#3
0
 /**
  * Initializer.
  *
  * @access   public
  * @return BaseController
  */
 public function __construct()
 {
     list($this->link_type, $this->link, $this->layout, $this->current_theme) = current_section();
     View::share('link_type', $this->link_type);
     View::share('current_theme', $this->current_theme);
     $website_settings = Setting::lists('value', 'name');
     View::share('website_settings', $website_settings);
     $locale = Setting::value('language');
     App::setLocale($locale);
     Lang::setLocale($locale);
     $this->user = current_user();
     View::share('current_user', $this->user);
     View::share('current_user_companies', current_user_companies());
 }
示例#4
0
 protected function setupLayout()
 {
     $type_page = Type::where('status', 1)->lists('name', 'type');
     $settings = Setting::lists('value', 'name');
     View::share(['settings' => $settings, 'type_page' => $type_page]);
 }
示例#5
0
 protected function setupLayout()
 {
     $type_page = Post::where('status', 1)->where('type_id', 4)->where('parent', 0)->lists('name', 'slug');
     $settings = Setting::lists('value', 'name');
     View::share(['settings' => $settings, 'type_page' => $type_page]);
 }