Changeset View
Changeset View
Standalone View
Standalone View
core/units/config_search/config_search_event_handler.php
Show All 39 Lines | |||||
* @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 */ | |||||
// show only items that belong to selected module | // show only items that belong to selected module | ||||
$module = $this->Application->GetVar('module'); | $module = $this->Application->GetVar('module'); | ||||
$object->addFilter('module_filter', '%1$s.ModuleName = ' . $this->Conn->qstr($module)); | $object->addFilter('module_filter', '%1$s.ModuleName = ' . $this->Conn->qstr($module)); | ||||
// don't show disabled search items | // don't show disabled search items | ||||
$object->addFilter('active_filter', '%1$s.SimpleSearch <> -1'); | $object->addFilter('active_filter', '%1$s.SimpleSearch <> -1'); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
* [HOOK] Creates search config record corresponding to custom field, that was just created | * [HOOK] Creates search config record corresponding to custom field, that was just created | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function OnCreateCustomField($event) | protected function OnCreateCustomField($event) | ||||
{ | { | ||||
/** @var kDBItem $custom_field */ | |||||
$custom_field = $event->MasterEvent->getObject(); | $custom_field = $event->MasterEvent->getObject(); | ||||
/* @var $custom_field kDBItem */ | |||||
if ( $custom_field->GetDBField('Type') == 6 || $custom_field->GetDBField('IsSystem') == 1 ) { | if ( $custom_field->GetDBField('Type') == 6 || $custom_field->GetDBField('IsSystem') == 1 ) { | ||||
// user & system custom fields are not searchable | // user & system custom fields are not searchable | ||||
return ; | return ; | ||||
} | } | ||||
/** @var kDBItem $object */ | |||||
$object = $event->getObject(Array ('skip_autoload' => true)); | $object = $event->getObject(Array ('skip_autoload' => true)); | ||||
Lint: CodingStandard.Array.Array.SpaceAfterKeyword: There must be no space between the Array keyword and the opening parenthesis | |||||
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" | |||||
/* @var $object kDBItem */ | |||||
$custom_id = $custom_field->GetID(); | $custom_id = $custom_field->GetID(); | ||||
if ( !$object->isLoaded() || ($object->GetDBField('CustomFieldId') != $custom_id) ) { | if ( !$object->isLoaded() || ($object->GetDBField('CustomFieldId') != $custom_id) ) { | ||||
$object->Load($custom_id, 'CustomFieldId'); | $object->Load($custom_id, 'CustomFieldId'); | ||||
} | } | ||||
$cf_search = Array (); | $cf_search = Array (); | ||||
$element_type = $custom_field->GetDBField('ElementType'); | $element_type = $custom_field->GetDBField('ElementType'); | ||||
Show All 29 Lines |
There must be no space between the Array keyword and the opening parenthesis