* '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(),
* )
/**
* 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'),
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(&$versions)
{
- $base = dirname(__FILE__);
- $lower = strtolower($cls);
- switch ($lower) {
- case 'favoritedsliceaction':
- require_once "$base/$lower.php";
- return false;
- default:
- return true;
- }
- }
+ $url = 'http://status.net/wiki/Plugin: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;
}
}