From 3e51d67bd8fab45456a4c5388a41335d838b4a64 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 9 Dec 2009 00:46:11 +0100 Subject: [PATCH] Use Horde_Url. --- kronolith/add.php | 14 +++++---- kronolith/attendees.php | 12 ++++---- kronolith/delete.php | 13 +++++---- kronolith/edit.php | 15 ++++------ kronolith/event.php | 7 +++-- kronolith/feed/index.php | 6 ++-- kronolith/lib/Block/month.php | 21 +++++++------- kronolith/lib/Block/prevmonthlist.php | 10 +++---- kronolith/lib/Block/summary.php | 24 +++++++--------- kronolith/lib/Event.php | 7 ++++- kronolith/lib/FreeBusy/View.php | 8 +++--- kronolith/lib/Kronolith.php | 18 ++++++------ kronolith/lib/View/Day.php | 39 ++++++++++++++------------ kronolith/lib/View/EditEvent.php | 5 ++-- kronolith/lib/View/Month.php | 24 +++++++++------- kronolith/lib/View/Week.php | 6 ++-- kronolith/lib/View/Year.php | 15 ++++++---- kronolith/new.php | 15 ++++------ kronolith/resources/groups/index.php | 4 +-- kronolith/resources/index.php | 6 ++-- kronolith/templates/calendar_list.php | 14 ++++----- kronolith/templates/delete/delete.inc | 5 ++-- kronolith/templates/delete/one.inc | 5 ++-- kronolith/templates/panel.inc | 2 +- kronolith/templates/prefs/fb_cals_select.inc | 2 +- kronolith/templates/search/search.inc | 2 +- kronolith/templates/search/search_advanced.inc | 2 +- kronolith/templates/week/head.inc | 13 +++++---- 28 files changed, 159 insertions(+), 155 deletions(-) diff --git a/kronolith/add.php b/kronolith/add.php index e7d1a1053..f9be6ff9e 100644 --- a/kronolith/add.php +++ b/kronolith/add.php @@ -52,11 +52,13 @@ if (!Horde_Util::getFormData('cancel')) { } } -if ($url = Horde_Util::getFormData('url')) { - header('Location: ' . $url); +if (!empty($url = Horde_Util::getFormData('url'))) { + $url = new Horde_Url($url, true); } else { - $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', - array('month' => Horde_Util::getFormData('month'), - 'year' => Horde_Util::getFormData('year'))); - header('Location: ' . Horde::applicationUrl($url, true)); + $url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true) + ->add(array('month' => Horde_Util::getFormData('month'), + 'year' => Horde_Util::getFormData('year'))); } + +// Make sure URL is unique. +header('Location: ' . $url->add('unique', hash('md5', microtime()))); diff --git a/kronolith/attendees.php b/kronolith/attendees.php index b24805622..aba3fb5a9 100644 --- a/kronolith/attendees.php +++ b/kronolith/attendees.php @@ -142,18 +142,16 @@ case 'dismiss': exit; } - $url = Horde_Util::getFormData('url'); - if (!empty($url)) { - $location = Horde::applicationUrl($url, true); + if (!empty($url = Horde_Util::getFormData('url'))) { + $url = new Horde_Url($url, true); } else { $date = new Horde_Date(Horde_Util::getFormData('date')); - $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', 'date', $date->dateString()); - $location = Horde::applicationUrl($url, true); + $url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true) + ->add('date', $date->dateString()); } // Make sure URL is unique. - $location = Horde_Util::addParameter($location, 'unique', hash('md5', microtime())); - header('Location: ' . $location); + header('Location: ' . $url->add('unique', hash('md5', microtime()))); exit; case 'clear': diff --git a/kronolith/delete.php b/kronolith/delete.php index dbc6ec9a2..ec8284c6e 100644 --- a/kronolith/delete.php +++ b/kronolith/delete.php @@ -85,12 +85,13 @@ if ($eventID = Horde_Util::getFormData('eventID')) { } } -if ($url = Horde_Util::getFormData('url')) { - $location = $url; +if (!empty($url = Horde_Util::getFormData('url'))) { + $url = new Horde_Url($url, true); } else { - $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', - 'date', Horde_Util::getFormData('date', date('Ymd'))); - $location = Horde::applicationUrl($url, true); + $date = new Horde_Date(Horde_Util::getFormData('date')); + $url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true) + ->add('date', Horde_Util::getFormData('date', date('Ymd'))); } -header('Location: ' . $location); +// Make sure URL is unique. +header('Location: ' . $url->add('unique', hash('md5', microtime()))); diff --git a/kronolith/edit.php b/kronolith/edit.php index 9c4327aae..340dac7ac 100644 --- a/kronolith/edit.php +++ b/kronolith/edit.php @@ -39,7 +39,6 @@ function _check_max() require_once dirname(__FILE__) . '/lib/base.php'; -$url = Horde_Util::getFormData('url'); $kronolith_driver = Kronolith::getDriver(); if ($exception = Horde_Util::getFormData('del_exception')) { @@ -173,15 +172,13 @@ if ($exception = Horde_Util::getFormData('del_exception')) { } } -if (!empty($url)) { - $location = $url; +if (!empty($url = Horde_Util::getFormData('url'))) { + $url = new Horde_Url($url, true); } else { - $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', - array('month' => Horde_Util::getFormData('month'), - 'year' => Horde_Util::getFormData('year'))); - $location = Horde::applicationUrl($url, true); + $url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true) + ->add(array('month' => Horde_Util::getFormData('month'), + 'year' => Horde_Util::getFormData('year'))); } // Make sure URL is unique. -$location = Horde_Util::addParameter($location, 'unique', hash('md5', microtime()), false); -header('Location: ' . $location); +header('Location: ' . $url->add('unique', hash('md5', microtime()))); diff --git a/kronolith/event.php b/kronolith/event.php index 7dc6fe476..a5eecad18 100644 --- a/kronolith/event.php +++ b/kronolith/event.php @@ -33,11 +33,12 @@ case 'DeleteEvent': case 'EditEvent': if ($view->event->isPrivate() && $view->event->getCreatorId() != Horde_Auth::getAuth()) { - $url = Horde_Util::getFormData('url'); - if (empty($url)) { + if (!empty($url = Horde_Util::getFormData('url'))) { + $url = new Horde_Url($url, true); + } else { $url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true); } - header('Location: ' . Horde_Util::addParameter($url, 'unique', hash('md5', microtime()), false)); + header('Location: ' . $url->add('unique', hash('md5', microtime()))); exit; } break; diff --git a/kronolith/feed/index.php b/kronolith/feed/index.php index 4d3c81835..62b70aed7 100644 --- a/kronolith/feed/index.php +++ b/kronolith/feed/index.php @@ -78,11 +78,11 @@ if (is_a($events, 'PEAR_Error')) { } if (isset($conf['urls']['pretty']) && $conf['urls']['pretty'] == 'rewrite') { - $self_url = 'feed/' . $calendar; + $self_url = Horde::applicationUrl('feed/' . $calendar, true, -1); } else { - $self_url = Horde_Util::addParameter('feed/index.php', 'c', $calendar); + $self_url = Horde::applicationUrl('feed/index.php', true, -1) + ->add('c', $calendar); } -$self_url = Horde::applicationUrl($self_url, true, -1); $owner = $share->get('owner'); $identity = Horde_Prefs_Identity::factory('none', $owner); diff --git a/kronolith/lib/Block/month.php b/kronolith/lib/Block/month.php index 7239d224c..f443b3147 100644 --- a/kronolith/lib/Block/month.php +++ b/kronolith/lib/Block/month.php @@ -35,21 +35,21 @@ class Horde_Block_Kronolith_month extends Horde_Block { */ function _title() { - global $registry; require_once dirname(__FILE__) . '/../base.php'; $title = _("All Calendars"); - $url_params = array(); - if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') { - $this->_share = &$GLOBALS['kronolith_shares']->getShare($this->_params['calendar']); + $url = Horde::url($GLOBALS['registry']->getInitialPage(), true); + if (isset($this->_params['calendar']) && + $this->_params['calendar'] != '__all') { + $this->_share = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']); if (!is_a($this->_share, 'PEAR_Error')) { - $url_params = array('display_cal' => $this->_params['calendar']); + $url->add('display_cal', $this->_params['calendar']); $title = htmlspecialchars($this->_share->get('name')); } } $date = new Horde_Date(time()); - return $title . ', ' . Horde::link(Horde::url(Horde_Util::addParameter($registry->getInitialPage(), $url_params), true)) . $date->strftime('%B, %Y') . ''; + return $title . ', ' . $url->link() . $date->strftime('%B, %Y') . ''; } /** @@ -168,14 +168,13 @@ class Horde_Block_Kronolith_month extends Horde_Block { } $html .= ''; - $url_params = array('date' => $date_ob->dateString()); + /* Set up the link to the day view. */ + $url = Horde::applicationUrl('day.php', true) + ->add('date', $date_ob->dateString()); if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') { - $url_params['display_cal'] = $this->_params['calendar']; + $url->add('display_cal', $this->_params['calendar']); } - /* Set up the link to the day view. */ - $url = Horde_Util::addParameter(Horde::applicationUrl('day.php', true), - $url_params); $date_stamp = $date_ob->dateString(); if (empty($all_events[$date_stamp])) { diff --git a/kronolith/lib/Block/prevmonthlist.php b/kronolith/lib/Block/prevmonthlist.php index ece26ddac..169355403 100644 --- a/kronolith/lib/Block/prevmonthlist.php +++ b/kronolith/lib/Block/prevmonthlist.php @@ -40,12 +40,12 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block { */ function _title() { - if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') { - $url_params = array('display_cal' => $this->_params['calendar']); - } else { - $url_params = array(); + $url = Horde::url($GLOBALS['registry']->getInitialPage(), true); + if (isset($this->_params['calendar']) && + $this->_params['calendar'] != '__all') { + $url->add('display_cal', $this->_params['calendar']); } - return Horde::link(Horde::url(Horde_Util::addParameter($GLOBALS['registry']->getInitialPage(), $url_params), true)) . _("Prior Events") . ''; + return $url->link() . _("Prior Events") . ''; } /** diff --git a/kronolith/lib/Block/summary.php b/kronolith/lib/Block/summary.php index 0bbe8fd50..3245c5243 100644 --- a/kronolith/lib/Block/summary.php +++ b/kronolith/lib/Block/summary.php @@ -63,14 +63,12 @@ class Horde_Block_Kronolith_summary extends Horde_Block { */ function _title() { - global $registry; - - if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') { - $url_params = array('display_cal' => $this->_params['calendar']); - } else { - $url_params = array(); + $url = Horde::url($GLOBALS['registry']->getInitialPage(), true); + if (isset($this->_params['calendar']) && + $this->_params['calendar'] != '__all') { + $url->add('display_cal', $this->_params['calendar']); } - return Horde::link(Horde::url(Horde_Util::addParameter($registry->getInitialPage(), $url_params), true)) . htmlspecialchars($registry->get('name')) . ''; + return $url->link() . htmlspecialchars($registry->get('name')) . ''; } /** @@ -164,16 +162,14 @@ class Horde_Block_Kronolith_summary extends Horde_Block { } else { $dayname = $day->strftime($prefs->getValue('date_format')); } - $url_params = array('date' => $day->dateString()); + $url = Horde::applicationUrl('day.php', true) + ->add('date', $day->dateString()); if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') { - $url_params['display_cal'] = $this->_params['calendar']; + $url->add('display_cal', $this->_params['calendar']); } - $daylink = Horde::applicationUrl('day.php', true); - $daylink = Horde_Util::addParameter($daylink, $url_params); - $html .= Horde::link($daylink, sprintf(_("Goto %s"), - $dayname)); - $html .= $dayname . ''; + $html .= $url->link(array('title' => sprintf(_("Goto %s"), $dayname))) + . $dayname . ''; $firstevent = false; $firstday = false; } diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index 2fb2d1ff7..9ba48e419 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -1315,7 +1315,12 @@ abstract class Kronolith_Event 'mday' => $match[3])); $formatted = $horde_date->strftime($GLOBALS['prefs']->getValue('date_format')); return $formatted - . Horde::link(Horde_Util::addParameter(Horde::applicationUrl('edit.php'), array('calendar' => $this->getCalendar(), 'eventID' => $this->eventID, 'del_exception' => $date, 'url' => Horde_Util::getFormData('url'))), sprintf(_("Delete exception on %s"), $formatted)) + . Horde::applicationUrl('edit.php') + ->add(array('calendar' => $this->getCalendar(), + 'eventID' => $this->eventID, + 'del_exception' => $date, + 'url' => Horde_Util::getFormData('url'))) + ->link(array('title' => sprintf(_("Delete exception on %s"), $formatted))) . Horde::img('delete-small.png', _("Delete"), '', $GLOBALS['registry']->getImageDir('horde')) . ''; } diff --git a/kronolith/lib/FreeBusy/View.php b/kronolith/lib/FreeBusy/View.php index 015ca4f5b..78b2641b7 100644 --- a/kronolith/lib/FreeBusy/View.php +++ b/kronolith/lib/FreeBusy/View.php @@ -80,10 +80,10 @@ class Kronolith_FreeBusy_View { $optimal->merge($required, false); $optimal->merge($optional); - $base_url = Horde::selfUrl(); - $base_url = Horde_Util::removeParameter($base_url, 'date'); - $base_url = Horde_Util::removeParameter($base_url, 'fbview'); - $base_url = Horde_Util::addParameter($base_url, 'fbview', $this->view); + $base_url = Horde::selfUrl() + ->remove('date') + ->remove('fbview') + ->add('fbview', $this->view); $template = new Horde_Template(); $template->set('title', $this->_title()); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 854744393..e09ac4f52 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1519,11 +1519,10 @@ class Kronolith { if (isset($GLOBALS['conf']['urls']['pretty']) && $GLOBALS['conf']['urls']['pretty'] == 'rewrite') { - $feed_url = 'feed/' . $calendar; - } else { - $feed_url = Horde_Util::addParameter('feed/index.php', 'c', $calendar); + return Horde::applicationUrl('feed/' . $calendar, true, -1); } - return Horde::applicationUrl($feed_url, true, -1); + return Horde::applicationUrl('feed/index.php', true, -1) + ->add('c', $calendar); } /** @@ -1687,7 +1686,7 @@ class Kronolith $myemail = $ident->getValue('from_addr'); if (!$myemail) { - $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Options. You must set one %shere%s before event notifications can be sent."), Horde::link(Horde_Util::addParameter(Horde::getServiceLink('options', 'kronolith'), array('app' => 'horde', 'group' => 'identities'))), ''), 'horde.error', array('content.raw')); + $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Options. You must set one %shere%s before event notifications can be sent."), Horde::getServiceLink('options', 'kronolith')->add(array('app' => 'horde', 'group' => 'identities'))->link(), ''), 'horde.error', array('content.raw')); return; } @@ -1753,8 +1752,11 @@ class Kronolith $message .= _("Attached is an iCalendar file with more information about the event. If your mail client supports iTip requests you can use this file to easily update your local copy of the event."); if ($action == self::ITIP_REQUEST) { - $attend_link = Horde_Util::addParameter(Horde::applicationUrl('attend.php', true, -1), array('c' => $event->getCalendar(), 'e' => $event->getId(), 'u' => $email), null, false); - $message .= "\n\n" . sprintf(_("If your email client doesn't support iTip requests you can use one of the following links to accept or decline the event.\n\nTo accept the event:\n%s\n\nTo accept the event tentatively:\n%s\n\nTo decline the event:\n%s\n"), Horde_Util::addParameter($attend_link, 'a', 'accept', false), Horde_Util::addParameter($attend_link, 'a', 'tentative', false), Horde_Util::addParameter($attend_link, 'a', 'decline', false)); + $attend_link = Horde::applicationUrl('attend.php', true, -1) + ->add(array('c' => $event->getCalendar(), + 'e' => $event->getId(), + 'u' => $email)); + $message .= "\n\n" . sprintf(_("If your email client doesn't support iTip requests you can use one of the following links to accept or decline the event.\n\nTo accept the event:\n%s\n\nTo accept the event tentatively:\n%s\n\nTo decline the event:\n%s\n"), $attend_link->add('a', 'accept'), $attend_link->add('a', 'tentative'), $attend_link->add('a', 'decline')); } /* Build the iCalendar data */ @@ -2370,7 +2372,7 @@ class Kronolith (!empty($conf['hooks']['permsdenied']) || $GLOBALS['perms']->hasAppPermission('max_events') === true || $GLOBALS['perms']->hasAppPermission('max_events') > self::countEvents())) { - $menu->add(Horde_Util::addParameter(Horde::applicationUrl('new.php'), 'url', Horde::selfUrl(true, false, true)), _("_New Event"), 'new.png'); + $menu->add(Horde::applicationUrl('new.php')->add('url', Horde::selfUrl(true, false, true)), _("_New Event"), 'new.png'); } if ($browser->hasFeature('dom')) { Horde::addScriptFile('goto.js', 'kronolith', array('direct' => false)); diff --git a/kronolith/lib/View/Day.php b/kronolith/lib/View/Day.php index b5d9a020f..4f112e4f2 100644 --- a/kronolith/lib/View/Day.php +++ b/kronolith/lib/View/Day.php @@ -90,14 +90,17 @@ class Kronolith_View_Day extends Kronolith_Day { echo ''; if ($addLinks) { - $newEventUrl = Horde_Util::addParameter( - 'new.php', - array('datetime' => sprintf($this->dateString() . '%02d%02d00', - $this->slots[0]['hour'], $this->slots[0]['min']), - 'allday' => 1, - 'url' => $this->link(0, true))); - $newEventUrl = Horde::link(Horde::applicationUrl($newEventUrl), _("Create a New Event"), 'hour') . _("All day") . - Horde::img('new_small.png', '+', array('class' => 'iconAdd')) . ''; + $newEventUrl = Horde::applicationUrl('new.php') + ->add(array('datetime' => sprintf($this->dateString() . '%02d%02d00', + $this->slots[0]['hour'], $this->slots[0]['min']), + 'allday' => 1, + 'url' => $this->link(0, true))) + ->link(array('title' => _("Create a New Event"), 'class' => + 'hour')) + . _("All day") + . Horde::img('new_small.png', '+', array('class' => + 'iconAdd')) + . ''; } else { $newEventUrl = '' . _("All day") . ''; } @@ -255,13 +258,14 @@ class Kronolith_View_Day extends Kronolith_Day { } if ($addLinks) { - $newEventUrl = Horde_Util::addParameter( - 'new.php', - array('datetime' => sprintf($this->dateString() . '%02d%02d00', - $this->slots[$i]['hour'], $this->slots[$i]['min']), - 'url' => $this->link(0, true))); - $newEventUrl = Horde::link(Horde::applicationUrl($newEventUrl), _("Create a New Event"), $hourclass) . - $time . Horde::img('new_small.png', '+', array('class' => 'iconAdd')) . ''; + $newEventUrl = Horde::applicationUrl('new.php') + ->add(array('datetime' => sprintf($this->dateString() . '%02d%02d00', + $this->slots[$i]['hour'], $this->slots[$i]['min']), + 'url' => $this->link(0, true))) + ->link(array('title' =>_("Create a New Event"), 'class' => $hourclass)) + . $time + . Horde::img('new_small.png', '+', array('class' => 'iconAdd')) + . ''; } else { $newEventUrl = '' . $time . ''; } @@ -454,9 +458,8 @@ class Kronolith_View_Day extends Kronolith_Day { function link($offset = 0, $full = false) { - return Horde::applicationUrl( - Horde_Util::addParameter('day.php', 'date', $this->getTime('%Y%m%d', $offset)), - $full); + return Horde::applicationUrl('day.php', $full) + ->add('date', $this->getTime('%Y%m%d', $offset)); } function getName() diff --git a/kronolith/lib/View/EditEvent.php b/kronolith/lib/View/EditEvent.php index a877dbae4..2e2782725 100644 --- a/kronolith/lib/View/EditEvent.php +++ b/kronolith/lib/View/EditEvent.php @@ -90,9 +90,8 @@ class Kronolith_View_EditEvent { if (isset($url)) { $cancelurl = $url; } else { - $cancelurl = Horde_Util::addParameter('month.php', array('month' => $month, - 'year', $year)); - $cancelurl = Horde::applicationUrl($cancelurl, true); + $cancelurl = Horde::applicationUrl('month.php', true) + ->add(array('month' => $month, 'year' => $year)); } $event = &$this->event; diff --git a/kronolith/lib/View/Month.php b/kronolith/lib/View/Month.php index 24a32a4bf..929a8d857 100644 --- a/kronolith/lib/View/Month.php +++ b/kronolith/lib/View/Month.php @@ -137,7 +137,7 @@ class Kronolith_View_Month { $showTime = Kronolith::viewShowTime(); $day_url = Horde::applicationUrl('day.php'); $this_link = $this->link(0, true); - $new_url = Horde_Util::addParameter(Horde::applicationUrl('new.php'), 'url', $this_link); + $new_url = Horde::applicationUrl('new.php')->add('url', $this_link); $new_img = Horde::img('new_small.png', '+'); foreach ($this->_currentCalendars as $id => $cal) { @@ -170,21 +170,24 @@ class Kronolith_View_Month { $html .= '
'; - $url = Horde_Util::addParameter($day_url, 'date', $date->dateString()); - $html .= '' . $date->mday . ''; + $html .= $day_url->add('date', $date->dateString()) + ->link(array('class' => 'day')) + . $date->mday . ''; if ($addLinks) { - $url = Horde_Util::addParameter($new_url, 'date', $date->dateString()); + $new_url->add('date', $date->dateString()); if ($sidebyside) { - $url = Horde_Util::addParameter($url, 'calendar', $id); + $new_url->add('calendar', $id); } - $html .= Horde::link($url, _("Create a New Event"), 'newEvent') . - $new_img . ''; + $html .= $new_url->link(array('title' => _("Create a New Event"), 'class' => 'newEvent')) + . $new_img . ''; } if ($date->dayOfWeek() == Horde_Date::DATE_MONDAY) { - $url = Horde_Util::addParameter('week.php', 'date', $date->dateString()); - $html .= Horde::link(Horde::applicationUrl($url), '', 'week') . sprintf(_("Week %d"), $week) . ''; + $html .= Horde::applicationUrl('week.php') + ->add('date', $date->dateString()) + ->link(array('class' => 'week')) + . sprintf(_("Week %d"), $week) . ''; } $html .= '
 
