diff options
Diffstat (limited to 'plugins/Live/Live.php')
-rw-r--r-- | plugins/Live/Live.php | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/plugins/Live/Live.php b/plugins/Live/Live.php index f659a8ae0e..4fbec02c54 100644 --- a/plugins/Live/Live.php +++ b/plugins/Live/Live.php @@ -1,30 +1,16 @@ <?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_Live */ /** - TODO Live! Plugin - ==== - - api propre - - html - - jquery spy - - make sure only one query is launched at once or what if requests takes more than 10s to succeed? - - simple stats above in TEXT - - Security review - - blog post, push version - -//TODO add api to get actions name/count/first/last/etc - */ - -/** * * @package Piwik_Live */ @@ -33,13 +19,34 @@ class Piwik_Live extends Piwik_Plugin public function getInformation() { return array( - 'name' => 'Live Visitors', - 'description' => 'Live Visitors!', + 'description' => Piwik_Translate('Live_PluginDescription'), 'author' => 'Piwik', - 'homepage' => 'http://piwik.org/', - 'version' => '0.1', + 'author_homepage' => 'http://piwik.org/', + 'version' => Piwik_Version::VERSION, ); } -} -Piwik_AddWidget('Live!', 'Live Visitors!', 'Live', 'widget'); + function getListHooksRegistered() + { + return array( + 'template_css_import' => 'css', + 'WidgetsList.add' => 'addWidget', + 'Menu.add' => 'addMenu', + ); + } + + function css() + { + echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/default/styles.css\" />\n"; + } + + function addMenu() + { + Piwik_AddMenu('General_Visitors', 'Live_VisitorLog', array('module' => 'Live', 'action' => 'getLastVisitsDetails')); + } + + public function addWidget() { + Piwik_AddWidget('Live!', 'Live Visitors!', 'Live', 'widget'); + } + +} |