1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-22 13:45:02 +00:00

Improved default action setting integration

This commit is contained in:
Starbeamrainbowlabs 2015-05-24 16:17:07 +01:00
parent 9277f00c08
commit f512958c05
2 changed files with 10 additions and 12 deletions

View file

@ -125,8 +125,8 @@ if(!isset($_GET["action"]) and !isset($_GET["page"]))
//make sure that the action is set
if(!isset($_GET["action"]))
$_GET["action"] = "view";
$_GET["action"] = $settings->defaultaction;
//make sure that the page is set
if(!isset($_GET["page"]) or strlen($_GET["page"]) === 0)
$_GET["page"] = $settings->defaultpage;
@ -203,7 +203,7 @@ function renderpage($title, $content, $minimal = false)
case "search": //displays a search bar
$html .= "<form method='get' action='index.php' style='display: inline;'><input type='search' name='page' list='allpages' placeholder='Type a page name here and hit enter' /></form>";
break;
//it isn't a keyword, so just output it directly
default:
$html .= $item;
@ -215,7 +215,7 @@ function renderpage($title, $content, $minimal = false)
$html .= "\t\t<a href='" . str_replace("{page}", $page, $item[1]) . "'>$item[0]</a>\n";
}
}
$html .= " </nav>
<h1 class='sitename'>$settings->sitename</h1>
$content
@ -322,14 +322,13 @@ class Slimdown {
$level = strlen ($chars);
return sprintf ('<h%d>%s</h%d>', $level + 1, trim($header), $level + 1);
}
/**
* Add a rule.
*/
public static function add_rule ($regex, $replacement) {
self::$rules[$regex] = $replacement;
}
/**
* Render some Markdown into HTML.
*/

View file

@ -253,8 +253,8 @@ if(!isset($_GET["action"]) and !isset($_GET["page"]))
//make sure that the action is set
if(!isset($_GET["action"]))
$_GET["action"] = "view";
$_GET["action"] = $settings->defaultaction;
//make sure that the page is set
if(!isset($_GET["page"]) or strlen($_GET["page"]) === 0)
$_GET["page"] = $settings->defaultpage;
@ -331,7 +331,7 @@ function renderpage($title, $content, $minimal = false)
case "search": //displays a search bar
$html .= "<form method='get' action='index.php' style='display: inline;'><input type='search' name='page' list='allpages' placeholder='Type a page name here and hit enter' /></form>";
break;
//it isn't a keyword, so just output it directly
default:
$html .= $item;
@ -343,7 +343,7 @@ function renderpage($title, $content, $minimal = false)
$html .= "\t\t<a href='" . str_replace("{page}", $page, $item[1]) . "'>$item[0]</a>\n";
}
}
$html .= " </nav>
<h1 class='sitename'>$settings->sitename</h1>
$content
@ -450,14 +450,13 @@ class Slimdown {
$level = strlen ($chars);
return sprintf ('<h%d>%s</h%d>', $level + 1, trim($header), $level + 1);
}
/**
* Add a rule.
*/
public static function add_rule ($regex, $replacement) {
self::$rules[$regex] = $replacement;
}
/**
* Render some Markdown into HTML.
*/