Ejemplo n.º 1
0
 /**
  * Is setting related to query text - used when searching
  *
  * @param string $query
  * @return bool true if related, false if not
  */
 public function is_related($query)
 {
     if (!$this->load_choices() or empty($this->choices)) {
         return false;
     }
     if (parent::is_related($query)) {
         return true;
     }
     $textlib = textlib_get_instance();
     foreach ($this->choices as $desc) {
         if (strpos($textlib->strtolower($desc), $query) !== false) {
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Is setting related to query text - used when searching
  *
  * @param string $query
  * @return bool true if related, false if not
  */
 public function is_related($query)
 {
     if (!$this->load_choices() or empty($this->choices)) {
         return false;
     }
     if (parent::is_related($query)) {
         return true;
     }
     foreach ($this->choices as $desc) {
         if (strpos(core_text::strtolower($desc), $query) !== false) {
             return true;
         }
     }
     return false;
 }