One common-header.inc to rule them (almost) all.
authorJan Schneider <jan@horde.org>
Thu, 9 Dec 2010 14:59:31 +0000 (15:59 +0100)
committerJan Schneider <jan@horde.org>
Thu, 9 Dec 2010 14:59:31 +0000 (15:59 +0100)
285 files changed:
agora/ban.php
agora/deleteforum.php
agora/editforum.php
agora/forums.php
agora/messages/abuse.php
agora/messages/delete.php
agora/messages/edit.php
agora/messages/index.php
agora/messages/lock.php
agora/messages/merge.php
agora/messages/move.php
agora/messages/split.php
agora/moderate.php
agora/moderators.php
agora/owner.php
agora/search.php
agora/templates/common-header.inc [deleted file]
agora/threads.php
ansel/browse.php
ansel/browse_edit.php
ansel/disclamer.php
ansel/faces/claim.php
ansel/faces/custom.php
ansel/faces/face.php
ansel/faces/gallery.php
ansel/faces/report.php
ansel/faces/search/all.php
ansel/faces/search/image.php
ansel/faces/search/image_define.php
ansel/faces/search/image_search.php
ansel/faces/search/name.php
ansel/faces/search/named.php
ansel/faces/search/owner.php
ansel/gallery.php
ansel/gallery/captions.php
ansel/gallery/sort.php
ansel/group.php
ansel/image.php
ansel/img/ecard.php
ansel/img/upload.php
ansel/lib/Ansel.php
ansel/lib/Application.php
ansel/lib/View/GalleryProperties.php
ansel/protect.php
ansel/report.php
ansel/templates/common-header.inc [deleted file]
ansel/view.php
ansel/xppublish.php
beatnik/editrec.php
beatnik/lib/Beatnik.php
beatnik/listzones.php
beatnik/templates/common-header.inc [deleted file]
beatnik/viewzone.php
chora/annotate.php
chora/browsedir.php
chora/browsefile.php
chora/co.php
chora/commit.php
chora/cvsgraph.php
chora/diff.php
chora/history.php
chora/lib/Chora.php
chora/patchsets.php
chora/stats.php
chora/templates/common-header.inc [deleted file]
folks/account/resetpassword.php
folks/account/signup.php
folks/account/username.php
folks/activity.php
folks/birthday.php
folks/edit/activity.php
folks/edit/comments.php
folks/edit/edit.php
folks/edit/facebook.php
folks/edit/friends/add.php
folks/edit/friends/blacklist.php
folks/edit/friends/for.php
folks/edit/friends/friends.php
folks/edit/friends/from.php
folks/edit/friends/groups.php
folks/edit/friends/index.php
folks/edit/friends/invite.php
folks/edit/friends/know.php
folks/edit/friends/of.php
folks/edit/password.php
folks/edit/privacy.php
folks/friends.php
folks/lib/Application.php
folks/list.php
folks/login.php
folks/new.php
folks/online.php
folks/perms.php
folks/popularity.php
folks/report.php
folks/search.php
folks/services.php
folks/templates/common-header.inc [deleted file]
folks/user.php
gollem/clipboard.php
gollem/edit.php
gollem/manager.php
gollem/permissions.php
gollem/quota.php
gollem/selectlist.php
gollem/templates/common-header.inc [deleted file]
hermes/admin.php
hermes/deliverables.php
hermes/entry.php
hermes/invoicing.php
hermes/search.php
hermes/start.php
hermes/templates/common-header.inc [deleted file]
hermes/time.php
hylax/compose.php
hylax/folder.php
hylax/send.php
hylax/summary.php
hylax/templates/common-header.inc [deleted file]
hylax/view.php
ingo/blacklist.php
ingo/filters.php
ingo/forward.php
ingo/rule.php
ingo/script.php
ingo/spam.php
ingo/templates/common-header.inc [deleted file]
ingo/vacation.php
ingo/whitelist.php
jonah/feed.php
jonah/lib/Application.php
jonah/lib/View/Base.php
jonah/lib/View/ChannelDelete.php
jonah/lib/View/ChannelEdit.php
jonah/lib/View/ChannelList.php
jonah/lib/View/DeliveryHtml.php
jonah/lib/View/StoryDelete.php
jonah/lib/View/StoryEdit.php
jonah/lib/View/StoryList.php
jonah/lib/View/StoryView.php
jonah/lib/View/TagSearchList.php
jonah/stories/share.php
jonah/stories/view.php
jonah/templates/common-header.inc [deleted file]
kronolith/attend.php
kronolith/attendees.php
kronolith/calendars/create.php
kronolith/calendars/delete.php
kronolith/calendars/edit.php
kronolith/calendars/index.php
kronolith/calendars/remote_edit.php
kronolith/calendars/remote_subscribe.php
kronolith/calendars/remote_unsubscribe.php
kronolith/contacts.php
kronolith/data.php
kronolith/day.php
kronolith/event.php
kronolith/lib/Application.php
kronolith/month.php
kronolith/new.php
kronolith/perms.php
kronolith/resources/create.php
kronolith/resources/delete.php
kronolith/resources/edit.php
kronolith/resources/groups/create.php
kronolith/resources/groups/delete.php
kronolith/resources/groups/edit.php
kronolith/resources/groups/index.php
kronolith/resources/index.php
kronolith/search.php
kronolith/templates/common-header.inc [deleted file]
kronolith/week.php
kronolith/workweek.php
kronolith/year.php
luxor/search.php
luxor/source.php
luxor/symbol.php
luxor/templates/common-header.inc [deleted file]
mnemo/data.php
mnemo/lib/Application.php
mnemo/list.php
mnemo/memo.php
mnemo/notepads/create.php
mnemo/notepads/delete.php
mnemo/notepads/edit.php
mnemo/notepads/index.php
mnemo/notes/index.php
mnemo/search.php
mnemo/stickies.php
mnemo/templates/common-header.inc [deleted file]
mnemo/view.php
nag/data.php
nag/lib/Application.php
nag/lib/Nag.php
nag/list.php
nag/search.php
nag/task.php
nag/tasklists/create.php
nag/tasklists/delete.php
nag/tasklists/edit.php
nag/tasklists/index.php
nag/tasks/index.php
nag/templates/common-header.inc [deleted file]
nag/templates/quick.inc [new file with mode: 0644]
nag/view.php
operator/export.php
operator/search.php
operator/templates/common-header.inc [deleted file]
operator/viewgraph.php
passwd/main.php
passwd/templates/common-header.inc [deleted file]
pastie/paste.php
pastie/templates/common-header.inc [deleted file]
pastie/view.php
shout/admin.php
shout/admin/accounts.php
shout/admin/numbers.php
shout/conferences.php
shout/devices.php
shout/dialplan.php
shout/extensions.php
shout/recordings.php
shout/templates/common-header.inc [deleted file]
shout/wizard.php
skeleton/list.php
skeleton/templates/common-header.inc [deleted file]
trean/add.php
trean/browse.php
trean/data.php
trean/edit.php
trean/lib/Application.php
trean/reports.php
trean/search.php
trean/templates/common-header.inc [deleted file]
turba/add.php
turba/addressbooks/create.php
turba/addressbooks/delete.php
turba/addressbooks/edit.php
turba/addressbooks/index.php
turba/contact.php
turba/data.php
turba/delete.php
turba/edit.php
turba/lib/View/Browse.php
turba/minisearch.php
turba/search.php
turba/templates/common-header.inc [deleted file]
vilma/domains/delete.php
vilma/domains/edit.php
vilma/domains/index.php
vilma/templates/common-header.inc [deleted file]
vilma/users/delete.php
vilma/users/edit.php
vilma/users/editAlias.php
vilma/users/editForward.php
vilma/users/index.php
vilma/virtuals/delete.php
vilma/virtuals/edit.php
vilma/virtuals/index.php
whups/admin/index.php
whups/lib/Application.php
whups/lib/Query.php
whups/lib/Ticket.php
whups/mybugs.php
whups/mybugs_edit.php
whups/query/index.php
whups/query/run.php
whups/queue/index.php
whups/reports.php
whups/search.php
whups/templates/common-header.inc [deleted file]
whups/ticket/comment.php
whups/ticket/create.php
whups/ticket/delete.php
whups/ticket/index.php
whups/ticket/queue.php
whups/ticket/type.php
whups/ticket/update.php
whups/ticket/watch.php
wicked/diff.php
wicked/display.php
wicked/history.php
wicked/lib/Application.php
wicked/preview.php
wicked/templates/common-header.inc [deleted file]

