summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-23 16:51:06 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-23 16:51:06 +0000
commit7491e3c44affb89fe28030f8759283bc1b4aa291 (patch)
tree077c14bcee9f68e80e07c8165dbf11ec41107e43
parent7485740d9741021b2016df80b225ae4d82b892d0 (diff)
Add a site-config parameter to the config.php file. Created a core_block:head method to insert the title into the head section. If the config value is false, the default Browse Photos::$item->title is used. A string value with a trailing '-' will append the config value to $item-title. Otherwise, the page title is set with the supplied value.
-rw-r--r--core/config/config.php9
-rw-r--r--core/helpers/core_block.php35
-rw-r--r--core/libraries/Theme.php6
-rw-r--r--themes/default/views/page.html.php3
4 files changed, 50 insertions, 3 deletions
diff --git a/core/config/config.php b/core/config/config.php
index 9fe668b8..745fd76b 100644
--- a/core/config/config.php
+++ b/core/config/config.php
@@ -135,3 +135,12 @@ $config['modules'] = array
MODPATH . 'atom',
MODPATH . 'search'
);
+
+/**
+ * Set the global site title.
+ * Valid values are:
+ * FALSE: Use the default, which is the album or image title
+ * A string value that ends with '-' will append the string befor the default value
+ * A string value without a trailing '-' will replace the default value.
+ */
+$config['site_title'] = "Gallery3 Rocks";
diff --git a/core/helpers/core_block.php b/core/helpers/core_block.php
new file mode 100644
index 00000000..aecbde47
--- /dev/null
+++ b/core/helpers/core_block.php
@@ -0,0 +1,35 @@
+<?php defined("SYSPATH") or die("No direct script access.");
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class core_block_Core {
+ public static function head($theme) {
+ $site_title = Kohana::config("core.site_title");
+ $title = $theme->item()->title;
+ if (!empty($site_title)) {
+ if (substr($site_title, -1) == "-") {
+ $title = "$site_title $title";
+ } else {
+ $title = $site_title;
+ }
+ } else {
+ $title = _("Browse Photos") . "::$title";
+ }
+ return "<title>$title</title>";
+ }
+}
diff --git a/core/libraries/Theme.php b/core/libraries/Theme.php
index 19c2dd57..d5af41b4 100644
--- a/core/libraries/Theme.php
+++ b/core/libraries/Theme.php
@@ -82,7 +82,11 @@ class Theme_Core {
case "photo_bottom":
if (empty($this->block_helpers[$function])) {
foreach (module::get_list() as $module) {
- $helper_path = MODPATH . "$module->name/helpers/{$module->name}_block.php";
+ if ($module->name == "core") {
+ $helper_path = APPPATH . "helpers/{$module->name}_block.php";
+ } else {
+ $helper_path = MODPATH . "$module->name/helpers/{$module->name}_block.php";
+ }
$helper_class = "{$module->name}_block";
if (file_exists($helper_path) && method_exists($helper_class, $function)) {
$this->block_helpers[$function][] = $helper_class;
diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php
index 8a93c9dc..886ecb15 100644
--- a/themes/default/views/page.html.php
+++ b/themes/default/views/page.html.php
@@ -4,7 +4,6 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title><?= _("Browse Photos") ?> :: <?= $item->title ?></title>
<link rel="stylesheet" type="text/css" href="<?= url::file("lib/yui/reset-fonts-grids.css") ?>"
media="screen,print,projection" />
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/screen.css") ?>"
@@ -24,7 +23,7 @@
</head>
<body>
- <?= $theme->page_top() ?>
+ <?= $theme->page_top() ?>
<div id="doc4" class="yui-t5 gView">
<div id="hd">
<div id="gHeader">