From c2ac9b9b759c3cde20ac00959f3b78ad9b596ffb Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 9 Dec 2010 15:59:31 +0100 Subject: [PATCH] One common-header.inc to rule them (almost) all. --- agora/ban.php | 2 +- agora/deleteforum.php | 2 +- agora/editforum.php | 2 +- agora/forums.php | 3 +- agora/messages/abuse.php | 2 +- agora/messages/delete.php | 2 +- agora/messages/edit.php | 2 +- agora/messages/index.php | 2 +- agora/messages/lock.php | 2 +- agora/messages/merge.php | 2 +- agora/messages/move.php | 2 +- agora/messages/split.php | 2 +- agora/moderate.php | 2 +- agora/moderators.php | 2 +- agora/owner.php | 2 +- agora/search.php | 2 +- agora/templates/common-header.inc | 30 ------------------- agora/threads.php | 2 +- ansel/browse.php | 2 +- ansel/browse_edit.php | 2 +- ansel/disclamer.php | 2 +- ansel/faces/claim.php | 2 +- ansel/faces/custom.php | 2 +- ansel/faces/face.php | 2 +- ansel/faces/gallery.php | 2 +- ansel/faces/report.php | 2 +- ansel/faces/search/all.php | 2 +- ansel/faces/search/image.php | 2 +- ansel/faces/search/image_define.php | 2 +- ansel/faces/search/image_search.php | 2 +- ansel/faces/search/name.php | 2 +- ansel/faces/search/named.php | 2 +- ansel/faces/search/owner.php | 2 +- ansel/gallery.php | 2 +- ansel/gallery/captions.php | 2 +- ansel/gallery/sort.php | 2 +- ansel/group.php | 2 +- ansel/image.php | 12 ++++---- ansel/img/ecard.php | 2 +- ansel/img/upload.php | 2 +- ansel/lib/Ansel.php | 11 ------- ansel/lib/Application.php | 3 ++ ansel/lib/View/GalleryProperties.php | 2 +- ansel/protect.php | 2 +- ansel/report.php | 2 +- ansel/templates/common-header.inc | 31 -------------------- ansel/view.php | 4 +-- ansel/xppublish.php | 2 +- beatnik/editrec.php | 3 +- beatnik/lib/Beatnik.php | 11 +++++++ beatnik/listzones.php | 3 +- beatnik/templates/common-header.inc | 39 ------------------------- beatnik/viewzone.php | 3 +- chora/annotate.php | 7 ++--- chora/browsedir.php | 2 +- chora/browsefile.php | 2 +- chora/co.php | 2 +- chora/commit.php | 2 +- chora/cvsgraph.php | 2 +- chora/diff.php | 2 +- chora/history.php | 2 +- chora/lib/Chora.php | 2 +- chora/patchsets.php | 2 +- chora/stats.php | 2 +- chora/templates/common-header.inc | 30 ------------------- folks/account/resetpassword.php | 2 +- folks/account/signup.php | 2 +- folks/account/username.php | 2 +- folks/activity.php | 2 +- folks/birthday.php | 2 +- folks/edit/activity.php | 2 +- folks/edit/comments.php | 2 +- folks/edit/edit.php | 2 +- folks/edit/facebook.php | 2 +- folks/edit/friends/add.php | 2 +- folks/edit/friends/blacklist.php | 2 +- folks/edit/friends/for.php | 2 +- folks/edit/friends/friends.php | 2 +- folks/edit/friends/from.php | 2 +- folks/edit/friends/groups.php | 2 +- folks/edit/friends/index.php | 2 +- folks/edit/friends/invite.php | 2 +- folks/edit/friends/know.php | 2 +- folks/edit/friends/of.php | 2 +- folks/edit/password.php | 2 +- folks/edit/privacy.php | 2 +- folks/friends.php | 2 +- folks/lib/Application.php | 21 ++++++++++++++ folks/list.php | 2 +- folks/login.php | 2 +- folks/new.php | 2 +- folks/online.php | 2 +- folks/perms.php | 2 +- folks/popularity.php | 2 +- folks/report.php | 2 +- folks/search.php | 2 +- folks/services.php | 2 +- folks/templates/common-header.inc | 33 --------------------- folks/user.php | 2 +- gollem/clipboard.php | 3 +- gollem/edit.php | 3 +- gollem/manager.php | 3 +- gollem/permissions.php | 3 +- gollem/quota.php | 3 +- gollem/selectlist.php | 3 +- gollem/templates/common-header.inc | 33 --------------------- hermes/admin.php | 2 +- hermes/deliverables.php | 2 +- hermes/entry.php | 2 +- hermes/invoicing.php | 2 +- hermes/search.php | 2 +- hermes/start.php | 2 +- hermes/templates/common-header.inc | 29 ------------------- hermes/time.php | 2 +- hylax/compose.php | 2 +- hylax/folder.php | 2 +- hylax/send.php | 2 +- hylax/summary.php | 2 +- hylax/templates/common-header.inc | 29 ------------------- hylax/view.php | 2 +- ingo/blacklist.php | 2 +- ingo/filters.php | 2 +- ingo/forward.php | 2 +- ingo/rule.php | 2 +- ingo/script.php | 2 +- ingo/spam.php | 2 +- ingo/templates/common-header.inc | 24 ---------------- ingo/vacation.php | 2 +- ingo/whitelist.php | 2 +- jonah/feed.php | 2 +- jonah/lib/Application.php | 10 +++++++ jonah/lib/View/Base.php | 2 +- jonah/lib/View/ChannelDelete.php | 2 +- jonah/lib/View/ChannelEdit.php | 2 +- jonah/lib/View/ChannelList.php | 2 +- jonah/lib/View/DeliveryHtml.php | 2 +- jonah/lib/View/StoryDelete.php | 2 +- jonah/lib/View/StoryEdit.php | 2 +- jonah/lib/View/StoryList.php | 2 +- jonah/lib/View/StoryView.php | 4 +-- jonah/lib/View/TagSearchList.php | 2 +- jonah/stories/share.php | 2 +- jonah/stories/view.php | 2 +- jonah/templates/common-header.inc | 33 --------------------- kronolith/attend.php | 3 +- kronolith/attendees.php | 3 +- kronolith/calendars/create.php | 3 +- kronolith/calendars/delete.php | 3 +- kronolith/calendars/edit.php | 3 +- kronolith/calendars/index.php | 3 +- kronolith/calendars/remote_edit.php | 3 +- kronolith/calendars/remote_subscribe.php | 3 +- kronolith/calendars/remote_unsubscribe.php | 3 +- kronolith/contacts.php | 3 +- kronolith/data.php | 3 +- kronolith/day.php | 12 +++++--- kronolith/event.php | 10 +++++-- kronolith/lib/Application.php | 8 +++++- kronolith/month.php | 12 +++++--- kronolith/new.php | 3 +- kronolith/perms.php | 3 +- kronolith/resources/create.php | 3 +- kronolith/resources/delete.php | 3 +- kronolith/resources/edit.php | 3 +- kronolith/resources/groups/create.php | 3 +- kronolith/resources/groups/delete.php | 3 +- kronolith/resources/groups/edit.php | 3 +- kronolith/resources/groups/index.php | 3 +- kronolith/resources/index.php | 3 +- kronolith/search.php | 3 +- kronolith/templates/common-header.inc | 44 ---------------------------- kronolith/week.php | 12 +++++--- kronolith/workweek.php | 12 +++++--- kronolith/year.php | 11 +++++-- luxor/search.php | 2 +- luxor/source.php | 2 +- luxor/symbol.php | 2 +- luxor/templates/common-header.inc | 29 ------------------- mnemo/data.php | 2 +- mnemo/lib/Application.php | 1 + mnemo/list.php | 6 +++- mnemo/memo.php | 2 +- mnemo/notepads/create.php | 2 +- mnemo/notepads/delete.php | 2 +- mnemo/notepads/edit.php | 2 +- mnemo/notepads/index.php | 2 +- mnemo/notes/index.php | 6 +++- mnemo/search.php | 6 +++- mnemo/stickies.php | 6 +++- mnemo/templates/common-header.inc | 35 ----------------------- mnemo/view.php | 2 +- nag/data.php | 4 +-- nag/lib/Application.php | 2 ++ nag/lib/Nag.php | 7 +++++ nag/list.php | 8 ++++-- nag/search.php | 7 +++-- nag/task.php | 4 +-- nag/tasklists/create.php | 4 +-- nag/tasklists/delete.php | 4 +-- nag/tasklists/edit.php | 4 +-- nag/tasklists/index.php | 4 +-- nag/tasks/index.php | 8 ++++-- nag/templates/common-header.inc | 46 ------------------------------ nag/templates/quick.inc | 11 +++++++ nag/view.php | 4 +-- operator/export.php | 2 +- operator/search.php | 2 +- operator/templates/common-header.inc | 29 ------------------- operator/viewgraph.php | 2 +- passwd/main.php | 2 +- passwd/templates/common-header.inc | 30 ------------------- pastie/paste.php | 2 +- pastie/templates/common-header.inc | 26 ----------------- pastie/view.php | 2 +- shout/admin.php | 2 +- shout/admin/accounts.php | 2 +- shout/admin/numbers.php | 2 +- shout/conferences.php | 2 +- shout/devices.php | 2 +- shout/dialplan.php | 2 +- shout/extensions.php | 2 +- shout/recordings.php | 2 +- shout/templates/common-header.inc | 29 ------------------- shout/wizard.php | 2 +- skeleton/list.php | 2 +- skeleton/templates/common-header.inc | 26 ----------------- trean/add.php | 4 +-- trean/browse.php | 2 +- trean/data.php | 2 +- trean/edit.php | 4 +-- trean/lib/Application.php | 16 +++++++++-- trean/reports.php | 2 +- trean/search.php | 2 +- trean/templates/common-header.inc | 45 ----------------------------- turba/add.php | 2 +- turba/addressbooks/create.php | 2 +- turba/addressbooks/delete.php | 2 +- turba/addressbooks/edit.php | 2 +- turba/addressbooks/index.php | 2 +- turba/contact.php | 2 +- turba/data.php | 4 +-- turba/delete.php | 2 +- turba/edit.php | 2 +- turba/lib/View/Browse.php | 2 +- turba/minisearch.php | 2 +- turba/search.php | 4 +-- turba/templates/common-header.inc | 30 ------------------- vilma/domains/delete.php | 2 +- vilma/domains/edit.php | 2 +- vilma/domains/index.php | 2 +- vilma/templates/common-header.inc | 30 ------------------- vilma/users/delete.php | 2 +- vilma/users/edit.php | 2 +- vilma/users/editAlias.php | 2 +- vilma/users/editForward.php | 2 +- vilma/users/index.php | 2 +- vilma/virtuals/delete.php | 2 +- vilma/virtuals/edit.php | 2 +- vilma/virtuals/index.php | 2 +- whups/admin/index.php | 2 +- whups/lib/Application.php | 5 +++- whups/lib/Query.php | 10 +++++++ whups/lib/Ticket.php | 10 +++++++ whups/mybugs.php | 2 +- whups/mybugs_edit.php | 2 +- whups/query/index.php | 5 +++- whups/query/run.php | 5 +++- whups/queue/index.php | 2 +- whups/reports.php | 2 +- whups/search.php | 2 +- whups/templates/common-header.inc | 37 ------------------------ whups/ticket/comment.php | 4 ++- whups/ticket/create.php | 2 +- whups/ticket/delete.php | 3 +- whups/ticket/index.php | 3 +- whups/ticket/queue.php | 3 +- whups/ticket/type.php | 3 +- whups/ticket/update.php | 3 +- whups/ticket/watch.php | 3 +- wicked/diff.php | 2 +- wicked/display.php | 2 +- wicked/history.php | 2 +- wicked/lib/Application.php | 4 ++- wicked/preview.php | 2 +- wicked/templates/common-header.inc | 30 ------------------- 285 files changed, 497 insertions(+), 1079 deletions(-) delete mode 100644 agora/templates/common-header.inc delete mode 100644 ansel/templates/common-header.inc delete mode 100644 beatnik/templates/common-header.inc delete mode 100644 chora/templates/common-header.inc delete mode 100644 folks/templates/common-header.inc delete mode 100644 gollem/templates/common-header.inc delete mode 100644 hermes/templates/common-header.inc delete mode 100644 hylax/templates/common-header.inc delete mode 100644 ingo/templates/common-header.inc delete mode 100644 jonah/templates/common-header.inc delete mode 100644 kronolith/templates/common-header.inc delete mode 100644 luxor/templates/common-header.inc delete mode 100644 mnemo/templates/common-header.inc delete mode 100644 nag/templates/common-header.inc create mode 100644 nag/templates/quick.inc delete mode 100644 operator/templates/common-header.inc delete mode 100644 passwd/templates/common-header.inc delete mode 100644 pastie/templates/common-header.inc delete mode 100644 shout/templates/common-header.inc delete mode 100644 skeleton/templates/common-header.inc delete mode 100644 trean/templates/common-header.inc delete mode 100644 turba/templates/common-header.inc delete mode 100644 vilma/templates/common-header.inc delete mode 100644 whups/templates/common-header.inc delete mode 100644 wicked/templates/common-header.inc diff --git a/agora/ban.php b/agora/ban.php index e8d057f62..9ee13573f 100644 --- a/agora/ban.php +++ b/agora/ban.php @@ -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'; diff --git a/agora/deleteforum.php b/agora/deleteforum.php index f0e778bf1..e63b2835c 100644 --- a/agora/deleteforum.php +++ b/agora/deleteforum.php @@ -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'; diff --git a/agora/editforum.php b/agora/editforum.php index 7185cac4d..c7a81a324 100644 --- a/agora/editforum.php +++ b/agora/editforum.php @@ -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'; diff --git a/agora/forums.php b/agora/forums.php index 331ed5473..61aa47f2f 100644 --- a/agora/forums.php +++ b/agora/forums.php @@ -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(''); +require $registry->get('templates', 'horde') . '/common-header.inc'; echo $view->render('forums.html.php'); require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/agora/messages/abuse.php b/agora/messages/abuse.php index 4f6b9ab14..d29f47f3a 100644 --- a/agora/messages/abuse.php +++ b/agora/messages/abuse.php @@ -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'; diff --git a/agora/messages/delete.php b/agora/messages/delete.php index d5d6ca61e..9831d3ede 100644 --- a/agora/messages/delete.php +++ b/agora/messages/delete.php @@ -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'; diff --git a/agora/messages/edit.php b/agora/messages/edit.php index 817489c54..3e93e455f 100644 --- a/agora/messages/edit.php +++ b/agora/messages/edit.php @@ -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'; diff --git a/agora/messages/index.php b/agora/messages/index.php index cf9e56ae9..1bed3c664 100644 --- a/agora/messages/index.php +++ b/agora/messages/index.php @@ -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'; diff --git a/agora/messages/lock.php b/agora/messages/lock.php index c39eb31d0..8f8402ae6 100644 --- a/agora/messages/lock.php +++ b/agora/messages/lock.php @@ -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'; diff --git a/agora/messages/merge.php b/agora/messages/merge.php index bff29491f..9a5aa0d3f 100644 --- a/agora/messages/merge.php +++ b/agora/messages/merge.php @@ -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'; diff --git a/agora/messages/move.php b/agora/messages/move.php index a90ed94a4..27484a071 100644 --- a/agora/messages/move.php +++ b/agora/messages/move.php @@ -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'; diff --git a/agora/messages/split.php b/agora/messages/split.php index 7f78a6338..de863c172 100644 --- a/agora/messages/split.php +++ b/agora/messages/split.php @@ -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'; diff --git a/agora/moderate.php b/agora/moderate.php index 28f777846..80087ad6d 100644 --- a/agora/moderate.php +++ b/agora/moderate.php @@ -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'; } diff --git a/agora/moderators.php b/agora/moderators.php index 903d69ac3..aa8211d0f 100644 --- a/agora/moderators.php +++ b/agora/moderators.php @@ -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'; diff --git a/agora/owner.php b/agora/owner.php index 02bafe3b3..8a32246f4 100644 --- a/agora/owner.php +++ b/agora/owner.php @@ -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')); diff --git a/agora/search.php b/agora/search.php index 18081b757..33f0a9f56 100644 --- a/agora/search.php +++ b/agora/search.php @@ -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 index 8fab3b204..000000000 --- a/agora/templates/common-header.inc +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> -" href="" type="application/rss+xml" /> - - - diff --git a/agora/threads.php b/agora/threads.php index b80ca5a7b..449ac68b4 100644 --- a/agora/threads.php +++ b/agora/threads.php @@ -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'; diff --git a/ansel/browse.php b/ansel/browse.php index ae017addb..36b851b63 100644 --- a/ansel/browse.php +++ b/ansel/browse.php @@ -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 '
 
