Example #1
0
 protected function loadData()
 {
     if (!($theme = Theme::getActiveTheme())) {
         throw new ApplicationException(Lang::get('cms::lang.theme.not_found_name', ['name' => Theme::getActiveThemeCode()]));
     }
     $this->vars['theme'] = $theme;
     $this->vars['inMaintenance'] = MaintenanceSetting::get('is_enabled');
 }
Example #2
0
 /**
  * Boot all of the bootable traits on the model.
  * @return void
  */
 protected static function bootDefaultTheme()
 {
     $resolver = static::getDatasourceResolver();
     if ($resolver->getDefaultDatasource()) {
         return;
     }
     $defaultTheme = App::runningInBackend() ? Theme::getEditThemeCode() : Theme::getActiveThemeCode();
     Theme::load($defaultTheme);
     $resolver->setDefaultDatasource($defaultTheme);
 }