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:
parent
ccf45ef91f
commit
2e8e839f5c
16 changed files with 22 additions and 19 deletions
|
@ -68,13 +68,13 @@ class Home extends Extension {
|
|||
return "
|
||||
<div id='front-page'>
|
||||
<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>
|
||||
<div class='space' id='links'>
|
||||
$main_links
|
||||
</div>
|
||||
<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 type='submit' value='Search'/>
|
||||
</form>
|
||||
|
|
|
@ -73,7 +73,7 @@ class Tag_History extends Extension {
|
|||
// tried to set it too the same thing so ignore it (might be a bot)
|
||||
// go back to the index page with you
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("index"));
|
||||
$page->set_redirect(make_link());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
class NavBlock extends Block {
|
||||
public function NavBlock() {
|
||||
$this->header = "Navigation";
|
||||
$this->body = "<a href='".make_link("index")."'>Index</a>";
|
||||
$this->body = "<a href='".make_link()."'>Index</a>";
|
||||
$this->section = "left";
|
||||
$this->position = 0;
|
||||
}
|
||||
|
|
|
@ -92,8 +92,11 @@ function tag_explode($tags) {
|
|||
* HTML Generation *
|
||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
function make_link($page, $query=null) {
|
||||
function make_link($page=null, $query=null) {
|
||||
global $config;
|
||||
|
||||
if(is_null($page)) $page = $config->get_string('front_page', 'post/list');
|
||||
|
||||
$base = $config->get_string('base_href', './index.php?q=');
|
||||
|
||||
if(is_null($query)) {
|
||||
|
|
|
@ -32,7 +32,7 @@ class AdminPage extends Extension {
|
|||
if($image) {
|
||||
send_event(new ImageDeletionEvent($image));
|
||||
$event->page->set_mode("redirect");
|
||||
$event->page->set_redirect(make_link("index"));
|
||||
$event->page->set_redirect(make_link());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ class CommentListTheme extends Themelet {
|
|||
|
||||
$h_prev = ($page_number <= 1) ? "Prev" :
|
||||
"<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" :
|
||||
"<a href='".make_link("comment/list/$next")."'>Next</a>";
|
||||
|
||||
|
|
|
@ -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_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_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 = "
|
||||
<p><form action='$h_search_link' method='GET'>
|
||||
<input id='search_input' name='search' type='text'
|
||||
|
|
|
@ -61,7 +61,7 @@ class SetupTheme extends Themelet {
|
|||
|
||||
private function build_navigation() {
|
||||
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>
|
||||
";
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ class TagList extends Extension {
|
|||
// }}}
|
||||
// maps {{{
|
||||
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_alphabetic = "<a href='".make_link("tags/alphabetic")."'>Alphabetic</a>";
|
||||
$h_popularity = "<a href='".make_link("tags/popularity")."'>Popularity</a>";
|
||||
|
|
|
@ -54,7 +54,7 @@ class UserPage extends Extension {
|
|||
else if($event->get_arg(0) == "logout") {
|
||||
setcookie("shm_session", "", time()+60*60*24*$config->get_int('login_memory'), "/");
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("index"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
else if($event->get_arg(0) == "changepass") {
|
||||
$this->change_password_wrapper($event->page);
|
||||
|
|
|
@ -105,7 +105,7 @@ class UserPageTheme extends Themelet {
|
|||
$h_comment_rate = sprintf("%3.1f", ($i_comment_count / $i_days_old2));
|
||||
|
||||
$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 "
|
||||
Join date: $h_join_date ($i_days_old days old)
|
||||
|
|
|
@ -51,7 +51,7 @@ class ViewTheme extends Themelet {
|
|||
private function build_navigation($image_id) {
|
||||
$h_pin = $this->build_pin($image_id);
|
||||
$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'
|
||||
value='Search' autocomplete='off'>
|
||||
<input type='submit' value='Find' style='display: none;'>
|
||||
|
|
|
@ -7,7 +7,7 @@ class CommentListTheme extends Themelet {
|
|||
|
||||
$h_prev = ($page_number <= 1) ? "Prev" :
|
||||
"<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" :
|
||||
"<a href='".make_link("comment/list/$next")."'>Next</a>";
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class IndexTheme extends Themelet {
|
|||
|
||||
private function build_navigation($page_number, $total_pages, $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 = "
|
||||
<p><form action='$h_search_link' method='GET'>
|
||||
<input name='search' type='text'
|
||||
|
|
|
@ -52,7 +52,7 @@ class UploadTheme extends Themelet {
|
|||
public function display_upload_status($page, $ok) {
|
||||
if($ok) {
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("index"));
|
||||
$page->set_redirect(make_link());
|
||||
}
|
||||
else {
|
||||
$page->set_title("Upload Status");
|
||||
|
|
|
@ -41,7 +41,7 @@ class ViewTheme extends Themelet {
|
|||
$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_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");
|
||||
|
||||
$this->pin = "$h_prev | $h_index | $h_next";
|
||||
|
@ -51,7 +51,7 @@ class ViewTheme extends Themelet {
|
|||
private function build_navigation($image_id) {
|
||||
$h_pin = $this->build_pin($image_id);
|
||||
$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'
|
||||
value='Search' autocomplete='off'>
|
||||
<input type='submit' value='Find' style='display: none;'>
|
||||
|
|
Reference in a new issue