]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/SimpleUrl/SimpleUrlPlugin.php
Test if $casSettings['user_whitelist'] is an array - and then perform in_array(....
[quix0rs-gnu-social.git] / plugins / SimpleUrl / SimpleUrlPlugin.php
index 45b745b07d0000a50860ef5042c084d5c280f2e5..235a330e028b20a6e5980ec4e65eb5effe73fec2 100644 (file)
@@ -22,7 +22,7 @@
  * @category  Plugin
  * @package   StatusNet
  * @author    Craig Andrews <candrews@integralblue.com>
- * @copyright 2009 Craig Andrews http://candrews.integralblue.com
+ * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
@@ -31,8 +31,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/plugins/UrlShortener/UrlShortenerPlugin.php';
-
 class SimpleUrlPlugin extends UrlShortenerPlugin
 {
     public $serviceUrl;
@@ -40,12 +38,26 @@ class SimpleUrlPlugin extends UrlShortenerPlugin
     function onInitializePlugin(){
         parent::onInitializePlugin();
         if(!isset($this->serviceUrl)){
-            throw new Exception("must specify a serviceUrl");
+            // TRANS: Exception thrown when the SimpleUrl plugin has been configured incorrectly.
+            throw new Exception(_m('You must specify a serviceUrl.'));
         }
     }
 
     protected function shorten($url) {
         return $this->http_get(sprintf($this->serviceUrl,urlencode($url)));
     }
-}
 
+    function onPluginVersion(array &$versions)
+    {
+        $versions[] = array('name' => sprintf('SimpleUrl (%s)', $this->shortenerName),
+                            'version' => GNUSOCIAL_VERSION,
+                            'author' => 'Craig Andrews',
+                            'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SimpleUrl',
+                            'rawdescription' =>
+                            // TRANS: Plugin description.
+                            sprintf(_m('Uses <a href="http://%1$s/">%1$s</a> URL-shortener service.'),
+                                    $this->shortenerName));
+
+        return true;
+    }
+}