Changeset View
Changeset View
Standalone View
Standalone View
core/units/themes/themes_eh.php
Context not available. | |||||
} | } | ||||
/** | /** | ||||
* Ensure, that current object is always taken from live table. | |||||
* | |||||
* @param kDBBase|kDBItem|kDBList $object Object. | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return void | |||||
*/ | |||||
protected function dbBuild(&$object, kEvent $event) | |||||
{ | |||||
if ( $event->Special == 'current' ) { | |||||
$event->setEventParam('live_table', true); | |||||
} | |||||
parent::dbBuild($object, $event); | |||||
} | |||||
/** | |||||
* Ensures that current theme detection will fallback to primary without extra DB query. | |||||
* | |||||
* @param kEvent $event Event. | |||||
* | |||||
* @return integer | |||||
*/ | |||||
public function getPassedID(kEvent $event) | |||||
{ | |||||
if ( $event->Special == 'current' ) { | |||||
$theme_id = $this->Application->GetVar('m_theme'); | |||||
if ( !$theme_id ) { | |||||
$theme_id = 'default'; | |||||
} | |||||
$this->Application->SetVar('m_theme', $theme_id); | |||||
$this->Application->SetVar($event->getPrefixSpecial() . '_id', $theme_id); | |||||
} | |||||
return parent::getPassedID($event); | |||||
} | |||||
/** | |||||
* Allows to set selected theme as primary | * Allows to set selected theme as primary | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
Context not available. |