Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1375775
admin_events_handler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Feb 1, 12:48 PM
Size
2 KB
Mime Type
text/x-php
Expires
Tue, Feb 3, 12:48 PM (5 h, 38 m)
Engine
blob
Format
Raw Data
Handle
884475
Attached To
rINP In-Portal
admin_events_handler.php
View Options
<?php
class
AdminEventsHandler
extends
kDBEventHandler
{
function
mapPermissions
()
{
parent
::
mapPermissions
();
$permissions
=
Array
(
'OnSaveColumns'
=>
array
(
'self'
=>
true
),
'OnClosePopup'
=>
array
(
'self'
=>
true
),
);
$this
->
permMapping
=
array_merge
(
$this
->
permMapping
,
$permissions
);
}
function
OnResetModRwCache
(&
$event
)
{
$this
->
Conn
->
Query
(
'DELETE FROM '
.
TABLE_PREFIX
.
'Cache WHERE VarName LIKE "mod_rw%"'
);
}
function
OnResetCMSMenuCache
(&
$event
)
{
$this
->
Conn
->
Query
(
'DELETE FROM '
.
TABLE_PREFIX
.
'Cache WHERE VarName = "cms_menu"'
);
}
function
OnResetSections
(&
$event
)
{
$this
->
Conn
->
Query
(
'DELETE FROM '
.
TABLE_PREFIX
.
'Cache WHERE VarName = "sections_parsed"'
);
}
function
OnResetConfigsCache
(&
$event
)
{
$this
->
Conn
->
Query
(
'DELETE FROM '
.
TABLE_PREFIX
.
'Cache WHERE VarName = "config_files" OR VarName = "configs_parsed" OR VarName = "sections_parsed"'
);
}
/**
* Refreshes ThemeFiles & Theme tables by actual content on HDD
*
* @param kEvent $event
*/
function
OnRebuildThemes
(&
$event
)
{
$themes_helper
=&
$this
->
Application
->
recallObject
(
'ThemesHelper'
);
/* @var $themes_helper kThemesHelper */
$themes_helper
->
refreshThemes
();
}
function
OnSaveColumns
(&
$event
)
{
$picker_helper
=&
$this
->
Application
->
RecallObject
(
'ColumnPickerHelper'
);
$picker_helper
->
SetGridName
(
$this
->
Application
->
GetLinkedVar
(
'grid_name'
));
/* @var $picker_helper kColumnPickerHelper */
$picked
=
trim
(
$this
->
Application
->
GetVar
(
'picked_str'
),
'|'
);
$hidden
=
trim
(
$this
->
Application
->
GetVar
(
'hidden_str'
),
'|'
);
$main_prefix
=
$this
->
Application
->
GetVar
(
'main_prefix'
);
$picker_helper
->
SaveColumns
(
$main_prefix
,
$picked
,
$hidden
);
$this
->
finalizePopup
(
$event
);
}
/**
* Just closes popup & deletes last_template & opener_stack if popup, that is closing
*
* @param kEvent $event
*/
function
OnClosePopup
(&
$event
)
{
$event
->
SetRedirectParam
(
'opener'
,
'u'
);
}
/**
* Occurs right after initialization of the kernel, used mainly as hook-to event
*
* @param kEvent $event
*/
function
OnStartup
(&
$event
)
{
}
/**
* Is called after tree was build (when not from cache)
*
* @param kEvent $event
*/
function
OnAfterBuildTree
(&
$event
)
{
}
}
Event Timeline
Log In to Comment