]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/gallery.php
allow doc and api calls from private
[quix0rs-gnu-social.git] / lib / gallery.php
index 6483b4722ac2bdf1a9a20dea6d4478d45ffe96ec..886b6b9e88bcfc1ea8b7b16158bab607d3ece510 100644 (file)
@@ -34,7 +34,13 @@ class GalleryAction extends Action {
 
        function handle($args) {
                parent::handle($args);
+
+               # Post from the tag dropdown; redirect to a GET
                
+               if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+                   common_redirect($this->self_url(), 307);
+               }
+
                $nickname = common_canonical_nickname($this->arg('nickname'));
                $user = User::staticGet('nickname', $nickname);
 
@@ -63,7 +69,7 @@ class GalleryAction extends Action {
                }
                
                $tag = $this->arg('tag');
-               
+
                common_show_header($profile->nickname . ": " . $this->gallery_type(),
                                                   NULL, $profile,
                                                   array($this, 'show_top'));
@@ -88,17 +94,17 @@ class GalleryAction extends Action {
                        $content[$t] = $t;
                }
                if ($tags) {
-                 common_element_start('dl', array('id'=>'filter_tags'));
-      common_element('dt', null, _('Filter tags'));
-                 common_element_start('dd');
-                 common_element_start('ul');
-                 common_element_start('li', array('id'=>'filter_tags_all', 'class'=>'child_1'));
+                       common_element_start('dl', array('id'=>'filter_tags'));
+                       common_element('dt', null, _('Filter tags'));
+                       common_element_start('dd');
+                       common_element_start('ul');
+                       common_element_start('li', array('id'=>'filter_tags_all', 'class'=>'child_1'));
                        common_element('a', array('href' => common_local_url($this->trimmed('action'),
                                                                                                                                 array('nickname' => $profile->nickname))),
                                                   _('All'));
                        common_element_end('li');
-                 common_element_start('li', array('id'=>'filter_tags_item'));
-                       common_element_start('form', array('name' => 'bytag', 'id' => 'bytag'));
+                       common_element_start('li', array('id'=>'filter_tags_item'));
+                       common_element_start('form', array('name' => 'bytag', 'id' => 'bytag', 'method' => 'post'));
                        common_dropdown('tag', _('Tag'), $content,
                                                        _('Choose a tag to narrow list'), FALSE, $tag);
                        common_submit('go', _('Go'));
@@ -249,7 +255,7 @@ class GalleryAction extends Action {
                        common_element('a', array('href' => $url),
                                                   _('Icons'));
                        common_element_end('li');
-      break;
+                       break;
                 default:
                        common_element_start('li', array('class'=>'child_1'));
                        $url_args = array('nickname' => $profile->nickname,
@@ -257,7 +263,7 @@ class GalleryAction extends Action {
                        if ($tag) {
                                $url_args['tag'] = $tag;
                        }
-                       common_local_url($this->trimmed('action'), $url_args);
+                       $url = common_local_url($this->trimmed('action'), $url_args);
                        common_element('a', array('href' => $url),
                                                   _('List'));
                        common_element_end('li');