Index: branches/5.0.x/core/units/skins/skin_eh.php =================================================================== diff -u -r12233 -r12299 --- branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12233) +++ branches/5.0.x/core/units/skins/skin_eh.php (.../skin_eh.php) (revision 12299) @@ -1,6 +1,6 @@ Array ('self' => true), - ); + class SkinEventHandler extends kDBEventHandler { - $this->permMapping = array_merge($this->permMapping, $permissions); - } + function mapPermissions() + { + parent::mapPermissions(); + $permissions = Array ( + 'OnItemBuild' => Array ('self' => true), + ); - /** - * With "primary" special loads primary skin - * - * @param kEvent $event - * @return int - */ - function getPassedID(&$event) - { - if ($event->Special == 'primary') { - return Array ('IsPrimary' => 1); + $this->permMapping = array_merge($this->permMapping, $permissions); } - return parent::getPassedID($event); - } + /** + * With "primary" special loads primary skin + * + * @param kEvent $event + * @return int + */ + function getPassedID(&$event) + { + if ($event->Special == 'primary') { + return Array ('IsPrimary' => 1); + } - /** - * Allows to set selected theme as primary - * - * @param kEvent $event - */ - function OnSetPrimary(&$event) - { - if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - return; + return parent::getPassedID($event); } - $ids = $this->StoreSelectedIDs($event); - if ($ids) { - $id = array_shift($ids); - $this->setPrimary($id); - } + /** + * Allows to set selected theme as primary + * + * @param kEvent $event + */ + function OnSetPrimary(&$event) + { + if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { + return; + } - $this->clearSelectedIDs($event); - } + $ids = $this->StoreSelectedIDs($event); + if ($ids) { + $id = array_shift($ids); + $this->setPrimary($id); + } - function setPrimary($id) - { - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + $this->clearSelectedIDs($event); + } - $sql = 'UPDATE '.$table_name.' - SET IsPrimary = 0'; - $this->Conn->Query($sql); + function setPrimary($id) + { + $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); + $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + $sql = 'UPDATE '.$table_name.' + SET IsPrimary = 0'; + $this->Conn->Query($sql); - $sql = 'UPDATE '.$table_name.' - SET IsPrimary = 1 - WHERE '.$id_field.' = '.$id; - $this->Conn->Query($sql); - } + $sql = 'UPDATE '.$table_name.' + SET IsPrimary = 1 + WHERE '.$id_field.' = '.$id; + $this->Conn->Query($sql); + } - /** - * [HOOK] Compile stylesheet file based on theme definitions - * - * @param kEvent $event - */ - function OnCompileStylesheet(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->SwitchToLive(); - $ids = $event->MasterEvent->getEventParam('ids'); - if (!is_array($ids)) { - $ids = explode(',', $ids); - } + /** + * [HOOK] Compile stylesheet file based on theme definitions + * + * @param kEvent $event + */ + function OnCompileStylesheet(&$event) + { + $object =& $event->getObject( Array('skip_autoload' => true) ); + $object->SwitchToLive(); - if (!$ids) { - return false; - } + $ids = $event->MasterEvent->getEventParam('ids'); + if (!is_array($ids)) { + $ids = explode(',', $ids); + } - $skin_helper =& $this->Application->recallObject('SkinHelper'); - /* @var $skin_helper SkinHelper */ + if (!$ids) { + return false; + } - foreach($ids as $id) { - $object->Load($id); - $skin_helper->compile($object); + $skin_helper =& $this->Application->recallObject('SkinHelper'); + /* @var $skin_helper SkinHelper */ + + foreach($ids as $id) { + $object->Load($id); + $skin_helper->compile($object); + } } - } -} \ No newline at end of file + + } \ No newline at end of file