'; @@ -231,7 +234,8 @@ class Kronolith_View_Month { function link($offset = 0, $full = false) { $month = $this->getMonth($offset); - return Horde::applicationUrl(Horde_Util::addParameter('month.php', 'date', $month->dateString()), $full); + return Horde::applicationUrl('month.php', $full) + ->add('date', $month->dateString()); } function getName() diff --git a/kronolith/lib/View/Week.php b/kronolith/lib/View/Week.php index 8ce8c48d4..d3a551a72 100644 --- a/kronolith/lib/View/Week.php +++ b/kronolith/lib/View/Week.php @@ -361,10 +361,8 @@ class Kronolith_View_Week { function link($offset = 0, $full = false) { $week = $this->getWeek($offset); - return Horde::applicationUrl(Horde_Util::addParameter($this->_controller, - 'date', - $week->dateString()), - $full); + return Horde::applicationUrl($this->_controller, $full) + ->add('date', $week->dateString()); } function getName() diff --git a/kronolith/lib/View/Year.php b/kronolith/lib/View/Year.php index fba4ffa1d..f2f89eed4 100644 --- a/kronolith/lib/View/Year.php +++ b/kronolith/lib/View/Year.php @@ -44,9 +44,11 @@ class Kronolith_View_Year { // Heading for each month. $date = new Horde_Date(sprintf('%04d%02d01010101', $this->year, $month)); $mtitle = $date->strftime('%B'); - $url = Horde_Util::addParameter(Horde::applicationUrl('month.php'), array('date' => $date->dateString())); - $html .= '

