/** * 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); }
protected function loadData() { $manager = UpdateManager::instance(); $this->vars['canUpdate'] = BackendAuth::getUser()->hasAccess('system.manage_updates'); $this->vars['updates'] = $manager->check(); $this->vars['warnings'] = $this->getSystemWarnings(); $this->vars['coreBuild'] = Parameter::get('system::core.build'); $this->vars['eventLog'] = EventLog::count(); $this->vars['requestLog'] = RequestLog::count(); $this->vars['appBirthday'] = PluginVersion::orderBy('created_at')->pluck('created_at'); }
/** * Modifies the Network HTTP object with common attributes. * @param Http $http Network object * @param array $postData Post data * @return void */ protected function applyHttpAttributes($http, $postData) { $postData['server'] = base64_encode(serialize(['php' => PHP_VERSION, 'url' => URL::to('/')])); if ($projectId = Parameter::get('system::project.id')) { $postData['project'] = $projectId; } if (Config::get('cms.edgeUpdates', false)) { $postData['edge'] = 1; } if ($this->key && $this->secret) { $postData['nonce'] = $this->createNonce(); $http->header('Rest-Key', $this->key); $http->header('Rest-Sign', $this->createSignature($postData, $this->secret)); } if ($credentials = Config::get('cms.updateAuth')) { $http->auth($credentials); } $http->noRedirect(); $http->data($postData); }
protected function getInstalledThemes() { $history = Parameter::get('system::theme.history', []); $manager = UpdateManager::instance(); $installed = $manager->requestProductDetails(array_keys($history), 'theme'); /* * Splice in the directory names */ foreach ($installed as $key => $data) { $code = array_get($data, 'code'); $installed[$key]['dirName'] = array_get($history, $code, $code); } return $installed; }
/** * Internal helper, attaches a build code to an asset path * @param array $asset Stored asset array * @return string */ protected function getAssetEntryBuildPath($asset) { $path = $asset['path']; if (isset($asset['attributes']['build'])) { $build = $asset['attributes']['build']; if ($build == 'core') { $build = 'v' . Parameter::get('system::core.build', 1); } elseif ($pluginVersion = PluginVersion::getVersion($build)) { $build = 'v' . $pluginVersion; } $path .= '?' . $build; } return $path; }
protected function getWidgetsFromUserPreferences() { $defaultWidgets = SystemParameters::get($this->getSystemParametersKey(), $this->defaultWidgets); $widgets = UserPreference::forUser()->get($this->getUserPreferencesKey(), $defaultWidgets); if (!is_array($widgets)) { return []; } return $widgets; }