Changeset View
Changeset View
Standalone View
Standalone View
core/units/themes/themes_eh.php
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | |||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function OnAfterCopyToLive(kEvent $event) | protected function OnAfterCopyToLive(kEvent $event) | ||||
{ | { | ||||
parent::OnAfterCopyToLive($event); | parent::OnAfterCopyToLive($event); | ||||
/** @var kDBItem $object */ | |||||
$object = $this->Application->recallObject($event->Prefix . '.-item', null, Array ('skip_autoload' => true, 'live_table' => true)); | $object = $this->Application->recallObject($event->Prefix . '.-item', null, Array ('skip_autoload' => true, 'live_table' => true)); | ||||
Lint: Generic.Files.LineLength.MaxExceeded: Line exceeds maximum limit of 140 characters; contains 143 characters | |||||
PHP keywords must be lowercase; expected "array" but found "Array" Lint: Generic.PHP.LowerCaseKeyword.Found: PHP keywords must be lowercase; expected "array" but found "Array" | |||||
There must be no space between the Array keyword and the opening parenthesis Lint: CodingStandard.Array.Array.SpaceAfterKeyword: There must be no space between the Array keyword and the opening parenthesis | |||||
/* @var $object kDBItem */ | |||||
$object->Load($event->getEventParam('id')); | $object->Load($event->getEventParam('id')); | ||||
if ( $object->GetDBField('PrimaryTheme') ) { | if ( $object->GetDBField('PrimaryTheme') ) { | ||||
$this->setPrimary($event->getEventParam('id')); | $this->setPrimary($event->getEventParam('id')); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
* @see kDBEventHandler::OnListBuild() | * @see kDBEventHandler::OnListBuild() | ||||
*/ | */ | ||||
protected function SetCustomQuery(kEvent $event) | protected function SetCustomQuery(kEvent $event) | ||||
{ | { | ||||
parent::SetCustomQuery($event); | parent::SetCustomQuery($event); | ||||
/** @var kDBList $object */ | |||||
$object = $event->getObject(); | $object = $event->getObject(); | ||||
/* @var $object kDBList */ | |||||
if ( in_array($event->Special, Array ('enabled', 'selected', 'available')) || !$this->Application->isAdminUser ) { | if ( in_array($event->Special, Array ('enabled', 'selected', 'available')) || !$this->Application->isAdminUser ) { | ||||
// "enabled" special or Front-End | // "enabled" special or Front-End | ||||
$object->addFilter('enabled_filter', '%1$s.Enabled = ' . STATUS_ACTIVE); | $object->addFilter('enabled_filter', '%1$s.Enabled = ' . STATUS_ACTIVE); | ||||
} | } | ||||
// site domain theme picker | // site domain theme picker | ||||
if ( $event->Special == 'selected' || $event->Special == 'available' ) { | if ( $event->Special == 'selected' || $event->Special == 'available' ) { | ||||
Line indented incorrectly; expected 2 tabs, found 3 Lint: Generic.WhiteSpace.ScopeIndent.IncorrectExact: Line indented incorrectly; expected 2 tabs, found 3 | |||||
/** @var EditPickerHelper $edit_picker_helper */ | |||||
$edit_picker_helper = $this->Application->recallObject('EditPickerHelper'); | $edit_picker_helper = $this->Application->recallObject('EditPickerHelper'); | ||||
/* @var $edit_picker_helper EditPickerHelper */ | |||||
$edit_picker_helper->applyFilter($event, 'Themes'); | $edit_picker_helper->applyFilter($event, 'Themes'); | ||||
} | } | ||||
// apply domain-based theme filtering | // apply domain-based theme filtering | ||||
$themes = $this->Application->siteDomainField('Themes'); | $themes = $this->Application->siteDomainField('Themes'); | ||||
if ( strlen($themes) ) { | if ( strlen($themes) ) { | ||||
$themes = explode('|', substr($themes, 1, -1)); | $themes = explode('|', substr($themes, 1, -1)); | ||||
$object->addFilter('domain_filter', '%1$s.ThemeId IN (' . implode(',', $themes) . ')'); | $object->addFilter('domain_filter', '%1$s.ThemeId IN (' . implode(',', $themes) . ')'); | ||||
} | } | ||||
} | } | ||||
} | } |
Line exceeds maximum limit of 140 characters; contains 143 characters