/**
  * Returns the trail -- the path from the root of the tree of study areas down
  * to the currently selected area.
  *
  * # TODO (mlunzena) this has to be refactored as well
  *
  * @return array      an array of study areas; currently each item is an
  *                    hashmap containing the ID of each area using the key
  *                    'id' and the name of the study area using the key 'name'
  */
 function getTrail()
 {
     $area = $this->selected;
     $trail = array($area->getID() => $area);
     while ($parent = $area->getParent()) {
         $trail[$parent->getID()] = $parent;
         $area = $parent;
     }
     $trail[StudipStudyArea::ROOT] = StudipStudyArea::getRootArea();
     return array_reverse($trail, TRUE);
 }