示例#1
0
 /**
  * Flags a theme as being uninstalled.
  * @param string $name Theme code
  */
 public function setUninstalled($code)
 {
     $history = Parameters::get('system::theme.history', []);
     if (array_key_exists($code, $history)) {
         unset($history[$code]);
     }
     Parameters::set('system::theme.history', $history);
 }
示例#2
0
 public function onDetachProject()
 {
     Parameters::set(['system::project.id' => null, 'system::project.name' => null, 'system::project.owner' => null]);
     Flash::success(Lang::get('system::lang.project.unbind_success'));
     return Redirect::to(Backend::url('system/updates'));
 }
示例#3
0
 /**
  * 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)
 {
     $paramKey = 'cms::theme.active';
     Parameters::set($paramKey, $code);
     Cache::forget($paramKey);
 }
示例#4
0
 /**
  * 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();
     Parameters::set(self::ACTIVE_KEY, $code);
 }
示例#5
0
 /**
  * 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();
     Parameters::set(['system::core.hash' => $hash, 'system::core.build' => $build]);
 }
示例#6
0
 /**
  * Flags a theme as being installed, so it is not downloaded twice.
  * @param string $name Theme code
  */
 public function setThemeInstalled($name)
 {
     $history = Parameters::get('system::theme.history', []);
     $history[$name] = Carbon::now()->timestamp;
     Parameters::set('system::theme.history', $history);
 }
示例#7
0
文件: Theme.php 项目: janusnic/stm
 /**
  * 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::$activeThemeCache = false;
     self::$editThemeCache = false;
     $paramKey = 'cms::theme.active';
     Parameters::set($paramKey, $code);
     Cache::forget($paramKey);
 }