index e8d057f..9ee1357 100644 (file)
@@ -71,6 +71,6 @@ $view->notify = Horde::endBuffer();
 $view->banned = $banned;
 $view->forum = $forums->getForum();
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('ban.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index f0e778b..e63b283 100644 (file)
@@ -79,6 +79,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $view->notify = Horde::endBuffer();
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('main.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 7185cac..c7a81a3 100644 (file)
@@ -67,6 +67,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $view->notify = Horde::endBuffer();
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('main.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 331ed54..61aa47f 100644 (file)
@@ -72,6 +72,7 @@ $pager_ob->preserve('scope', $scope);
 $view->pager_link = $pager_ob->render();
 
 $title = _("All Forums");
-require AGORA_TEMPLATES . '/common-header.inc';
+$linkTags = array('<link rel="alternate" title="' . _("Forums") . '" href="' . Horde::url('rss/index.php', true, -1)->add('scope', $scope) . '" type="application/rss+xml" />');
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('forums.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 4f6b9ab..d29f47f 100644 (file)
@@ -98,6 +98,6 @@ $view->message_author = $message['message_author'];
 $view->message_date = strftime($prefs->getValue('date_format'), $message['message_timestamp']);
 $view->message_body = Agora_Messages::formatBody($message['body']);
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('messages/form.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index d5d6ca6..9831d3e 100644 (file)
@@ -83,6 +83,6 @@ Horde::startBuffer();
 $form->renderActive(null, $vars, 'delete.php', 'post');
 $view->formbox = Horde::endBuffer();
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('messages/form.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 817489c..3e93e45 100644 (file)
@@ -122,6 +122,6 @@ Horde::startBuffer();
 $form->renderActive(null, $vars, 'edit.php', 'post');
 $view->formbox = Horde::endBuffer();
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('messages/edit.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index cf9e56a..1bed3c6 100644 (file)
@@ -211,6 +211,6 @@ if (!$messages->hasPermission(Horde_Perms::EDIT)) {
 
 Horde::addScriptFile('hideable.js', 'horde', true);
 Horde::addScriptFile('stripe.js', 'horde', true);
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render($template_file);
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index c39eb31..8f8402a 100644 (file)
@@ -80,6 +80,6 @@ $view->message_author = $message['message_author'];
 $view->message_date = strftime($prefs->getValue('date_format'), $message['message_timestamp']);
 $view->message_body = Agora_Messages::formatBody($message['body']);
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('messages/form.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index bff2949..9a5aa0d 100644 (file)
@@ -87,6 +87,6 @@ $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_body = Agora_Messages::formatBody($message['body']);
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('main.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index a90ed94..27484a0 100644 (file)
@@ -73,6 +73,6 @@ $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_body = Agora_Messages::formatBody($message['body']);
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('messages/edit.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 7f78a63..de863c1 100644 (file)
@@ -69,6 +69,6 @@ $view->message_subject = $message['message_subject'];
 $view->message_author = $message['message_author'];
 $view->message_body = Agora_Messages::formatBody($message['body']);
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('messages/edit.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 28f7778..80087ad 100644 (file)
@@ -80,7 +80,7 @@ if (isset($api_call)) {
     $title = _("Messages Awaiting Moderation");
     $view->menu = Horde::menu();
     Horde::addScriptFile('stripe.js', 'horde', true);
-    require AGORA_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     echo $view->render('moderate.html.php');
     require $registry->get('templates', 'horde') . '/common-footer.inc';
 }
index 903d69a..aa8211d 100644 (file)
@@ -88,6 +88,6 @@ $view->notify = Horde::endBuffer();
 $view->forums = $forums_list;
 
 Horde::addScriptFile('stripe.js', 'horde', true);
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('moderators.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 02bafe3..8a32246 100644 (file)
@@ -21,7 +21,7 @@ $owner = $registry->isAdmin() ? Horde_Util::getGet('owner', $registry->getAuth()
 $sort_by = Agora::getSortBy('threads');
 $sort_dir = Agora::getSortDir('threads');
 
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
index 18081b7..33f0a9f 100644 (file)
@@ -71,6 +71,6 @@ $form->renderActive(null, $vars, 'search.php', 'get');
 $view->searchForm = Horde::endBuffer();
 
 $title = _("Search Forums");
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('search.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/agora/templates/common-header.inc b/agora/templates/common-header.inc
deleted file mode 100644 (file)
index 8fab3b2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Agora: Copyright 2002-2010 The Horde Project.  Agora is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Agora: http://www.horde.org/agora/    -->
-<!--               Horde Licenses: http://www.horde.org/licenses/                   -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link rel="alternate" title="<?php echo _("Forums") ?>" href="<?php echo Horde_Util::addParameter(Horde::url('rss/index.php', true, -1), 'scope', $scope) ?>" type="application/rss+xml" />
-</head>
-
-<body>
index b80ca5a..449ac68 100644 (file)
@@ -76,6 +76,6 @@ $pager_ob->preserve('agora', Horde_Util::getFormData('agora'));
 $view->pager_link = $pager_ob->render();
 
 $title = sprintf(_("Threads in %s"), $forum_array['forum_name']);
-require AGORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $view->render('threads.html.php');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index ae017ad..36b851b 100644 (file)
@@ -18,7 +18,7 @@ $layout = new Horde_Block_Layout_View(
 $layout_html = $layout->toHtml();
 $title = _("Photo Galleries");
 Ansel_Search_Tag::clearSearch();
-require ANSEL_BASE . '/templates/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 echo '<div id="menuBottom"><a href="' . Horde::url('browse_edit.php') . '">' . _("Add Content") . '</a></div><div class="clear">&nbsp;</div>';
index 4cfaa48..de1bc40 100644 (file)
@@ -23,7 +23,7 @@ if ($layout->updated()) {
 }
 
 $title = _("My Photos :: Add Content");
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require $registry->get('templates', 'horde') . '/portal/edit.inc';
index a414c5d..b45396a 100644 (file)
@@ -41,7 +41,7 @@ if ($form->isSubmitted()) {
     }
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 $form->renderActive(null, null, null, 'post');
index 3aef198..f80e910 100644 (file)
@@ -62,7 +62,7 @@ if ($form->validate()) {
     exit;
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 $form->renderActive(null, null, null, 'post');
index 95ac574..bb5905d 100644 (file)
@@ -75,7 +75,7 @@ Horde::addScriptFile('stripe.js', 'horde');
 
 $injector->getInstance('Horde_Themes_Css')->addThemeStylesheet('cropper.css');
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require ANSEL_TEMPLATES . '/faces/custom.inc';
index 4c4e534..0884dd2 100644 (file)
@@ -28,7 +28,7 @@ try {
 
 $title = _("Face") . ' :: ' . $face['face_name'];
 $facename = htmlspecialchars($face['face_name']);
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require_once ANSEL_TEMPLATES . '/faces/face.inc';
index c684f26..301138b 100644 (file)
@@ -59,7 +59,7 @@ $pager->preserve('gallery',  $gallery_id);
 $title = sprintf(_("Searching for faces in %s"),Ansel::getUrlFor('view', array('gallery' => $gallery_id, 'view' => 'Gallery'))->link() . $gallery->get('name') . '</a>');
 Horde::addScriptFile('stripe.js', 'horde');
 Horde::addScriptFile('popup.js', 'horde');
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require ANSEL_TEMPLATES . '/faces/gallery.inc';
index c6c7e26..1ac306c 100644 (file)
@@ -65,7 +65,7 @@ if ($form->validate()) {
     exit;
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 $form->renderActive(null, null, null, 'post');
index 34df035..d5579ee 100644 (file)
@@ -33,7 +33,7 @@ $pager = new Horde_Core_Ui_Pager(
     )
 );
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 include ANSEL_TEMPLATES . '/faces/faces.inc';
index 3fb3bdb..69f4737 100644 (file)
@@ -59,7 +59,7 @@ if ($form->validate()) {
 }
 
 $title = _("Upload face photo");
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 echo $tabs->render(Horde_Util::getGet('search_faces', 'image'));
index a6f5e78..b6cb1bd 100644 (file)
@@ -52,7 +52,7 @@ Horde::addScriptFile('builder.js', 'horde');
 Horde::addScriptFile('cropper.js', 'ansel');
 Horde::addScriptFile('stripe.js', 'horde');
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require ANSEL_TEMPLATES . '/faces/define.inc';
index 24a8a90..1d558a5 100644 (file)
@@ -51,7 +51,7 @@ $pager = new Horde_Core_Ui_Pager(
     )
 );
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require ANSEL_TEMPLATES . '/faces/search.inc';
index 0e0387b..67f59b4 100644 (file)
@@ -41,7 +41,7 @@ $pager = new Horde_Core_Ui_Pager(
             'perpage' => $perpage));
 
 $title = _("Search by name");
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 include ANSEL_TEMPLATES . '/faces/faces.inc';
index f225a1f..a91a335 100644 (file)
@@ -33,7 +33,7 @@ $pager = new Horde_Core_Ui_Pager(
     )
 );
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 include ANSEL_TEMPLATES . '/faces/faces.inc';
index d4788cd..10a2e0b 100644 (file)
@@ -42,7 +42,7 @@ $pager = new Horde_Core_Ui_Pager(
     )
 );
 $pager->preserve('owner', $owner);
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 include ANSEL_TEMPLATES . '/faces/faces.inc';
index 53a63b4..a6b4f4f 100644 (file)
@@ -52,7 +52,7 @@ case 'empty':
     if ($galleryId) {
         try {
             $gallery = $GLOBALS['injector']->getInstance('Ansel_Injector_Factory_Storage')->create()->getGallery($galleryId);
-            require ANSEL_TEMPLATES . '/common-header.inc';
+            require $registry->get('templates', 'horde') . '/common-header.inc';
             echo Horde::menu();
             $notification->notify(array('listeners' => 'status'));
             require ANSEL_TEMPLATES . '/gallery/delete_confirmation.inc';
index bdbd95a..ab99fb7 100644 (file)
@@ -56,7 +56,7 @@ case 'save':
 }
 
 $title = _("Caption Editor");
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require ANSEL_TEMPLATES . '/captions/captions.inc';
index 38f705d..f57bee8 100644 (file)
@@ -65,7 +65,7 @@ Horde::addScriptFile('effects.js', 'horde');
 Horde::addScriptFile('dragdrop.js', 'horde');
 
 $title = sprintf(_("%s :: Sort"), $gallery->get('name'));
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 ?>
index dbad014..8210358 100644 (file)
@@ -82,7 +82,7 @@ if ($groupby !== 'none') {
     $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'none'))->link() . _("none") . '</a>';
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require ANSEL_TEMPLATES . '/group/header.inc';
index 56701a7..6b6aa29 100644 (file)
@@ -153,7 +153,7 @@ case 'modify':
     $vars->set('image_originalDate', $image->originalDate);
     $vars->set('image_uploaded', $image->uploaded);
 
-    require ANSEL_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     $form->renderActive($renderer, $vars, 'image.php', 'post', 'multipart/form-data');
     require $registry->get('templates', 'horde') . '/common-footer.inc';
     exit;
@@ -336,7 +336,7 @@ case 'resizeedit':
         Horde::addScriptFile('dragdrop.js', 'horde');
    }
 
-    require ANSEL_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     echo Horde::menu();
     $notification->notify(array('listeners' => 'status'));
 
@@ -469,7 +469,7 @@ case 'setwatermark':
     $form = new Ansel_Form_Watermark($vars, _("Watermark"));
     $renderer = new Horde_Form_Renderer();
 
-    require ANSEL_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     $form->renderActive($renderer, $vars, 'image.php', 'post');
     require $registry->get('templates', 'horde') . '/common-footer.inc';
     exit;
@@ -509,7 +509,7 @@ case 'previewrotate270':
                      $gallery->get('name'),
                      $image->filename);
 
-    require ANSEL_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     echo Horde::menu();
     require ANSEL_TEMPLATES . '/image/preview_image.inc';
     require $registry->get('templates', 'horde') . '/common-footer.inc';
@@ -736,7 +736,7 @@ case 'previewcrop':
 
         $params = $x1 . '.' . $y1 . '.' . $x2 . '.' . $y2;
 
-        require ANSEL_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         echo Horde::menu();
         require ANSEL_TEMPLATES . '/image/preview_cropimage.inc';
         require $registry->get('templates', 'horde') . '/common-footer.inc';
@@ -759,7 +759,7 @@ default:
     exit;
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $form->renderActive($renderer, $vars, 'image.php', 'post',
                     'multipart/form-data');
index 73e8b70..b0a7e67 100644 (file)
@@ -99,7 +99,7 @@ if ($editor->supportedByBrowser()) {
     $form->addHidden('', 'rtemode', 'text', false);
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 $notification->notify(array('listeners' => 'status'));
 $form->renderActive($renderer, $vars, 'ecard.php', 'post', 'multipart/form-data');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 59d319e..0a03adb 100644 (file)
@@ -41,7 +41,7 @@ $view->run();
 $nojs = $view->handleNoJs();
 
 $title = _("Add Photo");
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 echo '<div class="header" id="galleryHeader"><span class="breadcrumbs">' . Ansel::getBreadCrumbs($gallery) . '</span></div>';
 require ANSEL_TEMPLATES . '/image/plupload.inc';
index d0b6db8..44433e4 100644 (file)
@@ -18,17 +18,6 @@ class Ansel
     const SORT_DESCENDING = 1;
 
     /**
-     * Build initial Ansel javascript object.
-     *
-     * @return string
-     */
-    static public function initJSVars()
-    {
-        $code = array('Ansel = {ajax: {}, widgets: {}}');
-        return $code;
-    }
-
-    /**
      * Create and initialize the database object.
      *
      * @return mixed MDB2 object
index e5cd0de..e8ccb00 100644 (file)
@@ -82,6 +82,9 @@ class Ansel_Application extends Horde_Registry_Application
 
         /* Set a logger for the Vfs */
         $GLOBALS['injector']->getInstance('Horde_Core_Factory_Vfs')->create('images')->setLogger($GLOBALS['injector']->getInstance('Horde_Log_Logger'));
+
+        /* Build initial Ansel javascript object. */
+        Horde::addInlineJsVars(array('var Ansel' => array('ajax' => new stdClass, 'widgets' => new stdClass)));
     }
 
     /**
index 3356f9f..c990926 100644 (file)
@@ -117,7 +117,7 @@ class Ansel_View_GalleryProperties
             'slug' => $this->_properties['slug']
         ));
 
-        require ANSEL_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         echo Horde::menu();
         $GLOBALS['notification']->notify(array('listeners' => 'status'));
         echo $view->render('properties');
index b640afc..eb36f60 100644 (file)
@@ -38,7 +38,7 @@ if ($form->validate()) {
         exit;
     }
 }
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 echo '<div class="header">' . Ansel::getBreadCrumbs() . '</div>';
index 0a1a338..1e8d5ad 100644 (file)
@@ -81,7 +81,7 @@ if ($form->validate()) {
     exit;
 }
 
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 $form->renderActive(null, null, null, 'post');
diff --git a/ansel/templates/common-header.inc b/ansel/templates/common-header.inc
deleted file mode 100644 (file)
index 5b1ea0b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!--  Ansel: Copyright 2001-2010 The Horde Project.  Ansel is under the GPL.   -->
-<!-- Horde Project: http://www.horde.org/ | Ansel: http://www.horde.org/ansel/ -->
-<!--        GNU Public License: http://www.fsf.org/copyleft/gpl.html           -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-echo Horde::wrapInlineScript(Ansel::initJSVars());
-Horde::outputInlineScript();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index 79adfa1..ac43c5b 100644 (file)
@@ -39,7 +39,7 @@ $params['image_id'] = Horde_Util::getFormData('image');
 try {
     $view = new $view($params);
 } catch (Horde_Exception $e) {
-    require ANSEL_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     echo Horde::menu();
     $notification->notify(array('listeners' => 'status'));
     echo '<br /><em>' . htmlspecialchars($e->getMessage()) . '</em>';
@@ -48,7 +48,7 @@ try {
 }
 
 $title = $view->getTitle();
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 $view_html = $view->html();
index 45e67a1..effe1c8 100644 (file)
@@ -29,7 +29,7 @@ $PUBLISH_ONNEXT = '';
 $PUBLISH_CMD = '';
 
 $title = sprintf(_("Publish to %s"), $registry->get('name'));
-require ANSEL_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 // Check for a login.
 if ($cmd == 'login') {
index 6b7ec57..7c0bd02 100644 (file)
@@ -46,7 +46,8 @@ if ($form->validate($vars)) {
 }
 
 $title = $form->getTitle();
-require BEATNIK_TEMPLATES . '/common-header.inc';
+Beatnik::notifyCommits();
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require BEATNIK_TEMPLATES . '/menu.inc';
 
 $form->renderActive(null, null, $url, 'post');
index 9ff718d..fec557d 100644 (file)
@@ -453,6 +453,17 @@ class Beatnik {
         }
     }
 
+    function notifyCommits()
+    {
+        // This check has to come after the page has finished all work in case
+        // the status has changed due to a now-completed edit.
+        if (count(Beatnik::needCommit())) {
+            foreach (Beatnik::needCommit() as $domain) {
+                $GLOBLAS['notification']->push(sprintf(_("You have uncommitted changes in %s."), $domain));
+            }
+        }
+    }
+
     /**
      * Checks for the given permissions for the current user on the given
      * permissions node.  Optionally check for the requested permssion for a
index dfaaad5..babd460 100644 (file)
@@ -50,7 +50,8 @@ Horde::addScriptFile('beatnik.js');
 Horde::addScriptFile('stripe.js', 'horde');
 
 // Initialization complete.  Render the page.
-require BEATNIK_TEMPLATES . '/common-header.inc';
+Beatnik::notifyCommits();
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require BEATNIK_TEMPLATES . '/menu.inc';
 
 require BEATNIK_TEMPLATES . '/listzones/header.inc';
diff --git a/beatnik/templates/common-header.inc b/beatnik/templates/common-header.inc
deleted file mode 100644 (file)
index 73ce085..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * Copyright 2005-2007 Ben Klang <ben@alkaloid.net>
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-// This check has to come after the page has finished all work in case the
-// status has changed due to a now-completed edit.
-if (count(Beatnik::needCommit())) {
-    foreach(Beatnik::needCommit() as $domain) {
-        $notification->push(sprintf(_("You have uncommitted changes in %s."), $domain));
-    }
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!--    Beatnik Copyright 2005-2007, Ben Klang <ben@alkaloid.net> -->
-<!--    Horde Project: http://www.horde.org/                       -->
-<!--    Beatnik: http://projects.alkaloid.net/                     -->
-<!--    Horde Licenses: http://www.horde.org/licenses/             -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-<body>
index bae137c..a0b3aa1 100644 (file)
@@ -18,7 +18,8 @@ try {
 
 $title = $_SESSION['beatnik']['curdomain']['zonename'];
 Horde::addScriptFile('stripe.js', 'horde');
-require BEATNIK_TEMPLATES . '/common-header.inc';
+Beatnik::notifyCommits();
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require BEATNIK_TEMPLATES . '/menu.inc';
 
 // Get a list of all the fields for all record typess we'll be processing
index 254926a..74b634b 100644 (file)
@@ -48,13 +48,12 @@ $extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
                      Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
 
 Horde::addScriptFile('annotate.js', 'chora');
-
-$js_vars = array(
+Horde::addInlineJsVars(array('var Chora' => array(
     'ANNOTATE_URL' => (string)Horde::url('annotate.php', true)->add(array('actionID' => 'log', 'f' => $where, 'rev' => '')),
     'loading_text' => _("Loading...")
-);
+)));
 
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/annotate/header.inc';
index db27e48..dae1f92 100644 (file)
@@ -67,7 +67,7 @@ $printAllCols = count($fileList);
 $sortdirclass = $acts['sbt'] ? 'sortdown' : 'sortup';
 
 Horde::addScriptFile('tables.js', 'horde');
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/directory/header.inc';
index d2b6fde..195413d 100644 (file)
@@ -50,7 +50,7 @@ if ($VC->hasFeature('branches')) {
 Horde::addScriptFile('tables.js', 'horde');
 Horde::addScriptFile('quickfinder.js', 'horde');
 Horde::addScriptFile('revlog.js', 'chora');
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/log/header.inc';
index 0580494..e475ddd 100644 (file)
@@ -95,7 +95,7 @@ if (!$plain) {
     $extraLink = _("View:") . ' ' . implode(' | ', $views);
 
     Horde::addScriptFile('stripe.js', 'horde');
-    require CHORA_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     require CHORA_TEMPLATES . '/menu.inc';
     require CHORA_TEMPLATES . '/headerbar.inc';
     require CHORA_TEMPLATES . '/checkout/checkout.inc';
index 1d8e542..4d8b1e5 100644 (file)
@@ -42,7 +42,7 @@ $patchset = current($patchsets);
 header('Cache-Control: max-age=604800');
 
 Horde::addScriptFile('tables.js', 'horde');
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/patchsets/ps_single.inc';
index 872d6ac..31334f3 100644 (file)
@@ -53,7 +53,7 @@ if (Horde_Util::getFormData('show_image')) {
 $title = sprintf(_("Graph for %s"), $injector->getInstance('Horde_Core_Factory_TextFilter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)));
 $extraLink = Chora::getFileViews($where, 'cvsgraph');
 
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 
index 3d22110..934e1a9 100644 (file)
@@ -62,7 +62,7 @@ foreach ($VC->getRevisionRange($fl, $r1, $r2) as $val) {
 }
 
 Horde::addScriptFile('stripe.js', 'horde');
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/diff/header.inc';
index 61e04ee..eb3dc29 100644 (file)
@@ -129,7 +129,7 @@ foreach ($grid as $cols) {
 $title = sprintf(_("Source Branching View for %s"), $injector->getInstance('Horde_Core_Factory_TextFilter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)));
 $extraLink = Chora::getFileViews($where, 'history');
 
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/history/header.inc';
index e0b84df..8f6bb9d 100644 (file)
@@ -89,7 +89,7 @@ class Chora
         }
 
         $GLOBALS['notification']->push($message, 'horde.error');
-        require CHORA_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require CHORA_TEMPLATES . '/menu.inc';
         require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc';
         exit;
index 1093bf1..6b61eac 100644 (file)
@@ -44,7 +44,7 @@ $extraLink = Chora::getFileViews($where, 'patchsets');
 
 Horde::addScriptFile('tables.js', 'horde');
 Horde::addScriptFile('quickfinder.js', 'horde');
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/patchsets/header_table.inc';
index a6c0dcc..5535558 100644 (file)
@@ -31,7 +31,7 @@ arsort($stats);
 
 $title = sprintf(_("Statistics for %s"), $injector->getInstance('Horde_Core_Factory_TextFilter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)));
 Horde::addScriptFile('tables.js', 'horde');
-require CHORA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
 require CHORA_TEMPLATES . '/headerbar.inc';
 require CHORA_TEMPLATES . '/stats/stats.inc';
diff --git a/chora/templates/common-header.inc b/chora/templates/common-header.inc
deleted file mode 100644 (file)
index 7bb0337..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php
-echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html><head>';
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title = $title . ' - ' . $page_title;
-}
-
-Horde::outputMetaTags();
-
-if (Horde_Util::nonInputVar('js_vars')) {
-    Horde::addInlineScript('var Chora = ' . Horde_Serialize::serialize($js_vars, Horde_Serialize::JSON));
-}
-
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index f216d2c..bc6be61 100644 (file)
@@ -97,7 +97,7 @@ if ($form->validate()) {
     }
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 require FOLKS_TEMPLATES . '/login/signup.php';
index 25a21d6..475f2ea 100644 (file)
@@ -50,7 +50,7 @@ if ($form->validate()) {
 }
 
 $title = _("Sign up");
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 require FOLKS_TEMPLATES . '/login/signup.php';
index 583167c..53940ba 100644 (file)
@@ -45,7 +45,7 @@ if ($form->validate()) {
     }
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 require FOLKS_TEMPLATES . '/login/signup.php';
index d9aa49d..8c11b5a 100644 (file)
@@ -41,7 +41,7 @@ $list_url = Folks::getUrlFor('list', 'activity');
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/list/list.php';
 
index 8dd0922..509950b 100644 (file)
@@ -53,7 +53,7 @@ $list_url = Folks::getUrlFor('list', 'birthday');
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 require FOLKS_TEMPLATES . '/list/list.php';
index 2e9e858..729d04b 100644 (file)
@@ -51,7 +51,7 @@ $delete_url = Horde::url('edit/activity.php');
 $delete_img = Horde::img('delete.png');
 
 Horde::addScriptFile('tables.js', 'horde');
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('activity');
index 7caac64..2a5443a 100644 (file)
@@ -83,7 +83,7 @@ if (!$form->isSubmitted()) {
 }
 
 Horde::addScriptFile('tables.js', 'horde');
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('comments');
index 08d0635..ac7175b 100644 (file)
@@ -93,7 +93,7 @@ if ($form->validate()) {
 
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('edit');
index b49689a..4aed068 100644 (file)
@@ -31,7 +31,7 @@ try {
     Horde::url('user.php')->redirect();
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 echo $tabs->render('facebook');
 echo $block;
index 8726871..ba0a0ae 100644 (file)
@@ -63,7 +63,7 @@ if ($user) {
 $friend_form = new Folks_AddFriend_Form($vars, _("Add or remove user"), 'blacklist');
 
 Horde::addScriptFile('tables.js', 'horde');
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 echo $tabs->render('add');
 require FOLKS_TEMPLATES . '/edit/header.php';
index 422cd59..2987bfd 100644 (file)
@@ -76,7 +76,7 @@ $actions = array(
 
 $friend_form = new Folks_AddFriend_Form($vars, _("Add or remove user"), 'blacklist');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('blacklist');
index 132f268..394dde7 100644 (file)
@@ -48,7 +48,7 @@ if ($registry->hasInterface('letter')) {
                         'name' => _("Send message"));
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friendsof');
index d5c9bf3..219b73e 100644 (file)
@@ -45,7 +45,7 @@ if ($registry->hasInterface('letter')) {
                         'name' => _("Send message"));
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
index 9ee7cee..551eb41 100644 (file)
@@ -40,7 +40,7 @@ if ($registry->hasInterface('letter')) {
                         'name' => _("Send message"));
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friendsof');
index 25f10ea..3239dbd 100644 (file)
@@ -114,7 +114,7 @@ $perms_img = Horde::img('perms.png');
 $members_url = Horde::url('edit/friends/friends.php');
 $members_img = Horde::img('group.png');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('groups');
index 5ab2ab4..4c1ba52 100644 (file)
@@ -44,7 +44,7 @@ if ($registry->hasInterface('letter')) {
                         'name' => _("Send message"));
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
index c5d6094..8f3edfc 100644 (file)
@@ -50,7 +50,7 @@ if ($form->validate()) {
     }
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
index fc4272c..67f5d36 100644 (file)
@@ -44,7 +44,7 @@ if ($registry->hasInterface('letter')) {
                         'name' => _("Send message"));
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
index 9ee54ee..be7075b 100644 (file)
@@ -40,7 +40,7 @@ if ($registry->hasInterface('letter')) {
                         'name' => _("Send message"));
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friendsof');
index e29dc2f..32ea794 100644 (file)
@@ -187,7 +187,7 @@ if (!$prefs->isLocked('security_question')) {
 $v = &$form_security->addVariable(_("Security answer"), 'security_answer', 'text', true);
 $v->setDefault($prefs->getValue('security_answer'));
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('password');
index 54fa66b..9118e9f 100644 (file)
@@ -67,7 +67,7 @@ if ($form->validate()) {
 
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 echo $tabs->render('privacy');
 $form->renderActive(null, null, null, 'post');
index 668aa77..d059d7d 100644 (file)
@@ -65,7 +65,7 @@ if ($activities instanceof PEAR_Error) {
 }
 
 Horde::addScriptFile('stripe.js', 'horde');
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/friends/friends.php';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index afedc33..4dbd806 100644 (file)
@@ -12,6 +12,27 @@ class Folks_Application extends Horde_Registry_Application
     public $version = 'H4 (0.1-git)';
 
     /**
+     * Initialization function.
+     *
+     * Global variables defined:
+     * - $linkTags: <link> tags for common-header.inc.
+     */
+    protected function _init()
+    {
+        $links = array(Folks::getUrlFor('feed', 'online') => _("Online users"));
+        if ($GLOBALS['registry']->isAuthenticated()) {
+            $links[Folks::getUrlFor('feed', 'friends')] = _("Online friends");
+            $links[Folks::getUrlFor('feed', 'activity')] = _("Friends activity");
+            $links[Folks::getUrlFor('feed', 'know')] = _("People you might know");
+        }
+
+        $GLOBALS['linkTags'] = array();
+        foreach ($links as $url => $label) {
+            $GLOBALS['linkTags'][] = '<link rel="alternate" type="application/rss+xml" href="' . $url . '" title="' . $label . '" />';
+        }
+    }
+
+    /**
      * Add additional items to the menu.
      *
      * @param Horde_Menu $menu  The menu object.
index 3b07e0c..fda0b58 100644 (file)
@@ -53,7 +53,7 @@ $list_url = Folks::getUrlFor('list', 'list');
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/list/list.php';
 
index 3045173..bb25efa 100644 (file)
@@ -228,7 +228,7 @@ if ($form->isSubmitted()) {
     exit;
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 require FOLKS_TEMPLATES . '/login/login.php';
index bec0f71..99f4ded 100644 (file)
@@ -41,7 +41,7 @@ $list_url = Folks::getUrlFor('list', 'new');
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/list/list.php';
 
index dd85be3..17a02d7 100644 (file)
@@ -53,7 +53,7 @@ $list_url = Folks::getUrlFor('list', 'online');
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 require FOLKS_TEMPLATES . '/list/list.php';
index 7eda282..3b46410 100644 (file)
@@ -243,7 +243,7 @@ try {
     Horde::logMessage($e, 'NOTICE');
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 $notification->notify(array('listeners' => 'status'));
 require $registry->get('templates', 'horde') . '/shares/edit.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index e493659..a2ce231 100644 (file)
@@ -40,7 +40,7 @@ $pager->preserve($criteria);
 $list_url = Folks::getUrlFor('list', 'popularity');
 
 Horde::addScriptFile('stripe.js', 'horde');
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/list/list.php';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 20b059c..6fb7b1b 100644 (file)
@@ -62,7 +62,7 @@ if ($form->validate()) {
     Folks::getUrlFor('user', $user)->redirect();
 }
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 $form->renderActive(null, null, null, 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 7637330..f2e23a3 100644 (file)
@@ -87,7 +87,7 @@ Horde::addScriptFile('effects.js', 'horde');
 Horde::addScriptFile('redbox.js', 'horde');
 Horde::addScriptFile('search.js', 'folks');
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/list/list.php';
 
index 19d4245..3153651 100644 (file)
@@ -22,7 +22,7 @@ foreach ($registry->listApps() as $app) {
 }
 asort($apps);
 
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 require FOLKS_TEMPLATES . '/services/services.php';
 
diff --git a/folks/templates/common-header.inc b/folks/templates/common-header.inc
deleted file mode 100644 (file)
index e3fc6bc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Folks: Copyright 2008 Obala d.o.o.. www.obala.si     -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'online') ?>" title="<?php echo _("Online users") ?>" />
-<?php if ($GLOBALS['registry']->isAuthenticated()): ?>
-<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'friends') ?>" title="<?php echo _("Online friends") ?>" />
-<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'activity') ?>" title="<?php echo _("Friends activity") ?>" />
-<link rel="alternate" type="application/rss+xml" href="<?php echo Folks::getUrlFor('feed', 'know') ?>" title="<?php echo _("People you might know") ?>" />
-<?php endif; ?>
-</head>
-
-<body>
index 3123469..dc33b00 100644 (file)
@@ -62,7 +62,7 @@ if ($user == $GLOBALS['registry']->getAuth()) {
 Horde::addScriptFile('stripe.js', 'horde');
 
 $title = sprintf(_("%s's profile"), $user);
-require FOLKS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 switch ($profile['user_status']) {
index 85feaba..b7214cb 100644 (file)
@@ -44,7 +44,8 @@ $template->set('entry', $entry, true);
 $title = _("Clipboard");
 Horde::addScriptFile('tables.js', 'horde');
 $menu = Gollem::menu();
-require GOLLEM_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require GOLLEM_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 Gollem::status();
 echo $template->fetch(GOLLEM_TEMPLATES . '/clipboard/clipboard.html');
index 3e55c00..2df587b 100644 (file)
@@ -55,7 +55,8 @@ case 'edit_file':
     if ($mime_type == 'text/html') {
         $injector->getInstance('Horde_Editor')->initialize(array('id' => 'content'));
     }
-    require GOLLEM_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
+require GOLLEM_TEMPLATES . '/javascript_defs.php';
     Gollem::status();
     require GOLLEM_TEMPLATES . '/edit/edit.inc';
     require $registry->get('templates', 'horde') . '/common-footer.inc';
index 2f3c184..e4cfdf2 100644 (file)
@@ -587,7 +587,8 @@ Horde::addInlineJsVars(array(
 ));
 
 $menu = Gollem::menu();
-require GOLLEM_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require GOLLEM_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 Gollem::status();
 echo $template->fetch(GOLLEM_TEMPLATES . '/manager/manager.html');
index 0021031..9451a26 100644 (file)
@@ -21,7 +21,8 @@ if (!Gollem::getBackends('all')) {
 
     $title = _("Gollem Backend Permissions Administration");
     $menu = Gollem::menu();
-    require GOLLEM_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
+require GOLLEM_TEMPLATES . '/javascript_defs.php';
     echo $menu;
     Gollem::status();
     require $registry->get('templates', 'horde') . '/common-footer.inc';
index 67c4164..d1bbb42 100644 (file)
@@ -54,7 +54,8 @@ if ($gollem_be['quota_val'] > -1) {
 }
 
 $title = _("Quota Display");
-require GOLLEM_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require GOLLEM_TEMPLATES . '/javascript_defs.php';
 if (!$isPopup) {
     Gollem::menu();
     Gollem::status();
index bd9c881..2ec70f4 100644 (file)
@@ -196,7 +196,8 @@ Horde::addInlineJsVars(array(
     'cacheid' => $cacheid,
     'formid' => $formid
 ));
-require GOLLEM_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require GOLLEM_TEMPLATES . '/javascript_defs.php';
 Gollem::status();
 echo $t->fetch(GOLLEM_TEMPLATES . '/selectlist/selectlist.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/gollem/templates/common-header.inc b/gollem/templates/common-header.inc
deleted file mode 100644 (file)
index 0acaf00..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php
-echo !empty($language)
-    ? '<html lang="' . strtr($language, '_', '-') . '">'
-    : '<html>';
-?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-Horde::outputInlineScript();
-
-require GOLLEM_TEMPLATES . '/javascript_defs.php';
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index 63ea8c0..6bd036c 100644 (file)
@@ -30,7 +30,7 @@ function _open()
         $opened = true;
         $beendone = true;
         $title = _("Administration");
-        require HERMES_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require HERMES_TEMPLATES . '/menu.inc';
     }
 }
index 3983b0b..17552d4 100644 (file)
@@ -55,7 +55,7 @@ case 'deletedeliverable':
 }
 
 $title = _("Deliverables");
-require HERMES_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require HERMES_TEMPLATES . '/menu.inc';
 
 $renderer = new Horde_Form_Renderer();
index 0c4fb2c..f2b0349 100644 (file)
@@ -88,7 +88,7 @@ default:
 $form->setCostObjects($vars);
 
 $title = $vars->exists('id') ? _("Edit Time") : _("New Time");
-require HERMES_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require HERMES_TEMPLATES . '/menu.inc';
 $form->renderActive(new Horde_Form_Renderer(), $vars, 'entry.php', 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 1051f54..41567a8 100644 (file)
@@ -123,7 +123,7 @@ if ($form->validate()) {
     Horde::url('time.php')->redirect();
 }
 
-require HERMES_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require HERMES_TEMPLATES . '/menu.inc';
 
 $renderer = new Horde_Form_Renderer(array('varrenderer_driver' => 'tableset_html'));
index 1f73a28..09b671b 100644 (file)
@@ -88,7 +88,7 @@ $print_view = (bool)$vars->get('print');
 if (!$print_view) {
     Horde::addScriptFile('popup.js', 'horde', true);
 }
-require HERMES_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 if (!($searchVars = $session->get('hermes', 'search_criteria'))) {
     $searchVars = $vars;
index e068416..9daef38 100644 (file)
@@ -40,7 +40,7 @@ if ($form->validate($vars)) {
 }
 
 $title = _("Stop Watch");
-require HERMES_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 $renderer = new Horde_Form_Renderer();
 $form->renderActive($renderer, $vars, 'start.php', 'post');
diff --git a/hermes/templates/common-header.inc b/hermes/templates/common-header.inc
deleted file mode 100644 (file)
index 15eaab2..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Hermes: Copyright 2002-2009 The Horde Project. Hermes is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Hermes: http://www.horde.org/hermes/    -->
-<!--                Horde Licenses: http://www.horde.org/licenses/                    -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon()
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
index 4ce0438..2663045 100644 (file)
@@ -73,7 +73,7 @@ $print_view = (Horde_Util::getFormData('print') == 'true');
 if (!$print_view) {
     Horde::addScriptFile('popup.js', 'horde', true);
 }
-require HERMES_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 if ($print_view) {
     require $registry->get('templates', 'horde') . '/javascript/print.js';
index 1d7bd1f..91088d5 100644 (file)
@@ -54,7 +54,7 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require HYLAX_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/compose/compose.html');
 
 $renderer = new Horde_Form_Renderer();
index 9764381..bcb0ef3 100644 (file)
@@ -99,6 +99,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require HYLAX_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/folder/folder.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 9cab84e..626e2f2 100644 (file)
@@ -68,6 +68,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require HYLAX_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/fax/fax.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index ac4678e..af72696 100644 (file)
@@ -35,6 +35,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require HYLAX_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/summary/summary.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/hylax/templates/common-header.inc b/hylax/templates/common-header.inc
deleted file mode 100644 (file)
index 246ac27..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Hylax: Copyright 2003-2010 The Horde Project.  Hylax is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Hylax: http://www.horde.org/hylax/    -->
-<!--               Horde Licenses: http://www.horde.org/licenses/                   -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index c0e4ffa..aad94f4 100644 (file)
@@ -48,6 +48,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require HYLAX_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(HYLAX_TEMPLATES . '/fax/fax.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index b368329..f5206f5 100644 (file)
@@ -100,7 +100,7 @@ $bl_rule = $filters->findRule(Ingo_Storage::ACTION_BLACKLIST);
 $menu = Ingo::menu();
 Ingo::addNewFolderJs();
 $title = _("Blacklist Edit");
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 require INGO_TEMPLATES . '/blacklist/blacklist.inc';
index b6f318d..806468d 100644 (file)
@@ -135,7 +135,7 @@ Horde::addScriptFile('stripe.js', 'horde');
 Horde::addScriptFile('filters.js', 'ingo');
 $menu = Ingo::menu();
 $title = _("Filter Rules");
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 require INGO_TEMPLATES . '/filters/header.inc';
index 1794679..9e88d0b 100644 (file)
@@ -92,7 +92,7 @@ $form->setTitle($form_title);
 
 $title = _("Forwards Edit");
 $menu = Ingo::menu();
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 $form->renderActive(new Horde_Form_Renderer(array('encode_title' => false)), $vars, 'forward.php', 'post');
index 3092b23..d1bfff7 100644 (file)
@@ -190,7 +190,7 @@ $title = $rule['name'];
 Horde::addScriptFile('rule.js', 'ingo');
 $menu = Ingo::menu();
 Ingo::addNewFolderJs();
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 require INGO_TEMPLATES . '/rule/header.inc';
index 5aa2c96..4322212 100644 (file)
@@ -50,7 +50,7 @@ case 'show_active':
 
 $title = _("Filter Script Display");
 $menu = Ingo::menu();
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 require INGO_TEMPLATES . '/script/header.inc';
index 92d6cc1..173c4f5 100644 (file)
@@ -149,7 +149,7 @@ $form->setTitle($form_title);
 $title = _("Spam Filtering");
 $menu = Ingo::menu();
 Ingo::addNewFolderJs();
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 $form->renderActive($renderer, $vars, 'spam.php', 'post');
diff --git a/ingo/templates/common-header.inc b/ingo/templates/common-header.inc
deleted file mode 100644 (file)
index 3fdd052..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-    Horde::outputMetaTags();
-    Horde::includeStylesheetFiles();
-    Horde::includeScriptFiles();
-    Horde::includeFavicon();
-    Horde::outputInlineScript();
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index b65080d..e9a2d7b 100644 (file)
@@ -141,7 +141,7 @@ $form->setTitle($form_title);
 
 $title = _("Vacation Edit");
 $menu = Ingo::menu();
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 $form->renderActive(new Horde_Form_Renderer(array('encode_title' => false)), $vars, 'vacation.php', 'post');
index fcd54eb..1c245b7 100644 (file)
@@ -53,7 +53,7 @@ $wl_rule = $filters->findRule(Ingo_Storage::ACTION_WHITELIST);
 
 $title = _("Whitelist Edit");
 $menu = Ingo::menu();
-require INGO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $menu;
 Ingo::status();
 require INGO_TEMPLATES . '/whitelist/whitelist.inc';
index 17c9b67..0799b66 100644 (file)
@@ -61,6 +61,6 @@ Horde::startBuffer();
 $GLOBALS['notification']->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require JONAH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(JONAH_TEMPLATES . '/delivery/html.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 4df785b..1506cd8 100644 (file)
@@ -31,10 +31,20 @@ class Jonah_Application extends Horde_Registry_Application
      * Initialization function.
      *
      * Global variables defined:
+     * - $linkTags: <link> tags for common-header.inc.
      */
     protected function _init()
     {
         $GLOBALS['injector']->bindFactory('Jonah_Driver', 'Jonah_Injector_Factory_Driver', 'create');
+
+        if ($channel_id = Horde_Util::getFormData('channel_id')) {
+            $url = Horde::url('delivery/rss.php', true, -1)
+                ->add('channel_id', $channel_id);
+            if ($tag_id = Horde_Util::getFormData('tag_id')) {
+                $url->add('tag_id', $tag_id);
+            }
+            $GLOBALS['linkTags'] = array('<link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="' . $url . '" />');
+        }
     }
 
     /**
index b377526..8a9a508 100644 (file)
@@ -33,7 +33,7 @@ abstract class Jonah_View_Base
     {
         extract($this->_params, EXTR_REFS);
         $notification->push(sprintf(_("Error fetching story: %s"), $message), 'horde.error');
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         $notification->notify(array('listeners' => 'status'));
         require $registry->get('templates', 'horde') . '/common-footer.inc';
         exit;
index 4f28c74..c28b028 100644 (file)
@@ -72,7 +72,7 @@ class Jonah_View_ChannelDelete extends Jonah_View_Base
             exit;
         }
 
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         $form->renderActive(null, $vars, Horde::selfUrl(), 'post');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index e98dc1d..b1e1344 100644 (file)
@@ -60,7 +60,7 @@ class Jonah_View_ChannelEdit extends Jonah_View_Base
 
         $renderer = new Horde_Form_Renderer();
         $title = $form->getTitle();
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         $form->renderActive($renderer, $vars, 'edit.php', 'post');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index 8d76a9e..bedd73a 100644 (file)
@@ -65,7 +65,7 @@ class Jonah_View_ChannelList extends Jonah_View_Base
         Horde::addScriptFile('prototype.js', 'horde', true);
         Horde::addScriptFile('tables.js', 'horde', true);
         Horde::addScriptFile('quickfinder.js', 'horde', true);
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         echo $view->render('channellist');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index 5d73e8a..3cd9e21 100644 (file)
@@ -59,7 +59,7 @@ class Jonah_View_DeliveryHtml extends Jonah_View_Base
         $GLOBALS['notification']->notify(array('listeners' => 'status'));
         $template->set('notify', Horde::endBuffer());
 
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         echo $template->fetch(JONAH_TEMPLATES . '/delivery/html.html');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
     }
index f9222c9..5746896 100644 (file)
@@ -79,7 +79,7 @@ class Jonah_View_StoryDelete extends Jonah_View_Base
             Horde::url('stories/index.php', true)->add('channel_id', $channel_id)->setRaw(true)->redirect();
             exit;
         }
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         $form->renderActive(null, $vars, 'delete.php', 'post');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index b1cabad..c26d206 100644 (file)
@@ -73,7 +73,7 @@ class Jonah_View_StoryEdit extends Jonah_View_Base
         /* Needed javascript. */
         Horde::addScriptFile('open_calendar.js', 'horde');
         $title = $form->getTitle();
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index 58583d9..7bbaaf8 100644 (file)
@@ -108,7 +108,7 @@ class Jonah_View_StoryList extends Jonah_View_Base
         $view->stories = $stories;
         $view->read = true;
         $view->comments = $conf['comments']['allow'] && $registry->hasMethod('forums/numMessages') && $channel['channel_type'] == Jonah::INTERNAL_CHANNEL;
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         echo $view->render('index');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index 1790641..ddef725 100644 (file)
@@ -75,7 +75,7 @@ EOT;
             $story = $driver->getStory($channel_id, $story_id, !$browser->isRobot());
         } catch (Exception $e) {
             $notification->push(sprintf(_("Error fetching story: %s"), $e->getMessage()), 'horde.warning');
-            require JONAH_TEMPLATES . '/common-header.inc';
+            require $registry->get('templates', 'horde') . '/common-header.inc';
             require JONAH_TEMPLATES . '/menu.inc';
             require $registry->get('templates', 'horde') . '/common-footer.inc';
             exit;
@@ -141,7 +141,7 @@ EOT;
             }
         }
 
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         echo $view->render('view');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index e4b1ddc..df25a79 100644 (file)
@@ -108,7 +108,7 @@ class Jonah_View_TagSearchList extends Jonah_View_Base
         $view->stories = $stories;
         $view->read = true;
         $view->comments = $conf['comments']['allow'] && $registry->hasMethod('forums/numMessages') && $channel['channel_type'] == Jonah::INTERNAL_CHANNEL;
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         echo $view->render('index');
         require $registry->get('templates', 'horde') . '/common-footer.inc';
index e52ac19..4c740a6 100644 (file)
@@ -143,6 +143,6 @@ Horde::startBuffer();
 $GLOBALS['notification']->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require JONAH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $share_template->fetch(JONAH_TEMPLATES . '/stories/share.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 75b1291..06b4b97 100644 (file)
@@ -19,7 +19,7 @@ if (!$story_id) {
         $story_id = $injector->getInstance('Jonah_Driver')->getLatestStoryId($channel_id);
     } catch (Exception $e) {
         $notification->push(sprintf(_("Error fetching story: %s"), $e->getMessage()), 'horde.warning');
-        require JONAH_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require JONAH_TEMPLATES . '/menu.inc';
         require $registry->get('templates', 'horde') . '/common-footer.inc';
         exit;
diff --git a/jonah/templates/common-header.inc b/jonah/templates/common-header.inc
deleted file mode 100644 (file)
index 6c228d5..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-if ($channel_id = Horde_Util::getFormData('channel_id')) {
-    $rss_url_params = array('channel_id' => $channel_id);
-    if ($tag_id = Horde_Util::getFormData('tag_id')) {
-        $rss_url_params['tag_id'] = $tag_id;
-    }
-    echo '<link rel="alternate" type="application/rss+xml" title="RSS 0.91" href="' . Horde_Util::addParameter(Horde::url('delivery/rss.php', true, -1), $rss_url_params) . '" />';
-}
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
index 699c85c..11cced3 100644 (file)
@@ -70,7 +70,8 @@ if (((empty($cal) || empty($id)) && empty($uid)) || empty($user)) {
     }
 }
 
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 
 ?>
 <div id="menu"><h1>&nbsp;<?php echo htmlspecialchars($title) ?></h1></div>
index a7be69a..0fcede3 100644 (file)
@@ -265,7 +265,8 @@ $injector->getInstance('Horde_Core_Factory_Imple')->create(array('kronolith', 'C
 ));
 
 $title = _("Edit attendees");
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 $notification->notify(array('listeners' => 'status'));
 require KRONOLITH_TEMPLATES . '/attendees/attendees.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index cf70e17..0d222f3 100644 (file)
@@ -39,7 +39,8 @@ if ($form->validate($vars)) {
 
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
index 62d6bd1..48eca31 100644 (file)
@@ -51,7 +51,8 @@ if ($form->validate(new Horde_Variables($_POST))) {
 
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
index 5a5bd96..c4c7ebf 100644 (file)
@@ -66,7 +66,8 @@ $injector->getInstance('Horde_Core_Factory_Imple')->create(array('kronolith', 'T
 ));
 
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
index 4c29f5e..0650261 100644 (file)
@@ -75,7 +75,8 @@ $delete_img = Horde::img('delete.png', _("Delete"));
 Horde::addScriptFile('tables.js', 'horde');
 $title = _("Manage Calendars");
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 require KRONOLITH_TEMPLATES . '/calendar_list.php';
index aaefbb1..ab6ffa8 100644 (file)
@@ -73,7 +73,8 @@ $vars->set('user', $username);
 $vars->set('password', $password);
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'remote_edit.php', 'post');
index ec9bc3f..fae5983 100644 (file)
@@ -41,7 +41,8 @@ if ($form->validate($vars)) {
 
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'remote_subscribe.php', 'post');
index 40dbc1c..a7780f8 100644 (file)
@@ -55,7 +55,8 @@ if ($form->validate(new Horde_Variables($_POST))) {
 $vars->set('url', $calendar['url']);
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'remote_unsubscribe.php', 'post');
index 10b28cf..2d28914 100644 (file)
@@ -72,6 +72,7 @@ $display = Horde_Util::getFormData('display', 'name');
 
 /* Display the form. */
 $title = _("Address Book");
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 require KRONOLITH_TEMPLATES . '/contacts/contacts.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index d0620e6..2e70e26 100644 (file)
@@ -352,7 +352,8 @@ $export_calendars = Kronolith::listCalendars(Horde_Perms::READ, true);
 
 $title = _("Import/Export Calendar");
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 
index 507c651..64dad0c 100644 (file)
@@ -18,11 +18,15 @@ if (Kronolith::showAjaxView()) {
 
 $view = Kronolith::getView('Day');
 $title = $view->getTime($prefs->getValue('date_format'));
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+Horde::addScriptFile('views.js', 'kronolith');
 
-Horde::addScriptFile('tooltips.js', 'horde');
-$menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-echo $menu;
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
+echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
 echo '<div id="page">';
index 7eabe65..4cf2a0a 100644 (file)
@@ -48,9 +48,13 @@ case 'EditEvent':
 }
 
 $title = $view->getTitle();
-$menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-echo $menu;
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
+echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
 echo '<div id="page">';
index 62b80c3..2f53bdb 100644 (file)
@@ -59,7 +59,8 @@ class Kronolith_Application extends Horde_Registry_Application
      * Initialization function.
      *
      * Global variables defined:
-     *   $kronolith_shares - TODO
+     * - $kronolith_shares: TODO
+     * - $linkTags: <link> tags for common-header.inc.
      */
     protected function _init()
     {
@@ -78,6 +79,11 @@ class Kronolith_Application extends Horde_Registry_Application
         $GLOBALS['kronolith_shares'] = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create();
 
         Kronolith::initialize();
+
+        $GLOBALS['linkTags'] = array();
+        foreach ($GLOBALS['display_calendars'] as $calendar) {
+            $GLOBALS['linkTags'][] = '<link href="' . Kronolith::feedUrl($calendar) . '" rel="alternate" type="application/atom+xml" />';
+        }
     }
 
     /**
index a8b43a1..b942a56 100644 (file)
@@ -17,11 +17,15 @@ if (Kronolith::showAjaxView()) {
 
 $view = Kronolith::getView('Month');
 $title = $view->date->strftime('%B %Y');
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+Horde::addScriptFile('views.js', 'kronolith');
 
-Horde::addScriptFile('tooltips.js', 'horde');
-$menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-echo $menu;
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
+echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
 echo '<div id="page">';
index 80ff1f7..182d5e2 100644 (file)
@@ -77,7 +77,8 @@ $menu = Horde::menu();
 Horde::addScriptFile('edit.js', 'kronolith');
 Horde::addScriptFile('popup.js', 'horde');
 
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 require KRONOLITH_TEMPLATES . '/edit/edit.inc';
index fd7f5e2..72f740f 100644 (file)
@@ -112,7 +112,8 @@ try {
     Horde::logMessage($e, 'NOTICE');
 }
 
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 $notification->notify(array('listeners' => 'status'));
 require KRONOLITH_TEMPLATES . '/perms/perms.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index c340bc3..3a6ef7f 100644 (file)
@@ -40,7 +40,8 @@ if ($form->validate($vars)) {
 
 $menu = Horde::menu();
 $title = $form->getTitle();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
index b62e84d..7894c6e 100644 (file)
@@ -50,7 +50,8 @@ if ($form->validate(new Horde_Variables($_POST))) {
 
 $menu = Horde::menu();
 $title = $form->getTitle();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
index 2fb0163..4518f20 100644 (file)
@@ -60,7 +60,8 @@ $vars->set('responsetype', $resource->get('response_type'));
 
 $menu = Horde::menu();
 $title = $form->getTitle();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
index 2029f9b..4ce77a3 100644 (file)
@@ -35,7 +35,8 @@ if ($form->validate($vars)) {
 
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
index e3f4b5f..53af12a 100644 (file)
@@ -46,7 +46,8 @@ if ($form->validate(new Horde_Variables($_POST))) {
 
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
index ec7f81d..033635f 100644 (file)
@@ -54,7 +54,8 @@ $vars->set('members', $group->get('members'));
 
 $title = $form->getTitle();
 $menu = Horde::menu();
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
index 5c7af29..ecabe24 100644 (file)
@@ -15,7 +15,8 @@ if (!$GLOBALS['registry']->getAuth()) {
 $menu = Horde::menu();
 $title = _("Resource Groups");
 
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 
index bf26e57..865aa6e 100644 (file)
@@ -19,7 +19,8 @@ if (!$GLOBALS['registry']->getAuth()) {
 $menu = Horde::menu();
 $title = _("Edit resources");
 
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 
index e41db8c..4dc92c7 100644 (file)
@@ -113,7 +113,8 @@ if ($search_mode == 'basic') {
 $menu = Horde::menu();
 $title = _("Search");
 Horde::addScriptFile('tooltips.js', 'horde');
-require KRONOLITH_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
 echo $menu;
 $notification->notify(array('listeners' => 'status'));
 
diff --git a/kronolith/templates/common-header.inc b/kronolith/templates/common-header.inc
deleted file mode 100644 (file)
index 35f6262..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-Horde::addScriptFile('effects.js', 'horde');
-Horde::addScriptFile('views.js', 'kronolith');
-Horde::addScriptFile('stripe.js', 'horde');
-
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!--   Kronolith: Copyright 2000-2010 The Horde Project.  Kronolith is under the GPL.  -->
-<!-- Horde Project: http://www.horde.org/ | Kronolith: http://www.horde.org/kronolith/ -->
-<!--              GNU Public License: http://www.fsf.org/copyleft/gpl.html             -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-foreach ($GLOBALS['display_calendars'] as $calendar) {
-    echo '<link href="' . Kronolith::feedUrl($calendar) . '" rel="alternate" type="application/atom+xml" />';
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-require KRONOLITH_TEMPLATES . '/javascript_defs.php';
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-Horde::outputInlineScript();
-
-$bc = (isset($view) && is_object($view) && $prefs->getValue('show_panel'))
-    ? 'rightPanel'
-    : '';
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc) echo ' class="' . $bc . '"' ?>>
index b8e1553..dcd6f42 100644 (file)
@@ -18,11 +18,15 @@ if (Kronolith::showAjaxView()) {
 
 $view = Kronolith::getView('Week');
 $title = sprintf(_("Week %d"), $view->week);
-$menu = Horde::menu();
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+Horde::addScriptFile('views.js', 'kronolith');
 
-Horde::addScriptFile('tooltips.js', 'horde');
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-echo $menu;
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
+echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
 echo '<div id="page">';
index eb7b700..1e9e811 100644 (file)
@@ -19,11 +19,15 @@ if (Kronolith::showAjaxView()) {
 
 $view = Kronolith::getView('WorkWeek');
 $title = sprintf(_("Week %d"), $view->week);
-$menu = Horde::menu();
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+Horde::addScriptFile('views.js', 'kronolith');
 
-Horde::addScriptFile('tooltips.js', 'horde');
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-echo $menu;
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
+echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
 echo '<div id="page">';
index ae595e9..65b1169 100644 (file)
@@ -19,10 +19,15 @@ if (Kronolith::showAjaxView()) {
 
 $view = Kronolith::getView('Year');
 $title = $view->year;
-$menu = Horde::menu();
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+Horde::addScriptFile('views.js', 'kronolith');
 
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-echo $menu;
+require $registry->get('templates', 'horde') . '/common-header.inc';
+require KRONOLITH_TEMPLATES . '/javascript_defs.php';
+echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
 echo '<div id="page">';
index 20a0769..36ba06c 100644 (file)
@@ -26,7 +26,7 @@ if (count($ids) == 1) {
 // If there are multiple search results, display some info for all of them.
 
 $title = sprintf(_("Symbol Search for \"%s\""), $symbol);
-require LUXOR_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require LUXOR_TEMPLATES . '/menu.inc';
 
 echo '<h1 class="header">' . htmlspecialchars($title) . '</h1>';
index ca37dab..185bf57 100644 (file)
@@ -148,7 +148,7 @@ if (is_a($content, 'PEAR_Error')) {
     $notification->push($content->getMessage(), 'horde.error');
 }
 
-require LUXOR_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require LUXOR_TEMPLATES . '/menu.inc';
 require LUXOR_TEMPLATES . '/headerbar.inc';
 if (!is_a($content, 'PEAR_Error')) {
index 5008b9c..7bd5508 100644 (file)
@@ -73,7 +73,7 @@ if ($r) {
 }
 
 $title = sprintf(_("%s :: Symbol \"%s\""), $source['name'], $index->symname($ident));
-require LUXOR_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require LUXOR_TEMPLATES . '/menu.inc';
 
 $view = new Horde_View(array('templatePath' => LUXOR_TEMPLATES));
diff --git a/luxor/templates/common-header.inc b/luxor/templates/common-header.inc
deleted file mode 100644 (file)
index 8285642..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!--  Luxor: Copyright 2003-2009 The Horde Project.  Luxor is under the GPL.   -->
-<!-- Horde Project: http://www.horde.org/ | Luxor: http://www.horde.org/luxor/ -->
-<!--             Horde Licenses: http://www.horde.org/licenses/                -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
index c453f9a..5dd29e8 100644 (file)
@@ -199,7 +199,7 @@ if (is_array($next_step)) {
 }
 
 $title = _("Import/Export Notes");
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 
index e9c554c..7a44f65 100644 (file)
@@ -50,6 +50,7 @@ class Mnemo_Application extends Horde_Registry_Application
     protected function _init()
     {
         Mnemo::initialize();
+        $GLOBALS['injector']->getInstance('Horde_Themes_Css')->addThemeStylesheet('categoryCSS.php');
     }
 
     /**
index d42ecbd..bbafff5 100644 (file)
@@ -54,9 +54,13 @@ case 'search_memos':
     break;
 }
 
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
 Horde::addScriptFile('tables.js', 'horde', true);
 Horde::addScriptFile('quickfinder.js', 'horde', true);
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 require MNEMO_TEMPLATES . '/list/header.inc';
index 3ea0b8a..15d6299 100644 (file)
@@ -252,7 +252,7 @@ default:
 }
 
 $notepads = Mnemo::listNotepads(false, Horde_Perms::EDIT);
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 require MNEMO_TEMPLATES . '/memo/memo.inc';
index c8efe54..ebf2e74 100644 (file)
@@ -36,7 +36,7 @@ if ($form->validate($vars)) {
 }
 
 $title = $form->getTitle();
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
index a01d8f5..743ed12 100644 (file)
@@ -47,7 +47,7 @@ if ($form->validate(new Horde_Variables($_POST))) {
 }
 
 $title = $form->getTitle();
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
index 936fa70..2400a20 100644 (file)
@@ -54,7 +54,7 @@ if ($form->validate($vars)) {
 $vars->set('name', $notepad->get('name'));
 $vars->set('description', $notepad->get('desc'));
 $title = $form->getTitle();
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
index 3bdd905..8987430 100644 (file)
@@ -37,7 +37,7 @@ $delete_img = Horde::img('delete.png', _("Delete"), null);
 Horde::addScriptFile('popup.js', 'horde', true);
 Horde::addScriptFile('tables.js', 'horde', true);
 $title = _("Manage Notepads");
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 require MNEMO_TEMPLATES . '/notepad_list.php';
index cf581e5..566d065 100644 (file)
@@ -38,10 +38,14 @@ if (count($search_results) == 1) {
 $title = _("Search Results");
 $memos = $search_results;
 
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
 Horde::addScriptFile('tables.js', 'horde', true);
 Horde::addScriptFile('quickfinder.js', 'horde', true);
 
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 require MNEMO_TEMPLATES . '/list/header.inc';
 
index 51e13ee..df44d23 100644 (file)
@@ -18,8 +18,12 @@ Horde::addInlineScript(array(
     '$("search_pattern").focus()'
 ), 'dom');
 
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
 $title = _("Search");
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 require MNEMO_TEMPLATES . '/search/search.inc';
index 9c63d6e..ad61503 100644 (file)
@@ -54,7 +54,11 @@ case 'search_memos':
     break;
 }
 
-require MNEMO_TEMPLATES . '/common-header.inc';
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify();
 require MNEMO_TEMPLATES . '/list/header.inc';
diff --git a/mnemo/templates/common-header.inc b/mnemo/templates/common-header.inc
deleted file mode 100644 (file)
index 9d604b5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Mnemo: Copyright 2002-2009 The Horde Project.  Mnemo is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Mnemo: http://www.horde.org/mnemo/    -->
-<!--              Horde Licenses: http://www.horde.org/licenses/                    -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-
-$injector->getInstance('Horde_Themes_Css')->addThemeStylesheet('categoryCSS.php');
-Horde::includeStylesheetFiles();
-
-$bc = $prefs->getValue('show_panel')
-    ? 'rightPanel'
-    : '';
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
index 9c9dcd9..abeecf1 100644 (file)
@@ -117,7 +117,7 @@ $print_view = (bool)Horde_Util::getFormData('print');
 if (!$print_view) {
     Horde::addScriptFile('popup.js', 'horde', true);
 }
-require MNEMO_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 if ($print_view) {
     require $registry->get('templates', 'horde') . '/javascript/print.js';
index 24bda67..e0daa39 100644 (file)
@@ -244,8 +244,8 @@ foreach ($tasklists as $id => $tasklist) {
 }
 
 $title = _("Import/Export Tasks");
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 
 foreach ($templates[$next_step] as $template) {
index a12afbf..28359d5 100644 (file)
@@ -61,6 +61,8 @@ class Nag_Application extends Horde_Registry_Application
         $GLOBALS['nag_shares'] = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create();
 
         Nag::initialize();
+
+        $GLOBALS['injector']->getInstance('Horde_Themes_Css')->addThemeStylesheet('categoryCSS.php');
     }
 
     /**
index a89450c..6d3e9fd 100644 (file)
@@ -739,6 +739,13 @@ class Nag
         $GLOBALS['prefs']->setValue('display_tasklists', serialize($GLOBALS['display_tasklists']));
     }
 
+    public static function menu()
+    {
+        Horde::startBuffer();
+        include NAG_TEMPLATES . '/quick.inc';
+        return Horde::menu() . Horde::endBuffer();
+    }
+
     /**
      * Trigger notifications.
      */
index 389097e..b0bef2d 100644 (file)
@@ -89,8 +89,12 @@ Horde::addScriptFile('tooltips.js', 'horde');
 Horde::addScriptFile('effects.js', 'horde');
 Horde::addScriptFile('quickfinder.js', 'horde');
 
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 echo '<div id="page">';
 
index c584e54..a315e1f 100644 (file)
@@ -13,9 +13,12 @@ Horde::addInlineScript(array(
     '$("search_pattern")'
 ), 'dom');
 
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
 $title = _("Search");
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+NAG_TEMPLATES . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 require NAG_TEMPLATES . '/search/search.inc';
 require NAG_TEMPLATES . '/panel.inc';
index ed77ba0..28275bf 100644 (file)
@@ -241,8 +241,8 @@ default:
 }
 
 $title = $form->getTitle();
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 $form->renderActive();
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 7ba2588..b458772 100644 (file)
@@ -33,8 +33,8 @@ if ($form->validate($vars)) {
 }
 
 $title = $form->getTitle();
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 9d609c7..bf41113 100644 (file)
@@ -45,8 +45,8 @@ if ($form->validate(new Horde_Variables($_POST))) {
 }
 
 $title = $form->getTitle();
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index de0bbd4..5c3af6d 100644 (file)
@@ -51,8 +51,8 @@ $vars->set('name', $tasklist->get('name'));
 $vars->set('description', $tasklist->get('desc'));
 $vars->set('system', is_null($tasklist->get('owner')));
 $title = $form->getTitle();
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 461f905..88a755b 100644 (file)
@@ -62,8 +62,8 @@ $delete_img = Horde::img('delete.png', _("Delete"));
 
 Horde::addScriptFile('tables.js', 'horde');
 $title = _("Manage Task Lists");
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 require NAG_TEMPLATES . '/tasklist_list.php';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 99585cb..56c3eb4 100644 (file)
@@ -48,8 +48,12 @@ Horde::addScriptFile('tooltips.js', 'horde');
 Horde::addScriptFile('effects.js', 'horde');
 Horde::addScriptFile('quickfinder.js', 'horde');
 
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+if ($prefs->getValue('show_panel')) {
+    $bodyClass = 'rightPanel';
+}
+
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 echo '<div id="page">';
 require NAG_TEMPLATES . '/list.html.php';
diff --git a/nag/templates/common-header.inc b/nag/templates/common-header.inc
deleted file mode 100644 (file)
index b4d2aa3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::addInlineJsVars(array(
-    '-var Nag' => '{}'
-), array('top' => true));
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::outputInlineScript();
-Horde::includeFavicon();
-
-$injector->getInstance('Horde_Themes_Css')->addThemeStylesheet('categoryCSS.php');
-Horde::includeStylesheetFiles();
-
-$bc = $prefs->getValue('show_panel')
-    ? 'rightPanel'
-    : '';
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc) echo ' class="' . $bc . '"' ?>>
-
-<div id="quickAddInfoPanel" class="quickAddInfoPanel" style="display:none;">
- <h2><?php echo _("Quick Task Creation") ?></h2>
- <form method="post" action="quick.php">
-  <p><?php echo _("Enter one task per line. Create child tasks by indenting them below their parent task. Include due dates like \"laundry tomorrow\" or \"get dry cleaning next Thursday\".") ?></p>
-  <textarea name="quickText" id="quickText"></textarea>
-  <p><input type="submit" value="<?php echo _("Create") ?>" /></p>
- </form>
-</div>
diff --git a/nag/templates/quick.inc b/nag/templates/quick.inc
new file mode 100644 (file)
index 0000000..025e3cd
--- /dev/null
@@ -0,0 +1,11 @@
+<div id="quickAddInfoPanel" class="quickAddInfoPanel" style="display:none;">
+ <h2><?php echo _("Quick Task Creation") ?></h2>
+ <form method="post" action="quick.php">
+  <p><?php echo _("Enter one task per line. Create child tasks by indenting them below their parent task. Include due dates like \"laundry tomorrow\" or \"get dry cleaning next Thursday\".") ?></p>
+  <textarea name="quickText" id="quickText"></textarea>
+  <p>
+   <input type="submit" class="button" value="<?php echo _("Create") ?>" />
+   <input type="button" class="button" onclick="RedBox.close()" value="<?php echo _("Cancel") ?>" />
+  </p>
+ </form>
+</div>
index 22d0cab..ced4c73 100644 (file)
@@ -113,8 +113,8 @@ if ($share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE))
     $links[] = Horde::widget(Horde::url(Horde_Util::addParameter($taskurl, 'actionID', 'delete_task')), _("Delete"), 'smallheader', '', $prefs->getValue('delete_opt') ? 'return window.confirm(\'' . addslashes(_("Really delete this task?")) . '\');' : '', _("_Delete"));
 }
 
-require NAG_TEMPLATES . '/common-header.inc';
-echo Horde::menu();
+require $registry->get('templates', 'horde') . '/common-header.inc';
+echo Nag::menu();
 Nag::status();
 
 /* Set up alarm units and value. */
index 7cbb678..08ef951 100644 (file)
@@ -52,7 +52,7 @@ if ($form->isSubmitted() && $form->validate($vars, true)) {
 
 $title = _("Export Call Detail Records");
 
-require OPERATOR_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require OPERATOR_TEMPLATES . '/menu.inc';
 $notification->notify();
 $form->renderActive($renderer, $vars, Horde::url('export.php'), 'post');;
index ea02185..2c6db4a 100644 (file)
@@ -84,7 +84,7 @@ if ($stats['numcalls'] > $GLOBALS['conf']['storage']['searchlimit']) {
 $title = _("Search Call Detail Records");
 Horde::addScriptFile('stripe.js', 'horde', true);
 
-require OPERATOR_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require OPERATOR_TEMPLATES . '/menu.inc';
 $notification->notify();
 $form->renderActive($renderer, $vars, Horde::url('search.php'), 'post');
diff --git a/operator/templates/common-header.inc b/operator/templates/common-header.inc
deleted file mode 100644 (file)
index 8b345be..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<!-- Operator: Copyright 2008 Alkaloid Networks LLC.  Operator is under a Horde license. -->
-<!--     Horde Project: http://www.horde.org/ | Operator: http://projects.alkaloid.net/     -->
-<!--                 Horde Licenses: http://www.horde.org/licenses/                       -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index 6263120..d3ffe45 100644 (file)
@@ -91,7 +91,7 @@ $curgraph = $vars->get('graph');
 
 $title = _("Call Detail Records Graph");
 
-require OPERATOR_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require OPERATOR_TEMPLATES . '/menu.inc';
 
 $form->renderActive($renderer, $vars, Horde::url('viewgraph.php'), 'post');
index bd1e62f..694a40c 100644 (file)
@@ -263,6 +263,6 @@ Horde::addInlineScript(array(
 ), 'dom');
 
 $title = _("Change Password");
-require PASSWD_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require PASSWD_TEMPLATES . '/main/main.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/passwd/templates/common-header.inc b/passwd/templates/common-header.inc
deleted file mode 100644 (file)
index 456e7a1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-global $language;
-if (isset($language)) {
-    header('Content-type: text/html; charset=' . NLS::getCharset());
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Passwd: Copyright 2002-2009 The Horde Project.  Passwd is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Passwd: http://www.horde.org/passwd/    -->
-<!--                Horde Licenses: http://www.horde.org/licenses/                    -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-/* Print the page title. */
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc = Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
index edddce7..644e395 100644 (file)
@@ -43,7 +43,7 @@ try {
 
 $title = $form->getTitle();
 
-require PASTIE_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require PASTIE_TEMPLATES . '/menu.inc';
 
 require PASTIE_TEMPLATES . '/paste.inc';
diff --git a/pastie/templates/common-header.inc b/pastie/templates/common-header.inc
deleted file mode 100644 (file)
index 82da815..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index 7838fb6..c0cff2c 100644 (file)
@@ -39,7 +39,7 @@ try {
 
 $title = _("View Paste");
 
-require PASTIE_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require PASTIE_TEMPLATES . '/menu.inc';
 
 require PASTIE_TEMPLATES . '/view.inc';
index 28c08b6..e60ce60 100644 (file)
@@ -20,7 +20,7 @@ $title = _("Accounts: ");
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index 67c6add..c75be4a 100644 (file)
@@ -99,7 +99,7 @@ try {
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index 8ebb6f5..a13c057 100644 (file)
@@ -98,7 +98,7 @@ try {
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index a9f2cf3..6e4fad7 100644 (file)
@@ -102,7 +102,7 @@ try {
 }
 
 Horde::addScriptFile('stripe.js', 'horde');
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index 61e4c11..4c0b5a5 100644 (file)
@@ -104,7 +104,7 @@ try {
 }
 
 Horde::addScriptFile('stripe.js', 'horde');
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index cdd1585..8540b4a 100644 (file)
@@ -86,7 +86,7 @@ if ($action == 'edit') {
 Horde::addScriptFile('stripe.js', 'horde');
 Horde::addScriptFile('scriptaculous.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index f360096..b5d45a1 100644 (file)
@@ -30,7 +30,7 @@ try {
 Horde::addScriptFile('stripe.js', 'horde');
 Horde::addScriptFile('scriptaculous.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index b53874d..0b5876b 100644 (file)
@@ -53,7 +53,7 @@ default:
 
 Horde::addScriptFile('stripe.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
diff --git a/shout/templates/common-header.inc b/shout/templates/common-header.inc
deleted file mode 100644 (file)
index c146ab4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-     if (isset($language)) {
-         header('Content-type: text/html; charset=UTF-8');
-         header('Vary: Accept-Language');
-     }
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-          "DTD/xhtml1-transitional.dtd">
-<!--          Shout: Copyright 2005-2006, Ben Klang.           -->
-<!-- Horde Project: http://horde.org/ | Shout: http://projects.alkaloid.net/ -->
-<!--          Horde Licenses: http://www.horde.org/licenses/           -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeStylesheetFiles();
-
-?>
- <title><?php echo $page_title ?></title>
-</head>
-
-<body>
index 6f680eb..5fbe68f 100644 (file)
@@ -67,7 +67,7 @@ try {
 Horde::addScriptFile('scriptaculous.js', 'horde');
 Horde::addScriptFile('stripe.js', 'horde');
 
-require SHOUT_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require SHOUT_TEMPLATES . '/menu.inc';
 
 $notification->notify();
index 6d68c1c..6356e2a 100644 (file)
@@ -15,7 +15,7 @@ Horde_Registry::appInit('skeleton');
 
 $title = _("List");
 
-require SKELETON_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/skeleton/templates/common-header.inc b/skeleton/templates/common-header.inc
deleted file mode 100644 (file)
index 82da815..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index a76459e..b2025df 100644 (file)
@@ -63,7 +63,7 @@ case 'add_bookmark':
             echo Horde::wrapInlineScript(array('window.close();'));
         } elseif (Horde_Util::getFormData('iframe')) {
             $notification->push(_("Bookmark Added"), 'horde.success');
-            require TREAN_TEMPLATES . '/common-header.inc';
+            require $registry->get('templates', 'horde') . '/common-header.inc';
             $notification->notify();
         } else {
             Horde::url('browse.php', true)
@@ -116,7 +116,7 @@ if (Horde_Util::getFormData('popup')) {
 }
 
 $title = _("New Bookmark");
-require TREAN_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 if (!Horde_Util::getFormData('popup') && !Horde_Util::getFormData('iframe')) {
     echo Horde::menu();
     $notification->notify(array('listeners' => 'status'));
index 95b5e01..a54390b 100644 (file)
@@ -57,7 +57,7 @@ Horde::addScriptFile('tables.js', 'horde', true);
 Horde::addScriptFile('effects.js', 'horde', true);
 Horde::addScriptFile('redbox.js', 'horde', true);
 $title = _("Browse");
-require TREAN_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 if (!Horde_Util::getFormData('popup')) {
     echo Horde::menu();
     $notification->notify(array('listeners' => 'status'));
index 2f07dff..6a096c9 100644 (file)
@@ -182,7 +182,7 @@ EOH;
 }
 
 $title = _("Import Bookmarks");
-require TREAN_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 if (!$folders_exceeded || !$bookmarks_exceeded) {
index 2e0ad5c..d425436 100644 (file)
@@ -238,7 +238,7 @@ case 'rename':
 case 'del_folder':
     $folder = &$trean_shares->getFolder($folderId);
     $title = _("Confirm Deletion");
-    require TREAN_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     echo Horde::menu();
     $notification->notify(array('listeners' => 'status'));
     require TREAN_TEMPLATES . '/edit/delete_folder_confirmation.inc';
@@ -278,7 +278,7 @@ if (!count($bookmarks) && !count($folder)) {
 }
 
 $title = _("Edit Bookmark");
-require TREAN_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 if (!Horde_Util::getFormData('popup')) {
     echo Horde::menu();
     $notification->notify(array('listeners' => 'status'));
index c800f84..42ac513 100644 (file)
@@ -42,8 +42,10 @@ class Trean_Application extends Horde_Registry_Application
      * Initialization function.
      *
      * Global variables defined:
-     *   $trean_db     - TODO
-     *   $trean_shares - TODO
+     * - $trean_db:     TODO
+     * - $trean_shares: TODO
+     * - $linkTags:     <link> tags for common-header.inc.
+     * - $bodyClass:    <body> CSS class for common-header.inc.
      */
     protected function _init()
     {
@@ -58,6 +60,16 @@ class Trean_Application extends Horde_Registry_Application
         $GLOBALS['trean_shares'] = new Trean_Bookmarks();
 
         Trean::initialize();
+
+        $GLOBALS['injector']->getInstance('Horde_Themes_Css')->addThemeStylesheet('grids-min.css');
+        $rss = Horde::url('rss.php', true, -1);
+        if (Horde_Util::getFormData('f')) {
+            $rss->add('f', Horde_Util::getFormData('f'));
+        }
+        $GLOBALS['linkTags'] = array('<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars(_("Bookmarks Feed")) . '" href="' . $rss . '" />');
+        if ($GLOBALS['prefs']->getValue('show_folder_actions')) {
+            $GLOBALS['bodyClass'] = 'folderActions';
+        }
     }
 
     /**
index 73d8339..1373ca9 100644 (file)
@@ -18,7 +18,7 @@ require_once TREAN_BASE . '/lib/Views/BookmarkList.php';
 $drilldown = Horde_Util::getFormData('drilldown');
 $title = _("Reports");
 Horde::addScriptFile('stripe.js', 'horde', true);
-require TREAN_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
index 71fed2b..e782713 100644 (file)
@@ -17,7 +17,7 @@ require_once TREAN_BASE . '/lib/Forms/Search.php';
 require_once TREAN_BASE . '/lib/Views/BookmarkList.php';
 
 $title = _("Search");
-require TREAN_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo Horde::menu();
 $notification->notify(array('listeners' => 'status'));
 
diff --git a/trean/templates/common-header.inc b/trean/templates/common-header.inc
deleted file mode 100644 (file)
index 8585ce4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Trean: Copyright 2000-2009 The Horde Project.  Trean is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Trean: http://www.horde.org/trean/    -->
-<!--              Horde Licenses: http://www.horde.org/licenses/                    -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-
-$injector->getInstance('Horde_Themes_Css')->addThemeStylesheet('grids-min.css');
-Horde::includeStylesheetFiles();
-
-$rss = Horde::url('rss.php', true, -1);
-if (Horde_Util::getFormData('f')) {
-    $rss = Horde_Util::addParameter($rss, 'f', Horde_Util::getFormData('f'), false);
-}
-echo '<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars(_("Bookmarks Feed")) . '" href="' . $rss . '" />';
-
-$bc = Horde_Util::nonInputVar('bodyClass');
-if ($prefs->getValue('show_folder_actions')) {
-    if ($bc) {
-        $bc .= ' ';
-    }
-    $bc .= 'folderActions';
-}
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
index 9df85e4..ee42629 100644 (file)
@@ -69,7 +69,7 @@ if ($form->validate()) {
 }
 
 $title = _("New Contact");
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 $form->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('add.php'), 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 1ecaa5e..61cad1d 100644 (file)
@@ -35,7 +35,7 @@ if ($form->validate($vars)) {
 }
 
 $title = $form->getTitle();
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 echo $form->renderActive($form->getRenderer(), $vars, Horde::url('addressbooks/create.php'), 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index d70346d..b97b482 100644 (file)
@@ -54,7 +54,7 @@ if ($form->validate(new Horde_Variables($_POST))) {
 }
 
 $title = $form->getTitle();
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 echo $form->renderActive($form->getRenderer(), $vars, Horde::url('addressbooks/delete.php'), 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 60245ff..515a186 100644 (file)
@@ -54,7 +54,7 @@ if ($form->validate($vars)) {
 $vars->set('name', $addressbook->get('name'));
 $vars->set('description', $addressbook->get('desc'));
 $title = $form->getTitle();
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 echo $form->renderActive($form->getRenderer(), $vars, Horde::url('edit.php'), 'post');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index c0c21db..18a2f40 100644 (file)
@@ -43,7 +43,7 @@ $delete_img = Horde::img('delete.png', _("Delete"));
 
 Horde::addScriptFile('tables.js', 'horde');
 $title = _("Manage Address Books");
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 require TURBA_TEMPLATES . '/addressbook_list.php';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 5e7a9f0..68102fb 100644 (file)
@@ -101,7 +101,7 @@ if ($own_source == $source && $own_id == $contact->getValue('__key')) {
 
 $title = $view->getTitle();
 Horde::addScriptFile('contact_tabs.js', 'turba');
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 echo '<div id="page">';
 echo $tabs->render($viewName);
index 3f1c3f2..a8cc04e 100644 (file)
@@ -85,7 +85,7 @@ if (!$conf['menu']['import_export']) {
 /* If there are absolutely no valid sources, abort. */
 if (!$cfgSources) {
     $notification->push(_("No Address Books are currently available. Import and Export is disabled."), 'horde.error');
-    require TURBA_TEMPLATES . '/common-header.inc';
+    require $registry->get('templates', 'horde') . '/common-header.inc';
     require TURBA_TEMPLATES . '/menu.inc';
     require $registry->get('templates', 'horde') . '/common-footer.inc';
     exit;
@@ -509,7 +509,7 @@ case Horde_Data::IMPORT_DATETIME:
 }
 
 $title = _("Import/Export Address Books");
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 
 $default_source = $prefs->getValue('default_dir');
index 24326bd..9de84c8 100644 (file)
@@ -41,6 +41,6 @@ try {
 }
 
 $title = _("Deletion failed");
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index c144ee3..9e646a4 100644 (file)
@@ -86,7 +86,7 @@ if (!($edited instanceof PEAR_Error)) {
 }
 
 $title = sprintf(_("Edit \"%s\""), $contact->getValue('name'));
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 $form->setTitle($title);
 $form->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('edit.php'), 'post');
index ecb4763..b265e89 100644 (file)
@@ -430,7 +430,7 @@ class Turba_View_Browse {
         Horde::addScriptFile('quickfinder.js', 'horde');
         Horde::addScriptFile('effects.js', 'horde');
         Horde::addScriptFile('redbox.js', 'horde');
-        require TURBA_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require TURBA_TEMPLATES . '/menu.inc';
         foreach ($templates as $template) {
             require TURBA_TEMPLATES . $template;
index 0c14500..f179f76 100644 (file)
@@ -49,7 +49,7 @@ if (!is_null($search)) {
 
 Horde::addScriptFile('prototype.js', 'horde');
 $bodyClass = 'summary';
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 
 ?>
 <?php
index 3f8949f..be56e21 100644 (file)
@@ -72,7 +72,7 @@ if (!isset($addressBooks[$source])) {
     /* If there are absolutely no valid sources, abort. */
     if (!isset($addressBooks[$source])) {
         $notification->push(_("No Address Books are currently available. Searching is disabled."), 'horde.error');
-        require TURBA_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require TURBA_TEMPLATES . '/menu.inc';
         require $registry->get('templates', 'horde') . '/common-footer.inc';
         exit;
@@ -263,7 +263,7 @@ if (isset($view) && is_object($view)) {
     Turba::addBrowseJs();
 }
 
-require TURBA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
 echo $tabs->render($search_mode);
 echo $headerView->render('header');
diff --git a/turba/templates/common-header.inc b/turba/templates/common-header.inc
deleted file mode 100644 (file)
index 464bbc3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-global $language;
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Turba: Copyright 2000-2010 The Horde Project.  Turba is under an ASL license. -->
-<!--   Horde Project: http://www.horde.org/ | Turba: http://www.horde.org/turba/   -->
-<!--          Horde ASL License: http://www.horde.org/licenses/asl.php             -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?>>
index 4bd03e4..838298a 100644 (file)
@@ -54,6 +54,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index bdc38b6..ec26463 100644 (file)
@@ -51,6 +51,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index eea0680..f7042c1 100644 (file)
@@ -49,6 +49,6 @@ $images = array('delete' => Horde::img('delete.png', _("Delete Domain")),
 $template->set('images', $images);
 
 /* Render the page. */
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/domains/index.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/vilma/templates/common-header.inc b/vilma/templates/common-header.inc
deleted file mode 100644 (file)
index 1390c38..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Vilma: Copyright 2003-2010 The Horde Project.  Vilma is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Vilma: http://www.horde.org/vilma/    -->
-<!--          Horde BSD License: http://www.horde.org/licenses/bsdl.php            -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-Horde::outputInlineScript();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-</head>
-
-<body>
index 941f4ac..91f30af 100644 (file)
@@ -178,6 +178,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 97b2e53..3a7d180 100644 (file)
@@ -111,6 +111,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index f84f547..9bd8d66 100644 (file)
@@ -115,6 +115,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index a1cdecc..4822db8 100644 (file)
@@ -111,6 +111,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index e4d6f54..22607bd 100644 (file)
@@ -141,6 +141,6 @@ $images = array('delete' => Horde::img('delete.png', _("Delete User")),
 $template->set('images', $images);
 
 /* Render the page. */
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/users/index.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 03e062d..7253307 100644 (file)
@@ -68,6 +68,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index b5ec499..f1cd4b0 100644 (file)
@@ -94,6 +94,6 @@ Horde::startBuffer();
 $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/main/main.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 22cca99..73a4ffe 100644 (file)
@@ -63,6 +63,6 @@ $notification->notify(array('listeners' => 'status'));
 $template->set('notify', Horde::endBuffer());
 
 /* Render the page. */
-require VILMA_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 echo $template->fetch(VILMA_TEMPLATES . '/virtuals/index.html');
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 59b88a0..0bb284f 100644 (file)
@@ -49,7 +49,7 @@ function _open($isopened = false)
 
         $opened = true;
         $title = _("Administration");
-        require WHUPS_TEMPLATES . '/common-header.inc';
+        require $registry->get('templates', 'horde') . '/common-header.inc';
         require WHUPS_TEMPLATES . '/menu.inc';
         echo $tabs->render($vars->get('action'));
     }
index 8488a91..775432d 100644 (file)
@@ -45,7 +45,8 @@ class Whups_Application extends Horde_Registry_Application
      * Whups initialization.
      *
      * Global variables defined:
-     *   $whups_driver - The global Whups driver object.
+     * - $whups_driver: The global Whups driver object.
+     * - $linkTags:     <link> tags for common-header.inc.
      */
     protected function _init()
     {
@@ -55,6 +56,8 @@ class Whups_Application extends Horde_Registry_Application
 
         $GLOBALS['whups_driver'] = Whups_Driver::factory();
         $GLOBALS['whups_driver']->initialise();
+
+        $GLOBALS['linkTags'] = array('<link href="' . Horde::url('opensearch.php', true, -1) . '" rel="search" type="application/opensearchdescription+xml" title="' . $GLOBALS['registry']->get('name') . ' (' . Horde::url('', true) . ')" />');
     }
 
     /**
index de835c2..134fce9 100644 (file)
@@ -198,6 +198,16 @@ class Whups_Query {
     }
 
     /**
+     * Returns a <link> tag for this query's feed.
+     *
+     * @return string  A full <link> tag.
+     */
+    function feedLink()
+    {
+        return '<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars($this->name) . '" href="' . Whups::urlFor('query_rss', empty($this->slug) ? array('id' => $this->id) : array('slug' => $this->slug), true, -1) . '" />';
+    }
+
+    /**
      * Tab operations for this query.
      */
     function getTabs($vars)
index 8c977ed..ab917db 100644 (file)
@@ -533,6 +533,16 @@ class Whups_Ticket {
     }
 
     /**
+     * Returns a <link> tag for this ticket's feed.
+     *
+     * @return string  A full <link> tag.
+     */
+    function feedLink()
+    {
+        return '<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars('[#' . $this->getId() . '] ' . $this->get('summary')) . '" href="' . Whups::urlFor('ticket_rss', $this->getId(), true, -1) . '" />';
+    }
+
+    /**
      * Sets exclusive read permissions on a comment to a certain group.
      *
      * @param integer $commentId  The id of the comment to restrict.
index fd2f5bc..8e0aef1 100644 (file)
@@ -52,7 +52,7 @@ $layout_html = $layout->toHtml();
 
 $title = sprintf(_("My %s"), $registry->get('name'));
 $menuBottom = '<div id="menuBottom"><a href="' . Horde::url('mybugs_edit.php') . '">' . _("Add Content") . '</a></div><div class="clear">&nbsp;</div>';
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 echo $layout_html;
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index a9f0ee5..0cf2ff0 100644 (file)
@@ -27,7 +27,7 @@ if ($layout->updated()) {
 }
 
 $title = sprintf(_("My %s :: Add Content"), $registry->get('name'));
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require $registry->get('templates', 'horde') . '/portal/edit.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index d33f272..2ae9573 100644 (file)
@@ -168,8 +168,11 @@ $qops = array(
 );
 
 // Start the page.
+if ($whups_query->id) {
+    $linkTags[] = $whups_query->feedLink();
+}
 $title = _("Query Builder");
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 
 echo $queryTabs->render(Horde_Util::getFormData('action', 'edit'));
index e8306ff..a6c1cb5 100644 (file)
@@ -75,8 +75,11 @@ if ($isvalid) {
     $session->set('whups', 'last_search', Horde::url('query/run.php'));
 }
 
+if ($whups_query->id) {
+    $linkTags[] = $whups_query->feedLink();
+}
 $title = $whups_query->name ? $whups_query->name : _("Query Results");
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render($vars->get('action') ? $vars->get('action') : 'run');
index 64bfa95..1257630 100644 (file)
@@ -38,7 +38,7 @@ if (Horde_Util::getFormData('sortdir') !== null) {
 }
 
 $title = sprintf(_("Open tickets in %s"), $queue['name']);
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 
 $criteria = array('queue' => $id,
index 58df4e3..1341d39 100644 (file)
@@ -35,7 +35,7 @@ if (!count($queues)) {
 $reporter = new Whups_Reports($whups_driver);
 
 $title = _("Reports");
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 if (count($queues)) {
     require WHUPS_TEMPLATES . '/reports/stats.inc';
index 66ee86f..a9578ef 100644 (file)
@@ -152,7 +152,7 @@ if (($vars->get('formname') || $vars->get('summary') || $vars->get('states') ||
 }
 
 $title = _("Search");
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 
 if ($results) {
diff --git a/whups/templates/common-header.inc b/whups/templates/common-header.inc
deleted file mode 100644 (file)
index 2701fe8..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Whups: Copyright 2002-2010 The Horde Project.  Whups is under a Horde license. -->
-<!--   Horde Project: http://www.horde.org/ | Whups: http://www.horde.org/whups/    -->
-<!--              Horde Licenses: http://www.horde.org/licenses/                    -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $GLOBALS['registry']->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-if (isset($ticket)) {
-    echo '<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars('[#' . $ticket->getId() . '] ' . $ticket->get('summary')) . '" href="' . Whups::urlFor('ticket_rss', $ticket->getId(), true, -1) . '" />';
-}
-if (isset($whups_query) && isset($whups_query->id)) {
-    echo '<link rel="alternate" type="application/rss+xml" title="' . htmlspecialchars($whups_query->name) . '" href="' . Whups::urlFor('query_rss', empty($whups_query->slug) ? array('id' => $whups_query->id) : array('slug' => $whups_query->slug), true, -1) . '" />';
-}
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde::url('opensearch.php', true, -1) ?>" rel="search" type="application/opensearchdescription+xml" title="<?php echo $registry->get('name') . ' (' . Horde::url('', true) . ')' ?>" />
-</head>
-
-<body>
index af26ce9..e0b9e3e 100644 (file)
@@ -13,6 +13,8 @@ Horde_Registry::appInit('whups');
 require_once WHUPS_BASE . '/lib/Forms/AddComment.php';
 
 $ticket = Whups::getCurrentTicket();
+$linkTags[] = $ticket->feedLink();
+
 $vars = Horde_Variables::getDefaultVariables();
 $vars->set('id', $id = $ticket->getId());
 foreach ($ticket->getDetails() as $varname => $value) {
@@ -79,7 +81,7 @@ if ($vars->get('formname') == 'addcommentform' && $commentForm->validate($vars))
     }
 }
 
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index ac44c7e..588754a 100644 (file)
@@ -61,7 +61,7 @@ if ($valid1 && $valid2 && $valid3 &&
 
 // Start the page.
 $title = _("New Ticket");
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 
 if ($valid3 && $valid2 && $valid1) {
index a4dc1d1..ed184b3 100644 (file)
@@ -42,6 +42,7 @@ class DeleteTicketForm extends Horde_Form {
 }
 
 $ticket = Whups::getCurrentTicket();
+$linkTags[] = $ticket->feedLink();
 $details = $ticket->getDetails();
 if (!Whups::hasPermission($details['queue'], 'queue', Horde_Perms::DELETE)) {
     $notification->push(_("Permission Denied"), 'horde.error');
@@ -75,7 +76,7 @@ if ($vars->get('formname') == 'deleteticketform') {
     }
 }
 
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index 950a987..15d2265 100644 (file)
@@ -17,9 +17,10 @@ require_once WHUPS_BASE . '/lib/Renderer/Comment.php';
 $ticket = Whups::getCurrentTicket();
 $vars = Horde_Variables::getDefaultVariables();
 $ticket->setDetails($vars);
+$linkTags[] = $ticket->feedLink();
 
 $title = '[#' . $ticket->getId() . '] ' . $ticket->get('summary');
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index e16a076..ea32d7d 100644 (file)
@@ -117,6 +117,7 @@ class SetQueueStep3Form extends Horde_Form {
 }
 
 $ticket = Whups::getCurrentTicket();
+$linkTags[] = $ticket->feedLink();
 $vars = Horde_Variables::getDefaultVariables();
 $vars->set('id', $id = $ticket->getId());
 $form = $vars->get('formname');
@@ -190,7 +191,7 @@ if ($form == 'setqueuestep3form') {
 }
 
 $title = sprintf(_("Set Queue for %s"), '[#' . $id . '] ' . $ticket->get('summary'));
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index 40609c2..639e4aa 100644 (file)
@@ -65,6 +65,7 @@ class SetTypeStep2Form extends Horde_Form {
 }
 
 $ticket = Whups::getCurrentTicket();
+$linkTags[] = $ticket->feedLink();
 $details = $ticket->getDetails();
 if (!Whups::hasPermission($details['queue'], 'queue', 'update')) {
     $notification->push(_("Permission Denied"), 'horde.error');
@@ -121,7 +122,7 @@ if ($form == 'settypestep2form') {
 }
 
 $title = sprintf(_("Set Type for %s"), '[#' . $id . '] ' . $ticket->get('summary'));
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index 4197e15..5ecf60f 100644 (file)
@@ -13,6 +13,7 @@ Horde_Registry::appInit('whups');
 require_once WHUPS_BASE . '/lib/Forms/EditTicket.php';
 
 $ticket = Whups::getCurrentTicket();
+$linkTags[] = $ticket->feedLink();
 
 if (!Whups::hasPermission($ticket->get('queue'), 'queue', 'update')) {
     $notification->push(_("Permission Denied"), 'horde.error');
@@ -97,7 +98,7 @@ if ($vars->get('formname') == 'editticketform') {
 }
 
 $title = '[#' . $id . '] ' . $ticket->get('summary');
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index 124f382..70bea90 100644 (file)
@@ -35,6 +35,7 @@ class DeleteListenerForm extends Horde_Form {
 }
 
 $ticket = Whups::getCurrentTicket();
+$linkTags[] = $ticket->feedLink();
 $vars = Horde_Variables::getDefaultVariables();
 $vars->set('id', $id = $ticket->getId());
 foreach ($ticket->getDetails() as $varname => $value) {
@@ -72,7 +73,7 @@ if ($vars->get('formname') == 'addlistenerform') {
 }
 
 $title = sprintf(_("Watchers for %s"), '[#' . $id . '] ' . $ticket->get('summary'));
-require WHUPS_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WHUPS_TEMPLATES . '/menu.inc';
 require WHUPS_TEMPLATES . '/prevnext.inc';
 
index 479ac45..feef711 100644 (file)
@@ -51,7 +51,7 @@ if (!$page->allows(Wicked::MODE_DIFF)) {
 }
 
 $title = sprintf(_("Diff for %s between %s and %s"), $page->pageName(), $v1, $page->version());
-require WICKED_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WICKED_TEMPLATES . '/menu.inc';
 $page->render(Wicked::MODE_DIFF, $v1);
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 4693207..e3ea8ef 100644 (file)
@@ -130,7 +130,7 @@ if ($page->isLocked()) {
 $history = $session->get('wicked', 'history', Horde_Session::TYPE_ARRAY);
 
 $title = $page->pageTitle();
-require WICKED_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WICKED_TEMPLATES . '/menu.inc';
 $page->render(Wicked::MODE_DISPLAY, $params);
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index 54565bc..b1cd4ff 100644 (file)
@@ -24,7 +24,7 @@ if (!$page->allows(Wicked::MODE_HISTORY)) {
 }
 
 $title = sprintf(_("History: %s"), $page->pageName());
-require WICKED_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WICKED_TEMPLATES . '/menu.inc';
 $page->render(Wicked::MODE_HISTORY);
 require $registry->get('templates', 'horde') . '/common-footer.inc';
index a662302..e45572e 100644 (file)
@@ -45,11 +45,13 @@ class Wicked_Application extends Horde_Registry_Application
      * Wicked initialization.
      *
      * Global variables defined:
-     *   $wicked - The Wicked_Driver object.
+     * - $wicked:   The Wicked_Driver object.
+     * - $linkTags: <link> tags for common-header.inc.
      */
     protected function _init()
     {
         $GLOBALS['wicked'] = Wicked_Driver::factory();
+        $GLOBALS['linkTags'] = array('<link href="' . Horde::url('opensearch.php', true, -1) . '" rel="search" type="application/opensearchdescription+xml" title="' . $GLOBALS['registry']->get('name') . ' (' . Horde::url('', true) . ')" />');
     }
 
     /**
index 5d2777f..40719dd 100644 (file)
@@ -20,7 +20,7 @@ $wiki = &$page->getProcessor();
 $text = $wiki->transform($text);
 
 $title = sprintf(_("Edit %s"), Horde_Util::getFormData('age'));
-require WICKED_TEMPLATES . '/common-header.inc';
+require $registry->get('templates', 'horde') . '/common-header.inc';
 require WICKED_TEMPLATES . '/menu.inc';
 require WICKED_TEMPLATES . '/edit/preview.inc';
 require $registry->get('templates', 'horde') . '/common-footer.inc';
diff --git a/wicked/templates/common-header.inc b/wicked/templates/common-header.inc
deleted file mode 100644 (file)
index 74c4bc0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-if (isset($language)) {
-    header('Content-type: text/html; charset=UTF-8');
-    header('Vary: Accept-Language');
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<!-- Wicked: Copyright 2003-2010 The Horde Project.  Wicked is under a Horde license. -->
-<!--    Horde Project: http://www.horde.org/ | Wicked: http://www.horde.org/wicked/   -->
-<!--               Horde Licenses: http://www.horde.org/licenses/                     -->
-<?php echo !empty($language) ? '<html lang="' . strtr($language, '_', '-') . '">' : '<html>' ?>
-<head>
-<?php
-
-$page_title = $registry->get('name');
-if (!empty($title)) {
-    $page_title .= ' :: ' . $title;
-}
-
-Horde::outputMetaTags();
-Horde::includeScriptFiles();
-Horde::includeFavicon();
-Horde::includeStylesheetFiles();
-
-?>
-<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo Horde::url('opensearch.php', true, -1) ?>" rel="search" type="application/opensearchdescription+xml" title="<?php echo $registry->get('name') . ' (' . Horde::url('', true) . ')' ?>" />
-</head>
-
-<body>