original_string: public static function get_expanded_categories($withpath = null) {
          if (self::$expandedcategories === null) {
              /* @var \cache_session $cache */
              $cache = \cache::make('core', 'userselections');
              self::$expandedcategories = $cache->get('categorymanagementexpanded');
              if (self::$expandedcategories === false) {
                  self::$expandedcategories = array();
              }
          }
          if (empty($withpath)) {
              return array_keys(self::$expandedcategories);
          }
          $parents = explode('/', trim($withpath, '/'));
          $ref =& self::$expandedcategories;
          foreach ($parents as $parent) {
              if (!isset($ref[$parent])) {
                  return array();
              }
              $ref =& $ref[$parent];
          }
          if (is_array($ref)) {
              return array_keys($ref);
          } else {
              return array($parent);
          }
      }
code: public static function get_expanded_categories($withpath = null) {
          if (self::$expandedcategories === null) {
              /* @var \cache_session $cache */
              $cache = \cache::make('core', 'userselections');
              self::$expandedcategories = $cache->get('categorymanagementexpanded');
              if (self::$expandedcategories === false) {
                  self::$expandedcategories = array();
              }
          }
          if (empty($withpath)) {
              return array_keys(self::$expandedcategories);
          }
          $parents = explode('/', trim($withpath, '/'));
          $ref =& self::$expandedcategories;
          foreach ($parents as $parent) {
              if (!isset($ref[$parent])) {
                  return array();
              }
              $ref =& $ref[$parent];
          }
          if (is_array($ref)) {
              return array_keys($ref);
          } else {
              return array($parent);
          }
      }
code_tokens: public static function get_expanded_categories ( $ withpath = null ) { if ( self :: $ expandedcategories === null ) { /* @var \cache_session $cache */ $ cache = \ cache :: make ( 'core' , 'userselections' ) ; self :: $ expandedcategories = $ cache -> get ( 'categorymanagementexpanded' ) ; if ( self :: $ expandedcategories === false ) { self :: $ expandedcategories = array ( ) ; } } if ( empty ( $ withpath ) ) { return array_keys ( self :: $ expandedcategories ) ; } $ parents = explode ( '/' , trim ( $ withpath , '/' ) ) ; $ ref = & self :: $ expandedcategories ; foreach ( $ parents as $ parent ) { if ( ! isset ( $ ref [ $ parent ] ) ) { return array ( ) ; } $ ref = & $ ref [ $ parent ] ; } if ( is_array ( $ ref ) ) { return array_keys ( $ ref ) ; } else { return array ( $ parent ) ; } }
docstring: Returns the categories that should be expanded when displaying the interface.
  
  @param int|null $withpath If specified a path to require as the parent.
  @return \core_course_category[] An array of Category ID's to expand.
docstring_tokens: Returns the categories that should be expanded when displaying the interface .