Setup constants
This commit is contained in:
parent
5ceb6f4193
commit
972b68bdd3
29 changed files with 66 additions and 55 deletions
|
@ -60,7 +60,7 @@ class PageRequestEvent extends Event
|
||||||
|
|
||||||
// if path is not specified, use the default front page
|
// if path is not specified, use the default front page
|
||||||
if (empty($path)) { /* empty is faster than strlen */
|
if (empty($path)) { /* empty is faster than strlen */
|
||||||
$path = $config->get_string('front_page');
|
$path = $config->get_string(SetupConfig::FRONT_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// break the path into parts
|
// break the path into parts
|
||||||
|
|
|
@ -813,7 +813,7 @@ class Image
|
||||||
$tmpl = str_replace('$size', "{$this->width}x{$this->height}", $tmpl);
|
$tmpl = str_replace('$size', "{$this->width}x{$this->height}", $tmpl);
|
||||||
$tmpl = str_replace('$filesize', to_shorthand_int($this->filesize), $tmpl);
|
$tmpl = str_replace('$filesize', to_shorthand_int($this->filesize), $tmpl);
|
||||||
$tmpl = str_replace('$filename', $_escape($base_fname), $tmpl);
|
$tmpl = str_replace('$filename', $_escape($base_fname), $tmpl);
|
||||||
$tmpl = str_replace('$title', $_escape($config->get_string("title")), $tmpl);
|
$tmpl = str_replace('$title', $_escape($config->get_string(SetupConfig::TITLE)), $tmpl);
|
||||||
$tmpl = str_replace('$date', $_escape(autodate($this->posted, false)), $tmpl);
|
$tmpl = str_replace('$date', $_escape(autodate($this->posted, false)), $tmpl);
|
||||||
|
|
||||||
// nothing seems to use this, sending the event out to 50 exts is a lot of overhead
|
// nothing seems to use this, sending the event out to 50 exts is a lot of overhead
|
||||||
|
|
|
@ -405,7 +405,7 @@ class Page
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$theme_name = $config->get_string('theme', 'default');
|
$theme_name = $config->get_string(SetupConfig::THEME, 'default');
|
||||||
|
|
||||||
$this->add_html_header("<script type='text/javascript'>base_href = '$data_href';</script>", 40);
|
$this->add_html_header("<script type='text/javascript'>base_href = '$data_href';</script>", 40);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ function make_link(?string $page=null, ?string $query=null): string
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (is_null($page)) {
|
if (is_null($page)) {
|
||||||
$page = $config->get_string('main_page');
|
$page = $config->get_string(SetupConfig::MAIN_PAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null(BASE_URL)) {
|
if (!is_null(BASE_URL)) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ function mtimefile(string $file): string
|
||||||
function get_theme(): string
|
function get_theme(): string
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$theme = $config->get_string("theme", "default");
|
$theme = $config->get_string(SetupConfig::THEME, "default");
|
||||||
if (!file_exists("themes/$theme")) {
|
if (!file_exists("themes/$theme")) {
|
||||||
$theme = "default";
|
$theme = "default";
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,14 +27,14 @@ class BrowserSearch extends Extension
|
||||||
|
|
||||||
// Add in header code to let the browser know that the search plugin exists
|
// Add in header code to let the browser know that the search plugin exists
|
||||||
// We need to build the data for the header
|
// We need to build the data for the header
|
||||||
$search_title = $config->get_string('title');
|
$search_title = $config->get_string(SetupConfig::TITLE);
|
||||||
$search_file_url = make_link('browser_search/please_dont_use_this_tag_as_it_would_break_stuff__search.xml');
|
$search_file_url = make_link('browser_search/please_dont_use_this_tag_as_it_would_break_stuff__search.xml');
|
||||||
$page->add_html_header("<link rel='search' type='application/opensearchdescription+xml' title='$search_title' href='$search_file_url'>");
|
$page->add_html_header("<link rel='search' type='application/opensearchdescription+xml' title='$search_title' href='$search_file_url'>");
|
||||||
|
|
||||||
// The search.xml file that is generated on the fly
|
// The search.xml file that is generated on the fly
|
||||||
if ($event->page_matches("browser_search/please_dont_use_this_tag_as_it_would_break_stuff__search.xml")) {
|
if ($event->page_matches("browser_search/please_dont_use_this_tag_as_it_would_break_stuff__search.xml")) {
|
||||||
// First, we need to build all the variables we'll need
|
// First, we need to build all the variables we'll need
|
||||||
$search_title = $config->get_string('title');
|
$search_title = $config->get_string(SetupConfig::TITLE);
|
||||||
$search_form_url = make_link('post/list/{searchTerms}');
|
$search_form_url = make_link('post/list/{searchTerms}');
|
||||||
$suggenton_url = make_link('browser_search/')."{searchTerms}";
|
$suggenton_url = make_link('browser_search/')."{searchTerms}";
|
||||||
$icon_b64 = base64_encode(file_get_contents("ext/handle_static/static/favicon.ico"));
|
$icon_b64 = base64_encode(file_get_contents("ext/handle_static/static/favicon.ico"));
|
||||||
|
|
|
@ -65,7 +65,7 @@ class custom_html_headers extends Extension
|
||||||
global $config, $page;
|
global $config, $page;
|
||||||
|
|
||||||
// get config values
|
// get config values
|
||||||
$site_title = $config->get_string("title");
|
$site_title = $config->get_string(SetupConfig::TITLE);
|
||||||
$sitename_in_title = $config->get_int("sitename_in_title");
|
$sitename_in_title = $config->get_int("sitename_in_title");
|
||||||
|
|
||||||
// if feature is enabled & sitename isn't already in title
|
// if feature is enabled & sitename isn't already in title
|
||||||
|
|
|
@ -21,7 +21,7 @@ class DowntimeTheme extends Themelet
|
||||||
public function display_message(string $message)
|
public function display_message(string $message)
|
||||||
{
|
{
|
||||||
global $config, $user, $page;
|
global $config, $user, $page;
|
||||||
$theme_name = $config->get_string('theme');
|
$theme_name = $config->get_string(SetupConfig::THEME);
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$login_link = make_link("user_admin/login");
|
$login_link = make_link("user_admin/login");
|
||||||
$auth = $user->get_auth_html();
|
$auth = $user->get_auth_html();
|
||||||
|
|
|
@ -40,8 +40,8 @@ class ET extends Extension
|
||||||
global $config, $database;
|
global $config, $database;
|
||||||
|
|
||||||
$info = [];
|
$info = [];
|
||||||
$info['site_title'] = $config->get_string("title");
|
$info['site_title'] = $config->get_string(SetupConfig::TITLE);
|
||||||
$info['site_theme'] = $config->get_string("theme");
|
$info['site_theme'] = $config->get_string(SetupConfig::THEME);
|
||||||
$info['site_url'] = "http://" . $_SERVER["HTTP_HOST"] . get_base_href();
|
$info['site_url'] = "http://" . $_SERVER["HTTP_HOST"] . get_base_href();
|
||||||
|
|
||||||
$info['sys_shimmie'] = VERSION;
|
$info['sys_shimmie'] = VERSION;
|
||||||
|
|
|
@ -17,7 +17,7 @@ class HandleStatic extends Extension
|
||||||
if ($page->mode == PageMode::PAGE && (!isset($page->blocks) || $this->count_main($page->blocks) == 0)) {
|
if ($page->mode == PageMode::PAGE && (!isset($page->blocks) || $this->count_main($page->blocks) == 0)) {
|
||||||
$h_pagename = html_escape(implode('/', $event->args));
|
$h_pagename = html_escape(implode('/', $event->args));
|
||||||
$f_pagename = preg_replace("/[^a-z_\-\.]+/", "_", $h_pagename);
|
$f_pagename = preg_replace("/[^a-z_\-\.]+/", "_", $h_pagename);
|
||||||
$theme_name = $config->get_string("theme", "default");
|
$theme_name = $config->get_string(SetupConfig::THEME, "default");
|
||||||
|
|
||||||
$theme_file = "themes/$theme_name/static/$f_pagename";
|
$theme_file = "themes/$theme_name/static/$f_pagename";
|
||||||
$static_file = "ext/handle_static/static/$f_pagename";
|
$static_file = "ext/handle_static/static/$f_pagename";
|
||||||
|
|
|
@ -22,8 +22,8 @@ class Home extends Extension
|
||||||
global $config, $page;
|
global $config, $page;
|
||||||
if ($event->page_matches("home")) {
|
if ($event->page_matches("home")) {
|
||||||
$base_href = get_base_href();
|
$base_href = get_base_href();
|
||||||
$sitename = $config->get_string('title');
|
$sitename = $config->get_string(SetupConfig::TITLE);
|
||||||
$theme_name = $config->get_string('theme');
|
$theme_name = $config->get_string(SetupConfig::THEME);
|
||||||
|
|
||||||
$body = $this->get_body();
|
$body = $this->get_body();
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class Home extends Extension
|
||||||
// returns just the contents of the body
|
// returns just the contents of the body
|
||||||
global $config;
|
global $config;
|
||||||
$base_href = get_base_href();
|
$base_href = get_base_href();
|
||||||
$sitename = $config->get_string('title');
|
$sitename = $config->get_string(SetupConfig::TITLE);
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
if (is_null($contact_link)) {
|
if (is_null($contact_link)) {
|
||||||
$contact_link = "";
|
$contact_link = "";
|
||||||
|
|
|
@ -110,7 +110,7 @@ and of course start organising your images :-)
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (count($this->search_terms) == 0) {
|
if (count($this->search_terms) == 0) {
|
||||||
$page_title = $config->get_string('title');
|
$page_title = $config->get_string(SetupConfig::TITLE);
|
||||||
} else {
|
} else {
|
||||||
$search_string = implode(' ', $this->search_terms);
|
$search_string = implode(' ', $this->search_terms);
|
||||||
$page_title = html_escape($search_string);
|
$page_title = html_escape($search_string);
|
||||||
|
|
|
@ -87,7 +87,7 @@ class NumericScoreTheme extends Themelet
|
||||||
|
|
||||||
$nav_html = "<a href=".make_link().">Index</a>";
|
$nav_html = "<a href=".make_link().">Index</a>";
|
||||||
|
|
||||||
$page->set_heading($config->get_string('title'));
|
$page->set_heading($config->get_string(SetupConfig::TITLE));
|
||||||
$page->add_block(new Block("Navigation", $nav_html, "left", 10));
|
$page->add_block(new Block("Navigation", $nav_html, "left", 10));
|
||||||
$page->add_block(new Block(null, $html, "main", 30));
|
$page->add_block(new Block(null, $html, "main", 30));
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class RSS_Comments extends Extension
|
||||||
public function onPostListBuilding(PostListBuildingEvent $event)
|
public function onPostListBuilding(PostListBuildingEvent $event)
|
||||||
{
|
{
|
||||||
global $config, $page;
|
global $config, $page;
|
||||||
$title = $config->get_string('title');
|
$title = $config->get_string(SetupConfig::TITLE);
|
||||||
|
|
||||||
$page->add_html_header("<link rel=\"alternate\" type=\"application/rss+xml\" ".
|
$page->add_html_header("<link rel=\"alternate\" type=\"application/rss+xml\" ".
|
||||||
"title=\"$title - Comments\" href=\"".make_link("rss/comments")."\" />");
|
"title=\"$title - Comments\" href=\"".make_link("rss/comments")."\" />");
|
||||||
|
@ -60,7 +60,7 @@ class RSS_Comments extends Extension
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = $config->get_string('title');
|
$title = $config->get_string(SetupConfig::TITLE);
|
||||||
$base_href = make_http(get_base_href());
|
$base_href = make_http(get_base_href());
|
||||||
$version = $config->get_string('version');
|
$version = $config->get_string('version');
|
||||||
$xml = <<<EOD
|
$xml = <<<EOD
|
||||||
|
|
|
@ -12,7 +12,7 @@ class RSS_Images extends Extension
|
||||||
public function onPostListBuilding(PostListBuildingEvent $event)
|
public function onPostListBuilding(PostListBuildingEvent $event)
|
||||||
{
|
{
|
||||||
global $config, $page;
|
global $config, $page;
|
||||||
$title = $config->get_string('title');
|
$title = $config->get_string(SetupConfig::TITLE);
|
||||||
|
|
||||||
if (count($event->search_terms) > 0) {
|
if (count($event->search_terms) > 0) {
|
||||||
$search = html_escape(implode(' ', $event->search_terms));
|
$search = html_escape(implode(' ', $event->search_terms));
|
||||||
|
@ -47,7 +47,7 @@ class RSS_Images extends Extension
|
||||||
$data .= $this->thumb($image);
|
$data .= $this->thumb($image);
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = $config->get_string('title');
|
$title = $config->get_string(SetupConfig::TITLE);
|
||||||
$base_href = make_http(get_base_href());
|
$base_href = make_http(get_base_href());
|
||||||
$search = "";
|
$search = "";
|
||||||
if (count($search_terms) > 0) {
|
if (count($search_terms) > 0) {
|
||||||
|
|
12
ext/setup/config.php
Normal file
12
ext/setup/config.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
class SetupConfig
|
||||||
|
{
|
||||||
|
public const TITLE = "title";
|
||||||
|
public const FRONT_PAGE = "front_page";
|
||||||
|
public const MAIN_PAGE = "main_page";
|
||||||
|
public const THEME = "theme";
|
||||||
|
public const WORD_WRAP = "word_wrap";
|
||||||
|
public const COMMENT_CAPTCHA = "comment_captcha";
|
||||||
|
}
|
|
@ -6,6 +6,8 @@
|
||||||
* Description: Allows the site admin to configure the board to his or her taste
|
* Description: Allows the site admin to configure the board to his or her taste
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
include_once "config.php";
|
||||||
|
|
||||||
/* ConfigSaveEvent {{{
|
/* ConfigSaveEvent {{{
|
||||||
*
|
*
|
||||||
* Sent when the setup screen's 'set' button has been
|
* Sent when the setup screen's 'set' button has been
|
||||||
|
@ -275,12 +277,11 @@ class Setup extends Extension
|
||||||
public function onInitExt(InitExtEvent $event)
|
public function onInitExt(InitExtEvent $event)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$config->set_default_string("title", "Shimmie");
|
$config->set_default_string(SetupConfig::TITLE, "Shimmie");
|
||||||
$config->set_default_string("front_page", "post/list");
|
$config->set_default_string(SetupConfig::FRONT_PAGE, "post/list");
|
||||||
$config->set_default_string("main_page", "post/list");
|
$config->set_default_string(SetupConfig::MAIN_PAGE, "post/list");
|
||||||
$config->set_default_string("theme", "default");
|
$config->set_default_string(SetupConfig::THEME, "default");
|
||||||
$config->set_default_bool("word_wrap", true);
|
$config->set_default_bool(SetupConfig::WORD_WRAP, true);
|
||||||
$config->set_default_bool("comment_captcha", false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onPageRequest(PageRequestEvent $event)
|
public function onPageRequest(PageRequestEvent $event)
|
||||||
|
@ -368,11 +369,11 @@ class Setup extends Extension
|
||||||
</script>";
|
</script>";
|
||||||
$sb = new SetupBlock("General");
|
$sb = new SetupBlock("General");
|
||||||
$sb->position = 0;
|
$sb->position = 0;
|
||||||
$sb->add_text_option("title", "Site title: ");
|
$sb->add_text_option(SetupConfig::TITLE, "Site title: ");
|
||||||
$sb->add_text_option("front_page", "<br>Front page: ");
|
$sb->add_text_option(SetupConfig::FRONT_PAGE, "<br>Front page: ");
|
||||||
$sb->add_text_option("main_page", "<br>Main page: ");
|
$sb->add_text_option(SetupConfig::MAIN_PAGE, "<br>Main page: ");
|
||||||
$sb->add_text_option("contact_link", "<br>Contact URL: ");
|
$sb->add_text_option("contact_link", "<br>Contact URL: ");
|
||||||
$sb->add_choice_option("theme", $themes, "<br>Theme: ");
|
$sb->add_choice_option(SetupConfig::THEME, $themes, "<br>Theme: ");
|
||||||
//$sb->add_multichoice_option("testarray", array("a" => "b", "c" => "d"), "<br>Test Array: ");
|
//$sb->add_multichoice_option("testarray", array("a" => "b", "c" => "d"), "<br>Test Array: ");
|
||||||
$sb->add_bool_option("nice_urls", "<br>Nice URLs: ");
|
$sb->add_bool_option("nice_urls", "<br>Nice URLs: ");
|
||||||
$sb->add_label("<span id='nicetest'>(Javascript inactive, can't test!)</span>$nicescript");
|
$sb->add_label("<span id='nicetest'>(Javascript inactive, can't test!)</span>$nicescript");
|
||||||
|
|
|
@ -74,7 +74,7 @@ class XMLSitemap extends Extension
|
||||||
|
|
||||||
// add index
|
// add index
|
||||||
$index = [];
|
$index = [];
|
||||||
$index[0] = $config->get_string("front_page");
|
$index[0] = $config->get_string(SetupConfig::FRONT_PAGE);
|
||||||
$this->add_sitemap_queue($index, "weekly", "1");
|
$this->add_sitemap_queue($index, "weekly", "1");
|
||||||
|
|
||||||
/* --- Add 20 most used tags --- */
|
/* --- Add 20 most used tags --- */
|
||||||
|
|
|
@ -189,7 +189,7 @@ class UploadTheme extends Themelet
|
||||||
global $config;
|
global $config;
|
||||||
$link = make_http(make_link("upload"));
|
$link = make_http(make_link("upload"));
|
||||||
$main_page = make_http(make_link());
|
$main_page = make_http(make_link());
|
||||||
$title = $config->get_string('title');
|
$title = $config->get_string(SetupConfig::TITLE);
|
||||||
$max_size = $config->get_int('upload_size');
|
$max_size = $config->get_int('upload_size');
|
||||||
$max_kb = to_shorthand_int($max_size);
|
$max_kb = to_shorthand_int($max_size);
|
||||||
$delimiter = $config->get_bool('nice_urls') ? '?' : '&';
|
$delimiter = $config->get_bool('nice_urls') ? '?' : '&';
|
||||||
|
@ -235,7 +235,7 @@ class UploadTheme extends Themelet
|
||||||
if (class_exists("VideoFileHandler")) {
|
if (class_exists("VideoFileHandler")) {
|
||||||
$supported_ext .= " flv mp4 ogv webm m4v";
|
$supported_ext .= " flv mp4 ogv webm m4v";
|
||||||
}
|
}
|
||||||
$title = "Booru to " . $config->get_string('title');
|
$title = "Booru to " . $config->get_string(SetupConfig::TITLE);
|
||||||
// CA=0: Ask to use current or new tags | CA=1: Always use current tags | CA=2: Always use new tags
|
// CA=0: Ask to use current or new tags | CA=1: Always use current tags | CA=2: Always use new tags
|
||||||
$html .= '<p><a href="javascript:
|
$html .= '<p><a href="javascript:
|
||||||
var ste="'. $link . $delimiter .'url=";
|
var ste="'. $link . $delimiter .'url=";
|
||||||
|
|
|
@ -11,7 +11,7 @@ class CustomIndexTheme extends IndexTheme
|
||||||
|
|
||||||
if (count($this->search_terms) == 0) {
|
if (count($this->search_terms) == 0) {
|
||||||
$query = null;
|
$query = null;
|
||||||
$page_title = $config->get_string('title');
|
$page_title = $config->get_string(SetupConfig::TITLE);
|
||||||
} else {
|
} else {
|
||||||
$search_string = implode(' ', $this->search_terms);
|
$search_string = implode(' ', $this->search_terms);
|
||||||
$query = url_escape($search_string);
|
$query = url_escape($search_string);
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
$theme_name = $config->get_string('theme');
|
$theme_name = $config->get_string(SetupConfig::THEME);
|
||||||
//$base_href = $config->get_string('base_href');
|
//$base_href = $config->get_string('base_href');
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
|
@ -92,10 +92,9 @@ class Layout
|
||||||
$subheading = "<div id='subtitle'>{$this->subheading}</div>";
|
$subheading = "<div id='subtitle'>{$this->subheading}</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_name = $config->get_string('title'); // bzchan: change from normal default to get title for top of page
|
$site_name = $config->get_string(SetupConfig::TITLE); // bzchan: change from normal default to get title for top of page
|
||||||
$main_page = $config->get_string('main_page'); // bzchan: change from normal default to get main page for top of page
|
$main_page = $config->get_string(SetupConfig::MAIN_PAGE); // bzchan: change from normal default to get main page for top of page
|
||||||
|
|
||||||
// bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
|
|
||||||
$custom_links = "";
|
$custom_links = "";
|
||||||
if ($user->is_anonymous()) {
|
if ($user->is_anonymous()) {
|
||||||
$custom_links .= $this->navlinks(make_link('user_admin/login'), "My Account", ["user", "user_admin", "setup", "admin"]);
|
$custom_links .= $this->navlinks(make_link('user_admin/login'), "My Account", ["user", "user_admin", "setup", "admin"]);
|
||||||
|
|
|
@ -11,7 +11,7 @@ class CustomIndexTheme extends IndexTheme
|
||||||
|
|
||||||
if (count($this->search_terms) == 0) {
|
if (count($this->search_terms) == 0) {
|
||||||
$query = null;
|
$query = null;
|
||||||
$page_title = $config->get_string('title');
|
$page_title = $config->get_string(SetupConfig::TITLE);
|
||||||
} else {
|
} else {
|
||||||
$search_string = implode(' ', $this->search_terms);
|
$search_string = implode(' ', $this->search_terms);
|
||||||
$query = url_escape($search_string);
|
$query = url_escape($search_string);
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
//$theme_name = $config->get_string('theme');
|
//$theme_name = $config->get_string(SetupConfig::THEME);
|
||||||
//$base_href = $config->get_string('base_href');
|
//$base_href = $config->get_string('base_href');
|
||||||
//$data_href = get_base_href();
|
//$data_href = get_base_href();
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
|
@ -92,10 +92,9 @@ class Layout
|
||||||
$subheading = "<div id='subtitle'>{$this->subheading}</div>";
|
$subheading = "<div id='subtitle'>{$this->subheading}</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$site_name = $config->get_string('title'); // bzchan: change from normal default to get title for top of page
|
$site_name = $config->get_string(SetupConfig::TITLE); // bzchan: change from normal default to get title for top of page
|
||||||
$main_page = $config->get_string('main_page'); // bzchan: change from normal default to get main page for top of page
|
$main_page = $config->get_string(SetupConfig::MAIN_PAGE); // bzchan: change from normal default to get main page for top of page
|
||||||
|
|
||||||
// bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
|
|
||||||
$custom_links = "";
|
$custom_links = "";
|
||||||
if ($user->is_anonymous()) {
|
if ($user->is_anonymous()) {
|
||||||
$custom_links .= $this->navlinks(make_link('user_admin/login'), "Sign in", ["user", "user_admin", "setup", "admin"]);
|
$custom_links .= $this->navlinks(make_link('user_admin/login'), "Sign in", ["user", "user_admin", "setup", "admin"]);
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
//$theme_name = $config->get_string('theme', 'default');
|
//$theme_name = $config->get_string(SetupConfig::THEME, 'default');
|
||||||
//$data_href = get_base_href();
|
//$data_href = get_base_href();
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
$header_html = $page->get_all_html_headers();
|
$header_html = $page->get_all_html_headers();
|
||||||
|
|
|
@ -11,7 +11,7 @@ class CustomCommentListTheme extends CommentListTheme
|
||||||
//$prev = $page_number - 1;
|
//$prev = $page_number - 1;
|
||||||
//$next = $page_number + 1;
|
//$next = $page_number + 1;
|
||||||
|
|
||||||
$page_title = $config->get_string('title');
|
$page_title = $config->get_string(SetupConfig::TITLE);
|
||||||
$page->set_title($page_title);
|
$page->set_title($page_title);
|
||||||
$page->set_heading($page_title);
|
$page->set_heading($page_title);
|
||||||
$page->disable_left();
|
$page->disable_left();
|
||||||
|
|
|
@ -6,7 +6,7 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$theme_name = $config->get_string('theme', 'default');
|
$theme_name = $config->get_string(SetupConfig::THEME, 'default');
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
$header_html = $page->get_all_html_headers();
|
$header_html = $page->get_all_html_headers();
|
||||||
|
|
|
@ -13,8 +13,8 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
$theme_name = $config->get_string('theme', 'lite');
|
$theme_name = $config->get_string(SetupConfig::THEME, 'lite');
|
||||||
$site_name = $config->get_string('title');
|
$site_name = $config->get_string(SetupConfig::TITLE);
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
$header_html = $page->get_all_html_headers();
|
$header_html = $page->get_all_html_headers();
|
||||||
|
|
|
@ -11,10 +11,10 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$theme_name = $config->get_string('theme', 'material');
|
$theme_name = $config->get_string(SetupConfig::THEME, 'material');
|
||||||
$site_name = $config->get_string('title');
|
$site_name = $config->get_string(SetupConfig::TITLE);
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$main_page = $config->get_string('main_page');
|
$main_page = $config->get_string(SetupConfig::MAIN_PAGE);
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
$site_link = make_link();
|
$site_link = make_link();
|
||||||
$header_html = $page->get_all_html_headers();
|
$header_html = $page->get_all_html_headers();
|
||||||
|
|
|
@ -11,10 +11,10 @@ class Layout
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
//$theme_name = $config->get_string('theme', 'default');
|
//$theme_name = $config->get_string(SetupConfig::THEME, 'default');
|
||||||
$site_name = $config->get_string('title');
|
$site_name = $config->get_string(SetupConfig::TITLE);
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$main_page = $config->get_string('main_page');
|
$main_page = $config->get_string(SetupConfig::MAIN_PAGE);
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
$header_html = $page->get_all_html_headers();
|
$header_html = $page->get_all_html_headers();
|
||||||
|
|
||||||
|
|
Reference in a new issue