Consistently use Horde_Url::setAnchor()
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 27 Jul 2010 08:11:56 +0000 (02:11 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 27 Jul 2010 08:11:56 +0000 (02:11 -0600)
ansel/lib/Ansel.php
framework/Url/test/Horde/Url/AddTest.php
framework/Url/test/Horde/Url/RemoveTest.php
horde/admin/datatree.php
horde/login.php

index da244aa..5f4a955 100644 (file)
@@ -259,8 +259,7 @@ class Ansel
                     if ($data['view'] == 'Image' &&
                         !empty($data['gallery_view']) &&
                         $data['gallery_view'] == 'GalleryLightbox') {
-
-                        $url->anchor = $data['image'];
+                        $url->setAnchor($data['image']);
                     }
 
                 } elseif ($data['view'] == 'Results')  {
@@ -298,9 +297,8 @@ class Ansel
                 if ($data['view'] == 'Image' &&
                     !empty($data['gallery_view']) &&
                     $data['gallery_view'] == 'GalleryLightbox') {
-
                     $data['view'] = 'Gallery';
-                    $url->anchor = $data['image'];
+                    $url->setAnchor($data['image']);
                 }
 
                 return $url->add($data)->setRaw(true);
index 42a6f11..95246ce 100644 (file)
@@ -21,7 +21,7 @@ class Horde_Url_AddTest extends PHPUnit_Framework_TestCase
         $url->add('fez');
         $this->assertEquals('test?foo=1&amp;bar=2&amp;baz=3&amp;fez', (string)$url);
 
-        $url->anchor = 'boo';
+        $url->setAnchor('boo');
         $this->assertEquals('test?foo=1&amp;bar=2&amp;baz=3&amp;fez#boo', (string)$url);
         $url->addAnchor('bee');
         $this->assertEquals('test?foo=1&amp;bar=2&amp;baz=3&amp;fez#bee', (string)$url);
@@ -102,14 +102,14 @@ class Horde_Url_AddTest extends PHPUnit_Framework_TestCase
     public function testParseUrlAnchor()
     {
         $url = new Horde_Url('test?foo=1#bar');
-        $url->anchor = 'baz';
+        $url->setAnchor('baz');
         $this->assertEquals('test?foo=1#baz', (string)$url);
     }
 
     public function testEncodeAnchor()
     {
         $url = new Horde_Url('test');
-        $url->anchor = 'a@b.com';
+        $url->setAnchor('a@b.com');
         $this->assertEquals('test#a%40b.com', (string)$url);
     }
 
index 6fa4cc0..0bfddba 100644 (file)
@@ -24,7 +24,7 @@ class Horde_Url_RemoveTest extends PHPUnit_Framework_TestCase
         $this->assertEquals('test?bar=2&baz=3', (string)$url->remove('foo'));
 
         $url = new Horde_Url('test?foo=1#baz');
-        $url->anchor = '';
+        $url->setAnchor('');
         $this->assertEquals('test?foo=1', (string)$url);
     }
 
@@ -43,7 +43,7 @@ class Horde_Url_RemoveTest extends PHPUnit_Framework_TestCase
         $this->assertEquals('test?bar=2&amp;baz=3', (string)$url->remove('foo'));
 
         $url = new Horde_Url('test?foo=1&amp;bar=2#baz');
-        $url->anchor = '';
+        $url->setAnchor('');
         $this->assertEquals('test?foo=1&amp;bar=2', (string)$url);
     }
 
index 8d3812f..ff1130e 100644 (file)
@@ -18,8 +18,7 @@ function _addTree($parent, $parent_id, $datatree, $tree, $indent = 1)
 
     foreach ($nodes as $id => $node) {
         if ($id != $parent_id) {
-            $node_url = $url->copy()->add('show', $datatree->getParam('group') . ':' . $id);
-            $node_url->anchor = 'show';
+            $node_url = $url->copy()->add('show', $datatree->getParam('group') . ':' . $id)->setAnchor('show');
 
             $tree->addNode($parent . ':' . $id, $parent, $datatree->getShortName($node), $indent, false, array('url' => strval($node_url)));
             _addTree($parent . ':' . $id, $id, $datatree, $tree, $indent + 1);
index 6580176..128dafe 100644 (file)
@@ -36,7 +36,7 @@ function _addAnchor($url, $type, $vars, $url_anchor = null)
     case 'url':
         $anchor = $vars->anchor_string;
         if (!empty($anchor)) {
-            $url->anchor = $anchor;
+            $url->addAnchor($anchor);
         } else {
             return _addAnchor($url, 'param', $vars, $url_anchor);
         }