make_link with no args links to default page

git-svn-id: file:///home/shish/svn/shimmie2/trunk@373 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-26 13:19:39 +00:00
parent ccf45ef91f
commit 2e8e839f5c
16 changed files with 22 additions and 19 deletions

View File

@ -68,13 +68,13 @@ class Home extends Extension {
return " return "
<div id='front-page'> <div id='front-page'>
<h1> <h1>
<a style='text-decoration: none;' href='".make_link("index")."'><span>$sitename</span></a> <a style='text-decoration: none;' href='".make_link()."'><span>$sitename</span></a>
</h1> </h1>
<div class='space' id='links'> <div class='space' id='links'>
$main_links $main_links
</div> </div>
<div class='space'> <div class='space'>
<form action='".make_link("index")."' method='GET'> <form action='".make_link()."' method='GET'>
<input id='search_input' name='search' size='55' type='text' value='' autocomplete='off' /><br/> <input id='search_input' name='search' size='55' type='text' value='' autocomplete='off' /><br/>
<input type='submit' value='Search'/> <input type='submit' value='Search'/>
</form> </form>

View File

@ -73,7 +73,7 @@ class Tag_History extends Extension {
// tried to set it too the same thing so ignore it (might be a bot) // tried to set it too the same thing so ignore it (might be a bot)
// go back to the index page with you // go back to the index page with you
$page->set_mode("redirect"); $page->set_mode("redirect");
$page->set_redirect(make_link("index")); $page->set_redirect(make_link());
return; return;
} }

View File

