/** * Загрузить дерево всех разделов * Если есть разделы, модули для которых отключены, они будут игнорироваться * * @return array array([Type][ID] => Datasource_Section) */ public static function get_tree($type = NULL) { $result = array(); $sections = self::get_all($type); foreach ($sections as $section) { if (!Datasource_Section::exists($section->type())) { continue; } if (self::$first_section === NULL) { self::$first_section = $section->id(); } $result[$section->type()][$section->id()] = $section; } return $result; }