function handlerTreeFromSiteFunctions($funcs)
 {
     $ret = new HandlerTree();
     if ($funcs) {
         foreach ($funcs as $func) {
             //echo $func->toString();
             if ($func->get('parent_id')) {
                 $parent = $funcs[$func->get('parent_id')]->getHandler();
             } else {
                 $parent = 0;
             }
             if ($hand = $func->getHandler()) {
                 $ret->addHandler($hand, $parent);
             }
         }
     } else {
         if (class_exists(str_replace('Application', 'Setup', constant('APPLICATION')))) {
             $class_name = str_replace('Application', 'Setup', constant('APPLICATION'));
             $ret->addHandler(new $class_name(), 0);
         } else {
             throw new Exception('Can\'t create an empty handler tree in PilotDefaultUser::handlerTreeFromSiteFunctions(). In order to add handlers to a pilot application, create a Handler called YourPackageSetup and inherite from PilotSetup. See documentation for The PIlot at http://rocketsled.iaindooley.com/ for more details');
         }
     }
     return $ret;
 }
 /**
  * Return a {@link HandlerTree} appopriate for this {@link SystemUser}
  *
  * The object returned by this method will be set as the {@link HandlerTree}
  * object of the {@link SiteNavigation} class. If a {@link Handler} class 
  * is included in the return {@link HandlerTree} object from this function
  * then the system assumes that the {@link SystemUser} has access to that
  * handler and will print it out when requested, (actual user authentication
  * is done separately, so as to avoid someone simply altering the query 
  * string to access functions)
  * @return HandlerTree - a handler tree object contain all authorised handlers
  * @see Handler,HandlerTree
  * @access public
  */
 function getHandlerTree()
 {
     $ret = new HandlerTree();
     $ret->addHandler(new RocketSledSupport());
     return $ret;
 }