]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Do not show the URL shortener selection drop down if no shorteners are available
authorCraig Andrews <candrews@integralblue.com>
Wed, 11 Nov 2009 22:05:24 +0000 (17:05 -0500)
committerCraig Andrews <candrews@integralblue.com>
Wed, 11 Nov 2009 22:05:24 +0000 (17:05 -0500)
actions/othersettings.php

index d52a634aca37b606a14f5f95b83d37e93457e3fb..1d252f34ed89d02e09131c4e35d952ee7bb2bd1a 100644 (file)
@@ -96,6 +96,7 @@ class OthersettingsAction extends AccountSettingsAction
                                           common_local_url('othersettings')));
         $this->elementStart('fieldset');
         $this->hidden('token', common_session_token());
+        $this->elementStart('ul', 'form_data');
 
         Event::handle('GetUrlShorteners', array(&$shorteners));
         foreach($shorteners as $name=>$value)
@@ -105,14 +106,16 @@ class OthersettingsAction extends AccountSettingsAction
                 $services[$name].=_(' (free service)');
             }
         }
-        asort($services);
+        if($services)
+        {
+            asort($services);
 
-        $this->elementStart('ul', 'form_data');
-        $this->elementStart('li');
-        $this->dropdown('urlshorteningservice', _('Shorten URLs with'),
-                        $services, _('Automatic shortening service to use.'),
-                        false, $user->urlshorteningservice);
-        $this->elementEnd('li');
+            $this->elementStart('li');
+            $this->dropdown('urlshorteningservice', _('Shorten URLs with'),
+                            $services, _('Automatic shortening service to use.'),
+                            false, $user->urlshorteningservice);
+            $this->elementEnd('li');
+        }
         $this->elementStart('li');
         $this->checkbox('viewdesigns', _('View profile designs'),
                         $user->viewdesigns, _('Show or hide profile designs.'));