' . $mtitle . '

' . - ''; + $html .= '

' . $mtitle . '

' + . '
'; if (!$prefs->getValue('week_start_monday')) { $html .= ''; } @@ -110,8 +112,8 @@ class Kronolith_View_Year { } /* Set up the link to the day view. */ - $url = Horde::applicationUrl('day.php', true); - $url = Horde_Util::addParameter($url, 'date', $date->dateString()); + $url = Horde::applicationUrl('day.php', true) + ->add('date', $date->dateString()); if ($date->month != $month) { $cellday = ' '; @@ -161,7 +163,8 @@ class Kronolith_View_Year { function link($offset = 0, $full = false) { - return Horde::applicationUrl(Horde_Util::addParameter('year.php', 'date', $this->year + $offset) . '0101', $full); + return Horde::applicationUrl('year.php', $full) + ->add('date', ($this->year + $offset) . '0101'); } function getName() diff --git a/kronolith/new.php b/kronolith/new.php index fd1535330..eb2c75693 100644 --- a/kronolith/new.php +++ b/kronolith/new.php @@ -11,6 +11,9 @@ require dirname(__FILE__) . '/lib/base.php'; /* Check permissions. */ +$url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true) + ->add(array('month' => Horde_Util::getFormData('month'), + 'year' => Horde_Util::getFormData('year'))); if ($GLOBALS['perms']->hasAppPermission('max_events') !== true && $GLOBALS['perms']->hasAppPermission('max_events') <= Kronolith::countEvents()) { try { @@ -19,17 +22,13 @@ if ($GLOBALS['perms']->hasAppPermission('max_events') !== true && $message = @htmlspecialchars(sprintf(_("You are not allowed to create more than %d events."), $GLOBALS['perms']->hasAppPermission('max_events')), ENT_COMPAT, Horde_Nls::getCharset()); } $notification->push($message, 'horde.error', array('content.raw')); - $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Horde_Util::getFormData('month'), - 'year' => Horde_Util::getFormData('year'))); - header('Location: ' . Horde::applicationUrl($url, true)); + header('Location: ' . $url); exit; } $calendar_id = Horde_Util::getFormData('calendar', Kronolith::getDefaultCalendar(Horde_Perms::EDIT)); if (!$calendar_id) { - $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', array('month' => Horde_Util::getFormData('month'), - 'year' => Horde_Util::getFormData('year'))); - header('Location: ' . Horde::applicationUrl($url, true)); + header('Location: ' . $url); } $event = Kronolith::getDriver()->getEvent(); @@ -59,9 +58,7 @@ $url = Horde_Util::getFormData('url'); if (isset($url)) { $cancelurl = $url; } else { - $cancelurl = Horde_Util::addParameter('month.php', array('month' => $month, - 'year' => $year)); - $cancelurl = Horde::applicationUrl($cancelurl, true); + $cancelurl = Horde::applicationUrl('month.php', true)->add('month', $month); } $title = _("Add a new event"); diff --git a/kronolith/resources/groups/index.php b/kronolith/resources/groups/index.php index c745e76c3..f5fbd9e59 100644 --- a/kronolith/resources/groups/index.php +++ b/kronolith/resources/groups/index.php @@ -58,8 +58,8 @@ function performAction(action, rid) diff --git a/kronolith/resources/index.php b/kronolith/resources/index.php index 9eb4ecda6..53d3171a3 100644 --- a/kronolith/resources/index.php +++ b/kronolith/resources/index.php @@ -57,13 +57,13 @@ function performAction(action, rid) - + diff --git a/kronolith/templates/calendar_list.php b/kronolith/templates/calendar_list.php index a7d71e8f1..721457184 100644 --- a/kronolith/templates/calendar_list.php +++ b/kronolith/templates/calendar_list.php @@ -35,23 +35,23 @@ - + - + - + - + - + - + - + diff --git a/kronolith/templates/delete/delete.inc b/kronolith/templates/delete/delete.inc index a973f7db7..bc40c0a49 100644 --- a/kronolith/templates/delete/delete.inc +++ b/kronolith/templates/delete/delete.inc @@ -1,8 +1,7 @@ $month, - 'year' => $year)); - $url = Horde::applicationUrl($url, true); + $url = Horde::applicationUrl('month.php', true) + ->add(array('month' => $month, 'year' => $year)); } ?> diff --git a/kronolith/templates/delete/one.inc b/kronolith/templates/delete/one.inc index cb96503e6..8dde294ba 100644 --- a/kronolith/templates/delete/one.inc +++ b/kronolith/templates/delete/one.inc @@ -1,8 +1,7 @@ $month, - 'year' => $year)); - $url = Horde::applicationUrl($url, true); + $url = Horde::applicationUrl('month.php', true) + ->add(array('month' => $month, 'year' => $year)); } ?> diff --git a/kronolith/templates/panel.inc b/kronolith/templates/panel.inc index 2a2b87e4d..110ebb4b5 100644 --- a/kronolith/templates/panel.inc +++ b/kronolith/templates/panel.inc @@ -30,7 +30,7 @@ $tagger = Kronolith::getTagger(); - +
diff --git a/kronolith/templates/prefs/fb_cals_select.inc b/kronolith/templates/prefs/fb_cals_select.inc index 5579a72e0..6c2a4a1b3 100644 --- a/kronolith/templates/prefs/fb_cals_select.inc +++ b/kronolith/templates/prefs/fb_cals_select.inc @@ -6,7 +6,7 @@

