]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/SlicedFavorites/SlicedFavoritesPlugin.php
Change status.net/wiki URLs to git.gnu.io
[quix0rs-gnu-social.git] / plugins / SlicedFavorites / SlicedFavoritesPlugin.php
index 0a1a591efb88859941821de3f29536db5fa065c8..fcf971de6addc64c18771e5bd02bcf0a51560c15 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 /**
- * @package YammerImportPlugin
+ * @package SlicedFavoritesPlugin
  * @maintainer Brion Vibber <brion@status.net>
  */
 
@@ -33,13 +33,13 @@ class SlicedFavoritesPlugin extends Plugin
      *     'slices' => array(
      *       // show only pop's notices on /favorited
      *       'default' => array('include' => array('pop')),
-     * 
+     *
      *       // show only son's notices on /favorited/blog
      *       'blog' => array('include' => array('son')),
-     * 
+     *
      *       // show all favorited notices except pop's and son's on /favorited/submitted
      *       'submitted' => array('exclude' => array('pop', 'son')),
-     * 
+     *
      *       // show all favorited notices on /favorited/everybody
      *       'everybody' => array(),
      *     )
@@ -52,10 +52,10 @@ class SlicedFavoritesPlugin extends Plugin
     /**
      * Hook for RouterInitialized event.
      *
-     * @param Net_URL_Mapper $m path-to-action mapper
+     * @param URLMapper $m path-to-action mapper
      * @return boolean hook return
      */
-    function onRouterInitialized($m)
+    public function onRouterInitialized(URLMapper $m)
     {
         $m->connect('favorited/:slice',
                     array('action' => 'favoritedslice'),
@@ -77,33 +77,36 @@ class SlicedFavoritesPlugin extends Plugin
         return true;
     }
 
+    function onSlicedFavoritesGetSettings($slice, &$data)
+    {
+        if (isset($this->slices[$slice])) {
+            $data = $this->slices[$slice];
+            return false;
+        }
+        return true;
+    }
+
     /**
-     * Automatically load the actions and libraries used by the plugin
+     * Provide plugin version information.
      *
-     * @param Class $cls the class
+     * This data is used when showing the version page.
      *
-     * @return boolean hook return
+     * @param array &$versions array of version data arrays; see EVENTS.txt
      *
+     * @return boolean hook value
      */
-    function onAutoload($cls)
+    function onPluginVersion(array &$versions)
     {
-        $base = dirname(__FILE__);
-        $lower = strtolower($cls);
-        switch ($lower) {
-        case 'favoritedsliceaction':
-            require_once "$base/$lower.php";
-            return false;
-        default:
-            return true;
-        }
-    }
+        $url = 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/SlicedFavorites';
+
+        $versions[] = array('name' => 'SlicedFavorites',
+            'version' => GNUSOCIAL_VERSION,
+            'author' => 'Brion Vibber',
+            'homepage' => $url,
+            'rawdescription' =>
+            // TRANS: Plugin description.
+            _m('Shows timelines of popular notices for defined subsets of users.'));
 
-    function onSlicedFavoritesGetSettings($slice, &$data)
-    {
-        if (isset($this->slices[$slice])) {
-            $data = $this->slices[$slice];
-            return false;
-        }
         return true;
     }
 }