Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/admin/admin_events_handler.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return bool | * @return bool | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function CheckPermission(kEvent $event) | public function CheckPermission(kEvent $event) | ||||
{ | { | ||||
$perm_value = null; | $perm_value = null; | ||||
$system_events = Array ( | $system_events = array( | ||||
'OnResetModRwCache', 'OnResetSections', 'OnResetConfigsCache', 'OnResetParsedData', 'OnResetMemcache', | 'OnResetModRwCache', 'OnResetSections', 'OnResetConfigsCache', 'OnResetParsedData', 'OnResetMemcache', | ||||
'OnDeleteCompiledTemplates', 'OnCompileTemplates', 'OnGenerateTableStructure', 'OnSynchronizeDBRevisions', | 'OnDeleteCompiledTemplates', 'OnCompileTemplates', 'OnGenerateTableStructure', 'OnSynchronizeDBRevisions', | ||||
'OnDeploy', 'OnRebuildThemes', 'OnCheckPrefixConfig', 'OnMemoryCacheGet', 'OnMemoryCacheSet' | 'OnDeploy', 'OnRebuildThemes', 'OnDumpAssets', 'OnCheckPrefixConfig', 'OnMemoryCacheGet', | ||||
'OnMemoryCacheSet', | |||||
); | ); | ||||
if ( in_array($event->Name, $system_events) ) { | if ( in_array($event->Name, $system_events) ) { | ||||
// events from "Tools -> System Tools" section are controlled via that section "edit" permission | // events from "Tools -> System Tools" section are controlled via that section "edit" permission | ||||
$perm_value = /*$this->Application->isDebugMode() ||*/ $this->Application->CheckPermission($event->getSection() . '.edit'); | $perm_value = /*$this->Application->isDebugMode() ||*/ $this->Application->CheckPermission($event->getSection() . '.edit'); | ||||
} | } | ||||
$tools_events = Array ( | $tools_events = Array ( | ||||
▲ Show 20 Lines • Show All 429 Lines • ▼ Show 20 Line(s) | |||||
$themes_helper = $this->Application->recallObject('ThemesHelper'); | $themes_helper = $this->Application->recallObject('ThemesHelper'); | ||||
$themes_helper->refreshThemes(); | $themes_helper->refreshThemes(); | ||||
$event->SetRedirectParam('action_completed', 1); | $event->SetRedirectParam('action_completed', 1); | ||||
} | } | ||||
/** | /** | ||||
* Dumps assets | |||||
* | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function OnDumpAssets(kEvent $event) | |||||
{ | |||||
if ( $this->Application->GetVar('ajax') == 'yes' ) { | |||||
$event->status = kEvent::erSTOP; | |||||
} | |||||
/** @var MinifyHelper $minify_helper */ | |||||
$minify_helper = $this->Application->recallObject('MinifyHelper'); | |||||
$minify_helper->delete(); | |||||
$minify_helper->dump(); | |||||
$event->SetRedirectParam('action_completed', 1); | |||||
} | |||||
/** | |||||
* Saves grid column widths after their resize by user | * Saves grid column widths after their resize by user | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function OnSaveColumns(kEvent $event) | protected function OnSaveColumns(kEvent $event) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 758 Lines • Show Last 20 Lines |