]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/othersettings.php
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / actions / othersettings.php
index 8b674161a89bb1a28408e4e91b158083a5492167..10e9873b390b16f6cbc7e0d849a0c6d770a9814a 100644 (file)
@@ -57,7 +57,7 @@ class OthersettingsAction extends AccountSettingsAction
 
     function title()
     {
-        return _('Other Settings');
+        return _('Other settings');
     }
 
     /**
@@ -71,6 +71,12 @@ class OthersettingsAction extends AccountSettingsAction
         return _('Manage various other options.');
     }
 
+    function showScripts()
+    {
+        parent::showScripts();
+        $this->autofocus('urlshorteningservice');
+    }
+
     /**
      * Content area of the page
      *
@@ -90,27 +96,28 @@ class OthersettingsAction extends AccountSettingsAction
                                           common_local_url('othersettings')));
         $this->elementStart('fieldset');
         $this->hidden('token', common_session_token());
-
-        // I18N
-
-        $services = array(
-                          '' => 'None',
-                          'ur1.ca' => 'ur1.ca (free service)',
-                          '2tu.us' => '2tu.us (free service)',
-                          'ptiturl.com' => 'ptiturl.com',
-                          'bit.ly' => 'bit.ly',
-                          'tinyurl.com' => 'tinyurl.com',
-                          'is.gd' => 'is.gd',
-                          'snipr.com' => 'snipr.com',
-                          'metamark.net' => 'metamark.net'
-                          );
-
         $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');
+
+        $shorteners = array();
+        Event::handle('GetUrlShorteners', array(&$shorteners));
+        $services = array();
+        foreach($shorteners as $name=>$value)
+        {
+            $services[$name]=$name;
+            if($value['freeService']){
+                $services[$name].=_(' (free service)');
+            }
+        }
+        if($services)
+        {
+            asort($services);
+
+            $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.'));