<?php if (version_compare(PHP_VERSION, "5.1.3", "<")) { exit("Chyrp requires PHP 5.1.3 or greater."); } require_once "../includes/common.php"; # Prepare the controller. $progress = ProgressController::current(); # Parse the route. $route = Route::current($progress); if (module_enabled("cacher") and !empty(Modules::$instances["cacher"]->cacher->path)) { $cacher =& Modules::$instances["cacher"]->cacher; $cacher->caches = INCLUDES_DIR . "/caches/progress"; $cacher->path = str_replace(INCLUDES_DIR . "/caches", INCLUDES_DIR . "/caches/progress", $cacher->path); $cacher->file = $cacher->path . "/" . md5($cacher->url) . ".html"; $cacher->remove_expired(); } # Execute the appropriate Controller responder. $route->init(); # If the route failed or nothing was displayed, check for: # 1. Module-provided pages. # 2. Feather-provided pages. # 3. Theme-provided pages. if (!$route->success) { $displayed = false; if (!$displayed and $theme->file_exists("pages/" . $route->action)) { $progress->display("pages/progress/" . $route->action); } elseif (!$displayed) { show_404(); } }
/** * Function: url * Returns a milestone's URL. */ public function url() { if ($this->no_results) { return false; } return url("milestone/" . $this->id, ProgressController::current()); }
/** * Function: delete_link * Outputs a delete link for the ticket, if the <User.can> delete_ticket. * * Parameters: * $text - The text to show for the link. * $before - If the link can be shown, show this before it. * $after - If the link can be shown, show this after it. * $classes - Extra CSS classes for the link, space-delimited. */ public function delete_link($text = null, $before = null, $after = null, $classes = "") { if (!$this->deletable()) { return false; } fallback($text, __("Delete")); echo $before . '<a href="' . url("delete_ticket/" . $this->id, ProgressController::current()) . '" title="Delete" class="ticket_delete_link delete_link" id="' . ($classes ? $classes . " " : '') . 'ticket_delete_' . $this->id . '">' . $text . '</a>' . $after; }