芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/minscoop.com/app/Controllers/BaseController.php
session = \Config\Services::session(); $this->request = \Config\Services::request(); $this->settingsModel = new SettingsModel(); $this->commonModel = new CommonModel(); $this->postModel = new PostModel(); //general settings $this->generalSettings = Globals::$generalSettings; if ($_SERVER['REQUEST_METHOD'] == 'POST') { setActiveLangPostRequest(); } //settings $this->settings = Globals::$settings; //active languages $this->activeLanguages = Globals::$languages; //active lang $this->activeLang = Globals::$activeLang; //maintenance mode if ($this->generalSettings->maintenance_mode_status == 1) { if (!isAdmin()) { echo view('common/maintenance', ['generalSettings' => $this->generalSettings, 'baseSettings' => $this->settings]); } } //site fonts $this->activeFonts = $this->settingsModel->getSelectedFonts($this->settings); //active theme $this->activeTheme = getActiveTheme(); //rtl $this->rtl = false; if ($this->activeLang->text_direction == 'rtl') { $this->rtl = true; } $this->darkMode = Globals::$darkMode; //menu links $menuLinks = getCachedData('menu_links'); if (empty($menuLinks)) { $pageModel = new PageModel(); $menuLinks = $pageModel->getMenuLinks($this->activeLang->id); setCacheData('menu_links', $menuLinks); } //widgets $this->widgets = getCachedData('widgets'); if (empty($this->widgets)) { $this->widgets = $this->settingsModel->getWidgetsByLang($this->activeLang->id); setCacheData('widgets', $this->widgets); } //categories $this->categories = getCachedData('categories'); if (empty($this->categories)) { $this->categories = getCategoriesByLang($this->activeLang->id); setCacheData('categories', $this->categories); } //latest categories posts $this->latestCategoryPosts = getCachedData('latest_category_posts'); if (empty($this->latestCategoryPosts)) { $this->latestCategoryPosts = $this->postModel->getLatestCategoryPosts($this->activeLang->id); setCacheData('latest_category_posts', $this->latestCategoryPosts); } //ad spaces $this->adSpaces = $this->commonModel->getAdSpacesByLang($this->activeLang->id); //update last seen updateLastSeen(); //view variables $view = \Config\Services::renderer(); $view->setData(['assetsPath' => 'assets/' . getThemePath(), 'activeTheme' => $this->activeTheme, 'activeLang' => $this->activeLang, 'generalSettings' => $this->generalSettings, 'baseSettings' => $this->settings, 'activeLanguages' => $this->activeLanguages, 'rtl' => $this->rtl, 'darkMode' => $this->darkMode, 'activeFonts' => $this->activeFonts, 'baseMenuLinks' => $menuLinks, 'baseWidgets' => $this->widgets, 'baseCategories' => $this->categories, 'baseLatestCategoryPosts' => $this->latestCategoryPosts, 'adSpaces' => $this->adSpaces]); } }