diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-12-14 12:56:21 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-12-14 12:56:21 +0400 |
commit | 043fc882559e3ed31c1387fbd5ef158510c5668f (patch) | |
tree | e899ada11325b777e79de2b89997a943b21d3f34 /plugins/Annotations/Annotations.php | |
parent | 6720c8ae82f2f914a682c4c741fd6adc768dd230 (diff) |
Fixes #1253, added annotations plugin that allows attaching notes to different days.
Notes:
* Modified renderers so they would render arrays better. Before, arrays were added to DataTables and array keys were either lost or ignored, now they are rendered.
* Fixed issue w/ JSON rendering that rendered arrays when the PHP arrays didn't have contiguous keys.
* Augmented some exception messages.
* Added utility method processRequest to Piwik_API_Request to ease use of the class.
git-svn-id: http://dev.piwik.org/svn/trunk@7612 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Annotations/Annotations.php')
-rwxr-xr-x | plugins/Annotations/Annotations.php | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/plugins/Annotations/Annotations.php b/plugins/Annotations/Annotations.php new file mode 100755 index 0000000000..ed339812e6 --- /dev/null +++ b/plugins/Annotations/Annotations.php @@ -0,0 +1,70 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * @version $Id$ + * + * @category Piwik_Plugins + * @package Piwik_Annotations + */ + +/** + * Annotations plugins. Provides the ability to attach text notes to + * dates for each sites. Notes can be viewed, modified, deleted or starred. + * + * @package Piwik_Annotations + */ +class Piwik_Annotations extends Piwik_Plugin +{ + /** + * Returns information about this plugin. + * + * @return array + */ + public function getInformation() + { + return array( + 'description' => Piwik_Translate('Annotations_PluginDescription'), + 'author' => 'Piwik', + 'author_homepage' => 'http://piwik.org/', + 'version' => Piwik_Version::VERSION, + ); + } + + /** + * Returns list of event hooks. + * + * @return array + */ + public function getListHooksRegistered() + { + return array( + 'AssetManager.getCssFiles' => 'getCssFiles', + 'AssetManager.getJsFiles' => 'getJsFiles' + ); + } + + /** + * Adds css files for this plugin to the list in the event notification. + * + * @param Piwik_Event_Notification $notification notification object + */ + function getCssFiles( $notification ) + { + $cssFiles = &$notification->getNotificationObject(); + $cssFiles[] = "plugins/Annotations/templates/styles.css"; + } + + /** + * Adds js files for this plugin to the list in the event notification. + * + * @param Piwik_Event_Notification $notification notification object + */ + function getJsFiles( $notification ) + { + $jsFiles = &$notification->getNotificationObject(); + $jsFiles[] = "plugins/Annotations/templates/annotations.js"; + } +} |