Пример #1
0
 /**
  * Search plugins for the specified string
  *
  * @param string $query The string to search for
  * @return array
  */
 public function search($query)
 {
     if ($result = parent::search($query)) {
         return $result;
     }
     $found = false;
     foreach (core_component::get_plugin_list($this->subtype) as $name => $notused) {
         if (strpos(core_text::strtolower(get_string('pluginname', $this->subtype . '_' . $name)), $query) !== false) {
             $found = true;
             break;
         }
     }
     if ($found) {
         $result = new stdClass();
         $result->page = $this;
         $result->settings = array();
         return array($this->name => $result);
     } else {
         return array();
     }
 }
Пример #2
0
 /**
  * Searches all installed filters for specified filter
  *
  * @param string $query The filter(string) to search for
  * @param string $query
  */
 public function search($query)
 {
     global $CFG;
     if ($result = parent::search($query)) {
         return $result;
     }
     $found = false;
     $filternames = filter_get_all_installed();
     $textlib = textlib_get_instance();
     foreach ($filternames as $path => $strfiltername) {
         if (strpos($textlib->strtolower($strfiltername), $query) !== false) {
             $found = true;
             break;
         }
         list($type, $filter) = explode('/', $path);
         if (strpos($filter, $query) !== false) {
             $found = true;
             break;
         }
     }
     if ($found) {
         $result = new stdClass();
         $result->page = $this;
         $result->settings = array();
         return array($this->name => $result);
     } else {
         return array();
     }
 }
Пример #3
0
 function search($query)
 {
     global $CFG;
     if ($result = parent::search($query)) {
         return $result;
     }
     $found = false;
     if (!empty($CFG->blocks_version) and $blocks = get_records('block')) {
         $textlib = textlib_get_instance();
         foreach ($blocks as $block) {
             if (strpos($block->name, $query) !== false) {
                 $found = true;
                 break;
             }
             $strblockname = get_string('blockname', 'block_' . $block->name);
             if (strpos($textlib->strtolower($strblockname), $query) !== false) {
                 $found = true;
                 break;
             }
         }
     }
     if ($found) {
         $result = new object();
         $result->page = $this;
         $result->settings = array();
         return array($this->name => $result);
     } else {
         return array();
     }
 }
Пример #4
0
    /**
     * Searches all installed filters for specified filter
     *
     * @param string $query The filter(string) to search for
     * @param string $query
     */
    public function search($query) {
        global $CFG;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        $filternames = filter_get_all_installed();
        foreach ($filternames as $path => $strfiltername) {
            if (strpos(core_text::strtolower($strfiltername), $query) !== false) {
                $found = true;
                break;
            }
            if (strpos($path, $query) !== false) {
                $found = true;
                break;
            }
        }

        if ($found) {
            $result = new stdClass;
            $result->page = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
Пример #5
0
 /**
  * Method that satisfies requirements of parent interface but delegates to
  * the admin_externalpage functionality, depsite methods being non-equivalent
  *
  * @param object $external is the admin_external object you want to add
  * @param string $bogus only defined to satisfy interface.
  * @param string $bogus2 only defined to satisfy interface.
  * @return bool true if successful, false if not
  */
 public function add($setting, $bogus = '', $bogus2 = null)
 {
     // Note: this is only called as is done for admin_settingpage.
     return parent::add($setting);
 }