'; diff --git a/ansel/browse_edit.php b/ansel/browse_edit.php index 4cfaa48c8..de1bc400c 100644 --- a/ansel/browse_edit.php +++ b/ansel/browse_edit.php @@ -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'; diff --git a/ansel/disclamer.php b/ansel/disclamer.php index a414c5db6..b45396a36 100644 --- a/ansel/disclamer.php +++ b/ansel/disclamer.php @@ -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'); diff --git a/ansel/faces/claim.php b/ansel/faces/claim.php index 3aef1987d..f80e91094 100644 --- a/ansel/faces/claim.php +++ b/ansel/faces/claim.php @@ -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'); diff --git a/ansel/faces/custom.php b/ansel/faces/custom.php index 95ac5745c..bb5905dc6 100644 --- a/ansel/faces/custom.php +++ b/ansel/faces/custom.php @@ -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'; diff --git a/ansel/faces/face.php b/ansel/faces/face.php index 4c4e53488..0884dd2ca 100644 --- a/ansel/faces/face.php +++ b/ansel/faces/face.php @@ -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'; diff --git a/ansel/faces/gallery.php b/ansel/faces/gallery.php index c684f2626..301138bd5 100644 --- a/ansel/faces/gallery.php +++ b/ansel/faces/gallery.php @@ -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') . ''); 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'; diff --git a/ansel/faces/report.php b/ansel/faces/report.php index c6c7e261e..1ac306c96 100644 --- a/ansel/faces/report.php +++ b/ansel/faces/report.php @@ -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'); diff --git a/ansel/faces/search/all.php b/ansel/faces/search/all.php index 34df0359d..d5579ee1a 100644 --- a/ansel/faces/search/all.php +++ b/ansel/faces/search/all.php @@ -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'; diff --git a/ansel/faces/search/image.php b/ansel/faces/search/image.php index 3fb3bdb64..69f4737c9 100644 --- a/ansel/faces/search/image.php +++ b/ansel/faces/search/image.php @@ -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')); diff --git a/ansel/faces/search/image_define.php b/ansel/faces/search/image_define.php index a6f5e789f..b6cb1bd77 100644 --- a/ansel/faces/search/image_define.php +++ b/ansel/faces/search/image_define.php @@ -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'; diff --git a/ansel/faces/search/image_search.php b/ansel/faces/search/image_search.php index 24a8a90c7..1d558a594 100644 --- a/ansel/faces/search/image_search.php +++ b/ansel/faces/search/image_search.php @@ -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'; diff --git a/ansel/faces/search/name.php b/ansel/faces/search/name.php index 0e0387be0..67f59b491 100644 --- a/ansel/faces/search/name.php +++ b/ansel/faces/search/name.php @@ -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'; diff --git a/ansel/faces/search/named.php b/ansel/faces/search/named.php index f225a1fe7..a91a33544 100644 --- a/ansel/faces/search/named.php +++ b/ansel/faces/search/named.php @@ -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'; diff --git a/ansel/faces/search/owner.php b/ansel/faces/search/owner.php index d4788cdb9..10a2e0baa 100644 --- a/ansel/faces/search/owner.php +++ b/ansel/faces/search/owner.php @@ -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'; diff --git a/ansel/gallery.php b/ansel/gallery.php index 53a63b44c..a6b4f4fa7 100644 --- a/ansel/gallery.php +++ b/ansel/gallery.php @@ -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'; diff --git a/ansel/gallery/captions.php b/ansel/gallery/captions.php index bdbd95aa5..ab99fb7f5 100644 --- a/ansel/gallery/captions.php +++ b/ansel/gallery/captions.php @@ -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'; diff --git a/ansel/gallery/sort.php b/ansel/gallery/sort.php index 38f705d4c..f57bee8ae 100644 --- a/ansel/gallery/sort.php +++ b/ansel/gallery/sort.php @@ -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')); ?> diff --git a/ansel/group.php b/ansel/group.php index dbad0147a..8210358ee 100644 --- a/ansel/group.php +++ b/ansel/group.php @@ -82,7 +82,7 @@ if ($groupby !== 'none') { $groupby_links[] = Ansel::getUrlFor('group', array('actionID' => 'groupby', 'groupby' => 'none'))->link() . _("none") . ''; } -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'; diff --git a/ansel/image.php b/ansel/image.php index 56701a7db..6b6aa2973 100644 --- a/ansel/image.php +++ b/ansel/image.php @@ -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'); diff --git a/ansel/img/ecard.php b/ansel/img/ecard.php index 73e8b704b..b0a7e6794 100644 --- a/ansel/img/ecard.php +++ b/ansel/img/ecard.php @@ -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'; diff --git a/ansel/img/upload.php b/ansel/img/upload.php index 59d319ef7..0a03adb33 100644 --- a/ansel/img/upload.php +++ b/ansel/img/upload.php @@ -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 '
' . Ansel::getBreadCrumbs($gallery) . '
'; require ANSEL_TEMPLATES . '/image/plupload.inc'; diff --git a/ansel/lib/Ansel.php b/ansel/lib/Ansel.php index d0b6db860..44433e45a 100644 --- a/ansel/lib/Ansel.php +++ b/ansel/lib/Ansel.php @@ -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 diff --git a/ansel/lib/Application.php b/ansel/lib/Application.php index e5cd0dee5..e8ccb00e7 100644 --- a/ansel/lib/Application.php +++ b/ansel/lib/Application.php @@ -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))); } /** diff --git a/ansel/lib/View/GalleryProperties.php b/ansel/lib/View/GalleryProperties.php index 3356f9ffd..c990926f0 100644 --- a/ansel/lib/View/GalleryProperties.php +++ b/ansel/lib/View/GalleryProperties.php @@ -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'); diff --git a/ansel/protect.php b/ansel/protect.php index b640afc27..eb36f609f 100644 --- a/ansel/protect.php +++ b/ansel/protect.php @@ -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 '
' . Ansel::getBreadCrumbs() . '
'; diff --git a/ansel/report.php b/ansel/report.php index 0a1a338ab..1e8d5adcb 100644 --- a/ansel/report.php +++ b/ansel/report.php @@ -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 index 5b1ea0b90..000000000 --- a/ansel/templates/common-header.inc +++ /dev/null @@ -1,31 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); -echo Horde::wrapInlineScript(Ansel::initJSVars()); -Horde::outputInlineScript(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/ansel/view.php b/ansel/view.php index 79adfa1ae..ac43c5beb 100644 --- a/ansel/view.php +++ b/ansel/view.php @@ -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 '
' . htmlspecialchars($e->getMessage()) . ''; @@ -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(); diff --git a/ansel/xppublish.php b/ansel/xppublish.php index 45e67a131..effe1c8bb 100644 --- a/ansel/xppublish.php +++ b/ansel/xppublish.php @@ -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') { diff --git a/beatnik/editrec.php b/beatnik/editrec.php index 6b7ec570c..7c0bd02cc 100644 --- a/beatnik/editrec.php +++ b/beatnik/editrec.php @@ -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'); diff --git a/beatnik/lib/Beatnik.php b/beatnik/lib/Beatnik.php index 9ff718d02..fec557d6b 100644 --- a/beatnik/lib/Beatnik.php +++ b/beatnik/lib/Beatnik.php @@ -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 diff --git a/beatnik/listzones.php b/beatnik/listzones.php index dfaaad591..babd460b7 100644 --- a/beatnik/listzones.php +++ b/beatnik/listzones.php @@ -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 index 73ce0853b..000000000 --- a/beatnik/templates/common-header.inc +++ /dev/null @@ -1,39 +0,0 @@ - - * - * 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)); - } -} -?> - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - diff --git a/beatnik/viewzone.php b/beatnik/viewzone.php index bae137c37..a0b3aa12e 100644 --- a/beatnik/viewzone.php +++ b/beatnik/viewzone.php @@ -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 diff --git a/chora/annotate.php b/chora/annotate.php index 254926aa0..74b634bef 100644 --- a/chora/annotate.php +++ b/chora/annotate.php @@ -48,13 +48,12 @@ $extraLink = sprintf('%s | %s', 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'; diff --git a/chora/browsedir.php b/chora/browsedir.php index db27e4830..dae1f9228 100644 --- a/chora/browsedir.php +++ b/chora/browsedir.php @@ -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'; diff --git a/chora/browsefile.php b/chora/browsefile.php index d2b6fde42..195413d0b 100644 --- a/chora/browsefile.php +++ b/chora/browsefile.php @@ -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'; diff --git a/chora/co.php b/chora/co.php index 0580494a7..e475ddd28 100644 --- a/chora/co.php +++ b/chora/co.php @@ -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'; diff --git a/chora/commit.php b/chora/commit.php index 1d8e542e0..4d8b1e5d0 100644 --- a/chora/commit.php +++ b/chora/commit.php @@ -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'; diff --git a/chora/cvsgraph.php b/chora/cvsgraph.php index 872d6ac77..31334f3b6 100644 --- a/chora/cvsgraph.php +++ b/chora/cvsgraph.php @@ -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'; diff --git a/chora/diff.php b/chora/diff.php index 3d22110b2..934e1a93c 100644 --- a/chora/diff.php +++ b/chora/diff.php @@ -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'; diff --git a/chora/history.php b/chora/history.php index 61e04ee28..eb3dc2995 100644 --- a/chora/history.php +++ b/chora/history.php @@ -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'; diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index e0b84dfc4..8f6bb9d9b 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -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; diff --git a/chora/patchsets.php b/chora/patchsets.php index 1093bf1af..6b61eacf2 100644 --- a/chora/patchsets.php +++ b/chora/patchsets.php @@ -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'; diff --git a/chora/stats.php b/chora/stats.php index a6c0dccf2..5535558d2 100644 --- a/chora/stats.php +++ b/chora/stats.php @@ -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 index 7bb033705..000000000 --- a/chora/templates/common-header.inc +++ /dev/null @@ -1,30 +0,0 @@ - - -' : ''; - -$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(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/folks/account/resetpassword.php b/folks/account/resetpassword.php index f216d2c2d..bc6be61c5 100644 --- a/folks/account/resetpassword.php +++ b/folks/account/resetpassword.php @@ -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'; diff --git a/folks/account/signup.php b/folks/account/signup.php index 25a21d6d2..475f2eaba 100644 --- a/folks/account/signup.php +++ b/folks/account/signup.php @@ -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'; diff --git a/folks/account/username.php b/folks/account/username.php index 583167c14..53940baf2 100644 --- a/folks/account/username.php +++ b/folks/account/username.php @@ -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'; diff --git a/folks/activity.php b/folks/activity.php index d9aa49d75..8c11b5ae4 100644 --- a/folks/activity.php +++ b/folks/activity.php @@ -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'; diff --git a/folks/birthday.php b/folks/birthday.php index 8dd092284..509950bde 100644 --- a/folks/birthday.php +++ b/folks/birthday.php @@ -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'; diff --git a/folks/edit/activity.php b/folks/edit/activity.php index 2e9e858c3..729d04b83 100644 --- a/folks/edit/activity.php +++ b/folks/edit/activity.php @@ -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'); diff --git a/folks/edit/comments.php b/folks/edit/comments.php index 7caac6493..2a5443a93 100644 --- a/folks/edit/comments.php +++ b/folks/edit/comments.php @@ -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'); diff --git a/folks/edit/edit.php b/folks/edit/edit.php index 08d06355f..ac7175b36 100644 --- a/folks/edit/edit.php +++ b/folks/edit/edit.php @@ -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'); diff --git a/folks/edit/facebook.php b/folks/edit/facebook.php index b49689af3..4aed0680c 100644 --- a/folks/edit/facebook.php +++ b/folks/edit/facebook.php @@ -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; diff --git a/folks/edit/friends/add.php b/folks/edit/friends/add.php index 872687179..ba0a0ae50 100644 --- a/folks/edit/friends/add.php +++ b/folks/edit/friends/add.php @@ -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'; diff --git a/folks/edit/friends/blacklist.php b/folks/edit/friends/blacklist.php index 422cd59bf..2987bfdb8 100644 --- a/folks/edit/friends/blacklist.php +++ b/folks/edit/friends/blacklist.php @@ -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'); diff --git a/folks/edit/friends/for.php b/folks/edit/friends/for.php index 132f2681b..394dde751 100644 --- a/folks/edit/friends/for.php +++ b/folks/edit/friends/for.php @@ -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'); diff --git a/folks/edit/friends/friends.php b/folks/edit/friends/friends.php index d5c9bf3bb..219b73e1e 100644 --- a/folks/edit/friends/friends.php +++ b/folks/edit/friends/friends.php @@ -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'); diff --git a/folks/edit/friends/from.php b/folks/edit/friends/from.php index 9ee7cee2c..551eb419c 100644 --- a/folks/edit/friends/from.php +++ b/folks/edit/friends/from.php @@ -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'); diff --git a/folks/edit/friends/groups.php b/folks/edit/friends/groups.php index 25f10ea3e..3239dbd5a 100644 --- a/folks/edit/friends/groups.php +++ b/folks/edit/friends/groups.php @@ -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'); diff --git a/folks/edit/friends/index.php b/folks/edit/friends/index.php index 5ab2ab492..4c1ba520d 100644 --- a/folks/edit/friends/index.php +++ b/folks/edit/friends/index.php @@ -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'); diff --git a/folks/edit/friends/invite.php b/folks/edit/friends/invite.php index c5d6094ad..8f3edfc48 100644 --- a/folks/edit/friends/invite.php +++ b/folks/edit/friends/invite.php @@ -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'); diff --git a/folks/edit/friends/know.php b/folks/edit/friends/know.php index fc4272c97..67f5d3640 100644 --- a/folks/edit/friends/know.php +++ b/folks/edit/friends/know.php @@ -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'); diff --git a/folks/edit/friends/of.php b/folks/edit/friends/of.php index 9ee54ee8a..be7075b7a 100644 --- a/folks/edit/friends/of.php +++ b/folks/edit/friends/of.php @@ -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'); diff --git a/folks/edit/password.php b/folks/edit/password.php index e29dc2fed..32ea79496 100644 --- a/folks/edit/password.php +++ b/folks/edit/password.php @@ -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'); diff --git a/folks/edit/privacy.php b/folks/edit/privacy.php index 54fa66b00..9118e9f57 100644 --- a/folks/edit/privacy.php +++ b/folks/edit/privacy.php @@ -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'); diff --git a/folks/friends.php b/folks/friends.php index 668aa7704..d059d7d24 100644 --- a/folks/friends.php +++ b/folks/friends.php @@ -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'; diff --git a/folks/lib/Application.php b/folks/lib/Application.php index afedc3325..4dbd80621 100644 --- a/folks/lib/Application.php +++ b/folks/lib/Application.php @@ -12,6 +12,27 @@ class Folks_Application extends Horde_Registry_Application public $version = 'H4 (0.1-git)'; /** + * Initialization function. + * + * Global variables defined: + * - $linkTags: 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'][] = ''; + } + } + + /** * Add additional items to the menu. * * @param Horde_Menu $menu The menu object. diff --git a/folks/list.php b/folks/list.php index 3b07e0ca3..fda0b58cc 100644 --- a/folks/list.php +++ b/folks/list.php @@ -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'; diff --git a/folks/login.php b/folks/login.php index 304517319..bb25efa83 100644 --- a/folks/login.php +++ b/folks/login.php @@ -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'; diff --git a/folks/new.php b/folks/new.php index bec0f7121..99f4dedc2 100644 --- a/folks/new.php +++ b/folks/new.php @@ -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'; diff --git a/folks/online.php b/folks/online.php index dd85be3e5..17a02d7f1 100644 --- a/folks/online.php +++ b/folks/online.php @@ -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'; diff --git a/folks/perms.php b/folks/perms.php index 7eda28201..3b4641004 100644 --- a/folks/perms.php +++ b/folks/perms.php @@ -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'; diff --git a/folks/popularity.php b/folks/popularity.php index e4936596b..a2ce23191 100644 --- a/folks/popularity.php +++ b/folks/popularity.php @@ -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'; diff --git a/folks/report.php b/folks/report.php index 20b059cd7..6fb7b1b50 100644 --- a/folks/report.php +++ b/folks/report.php @@ -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'; diff --git a/folks/search.php b/folks/search.php index 763733013..f2e23a3af 100644 --- a/folks/search.php +++ b/folks/search.php @@ -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'; diff --git a/folks/services.php b/folks/services.php index 19d4245b8..315365103 100644 --- a/folks/services.php +++ b/folks/services.php @@ -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 index e3fc6bc05..000000000 --- a/folks/templates/common-header.inc +++ /dev/null @@ -1,33 +0,0 @@ - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> -" /> -isAuthenticated()): ?> -" /> -" /> -" /> - - - - diff --git a/folks/user.php b/folks/user.php index 312346969..dc33b00a6 100644 --- a/folks/user.php +++ b/folks/user.php @@ -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']) { diff --git a/gollem/clipboard.php b/gollem/clipboard.php index 85feaba53..b7214cb07 100644 --- a/gollem/clipboard.php +++ b/gollem/clipboard.php @@ -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'); diff --git a/gollem/edit.php b/gollem/edit.php index 3e55c001e..2df587bc5 100644 --- a/gollem/edit.php +++ b/gollem/edit.php @@ -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'; diff --git a/gollem/manager.php b/gollem/manager.php index 2f3c1843c..e4cfdf25e 100644 --- a/gollem/manager.php +++ b/gollem/manager.php @@ -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'); diff --git a/gollem/permissions.php b/gollem/permissions.php index 0021031df..9451a26f1 100644 --- a/gollem/permissions.php +++ b/gollem/permissions.php @@ -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'; diff --git a/gollem/quota.php b/gollem/quota.php index 67c4164d1..d1bbb4254 100644 --- a/gollem/quota.php +++ b/gollem/quota.php @@ -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(); diff --git a/gollem/selectlist.php b/gollem/selectlist.php index bd9c881a8..2ec70f427 100644 --- a/gollem/selectlist.php +++ b/gollem/selectlist.php @@ -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 index 0acaf0044..000000000 --- a/gollem/templates/common-header.inc +++ /dev/null @@ -1,33 +0,0 @@ - - -' - : ''; -?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); -Horde::outputInlineScript(); - -require GOLLEM_TEMPLATES . '/javascript_defs.php'; - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/hermes/admin.php b/hermes/admin.php index 63ea8c052..6bd036cd6 100644 --- a/hermes/admin.php +++ b/hermes/admin.php @@ -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'; } } diff --git a/hermes/deliverables.php b/hermes/deliverables.php index 3983b0b87..17552d44b 100644 --- a/hermes/deliverables.php +++ b/hermes/deliverables.php @@ -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(); diff --git a/hermes/entry.php b/hermes/entry.php index 0c4fb2c1d..f2b03493d 100644 --- a/hermes/entry.php +++ b/hermes/entry.php @@ -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'; diff --git a/hermes/invoicing.php b/hermes/invoicing.php index 1051f549d..41567a818 100644 --- a/hermes/invoicing.php +++ b/hermes/invoicing.php @@ -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')); diff --git a/hermes/search.php b/hermes/search.php index 1f73a2817..09b671be9 100644 --- a/hermes/search.php +++ b/hermes/search.php @@ -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; diff --git a/hermes/start.php b/hermes/start.php index e06841627..9daef385d 100644 --- a/hermes/start.php +++ b/hermes/start.php @@ -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 index 15eaab2ca..000000000 --- a/hermes/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon() -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/hermes/time.php b/hermes/time.php index 4ce043890..2663045cc 100644 --- a/hermes/time.php +++ b/hermes/time.php @@ -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'; diff --git a/hylax/compose.php b/hylax/compose.php index 1d7bd1fb7..91088d507 100644 --- a/hylax/compose.php +++ b/hylax/compose.php @@ -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(); diff --git a/hylax/folder.php b/hylax/folder.php index 97643817c..bcb0ef3e6 100644 --- a/hylax/folder.php +++ b/hylax/folder.php @@ -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'; diff --git a/hylax/send.php b/hylax/send.php index 9cab84e06..626e2f2af 100644 --- a/hylax/send.php +++ b/hylax/send.php @@ -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'; diff --git a/hylax/summary.php b/hylax/summary.php index ac4678e46..af72696b5 100644 --- a/hylax/summary.php +++ b/hylax/summary.php @@ -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 index 246ac27b4..000000000 --- a/hylax/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/hylax/view.php b/hylax/view.php index c0e4ffa08..aad94f48c 100644 --- a/hylax/view.php +++ b/hylax/view.php @@ -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'; diff --git a/ingo/blacklist.php b/ingo/blacklist.php index b368329ba..f5206f5cc 100644 --- a/ingo/blacklist.php +++ b/ingo/blacklist.php @@ -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'; diff --git a/ingo/filters.php b/ingo/filters.php index b6f318dd9..806468dc5 100644 --- a/ingo/filters.php +++ b/ingo/filters.php @@ -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'; diff --git a/ingo/forward.php b/ingo/forward.php index 17946791a..9e88d0bf6 100644 --- a/ingo/forward.php +++ b/ingo/forward.php @@ -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'); diff --git a/ingo/rule.php b/ingo/rule.php index 3092b23e9..d1bfff714 100644 --- a/ingo/rule.php +++ b/ingo/rule.php @@ -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'; diff --git a/ingo/script.php b/ingo/script.php index 5aa2c96c5..43222125f 100644 --- a/ingo/script.php +++ b/ingo/script.php @@ -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'; diff --git a/ingo/spam.php b/ingo/spam.php index 92d6cc1b7..173c4f55d 100644 --- a/ingo/spam.php +++ b/ingo/spam.php @@ -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 index 3fdd05233..000000000 --- a/ingo/templates/common-header.inc +++ /dev/null @@ -1,24 +0,0 @@ -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} -?> - -' : '' ?> - - -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/ingo/vacation.php b/ingo/vacation.php index b65080d54..e9a2d7b1a 100644 --- a/ingo/vacation.php +++ b/ingo/vacation.php @@ -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'); diff --git a/ingo/whitelist.php b/ingo/whitelist.php index fcd54eb39..1c245b7b3 100644 --- a/ingo/whitelist.php +++ b/ingo/whitelist.php @@ -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'; diff --git a/jonah/feed.php b/jonah/feed.php index 17c9b6711..0799b6666 100644 --- a/jonah/feed.php +++ b/jonah/feed.php @@ -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'; diff --git a/jonah/lib/Application.php b/jonah/lib/Application.php index 4df785b2f..1506cd805 100644 --- a/jonah/lib/Application.php +++ b/jonah/lib/Application.php @@ -31,10 +31,20 @@ class Jonah_Application extends Horde_Registry_Application * Initialization function. * * Global variables defined: + * - $linkTags: 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(''); + } } /** diff --git a/jonah/lib/View/Base.php b/jonah/lib/View/Base.php index b377526ce..8a9a508f4 100644 --- a/jonah/lib/View/Base.php +++ b/jonah/lib/View/Base.php @@ -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; diff --git a/jonah/lib/View/ChannelDelete.php b/jonah/lib/View/ChannelDelete.php index 4f28c741b..c28b02860 100644 --- a/jonah/lib/View/ChannelDelete.php +++ b/jonah/lib/View/ChannelDelete.php @@ -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'; diff --git a/jonah/lib/View/ChannelEdit.php b/jonah/lib/View/ChannelEdit.php index e98dc1dc5..b1e1344ea 100644 --- a/jonah/lib/View/ChannelEdit.php +++ b/jonah/lib/View/ChannelEdit.php @@ -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'; diff --git a/jonah/lib/View/ChannelList.php b/jonah/lib/View/ChannelList.php index 8d76a9e84..bedd73a26 100644 --- a/jonah/lib/View/ChannelList.php +++ b/jonah/lib/View/ChannelList.php @@ -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'; diff --git a/jonah/lib/View/DeliveryHtml.php b/jonah/lib/View/DeliveryHtml.php index 5d73e8ac9..3cd9e216e 100644 --- a/jonah/lib/View/DeliveryHtml.php +++ b/jonah/lib/View/DeliveryHtml.php @@ -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'; } diff --git a/jonah/lib/View/StoryDelete.php b/jonah/lib/View/StoryDelete.php index f9222c91b..574689672 100644 --- a/jonah/lib/View/StoryDelete.php +++ b/jonah/lib/View/StoryDelete.php @@ -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'; diff --git a/jonah/lib/View/StoryEdit.php b/jonah/lib/View/StoryEdit.php index b1cabad94..c26d206a3 100644 --- a/jonah/lib/View/StoryEdit.php +++ b/jonah/lib/View/StoryEdit.php @@ -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'; diff --git a/jonah/lib/View/StoryList.php b/jonah/lib/View/StoryList.php index 58583d933..7bbaaf8e1 100644 --- a/jonah/lib/View/StoryList.php +++ b/jonah/lib/View/StoryList.php @@ -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'; diff --git a/jonah/lib/View/StoryView.php b/jonah/lib/View/StoryView.php index 17906417b..ddef7254f 100644 --- a/jonah/lib/View/StoryView.php +++ b/jonah/lib/View/StoryView.php @@ -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'; diff --git a/jonah/lib/View/TagSearchList.php b/jonah/lib/View/TagSearchList.php index e4b1ddc07..df25a7906 100644 --- a/jonah/lib/View/TagSearchList.php +++ b/jonah/lib/View/TagSearchList.php @@ -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'; diff --git a/jonah/stories/share.php b/jonah/stories/share.php index e52ac1995..4c740a67f 100644 --- a/jonah/stories/share.php +++ b/jonah/stories/share.php @@ -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'; diff --git a/jonah/stories/view.php b/jonah/stories/view.php index 75b1291e9..06b4b9779 100644 --- a/jonah/stories/view.php +++ b/jonah/stories/view.php @@ -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 index 6c228d58e..000000000 --- a/jonah/templates/common-header.inc +++ /dev/null @@ -1,33 +0,0 @@ - - -' : '' ?> - -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 ''; -} -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/kronolith/attend.php b/kronolith/attend.php index 699c85c0a..11cced396 100644 --- a/kronolith/attend.php +++ b/kronolith/attend.php @@ -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'; ?> diff --git a/kronolith/attendees.php b/kronolith/attendees.php index a7be69a79..0fcede35f 100644 --- a/kronolith/attendees.php +++ b/kronolith/attendees.php @@ -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'; diff --git a/kronolith/calendars/create.php b/kronolith/calendars/create.php index cf70e171c..0d222f35f 100644 --- a/kronolith/calendars/create.php +++ b/kronolith/calendars/create.php @@ -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'); diff --git a/kronolith/calendars/delete.php b/kronolith/calendars/delete.php index 62d6bd1ad..48eca31fc 100644 --- a/kronolith/calendars/delete.php +++ b/kronolith/calendars/delete.php @@ -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'); diff --git a/kronolith/calendars/edit.php b/kronolith/calendars/edit.php index 5a5bd9689..c4c7ebf90 100644 --- a/kronolith/calendars/edit.php +++ b/kronolith/calendars/edit.php @@ -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'); diff --git a/kronolith/calendars/index.php b/kronolith/calendars/index.php index 4c29f5ea4..0650261c7 100644 --- a/kronolith/calendars/index.php +++ b/kronolith/calendars/index.php @@ -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'; diff --git a/kronolith/calendars/remote_edit.php b/kronolith/calendars/remote_edit.php index aaefbb154..ab6ffa870 100644 --- a/kronolith/calendars/remote_edit.php +++ b/kronolith/calendars/remote_edit.php @@ -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'); diff --git a/kronolith/calendars/remote_subscribe.php b/kronolith/calendars/remote_subscribe.php index ec9bc3f9c..fae59838d 100644 --- a/kronolith/calendars/remote_subscribe.php +++ b/kronolith/calendars/remote_subscribe.php @@ -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'); diff --git a/kronolith/calendars/remote_unsubscribe.php b/kronolith/calendars/remote_unsubscribe.php index 40dbc1c68..a7780f81f 100644 --- a/kronolith/calendars/remote_unsubscribe.php +++ b/kronolith/calendars/remote_unsubscribe.php @@ -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'); diff --git a/kronolith/contacts.php b/kronolith/contacts.php index 10b28cf93..2d2891473 100644 --- a/kronolith/contacts.php +++ b/kronolith/contacts.php @@ -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'; diff --git a/kronolith/data.php b/kronolith/data.php index d0620e6fb..2e70e2619 100644 --- a/kronolith/data.php +++ b/kronolith/data.php @@ -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')); diff --git a/kronolith/day.php b/kronolith/day.php index 507c651dc..64dad0c68 100644 --- a/kronolith/day.php +++ b/kronolith/day.php @@ -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 '
'; diff --git a/kronolith/event.php b/kronolith/event.php index 7eabe6502..4cf2a0ae0 100644 --- a/kronolith/event.php +++ b/kronolith/event.php @@ -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 '
'; diff --git a/kronolith/lib/Application.php b/kronolith/lib/Application.php index 62b80c36f..2f53bdbcb 100644 --- a/kronolith/lib/Application.php +++ b/kronolith/lib/Application.php @@ -59,7 +59,8 @@ class Kronolith_Application extends Horde_Registry_Application * Initialization function. * * Global variables defined: - * $kronolith_shares - TODO + * - $kronolith_shares: TODO + * - $linkTags: 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'][] = ''; + } } /** diff --git a/kronolith/month.php b/kronolith/month.php index a8b43a120..b942a5685 100644 --- a/kronolith/month.php +++ b/kronolith/month.php @@ -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 '
'; diff --git a/kronolith/new.php b/kronolith/new.php index 80ff1f7a9..182d5e26a 100644 --- a/kronolith/new.php +++ b/kronolith/new.php @@ -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'; diff --git a/kronolith/perms.php b/kronolith/perms.php index fd7f5e2a8..72f740fc7 100644 --- a/kronolith/perms.php +++ b/kronolith/perms.php @@ -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'; diff --git a/kronolith/resources/create.php b/kronolith/resources/create.php index c340bc35c..3a6ef7fcd 100644 --- a/kronolith/resources/create.php +++ b/kronolith/resources/create.php @@ -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'); diff --git a/kronolith/resources/delete.php b/kronolith/resources/delete.php index b62e84d19..7894c6e11 100644 --- a/kronolith/resources/delete.php +++ b/kronolith/resources/delete.php @@ -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'); diff --git a/kronolith/resources/edit.php b/kronolith/resources/edit.php index 2fb016361..4518f20a6 100644 --- a/kronolith/resources/edit.php +++ b/kronolith/resources/edit.php @@ -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'); diff --git a/kronolith/resources/groups/create.php b/kronolith/resources/groups/create.php index 2029f9b12..4ce77a368 100644 --- a/kronolith/resources/groups/create.php +++ b/kronolith/resources/groups/create.php @@ -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'); diff --git a/kronolith/resources/groups/delete.php b/kronolith/resources/groups/delete.php index e3f4b5f0f..53af12a7e 100644 --- a/kronolith/resources/groups/delete.php +++ b/kronolith/resources/groups/delete.php @@ -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'); diff --git a/kronolith/resources/groups/edit.php b/kronolith/resources/groups/edit.php index ec7f81d08..033635fb4 100644 --- a/kronolith/resources/groups/edit.php +++ b/kronolith/resources/groups/edit.php @@ -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'); diff --git a/kronolith/resources/groups/index.php b/kronolith/resources/groups/index.php index 5c7af29f0..ecabe248b 100644 --- a/kronolith/resources/groups/index.php +++ b/kronolith/resources/groups/index.php @@ -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')); diff --git a/kronolith/resources/index.php b/kronolith/resources/index.php index bf26e5717..865aa6e9d 100644 --- a/kronolith/resources/index.php +++ b/kronolith/resources/index.php @@ -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')); diff --git a/kronolith/search.php b/kronolith/search.php index e41db8ce4..4dc92c79a 100644 --- a/kronolith/search.php +++ b/kronolith/search.php @@ -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 index 35f626252..000000000 --- a/kronolith/templates/common-header.inc +++ /dev/null @@ -1,44 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -foreach ($GLOBALS['display_calendars'] as $calendar) { - echo ''; -} - -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' - : ''; - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/kronolith/week.php b/kronolith/week.php index b8e155392..dcd6f427f 100644 --- a/kronolith/week.php +++ b/kronolith/week.php @@ -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 '
'; diff --git a/kronolith/workweek.php b/kronolith/workweek.php index eb7b700fe..1e9e811d7 100644 --- a/kronolith/workweek.php +++ b/kronolith/workweek.php @@ -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 '
'; diff --git a/kronolith/year.php b/kronolith/year.php index ae595e92f..65b1169dd 100644 --- a/kronolith/year.php +++ b/kronolith/year.php @@ -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 '
'; diff --git a/luxor/search.php b/luxor/search.php index 20a076902..36ba06c55 100644 --- a/luxor/search.php +++ b/luxor/search.php @@ -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 '

' . htmlspecialchars($title) . '

'; diff --git a/luxor/source.php b/luxor/source.php index ca37dab94..185bf57d4 100644 --- a/luxor/source.php +++ b/luxor/source.php @@ -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')) { diff --git a/luxor/symbol.php b/luxor/symbol.php index 5008b9c9e..7bd5508f1 100644 --- a/luxor/symbol.php +++ b/luxor/symbol.php @@ -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 index 828564282..000000000 --- a/luxor/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/mnemo/data.php b/mnemo/data.php index c453f9ae3..5dd29e80a 100644 --- a/mnemo/data.php +++ b/mnemo/data.php @@ -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(); diff --git a/mnemo/lib/Application.php b/mnemo/lib/Application.php index e9c554c49..7a44f6586 100644 --- a/mnemo/lib/Application.php +++ b/mnemo/lib/Application.php @@ -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'); } /** diff --git a/mnemo/list.php b/mnemo/list.php index d42ecbdbc..bbafff580 100644 --- a/mnemo/list.php +++ b/mnemo/list.php @@ -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'; diff --git a/mnemo/memo.php b/mnemo/memo.php index 3ea0b8ad3..15d6299ff 100644 --- a/mnemo/memo.php +++ b/mnemo/memo.php @@ -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'; diff --git a/mnemo/notepads/create.php b/mnemo/notepads/create.php index c8efe544c..ebf2e74b5 100644 --- a/mnemo/notepads/create.php +++ b/mnemo/notepads/create.php @@ -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'); diff --git a/mnemo/notepads/delete.php b/mnemo/notepads/delete.php index a01d8f57b..743ed12b1 100644 --- a/mnemo/notepads/delete.php +++ b/mnemo/notepads/delete.php @@ -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'); diff --git a/mnemo/notepads/edit.php b/mnemo/notepads/edit.php index 936fa70e8..2400a2058 100644 --- a/mnemo/notepads/edit.php +++ b/mnemo/notepads/edit.php @@ -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'); diff --git a/mnemo/notepads/index.php b/mnemo/notepads/index.php index 3bdd9051d..898743010 100644 --- a/mnemo/notepads/index.php +++ b/mnemo/notepads/index.php @@ -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'; diff --git a/mnemo/notes/index.php b/mnemo/notes/index.php index cf581e50c..566d06566 100644 --- a/mnemo/notes/index.php +++ b/mnemo/notes/index.php @@ -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'; diff --git a/mnemo/search.php b/mnemo/search.php index 51e13eecc..df44d2370 100644 --- a/mnemo/search.php +++ b/mnemo/search.php @@ -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'; diff --git a/mnemo/stickies.php b/mnemo/stickies.php index 9c63d6e97..ad61503b7 100644 --- a/mnemo/stickies.php +++ b/mnemo/stickies.php @@ -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 index 9d604b5a6..000000000 --- a/mnemo/templates/common-header.inc +++ /dev/null @@ -1,35 +0,0 @@ - - - - - -' : '' ?> - -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' - : ''; - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/mnemo/view.php b/mnemo/view.php index 9c9dcd998..abeecf1d9 100644 --- a/mnemo/view.php +++ b/mnemo/view.php @@ -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'; diff --git a/nag/data.php b/nag/data.php index 24bda67a3..e0daa3905 100644 --- a/nag/data.php +++ b/nag/data.php @@ -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) { diff --git a/nag/lib/Application.php b/nag/lib/Application.php index a12afbfe4..28359d56a 100644 --- a/nag/lib/Application.php +++ b/nag/lib/Application.php @@ -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'); } /** diff --git a/nag/lib/Nag.php b/nag/lib/Nag.php index a89450ce8..6d3e9fdba 100644 --- a/nag/lib/Nag.php +++ b/nag/lib/Nag.php @@ -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. */ diff --git a/nag/list.php b/nag/list.php index 389097ed5..b0bef2dc8 100644 --- a/nag/list.php +++ b/nag/list.php @@ -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 '
'; diff --git a/nag/search.php b/nag/search.php index c584e544b..a315e1f90 100644 --- a/nag/search.php +++ b/nag/search.php @@ -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'; diff --git a/nag/task.php b/nag/task.php index ed77ba097..28275bfac 100644 --- a/nag/task.php +++ b/nag/task.php @@ -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'; diff --git a/nag/tasklists/create.php b/nag/tasklists/create.php index 7ba25882d..b4587724e 100644 --- a/nag/tasklists/create.php +++ b/nag/tasklists/create.php @@ -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'; diff --git a/nag/tasklists/delete.php b/nag/tasklists/delete.php index 9d609c764..bf4111319 100644 --- a/nag/tasklists/delete.php +++ b/nag/tasklists/delete.php @@ -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'; diff --git a/nag/tasklists/edit.php b/nag/tasklists/edit.php index de0bbd405..5c3af6d97 100644 --- a/nag/tasklists/edit.php +++ b/nag/tasklists/edit.php @@ -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'; diff --git a/nag/tasklists/index.php b/nag/tasklists/index.php index 461f9053d..88a755bc5 100644 --- a/nag/tasklists/index.php +++ b/nag/tasklists/index.php @@ -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'; diff --git a/nag/tasks/index.php b/nag/tasks/index.php index 99585cb62..56c3eb43a 100644 --- a/nag/tasks/index.php +++ b/nag/tasks/index.php @@ -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 '
'; require NAG_TEMPLATES . '/list.html.php'; diff --git a/nag/templates/common-header.inc b/nag/templates/common-header.inc deleted file mode 100644 index b4d2aa3b9..000000000 --- a/nag/templates/common-header.inc +++ /dev/null @@ -1,46 +0,0 @@ - - -' : '' ?> - -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' - : ''; - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> - - diff --git a/nag/templates/quick.inc b/nag/templates/quick.inc new file mode 100644 index 000000000..025e3cd6e --- /dev/null +++ b/nag/templates/quick.inc @@ -0,0 +1,11 @@ + diff --git a/nag/view.php b/nag/view.php index 22d0cab68..ced4c7337 100644 --- a/nag/view.php +++ b/nag/view.php @@ -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. */ diff --git a/operator/export.php b/operator/export.php index 7cbb67850..08ef9512e 100644 --- a/operator/export.php +++ b/operator/export.php @@ -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');; diff --git a/operator/search.php b/operator/search.php index ea02185e4..2c6db4a1f 100644 --- a/operator/search.php +++ b/operator/search.php @@ -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 index 8b345be5e..000000000 --- a/operator/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/operator/viewgraph.php b/operator/viewgraph.php index 6263120e6..d3ffe4510 100644 --- a/operator/viewgraph.php +++ b/operator/viewgraph.php @@ -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'); diff --git a/passwd/main.php b/passwd/main.php index bd1e62f87..694a40c11 100644 --- a/passwd/main.php +++ b/passwd/main.php @@ -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 index 456e7a167..000000000 --- a/passwd/templates/common-header.inc +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/pastie/paste.php b/pastie/paste.php index edddce7fb..644e395d2 100644 --- a/pastie/paste.php +++ b/pastie/paste.php @@ -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 index 82da81522..000000000 --- a/pastie/templates/common-header.inc +++ /dev/null @@ -1,26 +0,0 @@ - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/pastie/view.php b/pastie/view.php index 7838fb637..c0cff2c58 100644 --- a/pastie/view.php +++ b/pastie/view.php @@ -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'; diff --git a/shout/admin.php b/shout/admin.php index 28c08b608..e60ce600f 100644 --- a/shout/admin.php +++ b/shout/admin.php @@ -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(); diff --git a/shout/admin/accounts.php b/shout/admin/accounts.php index 67c6addca..c75be4a16 100644 --- a/shout/admin/accounts.php +++ b/shout/admin/accounts.php @@ -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(); diff --git a/shout/admin/numbers.php b/shout/admin/numbers.php index 8ebb6f5f9..a13c057e5 100644 --- a/shout/admin/numbers.php +++ b/shout/admin/numbers.php @@ -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(); diff --git a/shout/conferences.php b/shout/conferences.php index a9f2cf30b..6e4fad7d3 100644 --- a/shout/conferences.php +++ b/shout/conferences.php @@ -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(); diff --git a/shout/devices.php b/shout/devices.php index 61e4c117d..4c0b5a5d2 100644 --- a/shout/devices.php +++ b/shout/devices.php @@ -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(); diff --git a/shout/dialplan.php b/shout/dialplan.php index cdd1585e7..8540b4a39 100644 --- a/shout/dialplan.php +++ b/shout/dialplan.php @@ -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(); diff --git a/shout/extensions.php b/shout/extensions.php index f3600968d..b5d45a17f 100644 --- a/shout/extensions.php +++ b/shout/extensions.php @@ -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(); diff --git a/shout/recordings.php b/shout/recordings.php index b53874dfc..0b5876b67 100644 --- a/shout/recordings.php +++ b/shout/recordings.php @@ -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 index c146ab4d2..000000000 --- a/shout/templates/common-header.inc +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeStylesheetFiles(); - -?> - <?php echo $page_title ?> - - - diff --git a/shout/wizard.php b/shout/wizard.php index 6f680eb1b..5fbe68f24 100644 --- a/shout/wizard.php +++ b/shout/wizard.php @@ -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(); diff --git a/skeleton/list.php b/skeleton/list.php index 6d68c1c60..6356e2a91 100644 --- a/skeleton/list.php +++ b/skeleton/list.php @@ -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 index 82da81522..000000000 --- a/skeleton/templates/common-header.inc +++ /dev/null @@ -1,26 +0,0 @@ - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/trean/add.php b/trean/add.php index a76459e6d..b2025df57 100644 --- a/trean/add.php +++ b/trean/add.php @@ -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')); diff --git a/trean/browse.php b/trean/browse.php index 95b5e0127..a54390bd8 100644 --- a/trean/browse.php +++ b/trean/browse.php @@ -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')); diff --git a/trean/data.php b/trean/data.php index 2f07dff7e..6a096c901 100644 --- a/trean/data.php +++ b/trean/data.php @@ -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) { diff --git a/trean/edit.php b/trean/edit.php index 2e0ad5c66..d42543669 100644 --- a/trean/edit.php +++ b/trean/edit.php @@ -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')); diff --git a/trean/lib/Application.php b/trean/lib/Application.php index c800f84b3..42ac51389 100644 --- a/trean/lib/Application.php +++ b/trean/lib/Application.php @@ -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: tags for common-header.inc. + * - $bodyClass: 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(''); + if ($GLOBALS['prefs']->getValue('show_folder_actions')) { + $GLOBALS['bodyClass'] = 'folderActions'; + } } /** diff --git a/trean/reports.php b/trean/reports.php index 73d833967..1373ca9a3 100644 --- a/trean/reports.php +++ b/trean/reports.php @@ -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')); diff --git a/trean/search.php b/trean/search.php index 71fed2b91..e78271390 100644 --- a/trean/search.php +++ b/trean/search.php @@ -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 index 8585ce47e..000000000 --- a/trean/templates/common-header.inc +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -' : '' ?> - -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 ''; - -$bc = Horde_Util::nonInputVar('bodyClass'); -if ($prefs->getValue('show_folder_actions')) { - if ($bc) { - $bc .= ' '; - } - $bc .= 'folderActions'; -} - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/turba/add.php b/turba/add.php index 9df85e4e2..ee4262923 100644 --- a/turba/add.php +++ b/turba/add.php @@ -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'; diff --git a/turba/addressbooks/create.php b/turba/addressbooks/create.php index 1ecaa5e6d..61cad1d35 100644 --- a/turba/addressbooks/create.php +++ b/turba/addressbooks/create.php @@ -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'; diff --git a/turba/addressbooks/delete.php b/turba/addressbooks/delete.php index d70346dd3..b97b48206 100644 --- a/turba/addressbooks/delete.php +++ b/turba/addressbooks/delete.php @@ -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'; diff --git a/turba/addressbooks/edit.php b/turba/addressbooks/edit.php index 60245ff32..515a18670 100644 --- a/turba/addressbooks/edit.php +++ b/turba/addressbooks/edit.php @@ -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'; diff --git a/turba/addressbooks/index.php b/turba/addressbooks/index.php index c0c21db87..18a2f40a3 100644 --- a/turba/addressbooks/index.php +++ b/turba/addressbooks/index.php @@ -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'; diff --git a/turba/contact.php b/turba/contact.php index 5e7a9f067..68102fb44 100644 --- a/turba/contact.php +++ b/turba/contact.php @@ -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 '
'; echo $tabs->render($viewName); diff --git a/turba/data.php b/turba/data.php index 3f1c3f2fc..a8cc04e04 100644 --- a/turba/data.php +++ b/turba/data.php @@ -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'); diff --git a/turba/delete.php b/turba/delete.php index 24326bd59..9de84c862 100644 --- a/turba/delete.php +++ b/turba/delete.php @@ -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'; diff --git a/turba/edit.php b/turba/edit.php index c144ee3bf..9e646a46c 100644 --- a/turba/edit.php +++ b/turba/edit.php @@ -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'); diff --git a/turba/lib/View/Browse.php b/turba/lib/View/Browse.php index ecb476378..b265e8926 100644 --- a/turba/lib/View/Browse.php +++ b/turba/lib/View/Browse.php @@ -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; diff --git a/turba/minisearch.php b/turba/minisearch.php index 0c14500aa..f179f7695 100644 --- a/turba/minisearch.php +++ b/turba/minisearch.php @@ -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'; ?> 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 index 464bbc3c1..000000000 --- a/turba/templates/common-header.inc +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - -> diff --git a/vilma/domains/delete.php b/vilma/domains/delete.php index 4bd03e4b4..838298a42 100644 --- a/vilma/domains/delete.php +++ b/vilma/domains/delete.php @@ -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'; diff --git a/vilma/domains/edit.php b/vilma/domains/edit.php index bdc38b693..ec2646376 100644 --- a/vilma/domains/edit.php +++ b/vilma/domains/edit.php @@ -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'; diff --git a/vilma/domains/index.php b/vilma/domains/index.php index eea068062..f7042c162 100644 --- a/vilma/domains/index.php +++ b/vilma/domains/index.php @@ -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 index 1390c38ba..000000000 --- a/vilma/templates/common-header.inc +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); -Horde::outputInlineScript(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - diff --git a/vilma/users/delete.php b/vilma/users/delete.php index 941f4ac06..91f30afa3 100644 --- a/vilma/users/delete.php +++ b/vilma/users/delete.php @@ -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'; diff --git a/vilma/users/edit.php b/vilma/users/edit.php index 97b2e531a..3a7d180a7 100644 --- a/vilma/users/edit.php +++ b/vilma/users/edit.php @@ -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'; diff --git a/vilma/users/editAlias.php b/vilma/users/editAlias.php index f84f5474a..9bd8d66ce 100644 --- a/vilma/users/editAlias.php +++ b/vilma/users/editAlias.php @@ -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'; diff --git a/vilma/users/editForward.php b/vilma/users/editForward.php index a1cdeccbe..4822db8e9 100644 --- a/vilma/users/editForward.php +++ b/vilma/users/editForward.php @@ -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'; diff --git a/vilma/users/index.php b/vilma/users/index.php index e4d6f5444..22607bd0f 100644 --- a/vilma/users/index.php +++ b/vilma/users/index.php @@ -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'; diff --git a/vilma/virtuals/delete.php b/vilma/virtuals/delete.php index 03e062dd0..725330794 100644 --- a/vilma/virtuals/delete.php +++ b/vilma/virtuals/delete.php @@ -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'; diff --git a/vilma/virtuals/edit.php b/vilma/virtuals/edit.php index b5ec49946..f1cd4b0a7 100644 --- a/vilma/virtuals/edit.php +++ b/vilma/virtuals/edit.php @@ -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'; diff --git a/vilma/virtuals/index.php b/vilma/virtuals/index.php index 22cca996a..73a4ffec4 100644 --- a/vilma/virtuals/index.php +++ b/vilma/virtuals/index.php @@ -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'; diff --git a/whups/admin/index.php b/whups/admin/index.php index 59b88a0eb..0bb284f59 100644 --- a/whups/admin/index.php +++ b/whups/admin/index.php @@ -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')); } diff --git a/whups/lib/Application.php b/whups/lib/Application.php index 8488a91df..775432d58 100644 --- a/whups/lib/Application.php +++ b/whups/lib/Application.php @@ -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: 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(''); } /** diff --git a/whups/lib/Query.php b/whups/lib/Query.php index de835c205..134fce9a0 100644 --- a/whups/lib/Query.php +++ b/whups/lib/Query.php @@ -198,6 +198,16 @@ class Whups_Query { } /** + * Returns a tag for this query's feed. + * + * @return string A full tag. + */ + function feedLink() + { + return ''; + } + + /** * Tab operations for this query. */ function getTabs($vars) diff --git a/whups/lib/Ticket.php b/whups/lib/Ticket.php index 8c977ed12..ab917dbbb 100644 --- a/whups/lib/Ticket.php +++ b/whups/lib/Ticket.php @@ -533,6 +533,16 @@ class Whups_Ticket { } /** + * Returns a tag for this ticket's feed. + * + * @return string A full tag. + */ + function feedLink() + { + return ''; + } + + /** * Sets exclusive read permissions on a comment to a certain group. * * @param integer $commentId The id of the comment to restrict. diff --git a/whups/mybugs.php b/whups/mybugs.php index fd2f5bc15..8e0aef176 100644 --- a/whups/mybugs.php +++ b/whups/mybugs.php @@ -52,7 +52,7 @@ $layout_html = $layout->toHtml(); $title = sprintf(_("My %s"), $registry->get('name')); $menuBottom = '
 
'; -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'; diff --git a/whups/mybugs_edit.php b/whups/mybugs_edit.php index a9f0ee53c..0cf2ff0d1 100644 --- a/whups/mybugs_edit.php +++ b/whups/mybugs_edit.php @@ -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'; diff --git a/whups/query/index.php b/whups/query/index.php index d33f2728e..2ae95735e 100644 --- a/whups/query/index.php +++ b/whups/query/index.php @@ -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')); diff --git a/whups/query/run.php b/whups/query/run.php index e8306ffc4..a6c1cb546 100644 --- a/whups/query/run.php +++ b/whups/query/run.php @@ -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'); diff --git a/whups/queue/index.php b/whups/queue/index.php index 64bfa955a..12576306d 100644 --- a/whups/queue/index.php +++ b/whups/queue/index.php @@ -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, diff --git a/whups/reports.php b/whups/reports.php index 58df4e3b4..1341d3935 100644 --- a/whups/reports.php +++ b/whups/reports.php @@ -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'; diff --git a/whups/search.php b/whups/search.php index 66ee86f9f..a9578ef47 100644 --- a/whups/search.php +++ b/whups/search.php @@ -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 index 2701fe896..000000000 --- a/whups/templates/common-header.inc +++ /dev/null @@ -1,37 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -if (isset($ticket)) { - echo ''; -} -if (isset($whups_query) && isset($whups_query->id)) { - echo ''; -} - -?> -<?php echo htmlspecialchars($page_title) ?> - - - - diff --git a/whups/ticket/comment.php b/whups/ticket/comment.php index af26ce95c..e0b9e3e44 100644 --- a/whups/ticket/comment.php +++ b/whups/ticket/comment.php @@ -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'; diff --git a/whups/ticket/create.php b/whups/ticket/create.php index ac44c7ece..588754a81 100644 --- a/whups/ticket/create.php +++ b/whups/ticket/create.php @@ -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) { diff --git a/whups/ticket/delete.php b/whups/ticket/delete.php index a4dc1d11d..ed184b31f 100644 --- a/whups/ticket/delete.php +++ b/whups/ticket/delete.php @@ -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'; diff --git a/whups/ticket/index.php b/whups/ticket/index.php index 950a98767..15d226510 100644 --- a/whups/ticket/index.php +++ b/whups/ticket/index.php @@ -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'; diff --git a/whups/ticket/queue.php b/whups/ticket/queue.php index e16a076b4..ea32d7d76 100644 --- a/whups/ticket/queue.php +++ b/whups/ticket/queue.php @@ -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'; diff --git a/whups/ticket/type.php b/whups/ticket/type.php index 40609c2d9..639e4aaec 100644 --- a/whups/ticket/type.php +++ b/whups/ticket/type.php @@ -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'; diff --git a/whups/ticket/update.php b/whups/ticket/update.php index 4197e15a0..5ecf60faa 100644 --- a/whups/ticket/update.php +++ b/whups/ticket/update.php @@ -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'; diff --git a/whups/ticket/watch.php b/whups/ticket/watch.php index 124f382b2..70bea904f 100644 --- a/whups/ticket/watch.php +++ b/whups/ticket/watch.php @@ -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'; diff --git a/wicked/diff.php b/wicked/diff.php index 479ac45e0..feef7116d 100644 --- a/wicked/diff.php +++ b/wicked/diff.php @@ -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'; diff --git a/wicked/display.php b/wicked/display.php index 469320748..e3ea8efff 100644 --- a/wicked/display.php +++ b/wicked/display.php @@ -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'; diff --git a/wicked/history.php b/wicked/history.php index 54565bcc9..b1cd4ff03 100644 --- a/wicked/history.php +++ b/wicked/history.php @@ -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'; diff --git a/wicked/lib/Application.php b/wicked/lib/Application.php index a66230220..e45572e44 100644 --- a/wicked/lib/Application.php +++ b/wicked/lib/Application.php @@ -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: tags for common-header.inc. */ protected function _init() { $GLOBALS['wicked'] = Wicked_Driver::factory(); + $GLOBALS['linkTags'] = array(''); } /** diff --git a/wicked/preview.php b/wicked/preview.php index 5d2777fa9..40719ddaf 100644 --- a/wicked/preview.php +++ b/wicked/preview.php @@ -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 index 74c4bc00c..000000000 --- a/wicked/templates/common-header.inc +++ /dev/null @@ -1,30 +0,0 @@ - - - - - -' : '' ?> - -get('name'); -if (!empty($title)) { - $page_title .= ' :: ' . $title; -} - -Horde::outputMetaTags(); -Horde::includeScriptFiles(); -Horde::includeFavicon(); -Horde::includeStylesheetFiles(); - -?> -<?php echo htmlspecialchars($page_title) ?> - - - - -- 2.11.0