From 7b3bbbebc0bdf043604682a9f7ad347a83b9d0db Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 28 Jul 2010 18:41:51 +0200 Subject: [PATCH] setAnchor() makes more sense actually. --- framework/Url/lib/Horde/Url.php | 4 ++-- framework/Url/test/Horde/Url/AddTest.php | 2 +- horde/login.php | 2 +- kronolith/calendars/create.php | 2 +- kronolith/calendars/delete.php | 2 +- kronolith/calendars/edit.php | 2 +- kronolith/calendars/remote_edit.php | 2 +- kronolith/calendars/remote_subscribe.php | 2 +- kronolith/calendars/remote_unsubscribe.php | 2 +- kronolith/day.php | 2 +- kronolith/event.php | 2 +- kronolith/month.php | 2 +- kronolith/new.php | 2 +- kronolith/week.php | 2 +- kronolith/workweek.php | 2 +- kronolith/year.php | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/framework/Url/lib/Horde/Url.php b/framework/Url/lib/Horde/Url.php index a8445319c..4551d74a6 100644 --- a/framework/Url/lib/Horde/Url.php +++ b/framework/Url/lib/Horde/Url.php @@ -184,13 +184,13 @@ class Horde_Url } /** - * Adds an anchor. + * Sets the URL anchor. * * @param string $anchor An anchor to add. * * @return Horde_Url This (modified) object, to allow chaining. */ - public function addAnchor($anchor) + public function setAnchor($anchor) { $this->anchor = $anchor; return $this; diff --git a/framework/Url/test/Horde/Url/AddTest.php b/framework/Url/test/Horde/Url/AddTest.php index e9d208b09..c2e673d63 100644 --- a/framework/Url/test/Horde/Url/AddTest.php +++ b/framework/Url/test/Horde/Url/AddTest.php @@ -23,7 +23,7 @@ class Horde_Url_AddTest extends PHPUnit_Framework_TestCase $url->addAnchor('boo'); $this->assertEquals('test?foo=1&bar=2&baz=3&fez#boo', (string)$url); - $url->addAnchor('bee'); + $url->setAnchor('bee'); $this->assertEquals('test?foo=1&bar=2&baz=3&fez#bee', (string)$url); } diff --git a/horde/login.php b/horde/login.php index 4fc95db2a..185b1bd8f 100644 --- a/horde/login.php +++ b/horde/login.php @@ -36,7 +36,7 @@ function _addAnchor($url, $type, $vars, $url_anchor = null) case 'url': $anchor = $vars->anchor_string; if (!empty($anchor)) { - $url->addAnchor($anchor); + $url->setAnchor($anchor); } else { return _addAnchor($url, 'param', $vars, $url_anchor); } diff --git a/kronolith/calendars/create.php b/kronolith/calendars/create.php index 4255fc2a3..c2695ea26 100644 --- a/kronolith/calendars/create.php +++ b/kronolith/calendars/create.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('calendar:internal')); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('calendar:internal')); exit; } diff --git a/kronolith/calendars/delete.php b/kronolith/calendars/delete.php index 47563470c..70ab50197 100644 --- a/kronolith/calendars/delete.php +++ b/kronolith/calendars/delete.php @@ -28,7 +28,7 @@ if ($calendar_id == $GLOBALS['registry']->getAuth()) { } if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('calendar:internal|' . $calendar_id)); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('calendar:internal|' . $calendar_id)); exit; } diff --git a/kronolith/calendars/edit.php b/kronolith/calendars/edit.php index 5b3252f49..e42b69518 100644 --- a/kronolith/calendars/edit.php +++ b/kronolith/calendars/edit.php @@ -14,7 +14,7 @@ Horde_Registry::appInit('kronolith'); $vars = Horde_Variables::getDefaultVariables(); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('calendar:internal|' . $vars->get('c'))); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('calendar:internal|' . $vars->get('c'))); exit; } diff --git a/kronolith/calendars/remote_edit.php b/kronolith/calendars/remote_edit.php index fdedbb995..d5d43f3d2 100644 --- a/kronolith/calendars/remote_edit.php +++ b/kronolith/calendars/remote_edit.php @@ -15,7 +15,7 @@ $vars = Horde_Variables::getDefaultVariables(); $url = $vars->get('url'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('calendar:remote|' . rawurlencode($url))); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('calendar:remote|' . rawurlencode($url))); exit; } diff --git a/kronolith/calendars/remote_subscribe.php b/kronolith/calendars/remote_subscribe.php index b16bd524b..749871bb6 100644 --- a/kronolith/calendars/remote_subscribe.php +++ b/kronolith/calendars/remote_subscribe.php @@ -15,7 +15,7 @@ $vars = Horde_Variables::getDefaultVariables(); $url = $vars->get('url'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('calendar:remote|' . rawurlencode($url))); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('calendar:remote|' . rawurlencode($url))); exit; } diff --git a/kronolith/calendars/remote_unsubscribe.php b/kronolith/calendars/remote_unsubscribe.php index fe52eff7c..36abebe17 100644 --- a/kronolith/calendars/remote_unsubscribe.php +++ b/kronolith/calendars/remote_unsubscribe.php @@ -15,7 +15,7 @@ $vars = Horde_Variables::getDefaultVariables(); $url = $vars->get('url'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('calendar:remote|' . rawurlencode($url))); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('calendar:remote|' . rawurlencode($url))); exit; } diff --git a/kronolith/day.php b/kronolith/day.php index a74b14c8c..af563036d 100644 --- a/kronolith/day.php +++ b/kronolith/day.php @@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('day:' . Kronolith::currentDate()->dateString())); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('day:' . Kronolith::currentDate()->dateString())); exit; } diff --git a/kronolith/event.php b/kronolith/event.php index 675bf0d88..9b93c4c9d 100644 --- a/kronolith/event.php +++ b/kronolith/event.php @@ -21,7 +21,7 @@ if (is_string($view->event)) { } if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('event:' . $view->event->calendarType . '|' . $view->event->calendar . ':' . $view->event->id . ':' . Horde_Util::getFormData('datetime', Kronolith::currentDate()->dateString()))); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('event:' . $view->event->calendarType . '|' . $view->event->calendar . ':' . $view->event->id . ':' . Horde_Util::getFormData('datetime', Kronolith::currentDate()->dateString()))); exit; } diff --git a/kronolith/month.php b/kronolith/month.php index 7957617cc..1082ec823 100644 --- a/kronolith/month.php +++ b/kronolith/month.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('month:' . Kronolith::currentDate()->dateString())); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('month:' . Kronolith::currentDate()->dateString())); exit; } diff --git a/kronolith/new.php b/kronolith/new.php index 7c14dce14..ce97761a1 100644 --- a/kronolith/new.php +++ b/kronolith/new.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('event')); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('event')); exit; } diff --git a/kronolith/week.php b/kronolith/week.php index 11d460c51..24d55f998 100644 --- a/kronolith/week.php +++ b/kronolith/week.php @@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('week:' . Kronolith::currentDate()->dateString())); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('week:' . Kronolith::currentDate()->dateString())); exit; } diff --git a/kronolith/workweek.php b/kronolith/workweek.php index cfcf4f011..c091ce155 100644 --- a/kronolith/workweek.php +++ b/kronolith/workweek.php @@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('week:' . Kronolith::currentDate()->dateString())); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('week:' . Kronolith::currentDate()->dateString())); exit; } diff --git a/kronolith/year.php b/kronolith/year.php index a729de80f..68f4eca0f 100644 --- a/kronolith/year.php +++ b/kronolith/year.php @@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); if (Kronolith::showAjaxView()) { - header('Location: ' . Horde::applicationUrl('', true)->addAnchor('year:' . Kronolith::currentDate()->dateString())); + header('Location: ' . Horde::applicationUrl('', true)->setAnchor('year:' . Kronolith::currentDate()->dateString())); exit; } -- 2.11.0