public function search($query) {
        global $CFG, $DB;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        if ($processors = get_message_processors()) {
            foreach ($processors as $processor) {
                if (!$processor->available) {
                    continue;
                }
                if (strpos($processor->name, $query) !== false) {
                    $found = true;
                    break;
                }
                $strprocessorname = get_string('pluginname', 'message_'.$processor->name);
                if (strpos(core_text::strtolower($strprocessorname), $query) !== false) {
                    $found = true;
                    break;
                }
            }
        }
        if ($found) {
            $result = new stdClass();
            $result->page     = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
public function search($query) {
        global $CFG, $DB;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        if ($processors = get_message_processors()) {
            foreach ($processors as $processor) {
                if (!$processor->available) {
                    continue;
                }
                if (strpos($processor->name, $query) !== false) {
                    $found = true;
                    break;
                }
                $strprocessorname = get_string('pluginname', 'message_'.$processor->name);
                if (strpos(core_text::strtolower($strprocessorname), $query) !== false) {
                    $found = true;
                    break;
                }
            }
        }
        if ($found) {
            $result = new stdClass();
            $result->page     = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
public function search ( $ query ) { global $ CFG , $ DB ; if ( $ result = parent :: search ( $ query ) ) { return $ result ; } $ found = false ; if ( $ processors = get_message_processors ( ) ) { foreach ( $ processors as $ processor ) { if ( ! $ processor -> available ) { continue ; } if ( strpos ( $ processor -> name , $ query ) !== false ) { $ found = true ; break ; } $ strprocessorname = get_string ( 'pluginname' , 'message_' . $ processor -> name ) ; if ( strpos ( core_text :: strtolower ( $ strprocessorname ) , $ query ) !== false ) { $ found = true ; break ; } } } if ( $ found ) { $ result = new stdClass ( ) ; $ result -> page = $ this ; $ result -> settings = array ( ) ; return array ( $ this -> name => $ result ) ; } else { return array ( ) ; } }
Search for a specific message processor

@param string $query The string to search for
@return array
Search for a specific message processor