]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GroupFavorited/GroupFavoritedPlugin.php
getByPK (primary key) lookup for Managed_DataObject instances
[quix0rs-gnu-social.git] / plugins / GroupFavorited / GroupFavoritedPlugin.php
index 68815530aa602f923c40af874805eb2010655ad9..bfb7374d1d6050e5b09ab8d448ea246d679932df 100644 (file)
@@ -29,10 +29,10 @@ class GroupFavoritedPlugin 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)
+    function onRouterInitialized(URLMapper $m)
     {
         $m->connect('group/:nickname/favorited',
                     array('action' => 'groupfavorited'),
@@ -41,28 +41,7 @@ class GroupFavoritedPlugin extends Plugin
         return true;
     }
 
-    /**
-     * Automatically load the actions and libraries used by the plugin
-     *
-     * @param Class $cls the class
-     *
-     * @return boolean hook return
-     *
-     */
-    function onAutoload($cls)
-    {
-        $base = dirname(__FILE__);
-        $lower = strtolower($cls);
-        switch ($lower) {
-        case 'groupfavoritedaction':
-            require_once "$base/$lower.php";
-            return false;
-        default:
-            return true;
-        }
-    }
-
-    function onEndGroupGroupNav(GroupNav $nav)
+    function onEndGroupGroupNav(Menu $nav)
     {
         $action_name = $nav->action->trimmed('action');
         $nickname = $nav->group->nickname;
@@ -76,4 +55,28 @@ class GroupFavoritedPlugin extends Plugin
                             $action_name == 'groupfavorited',
                             'nav_group_group');
     }
+
+    /**
+     * Provide plugin version information.
+     *
+     * This data is used when showing the version page.
+     *
+     * @param array &$versions array of version data arrays; see EVENTS.txt
+     *
+     * @return boolean hook value
+     */
+    function onPluginVersion(array &$versions)
+    {
+        $url = 'http://status.net/wiki/Plugin:GroupFavorited';
+
+        $versions[] = array('name' => 'GroupFavorited',
+            'version' => GNUSOCIAL_VERSION,
+            'author' => 'Brion Vibber',
+            'homepage' => $url,
+            'rawdescription' =>
+            // TRANS: Plugin description.
+            _m('This plugin adds a menu item for popular notices in groups.'));
+
+        return true;
+    }
 }