@ -2,7 +2,7 @@
class NavBlock extends Block { class NavBlock extends Block {
public function NavBlock() { public function NavBlock() {
$this->header = "Navigation"; $this->header = "Navigation";
$this->body = "<a href='".make_link("index")."'>Index</a>"; $this->body = "<a href='".make_link()."'>Index</a>";
$this->section = "left"; $this->section = "left";
$this->position = 0; $this->position = 0;
} }

View File

@ -92,8 +92,11 @@ function tag_explode($tags) {
* HTML Generation * * HTML Generation *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function make_link($page, $query=null) { function make_link($page=null, $query=null) {
global $config; global $config;
if(is_null($page)) $page = $config->get_string('front_page', 'post/list');
$base = $config->get_string('base_href', './index.php?q='); $base = $config->get_string('base_href', './index.php?q=');
if(is_null($query)) { if(is_null($query)) {

View File

@ -32,7 +32,7 @@ class AdminPage extends Extension {
if($image) { if($image) {
send_event(new ImageDeletionEvent($image)); send_event(new ImageDeletionEvent($image));
$event->page->set_mode("redirect"); $event->page->set_mode("redirect");
$event->page->set_redirect(make_link("index")); $event->page->set_redirect(make_link());
} }
} }
} }

View File

@ -7,7 +7,7 @@ class CommentListTheme extends Themelet {
$h_prev = ($page_number <= 1) ? "Prev" : $h_prev = ($page_number <= 1) ? "Prev" :
"<a href='".make_link("comment/list/$prev")."'>Prev</a>"; "<a href='".make_link("comment/list/$prev")."'>Prev</a>";
$h_index = "<a href='".make_link("index")."'>Index</a>"; $h_index = "<a href='".make_link()."'>Index</a>";
$h_next = ($page_number >= $total_pages) ? "Next" : $h_next = ($page_number >= $total_pages) ? "Next" :
"<a href='".make_link("comment/list/$next")."'>Next</a>"; "<a href='".make_link("comment/list/$next")."'>Next</a>";

View File

@ -54,11 +54,11 @@ class IndexTheme extends Themelet {
$h_prev = ($page_number <= 1) ? "Prev" : "<a href='".make_link("post/list$query/$prev")."'>Prev</a>"; $h_prev = ($page_number <= 1) ? "Prev" : "<a href='".make_link("post/list$query/$prev")."'>Prev</a>";
$h_index = "<a href='".make_link("index")."'>Index</a>"; $h_index = "<a href='".make_link()."'>Index</a>";
$h_next = ($page_number >= $total_pages) ? "Next" : "<a href='".make_link("post/list$query/$next")."'>Next</a>"; $h_next = ($page_number >= $total_pages) ? "Next" : "<a href='".make_link("post/list$query/$next")."'>Next</a>";
$h_search_string = count($search_terms) == 0 ? "Search" : html_escape(implode(" ", $search_terms)); $h_search_string = count($search_terms) == 0 ? "Search" : html_escape(implode(" ", $search_terms));
$h_search_link = make_link("index"); $h_search_link = make_link();
$h_search = " $h_search = "
<p><form action='$h_search_link' method='GET'> <p><form action='$h_search_link' method='GET'>
<input id='search_input' name='search' type='text' <input id='search_input' name='search' type='text'

View File

@ -61,7 +61,7 @@ class SetupTheme extends Themelet {
private function build_navigation() { private function build_navigation() {
return " return "
<a href='".make_link("index")."'>Index</a> <a href='".make_link()."'>Index</a>
<br><a href='http://trac.shishnet.org/shimmie/wiki/Settings'>Help</a> <br><a href='http://trac.shishnet.org/shimmie/wiki/Settings'>Help</a>
"; ";
} }

View File

@ -76,7 +76,7 @@ class TagList extends Extension {
// }}} // }}}
// maps {{{ // maps {{{
private function build_navigation() { private function build_navigation() {
$h_index = "<a href='".make_link("index")."'>Index</a>"; $h_index = "<a href='".make_link()."'>Index</a>";
$h_map = "<a href='".make_link("tags/map")."'>Map</a>"; $h_map = "<a href='".make_link("tags/map")."'>Map</a>";
$h_alphabetic = "<a href='".make_link("tags/alphabetic")."'>Alphabetic</a>"; $h_alphabetic = "<a href='".make_link("tags/alphabetic")."'>Alphabetic</a>";
$h_popularity = "<a href='".make_link("tags/popularity")."'>Popularity</a>"; $h_popularity = "<a href='".make_link("tags/popularity")."'>Popularity</a>";

View File

@ -54,7 +54,7 @@ class UserPage extends Extension {
else if($event->get_arg(0) == "logout") { else if($event->get_arg(0) == "logout") {
setcookie("shm_session", "", time()+60*60*24*$config->get_int('login_memory'), "/"); setcookie("shm_session", "", time()+60*60*24*$config->get_int('login_memory'), "/");
$page->set_mode("redirect"); $page->set_mode("redirect");
$page->set_redirect(make_link("index")); $page->set_redirect(make_link());
} }
else if($event->get_arg(0) == "changepass") { else if($event->get_arg(0) == "changepass") {
$this->change_password_wrapper($event->page); $this->change_password_wrapper($event->page);

View File

@ -105,7 +105,7 @@ class UserPageTheme extends Themelet {
$h_comment_rate = sprintf("%3.1f", ($i_comment_count / $i_days_old2)); $h_comment_rate = sprintf("%3.1f", ($i_comment_count / $i_days_old2));
$u_name = url_escape($duser->name); $u_name = url_escape($duser->name);
$images_link = make_link("index", "search=poster%3D$u_name"); $images_link = make_link(, "search=poster%3D$u_name");
return " return "
Join date: $h_join_date ($i_days_old days old) Join date: $h_join_date ($i_days_old days old)

View File

@ -51,7 +51,7 @@ class ViewTheme extends Themelet {
private function build_navigation($image_id) { private function build_navigation($image_id) {
$h_pin = $this->build_pin($image_id); $h_pin = $this->build_pin($image_id);
$h_search = " $h_search = "
<p><form action='".make_link("index")."' method='GET'> <p><form action='".make_link()."' method='GET'>
<input id='search_input' name='search' type='text' <input id='search_input' name='search' type='text'
value='Search' autocomplete='off'> value='Search' autocomplete='off'>
<input type='submit' value='Find' style='display: none;'> <input type='submit' value='Find' style='display: none;'>

View File

@ -7,7 +7,7 @@ class CommentListTheme extends Themelet {
$h_prev = ($page_number <= 1) ? "Prev" : $h_prev = ($page_number <= 1) ? "Prev" :
"<a href='".make_link("comment/list/$prev")."'>Prev</a>"; "<a href='".make_link("comment/list/$prev")."'>Prev</a>";
$h_index = "<a href='".make_link("index")."'>Index</a>"; $h_index = "<a href='".make_link()."'>Index</a>";
$h_next = ($page_number >= $total_pages) ? "Next" : $h_next = ($page_number >= $total_pages) ? "Next" :
"<a href='".make_link("comment/list/$next")."'>Next</a>"; "<a href='".make_link("comment/list/$next")."'>Next</a>";

View File

@ -36,7 +36,7 @@ class IndexTheme extends Themelet {
private function build_navigation($page_number, $total_pages, $search_terms) { private function build_navigation($page_number, $total_pages, $search_terms) {
$h_search_string = count($search_terms) == 0 ? "" : html_escape(implode(" ", $search_terms)); $h_search_string = count($search_terms) == 0 ? "" : html_escape(implode(" ", $search_terms));
$h_search_link = make_link("index"); $h_search_link = make_link();
$h_search = " $h_search = "
<p><form action='$h_search_link' method='GET'> <p><form action='$h_search_link' method='GET'>
<input name='search' type='text' <input name='search' type='text'

View File

@ -52,7 +52,7 @@ class UploadTheme extends Themelet {
public function display_upload_status($page, $ok) { public function display_upload_status($page, $ok) {
if($ok) { if($ok) {
$page->set_mode("redirect"); $page->set_mode("redirect");
$page->set_redirect(make_link("index")); $page->set_redirect(make_link());
} }
else { else {
$page->set_title("Upload Status"); $page->set_title("Upload Status");

View File

@ -41,7 +41,7 @@ class ViewTheme extends Themelet {
$prev = $database->get_prev_image($image_id, $search_terms); $prev = $database->get_prev_image($image_id, $search_terms);
$h_prev = (!is_null($prev) ? "<a href='".make_link("post/view/{$prev->id}", $query)."'>Prev</a>" : "Prev"); $h_prev = (!is_null($prev) ? "<a href='".make_link("post/view/{$prev->id}", $query)."'>Prev</a>" : "Prev");
$h_index = "<a href='".make_link("index")."'>Index</a>"; $h_index = "<a href='".make_link()."'>Index</a>";
$h_next = (!is_null($next) ? "<a href='".make_link("post/view/{$next->id}", $query)."'>Next</a>" : "Next"); $h_next = (!is_null($next) ? "<a href='".make_link("post/view/{$next->id}", $query)."'>Next</a>" : "Next");
$this->pin = "$h_prev | $h_index | $h_next"; $this->pin = "$h_prev | $h_index | $h_next";
@ -51,7 +51,7 @@ class ViewTheme extends Themelet {
private function build_navigation($image_id) { private function build_navigation($image_id) {
$h_pin = $this->build_pin($image_id); $h_pin = $this->build_pin($image_id);
$h_search = " $h_search = "
<p><form action='".make_link("index")."' method='GET'> <p><form action='".make_link()."' method='GET'>
<input id='search_input' name='search' type='text' <input id='search_input' name='search' type='text'
value='Search' autocomplete='off'> value='Search' autocomplete='off'>
<input type='submit' value='Find' style='display: none;'> <input type='submit' value='Find' style='display: none;'>