Exemple #1
0
 public static function bootstrap()
 {
     URLMap::from("/filebrowser/view/:type/", 'FileBrowser::display');
 }
Exemple #2
0
 public static function parseUrl($arg = false)
 {
     if ($arg === false) {
         $_GET['q'] = filter('content_parseurl', $_GET['q']);
         URLMap::from("*", "Content::parseURL", 1000);
     } else {
         $parts = array_remove_empty(explode('/', $_GET['q']));
         if (count($parts) == 1) {
             if (self::isNode('/' . $parts[0])) {
                 self::setCurrent(self::nameToId('/' . $parts[0]));
             } else {
                 self::trigger404();
             }
         } elseif (count($parts) > 1) {
             $page = '/' . implode('/', $parts);
             if (self::isNode($page)) {
                 self::setCurrent(self::nameToId($page));
             } else {
                 self::trigger404();
             }
         } else {
             self::setCurrent(Settings::get('site', 'homepage id', true));
         }
     }
 }