public function __construct() { parent::__construct(); $this->forgetBeforeFilter('maintenance'); $this->theme = \Theme::type('admincp')->current(\ThemeManager::getActive('admincp'))->reBoot()->layout('layouts.default'); $this->activePage('dashboard'); }
public function __construct() { $this->theme = Theme::type('frontend')->current(\ThemeManager::getActive('frontend'))->reBoot()->layout('layouts.default'); $this->setTitle(); $this->theme->share('loggedInUser', \Auth::user()); $this->theme->share('languages', app('App\\Repositories\\LanguageRepository')->all()); //attach before filter if (Config::get('maintenance-mode', 0)) { if (Auth::check() and Auth::user()->id == 1) { //don't enable it for maintain admin } else { $this->beforeFilter('maintenance'); } } /** * Set global site variables */ $updateSpeed = \Config::get('realtime-check-interval', 30000); $updateSpeed = !$updateSpeed ? 30000 : $updateSpeed; $this->theme->share('site_name', \Config::get('site_title')); $this->theme->share('site_description', \Config::get('site_description')); $this->theme->share('site_keywords', \Config::get('site_keywords')); $this->theme->share('ogType', 'website'); $this->theme->share('ogSiteName', \Config::get('site_title')); $this->theme->share('ogUrl', \URL::to('/')); $this->theme->share('ogTitle', \Config::get('site_title')); $this->theme->share('ogImage', $this->theme->asset()->img('theme/images/logo.png')); $ajaxify = \Config::get('ajaxify_frontend') ? 'true' : 'false'; $emoticons = \Theme::option()->get('emoticons'); $emoticonLists = ''; if ($emoticons) { foreach ($emoticons as $code => $details) { $emoticonLists .= "'<img width=\\'16\\' height=\\'16\\' src=\\'" . $details['image'] . "\\' title=\\'" . $details['title'] . "\\'/>',\n"; } } $this->theme->asset()->beforeScriptContent("\n var baseUrl = '" . \URL::to('/') . "/';\n var siteName = '" . \Config::get('site_title') . "';\n var doAjaxify = " . $ajaxify . ";\n var maxPostImage = " . \Config::get('max-images-per-post', '') . ";\n var updateSpeed = " . $updateSpeed . ";\n var isLogin = '******'true' : 'false') . "';\n var imgIndicator = '" . \Theme::asset()->img('theme/images/loading.gif') . "';\n\n //time_ago translation\n var trans_ago = '" . trans('global.ago') . "';\n var trans_from_now = '" . trans('global.from-now') . "';\n var trans_any_moment = '" . trans('global.any-moment') . "';\n var trans_less_than_minute = '" . trans('global.less-than-minute') . "';\n var trans_about_minute = '" . trans('global.about-minute') . "';\n var trans_minutes = '" . trans('global.minutes') . "';\n var trans_about_hour = '" . trans('global.about-hour') . "';\n var trans_hours = '" . trans('global.hours') . "';\n var trans_about = '" . trans('global.about') . "';\n var trans_a_day = '" . trans('global.a-day') . "';\n var trans_days = '" . trans('global.days') . "';\n var trans_about_month = '" . trans('global.about-month') . "';\n var trans_months = '" . trans('global.months') . "';\n var trans_about_year = '" . trans('global.about-year') . "';\n var trans_years = '" . trans('global.years') . "';\n var emoticons = [" . $emoticonLists . "];\n "); /** * Usefull repository in views */ $this->theme->share('connectionRepository', app('App\\Repositories\\ConnectionRepository')); $this->theme->share('searchRepository', app('App\\Repositories\\SearchRepository')); $this->theme->share('notificationRepository', app('App\\Repositories\\NotificationRepository')); $this->theme->share('likeRepository', app('App\\Repositories\\LikeRepository')); }