/** * Flags a theme as being uninstalled. * @param string $code Theme code */ public function setUninstalled($code) { $history = Parameter::get('system::theme.history', []); if (array_key_exists($code, $history)) { unset($history[$code]); } Parameter::set('system::theme.history', $history); }
/** * Extracts the core after it has been downloaded. * @param string $hash * @param string $build * @return void */ public function extractCore($hash, $build) { $filePath = $this->getFilePath('core'); if (!Zip::extract($filePath, $this->baseDirectory)) { throw new ApplicationException(Lang::get('system::lang.zip.extract_failed', ['file' => $filePath])); } @unlink($filePath); // Database may fall asleep after this long process Db::reconnect(); Parameter::set(['system::core.hash' => $hash, 'system::core.build' => $build]); }
public function onDetachProject() { Parameter::set(['system::project.id' => null, 'system::project.name' => null, 'system::project.owner' => null]); Flash::success(Lang::get('system::lang.project.unbind_success')); return Backend::redirect('system/updates'); }
/** * Sets the active theme. * The active theme code is stored in the database and overrides the configuration cms.activeTheme parameter. * @param string $code Specifies the active theme code. */ public static function setActiveTheme($code) { self::resetCache(); Parameter::set(self::ACTIVE_KEY, $code); Event::fire('cms.theme.setActiveTheme', compact('code')); }
public function onMakeLayoutDefault() { $widgets = $this->getWidgetsFromUserPreferences(); SystemParameters::set($this->getSystemParametersKey(), $widgets); Flash::success(Lang::get('backend::lang.dashboard.make_default_success')); }