Index: branches/5.2.x/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r16414 -r16415 --- branches/5.2.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 16414) +++ branches/5.2.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 16415) @@ -1,6 +1,6 @@ status = kEvent::erSTOP; - - $field = $this->Application->GetVar('field'); - $cur_value = $this->Application->GetVar('cur_value'); - $object = $event->getObject(); /* @var $object kDBItem */ - if ( !$field || !$cur_value || !$object->isField($field) ) { - return; + $field = $this->Application->GetVar('field'); + + if ( !$field || !$term || !$object->isField($field) ) { + return array(); } $limit = $this->Application->GetVar('limit'); + if ( !$limit ) { $limit = 20; } $sql = 'SELECT DISTINCT ' . $field . ', ModuleOwner FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ' - WHERE ' . $field . ' LIKE ' . $this->Conn->qstr('%' . $cur_value . '%') . ' + WHERE ' . $field . ' LIKE ' . $this->Conn->qstr('%' . $term . '%') . ' ORDER BY ' . $field . ' ASC'; - $raw_suggestions = $this->Conn->Query($sql); + $data = $this->Conn->Query($sql); - $suggestions = Array (); - $this->Application->XMLHeader(); + $suggestions = array(); - foreach ($raw_suggestions as $raw_suggestion) { + foreach ($data as $raw_suggestion) { $suggestion = $raw_suggestion[$field]; if ( !isset($suggestions[$suggestion]) ) { - $suggestions[$suggestion] = Array (); + $suggestions[$suggestion] = array(); } $suggestions[$suggestion][] = $raw_suggestion['ModuleOwner']; } array_splice($suggestions, $limit); - echo ''; + $ret = array(); $of_label = $this->Application->Phrase('la_From', false); foreach ($suggestions as $suggestion_value => $suggestion_modules) { $suggestion_module = in_array('In-Portal', $suggestion_modules) ? 'In-Portal' : implode(', ', $suggestion_modules); $suggestion_title = $suggestion_value . ' ' . $of_label . ' ' . $suggestion_module . ''; - echo '' . kUtil::escape($suggestion_title, kUtil::ESCAPE_HTML) . ''; + $ret[$suggestion_value] = $suggestion_title; } - echo ''; + return $ret; } /**