mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 16:33:00 +00:00
begun work on a brand new theme. WARNING: HTML changes and link removals abound! Not all the links that should be are visiable at the moment.
This commit is contained in:
parent
f6e3b9803d
commit
c02243921c
3 changed files with 110 additions and 50 deletions
32
core.php
32
core.php
|
@ -280,8 +280,10 @@ class page_renderer
|
||||||
|
|
||||||
public static $main_content_template = "{navigation-bar}
|
public static $main_content_template = "{navigation-bar}
|
||||||
<h1 class='sitename'>{sitename}</h1>
|
<h1 class='sitename'>{sitename}</h1>
|
||||||
|
<main>
|
||||||
{content}
|
{content}
|
||||||
<hr />
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>Powered by Pepperminty Wiki, which was built by <a href='//starbeamrainbowlabs.com/'>Starbeamrainbowlabs</a>. Send bugs to 'bugs at starbeamrainbowlabs dot com' or open an issue <a href='//github.com/sbrl/Pepperminty-Wiki'>on github</a>.</p>
|
<p>Powered by Pepperminty Wiki, which was built by <a href='//starbeamrainbowlabs.com/'>Starbeamrainbowlabs</a>. Send bugs to 'bugs at starbeamrainbowlabs dot com' or open an issue <a href='//github.com/sbrl/Pepperminty-Wiki'>on github</a>.</p>
|
||||||
<p>Your local friendly administrators are {admins-name-list}.
|
<p>Your local friendly administrators are {admins-name-list}.
|
||||||
|
@ -363,6 +365,8 @@ class page_renderer
|
||||||
return "<style>$settings->css</style>";
|
return "<style>$settings->css</style>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static $nav_divider = "<span class='nav-divider inflexible'> | </span>";
|
||||||
|
|
||||||
public static function render_navigation_bar()
|
public static function render_navigation_bar()
|
||||||
{
|
{
|
||||||
global $settings, $user, $isloggedin, $page;
|
global $settings, $user, $isloggedin, $page;
|
||||||
|
@ -370,11 +374,12 @@ class page_renderer
|
||||||
|
|
||||||
if($isloggedin)
|
if($isloggedin)
|
||||||
{
|
{
|
||||||
$result .= "\t\t\tLogged in as " . self::render_username($user) . ". ";
|
$result .= "<span class='inflexible'>Logged in as " . self::render_username($user) . ".</span> "/* . page_renderer::$nav_divider*/;
|
||||||
$result .= "<a href='index.php?action=logout'>Logout</a>. | \n";
|
$result .= "<span><a href='index.php?action=logout'>Logout</a></span>";
|
||||||
|
$result .= page_renderer::$nav_divider;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$result .= "\t\t\tBrowsing as Anonymous. <a href='index.php?action=login'>Login</a>. | \n";
|
$result .= "<span class='inflexible'>Browsing as Anonymous.</span>" . /*page_renderer::$nav_divider . */"<span><a href='index.php?action=login'>Login</a></span>" . page_renderer::$nav_divider;
|
||||||
|
|
||||||
// Loop over all the navigation links
|
// Loop over all the navigation links
|
||||||
foreach($settings->navlinks as $item)
|
foreach($settings->navlinks as $item)
|
||||||
|
@ -385,23 +390,32 @@ class page_renderer
|
||||||
switch($item)
|
switch($item)
|
||||||
{
|
{
|
||||||
//keywords
|
//keywords
|
||||||
case "search": //displays a search bar
|
case "search": // Displays a search bar
|
||||||
$result .= "\t\t\t<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>\n";
|
$result .= "<span class='inflexible'><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></span>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "divider": // Displays a divider
|
||||||
|
$result .= page_renderer::$nav_divider;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "menu":
|
||||||
|
$result .= "<span class='inflexible nav-more'>More...</span>";
|
||||||
|
// todo Add the submenu
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// It isn't a keyword, so just output it directly
|
// It isn't a keyword, so just output it directly
|
||||||
default:
|
default:
|
||||||
$result .= "\t\t\t$item\n";
|
$result .= "<span>$item</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Output the item as a link to a url
|
// Output the item as a link to a url
|
||||||
$result .= "\t\t\t<a href='" . str_replace("{page}", $page, $item[1]) . "'>$item[0]</a>\n";
|
$result .= "<span><a href='" . str_replace("{page}", $page, $item[1]) . "'>$item[0]</a></span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= "\t\t</nav>";
|
$result .= "</nav>";
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
public static function render_username($name)
|
public static function render_username($name)
|
||||||
|
|
80
index.php
80
index.php
|
@ -89,23 +89,32 @@ $settings->admindetails = [
|
||||||
// Array of links and display text to display at the top of the site.
|
// Array of links and display text to display at the top of the site.
|
||||||
// Format:
|
// Format:
|
||||||
// [ "Display Text", "Link" ]
|
// [ "Display Text", "Link" ]
|
||||||
// You can also use strings here and they will be printed as-is, except the following special strings:
|
// You can also use strings here and they will be printed as-is, except the
|
||||||
|
// following special strings:
|
||||||
// search: Expands to a search box.
|
// search: Expands to a search box.
|
||||||
|
// divider: Expands to a divider to separate links.
|
||||||
|
// more: Expands to the "More..." submenu.
|
||||||
$settings->navlinks = [
|
$settings->navlinks = [
|
||||||
[ "Home", "index.php" ],
|
[ "Home", "index.php" ],
|
||||||
[ "Login", "index.php?action=login" ],
|
[ "Login", "index.php?action=login" ],
|
||||||
" | ",
|
|
||||||
"search",
|
"search",
|
||||||
" | ",
|
|
||||||
[ "Read", "index.php?page={page}" ],
|
[ "Read", "index.php?page={page}" ],
|
||||||
[ "Edit", "index.php?action=edit&page={page}" ],
|
[ "Edit", "index.php?action=edit&page={page}" ],
|
||||||
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
||||||
" | ",
|
//"divider",
|
||||||
|
[ "All Pages", "index.php?action=list" ],
|
||||||
|
"menu"
|
||||||
|
];
|
||||||
|
// An array of additional links in the above format that will be shown under
|
||||||
|
// "More" subsection.
|
||||||
|
$settings->nav_links_extra = [
|
||||||
[ $settings->admindisplaychar . "Delete", "index.php?action=delete&page={page}" ],
|
[ $settings->admindisplaychar . "Delete", "index.php?action=delete&page={page}" ],
|
||||||
[ $settings->admindisplaychar . "Move", "index.php?action=move&page={page}" ],
|
[ $settings->admindisplaychar . "Move", "index.php?action=move&page={page}" ]
|
||||||
" | ",
|
];
|
||||||
[ "All Pages", "index.php?action=list" ],
|
|
||||||
" | ",
|
// An array of links in the above format that will be shown at the bottom of
|
||||||
|
// the page.
|
||||||
|
$settings->nav_links_bottom = [
|
||||||
[ "Credits", "index.php?action=credits" ],
|
[ "Credits", "index.php?action=credits" ],
|
||||||
[ "Help", "index.php?action=help" ]
|
[ "Help", "index.php?action=help" ]
|
||||||
];
|
];
|
||||||
|
@ -113,14 +122,21 @@ $settings->navlinks = [
|
||||||
// A string of css to include. Will be included in the <head> of every page
|
// A string of css to include. Will be included in the <head> of every page
|
||||||
// inside a <style> tag. This may also be a url - urls will be referenced via a
|
// inside a <style> tag. This may also be a url - urls will be referenced via a
|
||||||
// <link rel='stylesheet' /> tag.
|
// <link rel='stylesheet' /> tag.
|
||||||
$settings->css = "body { font-family: sans-serif; color: #333333; background: #f8f8f8; }
|
$settings->css = "body { margin: 2rem 0; font-family: sans-serif; color: #111111; background: #eee8f2; }
|
||||||
label { display: inline-block; min-width: 10rem; }
|
nav { position: absolute; top: 0; left: 0; right: 0; display: flex; background-color: #8a62a7; color: #ffa74d; box-shadow: inset 0 -0.6rem 0.8rem -0.5rem rgba(50, 50, 50, 0.5); }
|
||||||
textarea[name=content] { display: block; width: 100%; height: 35rem; }
|
nav > span { flex: 1; text-align: center; line-height: 2; display: inline-block; margin: 0; padding: 0.3rem 0.5rem; transition: all 0.25s; border-left: 3px solid #442772; border-right: 3px solid #442772; }
|
||||||
/*input[name=page] { width: 16rem; }*/
|
nav > span:not(.inflexible):hover { transform: scale(1.1); }
|
||||||
nav { position: absolute; top: 5px; right: 5px; }
|
nav a { text-decoration: none; font-weight: bolder; color: inherit; }
|
||||||
th { text-align: left; }
|
.nav-divider { color: transparent; }
|
||||||
.sitename { text-align: center; font-size: 2.5rem; color: #222222; }
|
.nav-more { background-color: #442772; }
|
||||||
.footerdivider { margin-top: 4rem; }";
|
.inflexible { flex: none; }
|
||||||
|
input[type=search] { width: 14rem; padding: 0.3rem 0.4rem; font-size: 1rem; background: rgba(255, 255, 255, 0.4); border: 0; border-radius: 0.3rem; }
|
||||||
|
input[type=search]::-webkit-input-placeholder { color : white; }
|
||||||
|
h1 { text-align: center; }
|
||||||
|
.sitename { margin-top: 5rem; margin-bottom: 3rem; font-size: 2.5rem; }
|
||||||
|
main { padding: 2rem; background: #faf8fb; box-shadow: 0 0.2rem 1rem 0.3rem rgba(50, 50, 50, 0.5); }
|
||||||
|
footer { padding: 2rem; }
|
||||||
|
";
|
||||||
|
|
||||||
// A url that points to the favicon you want to use for your wiki. By default
|
// A url that points to the favicon you want to use for your wiki. By default
|
||||||
// this is set to a data: url of a Peppermint.
|
// this is set to a data: url of a Peppermint.
|
||||||
|
@ -442,8 +458,10 @@ class page_renderer
|
||||||
|
|
||||||
public static $main_content_template = "{navigation-bar}
|
public static $main_content_template = "{navigation-bar}
|
||||||
<h1 class='sitename'>{sitename}</h1>
|
<h1 class='sitename'>{sitename}</h1>
|
||||||
|
<main>
|
||||||
{content}
|
{content}
|
||||||
<hr />
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p>Powered by Pepperminty Wiki, which was built by <a href='//starbeamrainbowlabs.com/'>Starbeamrainbowlabs</a>. Send bugs to 'bugs at starbeamrainbowlabs dot com' or open an issue <a href='//github.com/sbrl/Pepperminty-Wiki'>on github</a>.</p>
|
<p>Powered by Pepperminty Wiki, which was built by <a href='//starbeamrainbowlabs.com/'>Starbeamrainbowlabs</a>. Send bugs to 'bugs at starbeamrainbowlabs dot com' or open an issue <a href='//github.com/sbrl/Pepperminty-Wiki'>on github</a>.</p>
|
||||||
<p>Your local friendly administrators are {admins-name-list}.
|
<p>Your local friendly administrators are {admins-name-list}.
|
||||||
|
@ -525,6 +543,8 @@ class page_renderer
|
||||||
return "<style>$settings->css</style>";
|
return "<style>$settings->css</style>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static $nav_divider = "<span class='nav-divider inflexible'> | </span>";
|
||||||
|
|
||||||
public static function render_navigation_bar()
|
public static function render_navigation_bar()
|
||||||
{
|
{
|
||||||
global $settings, $user, $isloggedin, $page;
|
global $settings, $user, $isloggedin, $page;
|
||||||
|
@ -532,11 +552,12 @@ class page_renderer
|
||||||
|
|
||||||
if($isloggedin)
|
if($isloggedin)
|
||||||
{
|
{
|
||||||
$result .= "\t\t\tLogged in as " . self::render_username($user) . ". ";
|
$result .= "<span class='inflexible'>Logged in as " . self::render_username($user) . ".</span> "/* . page_renderer::$nav_divider*/;
|
||||||
$result .= "<a href='index.php?action=logout'>Logout</a>. | \n";
|
$result .= "<span><a href='index.php?action=logout'>Logout</a></span>";
|
||||||
|
$result .= page_renderer::$nav_divider;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$result .= "\t\t\tBrowsing as Anonymous. <a href='index.php?action=login'>Login</a>. | \n";
|
$result .= "<span class='inflexible'>Browsing as Anonymous.</span>" . /*page_renderer::$nav_divider . */"<span><a href='index.php?action=login'>Login</a></span>" . page_renderer::$nav_divider;
|
||||||
|
|
||||||
// Loop over all the navigation links
|
// Loop over all the navigation links
|
||||||
foreach($settings->navlinks as $item)
|
foreach($settings->navlinks as $item)
|
||||||
|
@ -547,23 +568,32 @@ class page_renderer
|
||||||
switch($item)
|
switch($item)
|
||||||
{
|
{
|
||||||
//keywords
|
//keywords
|
||||||
case "search": //displays a search bar
|
case "search": // Displays a search bar
|
||||||
$result .= "\t\t\t<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>\n";
|
$result .= "<span class='inflexible'><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></span>";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "divider": // Displays a divider
|
||||||
|
$result .= page_renderer::$nav_divider;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "menu":
|
||||||
|
$result .= "<span class='inflexible nav-more'>More...</span>";
|
||||||
|
// todo Add the submenu
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// It isn't a keyword, so just output it directly
|
// It isn't a keyword, so just output it directly
|
||||||
default:
|
default:
|
||||||
$result .= "\t\t\t$item\n";
|
$result .= "<span>$item</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Output the item as a link to a url
|
// Output the item as a link to a url
|
||||||
$result .= "\t\t\t<a href='" . str_replace("{page}", $page, $item[1]) . "'>$item[0]</a>\n";
|
$result .= "<span><a href='" . str_replace("{page}", $page, $item[1]) . "'>$item[0]</a></span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= "\t\t</nav>";
|
$result .= "</nav>";
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
public static function render_username($name)
|
public static function render_username($name)
|
||||||
|
|
|
@ -86,23 +86,32 @@ $settings->admindetails = [
|
||||||
// Array of links and display text to display at the top of the site.
|
// Array of links and display text to display at the top of the site.
|
||||||
// Format:
|
// Format:
|
||||||
// [ "Display Text", "Link" ]
|
// [ "Display Text", "Link" ]
|
||||||
// You can also use strings here and they will be printed as-is, except the following special strings:
|
// You can also use strings here and they will be printed as-is, except the
|
||||||
|
// following special strings:
|
||||||
// search: Expands to a search box.
|
// search: Expands to a search box.
|
||||||
|
// divider: Expands to a divider to separate links.
|
||||||
|
// more: Expands to the "More..." submenu.
|
||||||
$settings->navlinks = [
|
$settings->navlinks = [
|
||||||
[ "Home", "index.php" ],
|
[ "Home", "index.php" ],
|
||||||
[ "Login", "index.php?action=login" ],
|
[ "Login", "index.php?action=login" ],
|
||||||
" | ",
|
|
||||||
"search",
|
"search",
|
||||||
" | ",
|
|
||||||
[ "Read", "index.php?page={page}" ],
|
[ "Read", "index.php?page={page}" ],
|
||||||
[ "Edit", "index.php?action=edit&page={page}" ],
|
[ "Edit", "index.php?action=edit&page={page}" ],
|
||||||
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
[ "Printable", "index.php?action=view&printable=yes&page={page}" ],
|
||||||
" | ",
|
//"divider",
|
||||||
|
[ "All Pages", "index.php?action=list" ],
|
||||||
|
"menu"
|
||||||
|
];
|
||||||
|
// An array of additional links in the above format that will be shown under
|
||||||
|
// "More" subsection.
|
||||||
|
$settings->nav_links_extra = [
|
||||||
[ $settings->admindisplaychar . "Delete", "index.php?action=delete&page={page}" ],
|
[ $settings->admindisplaychar . "Delete", "index.php?action=delete&page={page}" ],
|
||||||
[ $settings->admindisplaychar . "Move", "index.php?action=move&page={page}" ],
|
[ $settings->admindisplaychar . "Move", "index.php?action=move&page={page}" ]
|
||||||
" | ",
|
];
|
||||||
[ "All Pages", "index.php?action=list" ],
|
|
||||||
" | ",
|
// An array of links in the above format that will be shown at the bottom of
|
||||||
|
// the page.
|
||||||
|
$settings->nav_links_bottom = [
|
||||||
[ "Credits", "index.php?action=credits" ],
|
[ "Credits", "index.php?action=credits" ],
|
||||||
[ "Help", "index.php?action=help" ]
|
[ "Help", "index.php?action=help" ]
|
||||||
];
|
];
|
||||||
|
@ -110,14 +119,21 @@ $settings->navlinks = [
|
||||||
// A string of css to include. Will be included in the <head> of every page
|
// A string of css to include. Will be included in the <head> of every page
|
||||||
// inside a <style> tag. This may also be a url - urls will be referenced via a
|
// inside a <style> tag. This may also be a url - urls will be referenced via a
|
||||||
// <link rel='stylesheet' /> tag.
|
// <link rel='stylesheet' /> tag.
|
||||||
$settings->css = "body { font-family: sans-serif; color: #333333; background: #f8f8f8; }
|
$settings->css = "body { margin: 2rem 0; font-family: sans-serif; color: #111111; background: #eee8f2; }
|
||||||
label { display: inline-block; min-width: 10rem; }
|
nav { position: absolute; top: 0; left: 0; right: 0; display: flex; background-color: #8a62a7; color: #ffa74d; box-shadow: inset 0 -0.6rem 0.8rem -0.5rem rgba(50, 50, 50, 0.5); }
|
||||||
textarea[name=content] { display: block; width: 100%; height: 35rem; }
|
nav > span { flex: 1; text-align: center; line-height: 2; display: inline-block; margin: 0; padding: 0.3rem 0.5rem; transition: all 0.25s; border-left: 3px solid #442772; border-right: 3px solid #442772; }
|
||||||
/*input[name=page] { width: 16rem; }*/
|
nav > span:not(.inflexible):hover { transform: scale(1.1); }
|
||||||
nav { position: absolute; top: 5px; right: 5px; }
|
nav a { text-decoration: none; font-weight: bolder; color: inherit; }
|
||||||
th { text-align: left; }
|
.nav-divider { color: transparent; }
|
||||||
.sitename { text-align: center; font-size: 2.5rem; color: #222222; }
|
.nav-more { background-color: #442772; }
|
||||||
.footerdivider { margin-top: 4rem; }";
|
.inflexible { flex: none; }
|
||||||
|
input[type=search] { width: 14rem; padding: 0.3rem 0.4rem; font-size: 1rem; background: rgba(255, 255, 255, 0.4); border: 0; border-radius: 0.3rem; }
|
||||||
|
input[type=search]::-webkit-input-placeholder { color : white; }
|
||||||
|
h1 { text-align: center; }
|
||||||
|
.sitename { margin-top: 5rem; margin-bottom: 3rem; font-size: 2.5rem; }
|
||||||
|
main { padding: 2rem; background: #faf8fb; box-shadow: 0 0.2rem 1rem 0.3rem rgba(50, 50, 50, 0.5); }
|
||||||
|
footer { padding: 2rem; }
|
||||||
|
";
|
||||||
|
|
||||||
// A url that points to the favicon you want to use for your wiki. By default
|
// A url that points to the favicon you want to use for your wiki. By default
|
||||||
// this is set to a data: url of a Peppermint.
|
// this is set to a data: url of a Peppermint.
|
||||||
|
|
Loading…
Reference in a new issue