X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSlicedFavorites%2FSlicedFavoritesPlugin.php;h=fcf971de6addc64c18771e5bd02bcf0a51560c15;hb=a4e679a11858031edec63cc5a6625b062f2bcd60;hp=ed7f5ebb96c10c0ffaf98ecc80c3c47588bd2704;hpb=ff906331d6f8c94a5aec25ef0f7be36b983495f9;p=quix0rs-gnu-social.git diff --git a/plugins/SlicedFavorites/SlicedFavoritesPlugin.php b/plugins/SlicedFavorites/SlicedFavoritesPlugin.php index ed7f5ebb96..fcf971de6a 100644 --- a/plugins/SlicedFavorites/SlicedFavoritesPlugin.php +++ b/plugins/SlicedFavorites/SlicedFavoritesPlugin.php @@ -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; } }