- + add('u', Horde_Auth::getAuth()) ?>

diff --git a/kronolith/templates/search/search.inc b/kronolith/templates/search/search.inc index c0fb5327e..27d2a07cb 100644 --- a/kronolith/templates/search/search.inc +++ b/kronolith/templates/search/search.inc @@ -6,7 +6,7 @@

- + add('search_mode', 'advanced'), _("Advanced Search"), 'smallheader', '', '', _("Ad_vanced Search")) ?>

diff --git a/kronolith/templates/search/search_advanced.inc b/kronolith/templates/search/search_advanced.inc index c91df9627..03c7f439f 100644 --- a/kronolith/templates/search/search_advanced.inc +++ b/kronolith/templates/search/search_advanced.inc @@ -10,7 +10,7 @@ require KRONOLITH_TEMPLATES . '/edit/javascript.inc';

- + add('search_mode', 'basic'), _("Basic Search"), 'smallheader', '', '', _("_Basic Search")) ?>

diff --git a/kronolith/templates/week/head.inc b/kronolith/templates/week/head.inc index a5070e593..503c96b70 100644 --- a/kronolith/templates/week/head.inc +++ b/kronolith/templates/week/head.inc @@ -22,12 +22,13 @@ if (Kronolith::getDefaultCalendar(Horde_Perms::EDIT) && (!empty($conf['hooks']['permsdenied']) || $GLOBALS['perms']->hasAppPermission('max_events') === true || $GLOBALS['perms']->hasAppPermission('max_events') > Kronolith::countEvents())) { - $addurl = Horde_Util::addParameter('new.php', - array('date' => $day->dateString(), - 'url' => $this->link(0, true))); - echo Horde::link(Horde::applicationUrl($addurl), _("Create a New Event"), 'iconAdd') - . Horde::img('new_small.png', '+') - . ''; + echo Horde::applicationUrl('new.php') + ->add(array('date' => $day->dateString(), + 'url' => $this->link(0, true))) + ->link(array('title' => _("Create a New Event"), + 'class' => 'iconAdd')) + . Horde::img('new_small.png', '+') + . ''; } ?> link(), '', 'widget') . $day->getTime('%A, %d.') ?> -- 2.11.0
' . _("Su"). '
- getId()), _("Delete")) . $delete_img . '' ?> - getId()), _("Edit")) . $edit_img . '' ?> + add('c', $resource->getId())->link(array('title' => _("Delete"))) . $delete_img . '' ?> + add('c', $resource->getId())->link(array('title' => _("Edit"))) . $edit_img . '' ?>  
- getId()), _("Delete")) . $delete_img . '' ?> - getId()), _("Edit")) . $edit_img . '' ?> + add('c', $resource->getId())->link(array('title' => _("Delete"))) . $delete_img . '' ?> + add('c', $resource->getId())->link(array('title' => _("Edit"))) . $edit_img . '' ?>   get('name')) ?>get('calendar'), false); echo Horde::link($url, _("Click or copy this URL to display this calendar")) . htmlspecialchars(shorten_url($url)) . '' ?>add('display_cal', $resource->get('calendar'), false)->link(array('title' => _("Click or copy this URL to display this calendar"))) . htmlspecialchars(shorten_url($url)) . '' ?>
' ?>add('display_cal', 'remote_' . $calendar['url']); echo $url->link(array('title' => _("Click or copy this URL to display this calendar"), 'target' => '_blank')) . htmlspecialchars(shorten_url($url)) . '' ?> ' ?>' ?>add('url', $calendar['url'])->link(array('title' => _("Edit"))) . $edit_img . '' ?>   ' ?>add('url', $calendar['url'])->link(array('title' => _("Unsubscribe"))) . $delete_img . '' ?> get('name')) ?> getName(), false); echo Horde::link($url, _("Click or copy this URL to display this calendar")) . htmlspecialchars(shorten_url($url)) . '' ?>add('display_cal', $calendar->getName()); echo $url->link(array('title' => _("Click or copy this URL to display this calendar"))) . htmlspecialchars(shorten_url($url)) . '' ?> get('owner') ? $calendar->get('owner') : '-system-') . '/' . $calendar->getName() . '.ics'; echo Horde::link($url, _("Click or copy this URL to display this calendar"), '', '_blank') . htmlspecialchars(shorten_url($url)) . '' ?>getName()), _("Edit")) . $edit_img . '' ?>add('c', $calendar->getName())->link(array('title' => _("Edit"))) . $edit_img . '' ?> getName()), _("Change Permissions"), '', '_blank', Horde::popupJs($perms_url_base, array('params' => array('share' => $calendar->getName()), 'urlencode' => true)) . 'return false;') . $perms_img . '' ?>add('share', $calendar->getName())->link(array('title' => _("Change Permissions"), 'target' => '_blank', 'onclick' => Horde::popupJs($perms_url_base, array('params' => array('share' => $calendar->getName()), 'urlencode' => true)) . 'return false;')) . $perms_img . '' ?> getName()), _("Delete")) . $delete_img . '' ?>add('c', $calendar->getName())->link(array('title' => _("Delete"))) . $delete_img . '' ?>