/** * Parses the URL. * * return void */ public static function requireUri() { self::setLanguage(); self::$requestUri = !empty($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : 'index.html'; $actionParams = array(); $controller = 'index'; $action = 'index'; $layout = 'index'; $routingPath = strpos(self::$requestUri, 'admin') ? 'Admin' : 'Portal'; self::$routes = (require_once 'includes/Routing/' . $routingPath . '/routing.php'); foreach (self::$routes as $key => $value) { if ($value['uri'][0] == '#' && preg_match($value['uri'], self::$requestUri, $matches) > 0) { $controller = $value['params']['controller']; $action = !empty($value['params']['action']) ? $value['params']['action'] : 'index'; $actionParams = self::getActionValidParams($matches); $layout = !empty($value['layout']) ? $value['layout'] : $layout; break; } elseif (strpos(self::$requestUri, $value['uri']) !== false) { $controller = $value['params']['controller']; $action = !empty($value['params']['action']) ? $value['params']['action'] : 'index'; $layout = !empty($value['layout']) ? $value['layout'] : $layout; break; } } Site::loader($controller, $action, $actionParams, $layout); }
<?php use traq\helpers\Atom; // Entries $entries = array(); foreach ($tickets as $ticket) { $entries[] = array('title' => $ticket->summary, 'id' => "tickets:{$ticket->ticket_id}", 'updated' => Time::date("c", $ticket->created_at), 'link' => "http://" . $_SERVER['HTTP_HOST'] . Request::base($ticket->href()), 'author' => array('name' => $ticket->user->name), 'content' => array('type' => "XHTML", 'data' => $ticket->body)); } // Make feed $feed = new Atom(array('title' => l('x_ticket_feed', $project->name), 'link' => "http://" . $_SERVER['HTTP_HOST'] . Request::base(), 'feed_link' => "http://" . $_SERVER['HTTP_HOST'] . Request::requestUri(), 'updated' => $entries[0]['updated'], 'entries' => $entries)); // Output feed header("Content-type: text/plain"); print $feed->build();
<h3><?php echo l('new_tab'); ?> </h3> <form action="<?php echo Request::requestUri(); ?> " method="post" class="overlay_thin"> <?php echo show_errors($tab->errors); ?> <div class="tabular box"> <?php echo View::render('custom_tabs/_form'); ?> </div> <div class="actions"> <input type="submit" value="<?php echo l('create'); ?> " /> <input type="button" value="<?php echo l('cancel'); ?> " onclick="close_overlay();" /> </div> </form>