public static function get_search_areas_list($enabled = false) {

        // Two different arrays, we don't expect these arrays to be big.
        if (static::$allsearchareas !== null) {
            if (!$enabled) {
                return static::$allsearchareas;
            } else {
                return static::$enabledsearchareas;
            }
        }

        static::$allsearchareas = array();
        static::$enabledsearchareas = array();
        $searchclasses = \core_component::get_component_classes_in_namespace(null, 'search');

        foreach ($searchclasses as $classname => $classpath) {
            $areaname = substr(strrchr($classname, '\\'), 1);
            $componentname = strstr($classname, '\\', 1);
            if (!static::is_search_area($classname)) {
                continue;
            }

            $areaid = static::generate_areaid($componentname, $areaname);
            $searchclass = new $classname();
            static::$allsearchareas[$areaid] = $searchclass;
            if ($searchclass->is_enabled()) {
                static::$enabledsearchareas[$areaid] = $searchclass;
            }
        }

        if ($enabled) {
            return static::$enabledsearchareas;
        }
        return static::$allsearchareas;
    }
public static function get_search_areas_list($enabled = false) {

        // Two different arrays, we don't expect these arrays to be big.
        if (static::$allsearchareas !== null) {
            if (!$enabled) {
                return static::$allsearchareas;
            } else {
                return static::$enabledsearchareas;
            }
        }

        static::$allsearchareas = array();
        static::$enabledsearchareas = array();
        $searchclasses = \core_component::get_component_classes_in_namespace(null, 'search');

        foreach ($searchclasses as $classname => $classpath) {
            $areaname = substr(strrchr($classname, '\\'), 1);
            $componentname = strstr($classname, '\\', 1);
            if (!static::is_search_area($classname)) {
                continue;
            }

            $areaid = static::generate_areaid($componentname, $areaname);
            $searchclass = new $classname();
            static::$allsearchareas[$areaid] = $searchclass;
            if ($searchclass->is_enabled()) {
                static::$enabledsearchareas[$areaid] = $searchclass;
            }
        }

        if ($enabled) {
            return static::$enabledsearchareas;
        }
        return static::$allsearchareas;
    }
public static function get_search_areas_list ( $ enabled = false ) { // Two different arrays, we don't expect these arrays to be big. if ( static :: $ allsearchareas !== null ) { if ( ! $ enabled ) { return static :: $ allsearchareas ; } else { return static :: $ enabledsearchareas ; } } static :: $ allsearchareas = array ( ) ; static :: $ enabledsearchareas = array ( ) ; $ searchclasses = \ core_component :: get_component_classes_in_namespace ( null , 'search' ) ; foreach ( $ searchclasses as $ classname => $ classpath ) { $ areaname = substr ( strrchr ( $ classname , '\\' ) , 1 ) ; $ componentname = strstr ( $ classname , '\\' , 1 ) ; if ( ! static :: is_search_area ( $ classname ) ) { continue ; } $ areaid = static :: generate_areaid ( $ componentname , $ areaname ) ; $ searchclass = new $ classname ( ) ; static :: $ allsearchareas [ $ areaid ] = $ searchclass ; if ( $ searchclass -> is_enabled ( ) ) { static :: $ enabledsearchareas [ $ areaid ] = $ searchclass ; } } if ( $ enabled ) { return static :: $ enabledsearchareas ; } return static :: $ allsearchareas ; }
Return the list of available search areas.

@param bool $enabled Return only the enabled ones.
@return \core_search\base[]
Return the list of available search areas .