From 9bcf3f24892e3ce52e0ce9cb4c38465b9084059c Mon Sep 17 00:00:00 2001 From: mattpiwik Date: Sun, 27 Jul 2008 23:07:52 +0000 Subject: - Adding description to each plugin - cleaning plugins listing, splitting ExamplePlugin in multiple small plugins, renamed Home -> CoreHome PluginsAdmin -> CorePluginsAdmin AdminHome -> CoreAdminHome - simplified authentication classes (not using Zend_Auth_Db anymore) - adding a new widget listing the last posts on Piwik.org/blog git-svn-id: http://dev.piwik.org/svn/trunk@581 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/API/API.php | 4 +- plugins/API/Controller.php | 2 +- plugins/Actions/Actions.php | 2 +- plugins/Actions/Controller.php | 6 +- plugins/AdminHome/AdminHome.php | 27 - plugins/AdminHome/Controller.php | 66 -- plugins/AdminHome/templates/index.tpl | 48 - plugins/AdminHome/templates/menu.css | 37 - plugins/AdminHome/templates/menu.tpl | 5 - plugins/Dashboard/Controller.php | 2 +- plugins/Dashboard/Dashboard.php | 2 +- plugins/Dashboard/templates/header.tpl | 10 +- plugins/Dashboard/templates/index.tpl | 4 +- plugins/ExampleAPI/API.php | 92 ++ plugins/ExampleAPI/ExampleAPI.php | 15 + plugins/ExampleFeedburner/ExampleFeedburner.php | 73 ++ plugins/ExampleFeedburner/feedburner.tpl | 35 + plugins/ExamplePlugin/API.php | 89 -- plugins/ExamplePlugin/ExamplePlugin.php | 121 +-- plugins/ExamplePlugin/feedburner.tpl | 35 - plugins/ExampleRssWidget/ExampleRssWidget.php | 4 +- plugins/Feedback/Controller.php | 1 - plugins/Feedback/Feedback.php | 2 +- plugins/Feedback/index.tpl | 2 +- plugins/Home/Controller.php | 134 --- plugins/Home/Home.php | 26 - plugins/Home/templates/calendar.js | 172 ---- plugins/Home/templates/cloud.tpl | 68 -- plugins/Home/templates/datatable.css | 339 ------- plugins/Home/templates/datatable.js | 988 --------------------- plugins/Home/templates/datatable.tpl | 40 - plugins/Home/templates/datatable_actions.tpl | 40 - plugins/Home/templates/datatable_actions_js.tpl | 12 - .../Home/templates/datatable_actions_recursive.tpl | 44 - .../templates/datatable_actions_subdatable.tpl | 19 - plugins/Home/templates/datatable_footer.tpl | 36 - plugins/Home/templates/datatable_js.tpl | 12 - plugins/Home/templates/date.js | 89 -- plugins/Home/templates/graph.tpl | 16 - plugins/Home/templates/header.tpl | 8 - plugins/Home/templates/images/bg_header.jpg | Bin 9097 -> 0 bytes plugins/Home/templates/images/bullet1.gif | Bin 47 -> 0 bytes plugins/Home/templates/images/bullet2.gif | Bin 55 -> 0 bytes plugins/Home/templates/images/more.png | Bin 1045 -> 0 bytes plugins/Home/templates/images/more_date.gif | Bin 56 -> 0 bytes plugins/Home/templates/images/more_period.gif | Bin 53 -> 0 bytes plugins/Home/templates/images/reset_search.png | Bin 1021 -> 0 bytes plugins/Home/templates/images/search.png | Bin 136 -> 0 bytes plugins/Home/templates/index.tpl | 77 -- plugins/Home/templates/logo.tpl | 14 - plugins/Home/templates/menu.css | 111 --- plugins/Home/templates/menu.js | 126 --- plugins/Home/templates/menu.tpl | 16 - plugins/Home/templates/period_select.tpl | 13 - plugins/Home/templates/piwik_tag.tpl | 19 - plugins/Home/templates/sites_select.tpl | 0 plugins/Home/templates/sparkline.js | 59 -- plugins/Home/templates/style.css | 258 ------ plugins/Home/templates/top_bar.tpl | 31 - plugins/Installation/Installation.php | 2 +- plugins/Login/Auth.php | 57 +- plugins/Login/Controller.php | 7 +- plugins/Login/Login.php | 17 +- plugins/PluginsAdmin/Controller.php | 65 -- plugins/PluginsAdmin/PluginsAdmin.php | 32 - plugins/PluginsAdmin/templates/manage.tpl | 29 - plugins/Provider/Provider.php | 2 +- plugins/Referers/Referers.php | 2 +- plugins/Referers/index.tpl | 2 +- plugins/SitesManager/SitesManager.php | 3 +- plugins/SitesManager/templates/SitesManager.js | 17 +- plugins/SitesManager/templates/SitesManager.tpl | 10 +- plugins/UserCountry/UserCountry.php | 2 +- plugins/UserCountry/index.tpl | 2 +- plugins/UserSettings/UserSettings.php | 27 +- plugins/UsersManager/API.php | 8 +- plugins/UsersManager/Controller.php | 2 +- plugins/UsersManager/UsersManager.php | 2 +- plugins/UsersManager/templates/UsersManager.js | 17 +- plugins/UsersManager/templates/UsersManager.tpl | 37 +- plugins/VisitFrequency/VisitFrequency.php | 2 +- plugins/VisitFrequency/index.tpl | 2 +- plugins/VisitTime/VisitTime.php | 2 +- plugins/VisitorInterest/VisitorInterest.php | 24 +- plugins/VisitsSummary/VisitsSummary.php | 2 +- plugins/VisitsSummary/index.tpl | 2 +- plugins/Widgetize/Widgetize.php | 2 +- plugins/Widgetize/templates/iframe.tpl | 6 +- plugins/Widgetize/templates/js.tpl | 6 +- 89 files changed, 411 insertions(+), 3430 deletions(-) delete mode 100644 plugins/AdminHome/AdminHome.php delete mode 100644 plugins/AdminHome/Controller.php delete mode 100644 plugins/AdminHome/templates/index.tpl delete mode 100644 plugins/AdminHome/templates/menu.css delete mode 100644 plugins/AdminHome/templates/menu.tpl create mode 100644 plugins/ExampleAPI/API.php create mode 100644 plugins/ExampleAPI/ExampleAPI.php create mode 100644 plugins/ExampleFeedburner/ExampleFeedburner.php create mode 100644 plugins/ExampleFeedburner/feedburner.tpl delete mode 100644 plugins/ExamplePlugin/API.php delete mode 100644 plugins/ExamplePlugin/feedburner.tpl delete mode 100644 plugins/Home/Controller.php delete mode 100644 plugins/Home/Home.php delete mode 100644 plugins/Home/templates/calendar.js delete mode 100644 plugins/Home/templates/cloud.tpl delete mode 100644 plugins/Home/templates/datatable.css delete mode 100644 plugins/Home/templates/datatable.js delete mode 100644 plugins/Home/templates/datatable.tpl delete mode 100644 plugins/Home/templates/datatable_actions.tpl delete mode 100644 plugins/Home/templates/datatable_actions_js.tpl delete mode 100644 plugins/Home/templates/datatable_actions_recursive.tpl delete mode 100644 plugins/Home/templates/datatable_actions_subdatable.tpl delete mode 100644 plugins/Home/templates/datatable_footer.tpl delete mode 100644 plugins/Home/templates/datatable_js.tpl delete mode 100644 plugins/Home/templates/date.js delete mode 100644 plugins/Home/templates/graph.tpl delete mode 100644 plugins/Home/templates/header.tpl delete mode 100644 plugins/Home/templates/images/bg_header.jpg delete mode 100644 plugins/Home/templates/images/bullet1.gif delete mode 100644 plugins/Home/templates/images/bullet2.gif delete mode 100644 plugins/Home/templates/images/more.png delete mode 100644 plugins/Home/templates/images/more_date.gif delete mode 100644 plugins/Home/templates/images/more_period.gif delete mode 100644 plugins/Home/templates/images/reset_search.png delete mode 100644 plugins/Home/templates/images/search.png delete mode 100644 plugins/Home/templates/index.tpl delete mode 100644 plugins/Home/templates/logo.tpl delete mode 100644 plugins/Home/templates/menu.css delete mode 100644 plugins/Home/templates/menu.js delete mode 100644 plugins/Home/templates/menu.tpl delete mode 100644 plugins/Home/templates/period_select.tpl delete mode 100644 plugins/Home/templates/piwik_tag.tpl delete mode 100644 plugins/Home/templates/sites_select.tpl delete mode 100644 plugins/Home/templates/sparkline.js delete mode 100644 plugins/Home/templates/style.css delete mode 100644 plugins/Home/templates/top_bar.tpl delete mode 100644 plugins/PluginsAdmin/Controller.php delete mode 100644 plugins/PluginsAdmin/PluginsAdmin.php delete mode 100644 plugins/PluginsAdmin/templates/manage.tpl (limited to 'plugins') diff --git a/plugins/API/API.php b/plugins/API/API.php index af64f74cb4..de0b15fbbf 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: ExamplePlugin.php 169 2008-01-14 05:41:15Z matt $ * - * @package Piwik_PluginsAdmin + * @package Piwik_CorePluginsAdmin */ class Piwik_API extends Piwik_Plugin @@ -16,7 +16,7 @@ class Piwik_API extends Piwik_Plugin return array( // name must be the className prefix! 'name' => 'API', - 'description' => '', + 'description' => 'All the data in Piwik is available through simple APIs. This plugin is the web service entry point, that you can call to get your Web Analytics data in xml, json, php, csv, etc. Discover the Piwik APIs.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php index e411626b2d..da14d63ee1 100644 --- a/plugins/API/Controller.php +++ b/plugins/API/Controller.php @@ -52,7 +52,7 @@ class Piwik_API_Controller extends Piwik_Controller function listAllAPI() { - $token_auth = Zend_Registry::get('auth')->getTokenAuth(); + $token_auth = Piwik::getCurrentUserTokenAuth(); echo " -{/literal} - - - - - - - - -Piwik admin   -Back to Piwik -

- - - -
-
- -
-{if $content}{$content}{/if} -
- - diff --git a/plugins/AdminHome/templates/menu.css b/plugins/AdminHome/templates/menu.css deleted file mode 100644 index 312ba8a436..0000000000 --- a/plugins/AdminHome/templates/menu.css +++ /dev/null @@ -1,37 +0,0 @@ -#tablist { - padding: 3px 0; - margin-left: 0; - margin-bottom: 0; - margin-top: 0.1em; - border-bottom: 1px solid gray; -} - -#tablist li { - list-style: none; - display: inline; - margin: 0; -} - -#tablist li a { - text-decoration: none; - padding: 3px 0.5em; - margin-right: 3px; - border: 1px solid #778; - border-bottom: none; - background: white; - font: bold 16px Georgia; -} - -#tablist li a:link,#tablist li a:visited { - color: black; -} - -#tablist li a:hover { - color: black; - background: #defdbb; - border-color: black; -} - -#tablist li a.current { - background: #defdbb; -} \ No newline at end of file diff --git a/plugins/AdminHome/templates/menu.tpl b/plugins/AdminHome/templates/menu.tpl deleted file mode 100644 index 0922c2e05b..0000000000 --- a/plugins/AdminHome/templates/menu.tpl +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/plugins/Dashboard/Controller.php b/plugins/Dashboard/Controller.php index d354468fd8..2ae167f3f1 100644 --- a/plugins/Dashboard/Controller.php +++ b/plugins/Dashboard/Controller.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later * @version $Id: Controller.php 241 2008-01-26 01:30:37Z matt $ * - * @package Piwik_Home + * @package Piwik_CoreHome * */ diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php index b1ac0aea0e..291a654809 100644 --- a/plugins/Dashboard/Dashboard.php +++ b/plugins/Dashboard/Dashboard.php @@ -16,7 +16,7 @@ class Piwik_Dashboard extends Piwik_Plugin return array( // name must be the className prefix! 'name' => 'Dashboard', - 'description' => '', + 'description' => 'Your Web Analytics Dashboard. You can customize Your Dashboard: add new widgets, change the order of your widgets. Each user can access his own custom Dashboard.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Dashboard/templates/header.tpl b/plugins/Dashboard/templates/header.tpl index 30d1a45f56..6b9a87e5b8 100644 --- a/plugins/Dashboard/templates/header.tpl +++ b/plugins/Dashboard/templates/header.tpl @@ -1,7 +1,7 @@ {* This header is for loading the dashboard in stand alone mode*} -{loadJavascriptTranslations modules='Home Dashboard'} +{loadJavascriptTranslations modules='CoreHome Dashboard'} @@ -13,13 +13,13 @@ - - - + + + - + diff --git a/plugins/Dashboard/templates/index.tpl b/plugins/Dashboard/templates/index.tpl index 4345f74a2d..fb3a13abab 100644 --- a/plugins/Dashboard/templates/index.tpl +++ b/plugins/Dashboard/templates/index.tpl @@ -1,4 +1,4 @@ -{loadJavascriptTranslations modules='Home Dashboard'} +{loadJavascriptTranslations modules='CoreHome Dashboard'} +{/literal} + + +
+ + +
+ diff --git a/plugins/ExamplePlugin/API.php b/plugins/ExamplePlugin/API.php deleted file mode 100644 index 72c5bde7e1..0000000000 --- a/plugins/ExamplePlugin/API.php +++ /dev/null @@ -1,89 +0,0 @@ -setColumns( array('name' => 'piwik', 'license' => 'GPL')); - $dataTable->addRow($row1); - - $dataTable->addRowFromSimpleArray( array('name' => 'google analytics', 'license' => 'commercial') ); - - return $dataTable; - } - - public function getMoreInformationAnswerToLife() - { - return "Check http://en.wikipedia.org/wiki/The_Answer_to_Life,_the_Universe,_and_Everything"; - } - -} - diff --git a/plugins/ExamplePlugin/ExamplePlugin.php b/plugins/ExamplePlugin/ExamplePlugin.php index 8c108fe670..d3c7bd1094 100644 --- a/plugins/ExamplePlugin/ExamplePlugin.php +++ b/plugins/ExamplePlugin/ExamplePlugin.php @@ -16,33 +16,18 @@ class Piwik_ExamplePlugin extends Piwik_Plugin return array( // name must be the className prefix! 'name' => 'ExamplePlugin', - 'description' => 'Description', + 'description' => 'Example Plugin: This plugin shows how to create a very simple plugin, that exports two widgets in the Dashboard.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', ); } - - function install() - { - try{ - Piwik_Query('ALTER TABLE '.Piwik::prefixTable('site'). " ADD `feedburnerName` VARCHAR( 100 ) DEFAULT NULL"); - } catch(Zend_Db_Statement_Exception $e){ - // mysql code error 1060: column already exists - // if there is another error we throw the exception, otherwise it is OK as we are simply reinstalling the plugin - if(!ereg('1060',$e->getMessage())) - { - throw $e; - } - } - } - function uninstall() - { - Piwik_Query('ALTER TABLE '.Piwik::prefixTable('site'). " DROP `feedburnerName`"); - } - } +// we register the widgets so they appear in the "Add a new widget" window in the dashboard +Piwik_AddWidget('ExamplePlugin', 'exampleWidget', 'Example widget'); +Piwik_AddWidget('ExamplePlugin', 'blogMatthieu', 'Blog matthieu RSS'); + class Piwik_ExamplePlugin_Controller extends Piwik_Controller { /** @@ -55,6 +40,35 @@ class Piwik_ExamplePlugin_Controller extends Piwik_Controller echo "Happy coding with Piwik :)"; } + /** + * See the result on piwik/?module=ExamplePlugin&action=exampleWidget + * or in the dashboard > Add a new widget + * + */ + function exampleWidget() + { + echo "Hello world!
You can output whatever you want in widgets, and put them on dashboard or everywhere on the web (in your blog, website, etc.). +
Widgets can include graphs, tables, flash, text, images, etc. +
It's very easy to create a new plugin and widgets in Piwik. Have a look at this example file (/plugins/ExamplePlugin/ExamplePlugin.php). +
Happy coding!"; + } + + /** + * Embed Matt's blog using widgetbox.com widget code + */ + function blogMatthieu() + { + echo ' + + + + + + + + '; + } + /** * This method displays a text containing an help about "How to build plugins for Piwik". * This help is then used on http://dev.piwik.org @@ -130,71 +144,4 @@ class Piwik_ExamplePlugin_Controller extends Piwik_Controller return "false"; } } - - /** - * See the result on piwik/?module=ExamplePlugin&action=exampleWidget - * or in the dashboard > Add a new widget - * - */ - function exampleWidget() - { - echo "Hello world!
You can output whatever you want in widgets, and put them on dashboard or everywhere on the web (in your blog, website, etc.). -
Widgets can include graphs, tables, flash, text, images, etc. -
It's very easy to create a new plugin and widgets in Piwik. Have a look at this example file (/plugins/ExamplePlugin/ExamplePlugin.php). -
Happy coding!"; - } - - /** - * Embed Matthieu's blog using widgetbox.com widget code - * - */ - function blogMatthieu() - { - echo ' - - - - - - - - '; - } - - /** - * Simple feedburner statistics output - * - */ - function feedburner() - { - $view = new Piwik_View('ExamplePlugin/feedburner.tpl'); - $feedburnerFeedName = Piwik_FetchOne('SELECT feedburnerName FROM '.Piwik::prefixTable('site'). - ' WHERE idsite = ?', Piwik_Common::getRequestVar('idSite',1,'int') ); - if(empty($feedburnerFeedName)) - { - $feedburnerFeedName = 'Piwik'; - } - $view->feedburnerFeedName = $feedburnerFeedName; - echo $view->render(); - } - - /** - * Function called to save the Feedburner ID entered in the form - * - */ - function saveFeedburnerName() - { - // we save the value in the DB for an authenticated user - if(Piwik::getCurrentUserLogin() != 'anonymous') - { - Piwik_Query('UPDATE '.Piwik::prefixTable('site').' SET feedburnerName = ? WHERE idsite = ?', - array(Piwik_Common::getRequestVar('name','','string'), Piwik_Common::getRequestVar('idSite',1,'int')) - ); - } - } } - -// we register the widgets so they appear in the "Add a new widget" window in the dashboard -Piwik_AddWidget('ExamplePlugin', 'exampleWidget', 'Example widget'); -Piwik_AddWidget('ExamplePlugin', 'feedburner', 'Feedburner statistics'); -Piwik_AddWidget('ExamplePlugin', 'blogMatthieu', 'Blog matthieu RSS'); \ No newline at end of file diff --git a/plugins/ExamplePlugin/feedburner.tpl b/plugins/ExamplePlugin/feedburner.tpl deleted file mode 100644 index c3673bf529..0000000000 --- a/plugins/ExamplePlugin/feedburner.tpl +++ /dev/null @@ -1,35 +0,0 @@ - -{literal} - -{/literal} - - -
- - -
- diff --git a/plugins/ExampleRssWidget/ExampleRssWidget.php b/plugins/ExampleRssWidget/ExampleRssWidget.php index 4285f414a8..4f7f8e4541 100644 --- a/plugins/ExampleRssWidget/ExampleRssWidget.php +++ b/plugins/ExampleRssWidget/ExampleRssWidget.php @@ -6,8 +6,8 @@ class Piwik_ExampleRssWidget extends Piwik_Plugin { return array( // name must be the className prefix! - 'name' => 'Example RSS Widget', - 'description' => 'Simple example on how to create a new widget that reads a RSS feed', + 'name' => 'ExampleRssWidget', + 'description' => 'Example Plugin: How to create a new widget that reads a RSS feed?', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Feedback/Controller.php b/plugins/Feedback/Controller.php index 8105529b18..45046a8342 100644 --- a/plugins/Feedback/Controller.php +++ b/plugins/Feedback/Controller.php @@ -18,7 +18,6 @@ class Piwik_Feedback_Controller extends Piwik_Controller function index() { $view = new Piwik_View('Feedback/index.tpl'); - echo $view->render(); } diff --git a/plugins/Feedback/Feedback.php b/plugins/Feedback/Feedback.php index fc80da5713..964d4157c0 100644 --- a/plugins/Feedback/Feedback.php +++ b/plugins/Feedback/Feedback.php @@ -15,7 +15,7 @@ class Piwik_Feedback extends Piwik_Plugin { return array( 'name' => 'Feedback', - 'description' => '', + 'description' => 'Send your Feedback to the Piwik Team in one click. Share your ideas and suggestions with us!', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Feedback/index.tpl b/plugins/Feedback/index.tpl index 77536a0773..21faa165dd 100644 --- a/plugins/Feedback/index.tpl +++ b/plugins/Feedback/index.tpl @@ -14,7 +14,7 @@ input, textarea, p {

Body: -

+

diff --git a/plugins/Home/Controller.php b/plugins/Home/Controller.php deleted file mode 100644 index 24bf997f67..0000000000 --- a/plugins/Home/Controller.php +++ /dev/null @@ -1,134 +0,0 @@ -getCreationDate()->isToday()) - { - $defaultDate = 'today'; - } - else - { - $defaultDate = Zend_Registry::get('config')->General->default_day; - } - header("Location:index.php?module=Home&action=index&idSite=$firstSiteId&period=day&date=$defaultDate"); - } - else - { - if(($currentLogin = Piwik::getCurrentUserLogin()) != 'anonymous') - { - Piwik_ExitWithMessage( sprintf(Piwik_Translate('Home_NoPrivileges'),$currentLogin). - "

   › ".Piwik_Translate('General_Logout')."
"); - } - else - { - Piwik_FrontController::dispatch('Login'); - } - } - exit; - } - - protected function setGeneralVariablesView($view) - { - // date - $view->date = $this->strDate; - $oDate = Piwik_Date::factory($this->strDate); - $localizedDateFormat = Piwik_Translate('Home_LocalizedDateFormat'); - $view->prettyDate = $oDate->getLocalized($localizedDateFormat); - - // period - $currentPeriod = Piwik_Common::getRequestVar('period'); - $otherPeriodsAvailable = array('day', 'week', 'month', 'year'); - - $otherPeriodsNames = array( - 'day' => Piwik_Translate('Home_PeriodDay'), - 'week' => Piwik_Translate('Home_PeriodWeek'), - 'month' => Piwik_Translate('Home_PeriodMonth'), - 'year' => Piwik_Translate('Home_PeriodYear') - ); - - $found = array_search($currentPeriod,$otherPeriodsAvailable); - if($found !== false) - { - unset($otherPeriodsAvailable[$found]); - } - - $view->period = $currentPeriod; - $view->otherPeriods = $otherPeriodsAvailable; - $view->periodsNames = $otherPeriodsNames; - - // other - $view->idSite = Piwik_Common::getRequestVar('idSite'); - - $view->userLogin = Piwik::getCurrentUserLogin(); - $view->sites = Piwik_SitesManager_API::getSitesWithAtLeastViewAccess(); - $view->url = Piwik_Url::getCurrentUrl(); - - $view->menu = Piwik_GetMenu(); - $view->menuJson = json_encode($view->menu); - //var_dump($view->menuJson); - } - - public function showInContext() - { - $controllerName = Piwik_Common::getRequestVar('moduleToLoad'); - $actionName = Piwik_Common::getRequestVar('actionToLoad', 'index'); - - $view = $this->getDefaultIndexView(); - $view->basicHtmlView = true; - $view->content = Piwik_FrontController::getInstance()->fetchDispatch( $controllerName, $actionName ); - echo $view->render(); - } - - protected function getDefaultIndexView() - { - - $view = new Piwik_View('Home/templates/index.tpl'); - $this->setGeneralVariablesView($view); - - $site = new Piwik_Site($view->idSite); - $minDate = $site->getCreationDate(); - - $view->minDateYear = $minDate->toString('Y'); - $view->minDateMonth = $minDate->toString('m'); - $view->minDateDay = $minDate->toString('d'); - - $view->basicHtmlView = false; - $view->content = ''; - return $view; - } - public function index() - { - $view = $this->getDefaultIndexView(); - echo $view->render(); - } -} - diff --git a/plugins/Home/Home.php b/plugins/Home/Home.php deleted file mode 100644 index d830b6cbd9..0000000000 --- a/plugins/Home/Home.php +++ /dev/null @@ -1,26 +0,0 @@ - 'Home', - 'description' => '', - 'author' => 'Piwik', - 'homepage' => 'http://piwik.org/', - 'version' => '0.1', - ); - } -} - diff --git a/plugins/Home/templates/calendar.js b/plugins/Home/templates/calendar.js deleted file mode 100644 index 9434900082..0000000000 --- a/plugins/Home/templates/calendar.js +++ /dev/null @@ -1,172 +0,0 @@ - -Date.prototype.getWeek = function() { -var onejan = new Date(this.getFullYear(),0,1); -return Math.ceil((((this - onejan) / 86400000) + onejan.getDay())/7); -} - -var splitDate = currentDateStr.split("-"); - -var currentYear = splitDate[0]; -var currentMonth = splitDate[1] - 1; -var currentDay = splitDate[2]; - -var currentDate = new Date(currentYear, currentMonth, currentDay); -var todayDate = new Date; -var todayMonth = todayDate.getMonth(); -var todayYear = todayDate.getFullYear(); -var todayDay = todayDate.getDate(); - -function isDateSelected( date ) -{ - var valid = false; - - var dateMonth = date.getMonth(); - var dateYear = date.getFullYear(); - var dateDay = date.getDate(); - var style = ''; - - if( date.toLocaleDateString() == todayDate.toLocaleDateString()) - { - style = style + 'dateToday '; - } - - // we dont color dates in the future - if( dateMonth == todayMonth - && dateYear == todayYear - && dateDay >= todayDay - ) - { - return [true, style]; - } - - // we dont color dates before the minimum date - if( dateYear < minDateYear - || ( dateYear == minDateYear - && - ( - (dateMonth == minDateMonth - 1 - && dateDay < minDateDay) - || (dateMonth < minDateMonth - 1) - ) - ) - ) - { - return [true, style]; - } - - // we color all day of the month for the same year for the month period - if(period == "month" - && dateMonth == currentMonth - && dateYear == currentYear - ) - { - valid = true; - } - // we color all day of the year for the year period - else if(period == "year" - && dateYear == currentYear - ) - { - valid = true; - } - else if(period == "week" - && date.getWeek() == currentDate.getWeek() - && dateYear == currentYear - ) - { - valid = true; - } - else if( period == "day" - && dateDay == currentDay - && dateMonth == currentMonth - && dateYear == currentYear - ) - { - valid = true; - } - - if(valid) - { - return [true, style+'dateUsedStats']; - } - return [true, style]; -} - - -function updateDate() -{ - var date = formatDate(popUpCal.getDateFor($('#calendar')[0])); - - // available in global scope - var currentUrl = window.location.href; - if((startStrDate = currentUrl.indexOf("date")) >= 0) - { - // look for the & after the date - var endStrDate = currentUrl.indexOf("&", startStrDate); - if(endStrDate == -1) - { - endStrDate = currentUrl.length; - } - - var dateToReplace = currentUrl.substring( - startStrDate + 4+1, - endStrDate - ); - regDateToReplace = new RegExp(dateToReplace, 'ig'); - currentUrl = currentUrl.replace( regDateToReplace, date ); - } - else - { - currentUrl = currentUrl + '&date=' + date; - } - - window.location.href = currentUrl; -} - -function formatDate(date) -{ - var day = date.getDate(); - var month = date.getMonth() + 1; - return date.getFullYear() + '-' - + (month < 10 ? '0' : '') + month + '-' - + (day < 10 ? '0' : '') + day ; -} - -$(document).ready(function(){ - $("#calendar").calendar({ - onSelect: updateDate, - showOtherMonths: true, - dateFormat: 'DMY-', - firstDay: 1, - minDate: new Date(minDateYear, minDateMonth - 1, minDateDay), - maxDate: new Date(), - changeFirstDay: false, - prevText: "", - nextText: "", - currentText: "", - customDate: isDateSelected, - dayNames: [ - _pk_translate('Home_DaySu'), - _pk_translate('Home_DayMo'), - _pk_translate('Home_DayTu'), - _pk_translate('Home_DayWe'), - _pk_translate('Home_DayTh'), - _pk_translate('Home_DayFr'), - _pk_translate('Home_DaySa')], - monthNames: [ - _pk_translate('Home_MonthJanuary'), - _pk_translate('Home_MonthFebruary'), - _pk_translate('Home_MonthMarch'), - _pk_translate('Home_MonthApril'), - _pk_translate('Home_MonthMay'), - _pk_translate('Home_MonthJune'), - _pk_translate('Home_MonthJuly'), - _pk_translate('Home_MonthAugust'), - _pk_translate('Home_MonthSeptember'), - _pk_translate('Home_MonthOctober'), - _pk_translate('Home_MonthNovember'), - _pk_translate('Home_MonthDecemeber')] - }, - currentDate); - } -); diff --git a/plugins/Home/templates/cloud.tpl b/plugins/Home/templates/cloud.tpl deleted file mode 100644 index 745b179c4a..0000000000 --- a/plugins/Home/templates/cloud.tpl +++ /dev/null @@ -1,68 +0,0 @@ -

-{literal} - -{/literal} - -
-{if count($cloudValues) == 0} -
No data for this tag cloud.
-{else} - {foreach from=$cloudValues key=word item=value} - - {if false !== $labelMetadata[$value.word].url}{/if} - {if false !== $labelMetadata[$value.word].logo}{else} - - {$value.wordTruncated}{/if}{if false !== $labelMetadata[$value.word].url}{/if} - {/foreach} -{/if} -{if $showFooter} - {include file="Home/templates/datatable_footer.tpl"} -{/if} -{include file="Home/templates/datatable_js.tpl"} -
-
diff --git a/plugins/Home/templates/datatable.css b/plugins/Home/templates/datatable.css deleted file mode 100644 index bfd266b599..0000000000 --- a/plugins/Home/templates/datatable.css +++ /dev/null @@ -1,339 +0,0 @@ -/* container of each table */ -.parentDiv { - width: 450px; - /* not more than 450px to make sure 2 of them can fit horizontally on a 1024 screen */ -} - -.parentDivActions { - width: 500px; -} - -.parentDivGraph { - width: 500px; -} - -.parentDivGraphEvolution { - width: 100%; -} - -/* main data table */ -table.dataTable { - width: 100%; - padding: 0; - border-spacing: 0; - margin: 0; - font-size: 0.9em; -} - -table.dataTable td.label,table.subDataTable td.label,table.dataTableActions td.label - { - width: 100%; -} - -table.dataTable img,table.subDataTable img,table.dataTableActions img { - vertical-align: middle; -} - -table.dataTable img { - border: 0; - margin-right: 1em; - margin-left: 0.5em; -} - -table.dataTable tr.subDataTable { - cursor: pointer; -} - -table.dataTable th { - margin: 0; - color: #6D929B; - border-right: 1px solid #C1DAD7; - border-bottom: 1px solid #C1DAD7; - border-top: 1px solid #C1DAD7; - text-transform: capitalize; - text-align: left; - padding: 6px 6px 6px 12px; - background: #D4E3ED url(images/bg_header.jpg) no-repeat; -} - -table.dataTable th.columnSorted { - font-weight: bold; - padding-right: 20px; -} - -table.dataTable td { - border-right: 1px solid #C1DAD7; - border-bottom: 1px solid #C1DAD7; - border-left: 0; - padding: 5px 5px 5px 12px; - background: #fff; -} - -table.dataTable td,table.dataTable td a { - margin: 0; - text-decoration: none; - color: #4f6b72; -} - -table.dataTable td.labeleven,table.dataTable td.columneven { - background: #F9FAFA; -} - -table.dataTable td.columneven { - color: #797268; -} - -table.dataTable td.labeleven { - background-image: url(images/bullet2.gif); - background-repeat: no-repeat; - color: #797268; -} - -table.dataTable td.labelodd { - background: #fff url(images/bullet1.gif) no-repeat; -} - -table.dataTable td.label,table.subActionsDataTable td.label,table.actionsDataTable td.label - { - border-top: 0; - border-left: 1px solid #C1DAD7; -} - -table.dataTable th.label { - border-left: 1px solid #C1DAD7; -} - -/* the cell containing the subdatatable */ -table.dataTable .cellSubDataTable { - border-left: 1px solid #C1DAD7; - padding: 0; - margin: 0; -} - -/* A link in a column in the DataTable */ -table.dataTable td #urlLink { - display: none; -} - -/* SUBDATATABLE */ /* a datatable inside another datatable */ -table.subDataTable { - background: #FFFFFF; - width: 95%; - border-top: 1px solid #e5eff8; - border-right: 1px solid #e5eff8; - margin: 10px; -} - -table.subDataTable td { - border: 0; -} - -table.subDataTable thead th { - font-weight: normal; - font-size: 1.1em; - text-align: left; - border: 0; - border: 1px solid #D1D1D1; - padding: .3em 1em; - color: #333333; - background: #FFE9C6; -} - -table.subDataTable td.labeleven,table.subDataTable td.labelodd { - background-image: none; -} - -table.subDataTable td { - border-bottom: 1px solid #E5E5E5; - border-left: 1px solid #E5E5E5; -} - -table.subDataTable td,table.subDataTable td a { - padding: 0.3em 1em; - color: #615B53; -} - -table.subDataTable td.labeleven,table.subDataTable td.columneven { - color: #2D2A27; -} - -table.subDataTable td.label { - width: 80%; -} - -table.subDataTable td.labelodd,table.subDataTable td.labelodd a { - background: #ffffff; -} - -/* misc SPAN and DIV */ -table thead div { - -} - -#sortIconContainer { - float: right; -} - -#sortIcon { - margin: 0px; - position: absolute; -} - -#dataTablePages { - color: #E1E1E1; - font-weight: bold; - margin: 10px; - font-size: 0.9em; -} - -#dataTableSearchPattern { - display: inline; - white-space: nowrap; -} - -#dataTableSearchPattern input { - font-size: 0.7em; - padding: 2px; - border: 1px solid #B3B3B3; - color: #0C183A; -} - -#dataTableSearchPattern input:hover { - background: #F7F7FF none repeat scroll 0%; -} - -#dataTableSearchPattern #keyword { - background: transparent url(images/search.png) no-repeat scroll 4px - center; - padding: 3px 3px 3px 20px; -} - -#dataTableExcludeLowPopulation,#dataTableNext,#dataTablePrevious { - font-size: 0.9em; - color: #184A83; - text-decoration: underline; - cursor: pointer; -} - -.subDataTable#dataTableFeatures { - padding-top: 0px; - padding-bottom: 5px; - width: 100%; -} - -#dataTableFeatures { - padding-top: 10px; - padding-bottom: 10px; - width: 100%; - text-align: center; -} - -#dataTableExcludeLowPopulation { - float: right; - font-size: 0.8em; - color: #C3C6D8; - text-align: right; -} - -#dataTableNext,#dataTablePrevious,#dataTableSearchPattern,#loadingDataTable - { - display: none; -} - -.subDataTable #exportDataTable { - height: 0px; -} - -#exportDataTable { - float: right; - height: 18px; -} - -#exportToFormat { - float: right; -} - -#exportDataTableShow { - float: right; -} - -#exportDataTable,#exportDataTable a { - text-decoration: none; - color: #8894B1; -} - -.dataTableSpacer { - clear: both; -} - -#loadingDataTable { - float: left; - font-size: 1em; - color: #193B6C; - padding: 0.5em; -} - -#tooltip { - position: absolute; - z-index: 3000; - border: 1px solid #111; - background-color: #eee; - padding-left: 5px; - padding-right: 5px; - opacity: 0.85; - font-size: 0.7em; -} - -/* Actions table */ -table.dataTableActions tr td.labelodd { - background-image: none; -} - -/* levels higher than 4 have a default padding left */ -tr.subActionsDataTable td.label,tr.actionsDataTable td.label { - padding-left: 7em; -} - -tr.level0 td.label { - padding-left: +1.5em; -} - -tr.level1 td.label { - padding-left: +3.5em; -} - -tr.level2 td.label { - padding-left: +5.5em; -} - -tr.level3 td.label { - padding-left: +6.5em; -} - -tr.level4 td.label { - padding-left: +7em; -} - -tr td.label img.plusMinus { - margin-left: -1em; - margin-right: 0em; -} - -/* graph form containing embed code */ -.formEmbedCode,.formEmbedCode input,.formEmbedCode a { - font-size: 11px; - text-decoration: none; -} - -.formEmbedCode input { - background-color: #FBFDFF; - border: 1px solid #ECECEC; -} - -#emptyDatatable { - padding-top: 20px; - padding-bottom: 10px; - text-align: center; - font-size: 0.9em; - font-style: italic; -} \ No newline at end of file diff --git a/plugins/Home/templates/datatable.js b/plugins/Home/templates/datatable.js deleted file mode 100644 index 2eff91fe97..0000000000 --- a/plugins/Home/templates/datatable.js +++ /dev/null @@ -1,988 +0,0 @@ -//----------------------------------------------------------------------------- -// Data Table -//----------------------------------------------------------------------------- -//A list of all our DataTables -//Test if the object have already been initialized (multiple includes) -if(typeof dataTables == "undefined") - var dataTables = new Object; - -//DataTable constructor -function dataTable() -{ - this.param = new Object; -} - -//Prototype of the DataTable object -dataTable.prototype = -{ - //initialisation function - init: function(workingDivId, domElem) - { - if(typeof domElem == "undefined") - { - domElem = $('#'+workingDivId); - } - - this.workingDivId = workingDivId; - this.loadedSubDataTable = new Object; - this.bindEventsAndApplyStyle(domElem); - this.initialized = true; - }, - - //function triggered when user click on column sort - onClickSort: function(domElem) - { - var self = this; - - var newColumnToSort = $(domElem).attr('id'); - // we lookup if the column to sort was already this one, if it is the case then we switch from desc <-> asc - if(self.param.filter_sort_column == newColumnToSort) - { - // toggle the sorted order - if(this.param.filter_sort_order == 'asc') - { - self.param.filter_sort_order = 'desc'; - } - else - { - self.param.filter_sort_order = 'asc'; - } - } - self.param.filter_offset = 0; - self.param.filter_sort_column = newColumnToSort; - self.reloadAjaxDataTable(); - }, - - //Reset DataTable filters (used before a reload or view change) - resetAllFilters: function() - { - var self = this; - var FiltersToRestore = new Array(); - filters = [ - 'filter_column', - 'filter_pattern', - 'filter_column_recursive', - 'filter_pattern_recursive', - 'filter_excludelowpop', - 'filter_excludelowpop_value', - 'filter_offset', - 'filter_limit', - 'filter_sort_column', - 'filter_sort_order', - 'show_search' - ]; - - for(var key in filters) - { - var value = filters[key]; - FiltersToRestore[value] = self.param[value]; - delete self.param[value]; - } - - - return FiltersToRestore; - }, - - //Restores the filters to the values given in the array in parameters - restoreAllFilters: function(FiltersToRestore) - { - var self = this; - for(key in FiltersToRestore) - { - self.param[key] = FiltersToRestore[key]; - } - }, - - //Translate string parameters to javascript builtins - //'true' -> true, 'false' -> false - //it simplifies condition tests in the code - cleanParams: function() - { - var self = this; - for(var key in self.param) - { - if(self.param[key] == 'true') self.param[key]=true; - if(self.param[key] == 'false') self.param[key]=false; - } - }, - - // Returns the standard Ajax request object used by the Jquery .ajax method - buildAjaxRequest: function(callbackSuccess) - { - var self = this; - - //prepare the ajax request - var ajaxRequest = - { - type: 'GET', - url: 'index.php', - dataType: 'html', - async: true, - error: ajaxHandleError, // Callback when the request fails - success: callbackSuccess, // Callback when the request succeeds - data: new Object - }; - - //Extract the configuration from the datatable and pass it to the API - for(var key in self.param) - { - if(typeof self.param[key] != "undefined") - ajaxRequest.data[key] = self.param[key]; - } - - return ajaxRequest; - }, - - // Function called to trigger the AJAX request - // The ajax request contains the function callback to trigger if the request is successful or failed - // displayLoading = false When we don't want to display the Loading... DIV #loadingDataTable - // for example when the script add a Loading... it self and doesn't want to display the generic Loading - reloadAjaxDataTable: function(displayLoading, callbackSuccess) - { - var self = this; - - if (typeof displayLoading == "undefined") - { - displayLoading = true; - } - if (typeof callbackSuccess == "undefined") - { - callbackSuccess = self.dataTableLoaded; - } - - if(displayLoading) - { - $('#'+self.workingDivId+' #loadingDataTable').css('display','block'); - } - - $.ajax(self.buildAjaxRequest(callbackSuccess)); - }, - - - // Function called when the AJAX request is successful - // it looks for the ID of the response and replace the very same ID - // in the current page with the AJAX response - dataTableLoaded: function(response) - { - var content = $(response); - var idToReplace = $(content).attr('id'); - var dataTableSel = $('#'+idToReplace); - - // if the current dataTable is situated inside another datatable - table = $(content).parents('table.dataTable'); - if(dataTableSel.parents('.dataTable').is('table')) - { - // we add class to the table so that we can give a different style to the subtable - $(content).children('table.dataTable').addClass('subDataTable'); - $(content).children('#dataTableFeatures').addClass('subDataTable'); - - //we force the initialisation of subdatatables - dataTableSel.html( $(content).html() ); - //dataTables[idToReplace].init( idToReplace, $('#'+idToReplace) ); - } - else - { - dataTableSel.html( $(content).html() ); - lazyScrollTo(dataTableSel[0], 400); - } - }, - - - /* This method is triggered when a new DIV is loaded, which happens - - at the first loading of the page - - after any AJAX loading of a DataTable - - This method basically add features to the DataTable, - - such as column sorting, searching in the rows, displaying Next / Previous links, etc. - - add styles to the cells and rows (odd / even styles) - - modify some rows to add images if a span img is found, or add a link if a span urlLink is found - or truncate the labels when they are too big - - bind new events onclick / hover / etc. to trigger AJAX requests, - nice hovertip boxes for truncated cells - */ - bindEventsAndApplyStyle: function(domElem) - { - var self = this; - - self.cleanParams(); - - self.handleSort(domElem); - - self.handleSearchBox(domElem); - self.handleLowPopulationLink(domElem); - self.handleOffsetInformation(domElem); - self.handleExportBox(domElem); - - self.applyCosmetics(domElem); - - self.handleSubDataTable(domElem); - }, - - // if sorting the columns is enabled, when clicking on a column, - // - if this column was already the one used for sorting, we revert the order desc<->asc - // - we send the ajax request with the new sorting information - handleSort: function(domElem) - { - var self = this; - - if( self.param.enable_sort ) - { - $('.sortable', domElem).click( - function() - { - $(this).unbind('click'); - self.onClickSort(this); - } - ); - - // are we in a subdatatable? - var currentIsSubDataTable = $(domElem).parent().hasClass('cellSubDataTable'); - - var prefixSortIcon = ''; - if(currentIsSubDataTable) - { - prefixSortIcon = '_subtable_'; - } - var imageSortWidth = 16; - var imageSortHeight = 16; - // we change the style of the column currently used as sort column - // adding an image and the class columnSorted to the TD - $(".sortable#"+self.param.filter_sort_column+' #thDIV', domElem).parent() - .addClass('columnSorted') - .prepend('
'); - } - }, - - // Add behaviour to the low population link - handleLowPopulationLink: function(domElem, callbackSuccess) - { - var self = this; - - // Showing the link "Exclude low population" for this DIV - if(self.param.show_exclude_low_population) - { - // Set the string for the DIV, either "Exclude low pop" or "Include all" - $('#dataTableExcludeLowPopulation', domElem) - .each( - function() - { - if(Number(self.param.filter_excludelowpop) != 0) - { - string = _pk_translate('Home_IncludeAllPopulation'); - } - else - { - string = _pk_translate('Home_ExcludeLowPopulation'); - } - $(this).html(string); - } - ) - // Bind a click event to the DIV that triggers the ajax request - .click( - function() - { - if(Number(self.param.filter_excludelowpop) != 0) - { - self.param.filter_excludelowpop = 0; - self.param.filter_excludelowpop_value = 0; - } - else - { - self.param.filter_excludelowpop = self.param.filter_excludelowpop_default; - self.param.filter_excludelowpop_value = self.param.filter_excludelowpop_value_default; - } - self.param.filter_offset = 0; - - self.reloadAjaxDataTable(true, callbackSuccess); - } - ); - } - - }, - - //behaviour for the DataTable 'search box' - handleSearchBox: function(domElem, callbackSuccess) - { - var self = this; - - // Showing the search box for dom element DIV and binding the event - // - on the keyword DIV anywhere, if the ENTER key is pressed - if(self.param.show_search) - { - var currentPattern = self.param.filter_pattern; - if(typeof self.param.filter_pattern != "undefined" - && self.param.filter_pattern.length > 0) - { - currentPattern = self.param.filter_pattern; - } - else if(typeof self.param.filter_pattern_recursive != "undefined" - && self.param.filter_pattern_recursive.length > 0) - { - currentPattern = self.param.filter_pattern_recursive; - } - else - { - currentPattern = ''; - } - - - $('#dataTableSearchPattern', domElem) - .show() - .each(function(){ - // when enter is pressed in the input field we submit the form - $('#keyword', this) - .keypress( - function(e) - { - if(submitOnEnter(e)) - { - $(this).siblings(':submit').submit(); - } - } - ) - .val(currentPattern) - ; - - $(':submit', this).submit( - function() - { - var keyword = $(this).siblings('#keyword').val(); - self.param.filter_offset = 0; - - if(self.param.search_recursive) - { - self.param.filter_column_recursive = 'label'; - self.param.filter_pattern_recursive = keyword; - } - else - { - self.param.filter_column = 'label'; - self.param.filter_pattern = keyword; - } - self.reloadAjaxDataTable(true, callbackSuccess); - } - ); - - $(':submit', this) - .click( function(){ $(this).submit(); }) - ; - - // in the case there is a searched keyword we display the RESET image - if(currentPattern) - { - var target = this; - var clearImg = $('\ - \ - ') - .click( function() { - $('#keyword', target).val(''); - $(':submit', target).submit(); - }); - $('#keyword',this).after(clearImg); - - } - } - ); - - } - }, - - //behaviour for '< prev' 'next >' links and page count - handleOffsetInformation: function(domElem) - { - var self = this; - - // Showing the offset information (1 - 10 of 42) for this DIV - if( self.param.show_offset_information - // fix konqueror that doesnt recognize the show_offset_information false for the tag cloud - // and we really dont want to print Next/Previous for tag clouds - && self.param.viewDataTable != 'cloud' ) - { - $('#dataTablePages', domElem).each( - function(){ - var offset = 1+Number(self.param.filter_offset); - var offsetEnd = Number(self.param.filter_offset) + Number(self.param.filter_limit); - var totalRows = Number(self.param.totalRows); - offsetEndDisp = offsetEnd; - - if(offsetEnd > totalRows) offsetEndDisp = totalRows; - - // only show this string if there is some rows in the datatable - if(totalRows != 0) - { - var str = sprintf(_pk_translate('Home_PageOf'),offset + '-' + offsetEndDisp,totalRows); - $(this).text(str); - } - } - ); - - - // Display the next link if the total Rows is greater than the current end row - $('#dataTableNext', domElem) - .each(function(){ - var offsetEnd = Number(self.param.filter_offset) - + Number(self.param.filter_limit); - var totalRows = Number(self.param.totalRows); - if(offsetEnd < totalRows) - { - $(this).css('display','inline'); - } - }) - // bind the click event to trigger the ajax request with the new offset - .click(function(){ - $(this).unbind('click'); - self.param.filter_offset = Number(self.param.filter_offset) + Number(self.param.filter_limit); - self.reloadAjaxDataTable(); - }) - ; - - // Display the previous link if the current offset is not zero - $('#dataTablePrevious', domElem) - .each(function(){ - var offset = 1+Number(self.param.filter_offset); - if(offset != 1) - { - $(this).css('display','inline'); - } - } - ) - // bind the click event to trigger the ajax request with the new offset - // take care of the negative offset, we setup 0 - .click( - function(){ - $(this).unbind('click'); - var offset = Number(self.param.filter_offset) - Number(self.param.filter_limit); - if(offset < 0) { offset = 0; } - self.param.filter_offset = offset; - self.reloadAjaxDataTable(); - } - ) - ; - - } - }, - - //behaviour for DataTable view box (data, table, cloud, graph, ...) - handleExportBox: function(domElem) - { - var self = this; - if( !self.param.idSubtable ) - { - // When the (+) image is hovered, the export buttons are displayed - $('#exportDataTableShow', domElem) - .show() - .hover( function() { - $(this).fadeOut('slow'); - $('#exportToFormat', $(this).parent()).show('slow'); - }, function(){} - ); - - //timeout object used to hide the datatable export buttons - var timeout = null; - - $('#exportDataTable', domElem) - .hover( function() { - //display 'hand' cursor - $(this).css({ cursor: "pointer"}); - - //cancel timeout if necessary - if(timeout != null) - { - clearTimeout(timeout); - timeout = null; - } - }, - function() { - //display standard cursor - $(this).css({ cursor: "auto"}); - - //set a timeout that will hide export buttons after a few moments - var dom = this; - timeout = setTimeout(function(){ - $('#exportToFormat', dom).fadeOut('fast', function(){ //queue the two actions - $('#exportDataTableShow', dom).show('fast');}); - }, 1000); - } - ); - - $('.viewDataTable', domElem).click( - function(){ - var viewDataTable = $(this).attr('format'); - self.resetAllFilters(); - self.param.viewDataTable = viewDataTable; - - self.reloadAjaxDataTable(); - } - ); - - $('#exportToFormat img', domElem).click(function(){ - $(this).siblings('#linksExportToFormat').toggle(); - }); - - $('.exportToFormat', domElem).attr( 'href', function(){ - var format = $(this).attr('format'); - var method = $(this).attr('methodToCall'); - var filter_limit = $(this).attr('filter_limit'); - - var str = '?module=API' - +'&method='+method - +'&format='+format - +'&idSite='+self.param.idSite - +'&period='+self.param.period - +'&date='+self.param.date; - if( filter_limit ) - { - str += '&filter_limit=' + filter_limit; - } - return str; - } - ); - } - }, - - //Apply some miscelleaneous style to the DataTable - applyCosmetics: function(domElem) - { - var self = this; - - // we truncate the labels columns from the second row - $("table tr td:first-child", domElem).truncate(30); - $('.truncated', domElem).Tooltip(); - - var imageLinkWidth = 10; - var imageLinkHeight = 9; - - // we add a link based on the present in the column label (the first column) - // if this span is there, we add the link around the HTML in the TD - // but we add this link only for the rows that are not clickable already (subDataTable) - $("tr:not('.subDataTable') td:first-child:has('#urlLink')", domElem).each( function(){ - - var imgToPrepend = ''; - if( $(this).find('img').length == 0 ) - { - imgToPrepend = ' '; - } - var urlToLink = $('#urlLink',this).text(); - - $(this).html( - '' + imgToPrepend + $(this).html() + '' - ); - }); - - - // Add some styles on the cells even/odd - // label (first column of a data row) or not - $("th:first-child", domElem).addClass('label'); - $("td:first-child:odd", domElem).addClass('label labeleven'); - $("td:first-child:even", domElem).addClass('label labelodd'); - $("tr:odd td", domElem).slice(1).addClass('columnodd'); - $("tr:even td", domElem).slice(1).addClass('columneven'); - - // Change cursor on mouse hover if sort is enabled - if( self.param.enable_sort ) - { - $("th.sortable", domElem).hover( - function() - { - $(this).css({ cursor: "pointer"}); - }, - function() - { - $(this).css({ cursor: "auto"}); - } - ); - } - }, - - //behaviour for 'nested DataTable' (DataTable loaded on a click on a row) - handleSubDataTable: function(domElem) - { - var self = this; - // When the TR has a subDataTable class it means that this row has a link to a subDataTable - $('tr.subDataTable', domElem) - .click( - function() - { - // get the idSubTable - var idSubTable = $(this).attr('id'); - var divIdToReplaceWithSubTable = 'subDataTable_'+idSubTable; - - // if the subDataTable is not already loaded - if (typeof self.loadedSubDataTable[divIdToReplaceWithSubTable] == "undefined") - { - var numberOfColumns = $(this).children().length; - - // at the end of the query it will replace the ID matching the new HTML table #ID - // we need to create this ID first - $(this).after( '\ - \ - \ -
\ - '+ _pk_translate('Home_Loading') +'\ -
\ - \ - \ - '); - - var savedActionVariable = self.param.action; - - // reset all the filters from the Parent table - var filtersToRestore = self.resetAllFilters(); - - self.param.idSubtable = idSubTable; - self.param.action = self.param.actionToLoadTheSubTable; - self.reloadAjaxDataTable(false); - - self.param.action = savedActionVariable; - delete self.param.idSubtable; - self.restoreAllFilters(filtersToRestore); - - self.loadedSubDataTable[divIdToReplaceWithSubTable] = true; - - $(this).next().toggle(); - } - - $(this).next().toggle(); - } - ); - } -}; - - -// Helper function : -// returns true if the event keypress passed in parameter is the ENTER key -function submitOnEnter(e) -{ - var key=e.keyCode || e.which; - if (key==13) - { - return true; - } -} - - - - -//----------------------------------------------------------------------------- -// Action Data Table -//----------------------------------------------------------------------------- - -//inheritance declaration -//actionDataTable is a child of dataTable -actionDataTable.prototype = new dataTable; -actionDataTable.prototype.constructor = actionDataTable; - - -//A list of all our actionDataTables -//Test if the object have already been initialized (multiple includes) -if(typeof actionDataTables == "undefined") - var actionDataTables = new Object; - -//actionDataTable constructor -function actionDataTable() -{ - dataTable.call(this); - this.parentAttributeParent = ''; - this.parentId = ''; - this.disabledRowDom = new Object; //to handle double click on '+' row -} - -//Prototype of the actionDataTable object -actionDataTable.prototype = -{ - //method inheritance - cleanParams: dataTable.prototype.cleanParams, - reloadAjaxDataTable: dataTable.prototype.reloadAjaxDataTable, - buildAjaxRequest: dataTable.prototype.buildAjaxRequest, - handleLowPopulationLink: dataTable.prototype.handleLowPopulationLink, - handleSearchBox: dataTable.prototype.handleSearchBox, - - //initialisation of the actionDataTable - init: function(workingDivId, domElem) - { - if(typeof domElem == "undefined") - { - domElem = $('#'+workingDivId); - } - this.workingDivId = workingDivId; - this.bindEventsAndApplyStyle(domElem); - this.initialized = true; - }, - - //see dataTable::bindEventsAndApplyStyle - bindEventsAndApplyStyle: function(domElem) - { - var self = this; - - self.cleanParams(); - - // we dont display the link on the row with subDataTable when we are already - // printing all the subTables (case of recursive search when the content is - // including recursively all the subtables - if(!self.param.filter_pattern_recursive) - { - $('tr.subActionsDataTable.rowToProcess') - .click( function() - { - self.onClickActionSubDataTable(this) - }) - .hover(function() { - $(this).css({ cursor: "pointer"}); - }, - function() { - $(this).css({ cursor: "auto"}); - } - ); - } - - self.applyCosmetics(domElem); - - if( self.workingDivId != undefined) - { - self.handleSearchBox(domElem, self.actionsDataTableLoaded ); - self.handleLowPopulationLink(domElem, self.actionsDataTableLoaded ); - } - }, - - //see dataTable::applyCosmetics - applyCosmetics: function(domElem) - { - var self = this; - - $('tr.subActionsDataTable.rowToProcess') - .css('font-weight','bold'); - - $("th:first-child", domElem).addClass('label'); - - var imagePlusMinusWidth = 12; - var imagePlusMinusHeight = 12; - $('tr.subActionsDataTable.rowToProcess td:first-child') - .each( function(){ - $(this).prepend(''); - if(self.param.filter_pattern_recursive) - { - setImageMinus(this); - } - else - { - setImagePlus(this); - } - }); - - $('tr.rowToProcess') - .each( function() { - // we add the CSS style depending on the level of the current loading category - // we look at the style of the parent row - var style = $(this).prev().attr('class'); - var currentStyle = $(this).attr('class'); - - if( (typeof currentStyle != 'undefined') - && currentStyle.indexOf('level') >= 0 ) - { - } - else - { - var level = getNextLevelFromClass( style ); - $(this).addClass('level'+ level); - } - - // we add an attribute parent that contains the ID of all the parent categories - // this ID is used when collapsing a parent row, it searches for all children rows - // which 'parent' attribute's value contains the collapsed row ID - $(this).attr('parent', function(){ - return self.parentAttributeParent + ' ' + self.parentId; - } - ); - - // Add some styles on the cells even/odd - // label (first column of a data row) or not - $("td:first-child:odd", this).addClass('label labeleven'); - $("td:first-child:even", this).addClass('label labelodd'); - // we truncate the labels columns from the second row - $("td:first-child", this).truncate(30); - $('.truncated', this).Tooltip(); - }) - .removeClass('rowToProcess'); - }, - - // Called when the user click on an actionDataTable row - onClickActionSubDataTable: function(domElem) - { - var self = this; - - // get the idSubTable - var idSubTable = $(domElem).attr('id'); - - var divIdToReplaceWithSubTable = 'subDataTable_'+idSubTable; - - var NextStyle = $(domElem).next().attr('class'); - var CurrentStyle = $(domElem).attr('class'); - - var currentRowLevel = getLevelFromClass(CurrentStyle); - var nextRowLevel = getLevelFromClass(NextStyle); - - // if the row has not been clicked - // which is the same as saying that the next row level is equal or less than the current row - // because when we click a row the level of the next rows is higher (level2 row gives level3 rows) - if(currentRowLevel >= nextRowLevel) - { - //unbind click to avoid double click problem - $(domElem).unbind('click'); - self.disabledRowDom = $(domElem); - - var numberOfColumns = $(domElem).children().length; - $(domElem).after( '\ - \ - \ - Loading...\ - \ - \ - '); - var savedActionVariable = self.param.action; - - // reset search for subcategories - delete self.param.filter_column; - delete self.param.filter_pattern; - - self.param.idSubtable = idSubTable; - self.param.action = self.param.actionToLoadTheSubTable; - - self.reloadAjaxDataTable(false, function(resp){self.actionsSubDataTableLoaded(resp)}); - self.param.action = savedActionVariable; - delete self.param.idSubtable; - } - // else we toggle all these rows - else - { - var plusDetected = $('td img', domElem).attr('src').indexOf('plus') >= 0; - - $(domElem).siblings().each( function(){ - var parents = $(this).attr('parent'); - if(parents) - { - if(parents.indexOf(idSubTable) >= 0 || parents.indexOf('subDataTable_'+idSubTable) >= 0) - { - if(plusDetected) - { - $(this).css('display',''); - - //unroll everything and display '-' sign - //if the row is already opened - var NextStyle = $(this).next().attr('class'); - var CurrentStyle = $(this).attr('class'); - - var currentRowLevel = getLevelFromClass(CurrentStyle); - var nextRowLevel = getLevelFromClass(NextStyle); - - if(currentRowLevel < nextRowLevel) - setImageMinus(this); - } - else - { - $(this).css('display','none'); - } - } - } - }); - } - - // toggle the +/- image - var plusDetected = $('td img', domElem).attr('src').indexOf('plus') >= 0; - if(plusDetected) - { - setImageMinus(domElem); - } - else - { - setImagePlus(domElem); - } - }, - - //called when the full table actions is loaded - actionsDataTableLoaded: function(response) - { - var content = $(response); - var idToReplace = $(content).attr('id'); - - //reset parents id - self.parentAttributeParent = ''; - self.parentId = ''; - - var dataTableSel = $('#'+idToReplace); - dataTableSel.html($(content).html()); - lazyScrollTo(dataTableSel[0], 400); - }, - - // Called when a set of rows for a category of actions is loaded - actionsSubDataTableLoaded: function(response) - { - var self = this; - var idToReplace = $(response).attr('id'); - - // remove the first row of results which is only used to get the Id - var response = $(response).filter('tr').slice(1).addClass('rowToProcess'); - self.parentAttributeParent = $('tr#'+idToReplace).prev().attr('parent'); - self.parentId = idToReplace; - - $('tr#'+idToReplace).after( response ).remove(); - - - var re = /subDataTable_(\d+)/; - ok = re.exec(self.parentId); - if(ok) - { - self.parentId = ok[1]; - } - - // we execute the bindDataTableEvent function for the new DIV - self.init(self.workingDivId, $('#'+idToReplace)); - - //bind back the click event (disabled to avoid double-click problem) - self.disabledRowDom.click( - function() - { - self.onClickActionSubDataTable(this) - }); - } -}; - -//helper function for actionDataTable -function getLevelFromClass( style) -{ - if (typeof style == "undefined") return 0; - - var currentLevelIndex = style.indexOf('level'); - var currentLevel = 0; - if( currentLevelIndex >= 0) - { - currentLevel = Number(style.substr(currentLevelIndex+5,1)); - } - return currentLevel; -} - -//helper function for actionDataTable -function getNextLevelFromClass( style ) -{ - if (typeof style == "undefined") return 0; - currentLevel = getLevelFromClass(style); - newLevel = currentLevel; - // if this is not a row to process so - if( style.indexOf('rowToProcess') < 0 ) - { - newLevel = currentLevel + 1; - } - return newLevel; -} - -//helper function for actionDataTable -function setImageMinus( domElem ) -{ - $('img',domElem).attr('src', 'themes/default/images/minus.png'); -} - -//helper function for actionDataTable -function setImagePlus( domElem ) -{ - $('img',domElem).attr('src', 'themes/default/images/plus.png'); -} - diff --git a/plugins/Home/templates/datatable.tpl b/plugins/Home/templates/datatable.tpl deleted file mode 100644 index 599e28f921..0000000000 --- a/plugins/Home/templates/datatable.tpl +++ /dev/null @@ -1,40 +0,0 @@ -
- {if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'} - {$arrayDataTable.message} - {else} - {if count($arrayDataTable) == 0} -
{'Home_TableNoData'|translate}
- {else} - - - - - {foreach from=$dataTableColumns item=column} - - {/foreach} - - - - - {foreach from=$arrayDataTable item=row} - - {foreach from=$dataTableColumns key=idColumn item=column} - - {/foreach} - - {/foreach} - -
{$column.displayName}
- {if $idColumn==0 && isset($row.metadata.url)}{$row.metadata.url}{/if} - {if $idColumn==0 && isset($row.metadata.logo)}{/if} - {* sometimes all columns are not set in the datatable, we assume the value 0 *} - {if isset($row.columns[$column.name])}{$row.columns[$column.name]}{else}0{/if} -
- {/if} - - {if $showFooter} - {include file="Home/templates/datatable_footer.tpl"} - {/if} - {include file="Home/templates/datatable_js.tpl"} - {/if} -
diff --git a/plugins/Home/templates/datatable_actions.tpl b/plugins/Home/templates/datatable_actions.tpl deleted file mode 100644 index d5ee5fc421..0000000000 --- a/plugins/Home/templates/datatable_actions.tpl +++ /dev/null @@ -1,40 +0,0 @@ -
-{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'} - {$arrayDataTable.message} -{else} - {if count($arrayDataTable) == 0} -
{'Home_TableNoData'|translate}
- {else} - - - - {foreach from=$dataTableColumns item=column} - - - - - {foreach from=$arrayDataTable item=row} - - {foreach from=$dataTableColumns key=idColumn item=column} - - {/foreach} - - {/foreach} - - - -
{$column.name} - {/foreach} -
- {* sometimes all columns are not set in the datatable, we assume the value 0 *} - {if isset($row.columns[$column.name])}{$row.columns[$column.name]}{else}0{/if} -
- {/if} - - {if $showFooter} - {include file="Home/templates/datatable_footer.tpl"} - {/if} - {include file="Home/templates/datatable_actions_js.tpl"} - - {/if} -
diff --git a/plugins/Home/templates/datatable_actions_js.tpl b/plugins/Home/templates/datatable_actions_js.tpl deleted file mode 100644 index 5bf5ed2bca..0000000000 --- a/plugins/Home/templates/datatable_actions_js.tpl +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/plugins/Home/templates/datatable_actions_recursive.tpl b/plugins/Home/templates/datatable_actions_recursive.tpl deleted file mode 100644 index b11a67e6ae..0000000000 --- a/plugins/Home/templates/datatable_actions_recursive.tpl +++ /dev/null @@ -1,44 +0,0 @@ -
-{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'} - {$arrayDataTable.message} -{else} - {if count($arrayDataTable) == 0} -
{'Home_TableNoData'|translate}
- {else} - - - - {foreach from=$dataTableColumns item=column} - - - - - {foreach from=$arrayDataTable item=row} - - {foreach from=$dataTableColumns key=idColumn item=column} - - {/foreach} - - {/foreach} - - - - - - - -
{$column.displayName} - {/foreach} -
- {* sometimes all columns are not set in the datatable, we assume the value 0 *} - {if isset($row.columns[$column.name])}{$row.columns[$column.name]}{else}0{/if} -
- -
- {/if} - - {include file="Home/templates/datatable_footer.tpl"} - {include file="Home/templates/datatable_actions_js.tpl"} - - {/if} -
diff --git a/plugins/Home/templates/datatable_actions_subdatable.tpl b/plugins/Home/templates/datatable_actions_subdatable.tpl deleted file mode 100644 index ff25b77061..0000000000 --- a/plugins/Home/templates/datatable_actions_subdatable.tpl +++ /dev/null @@ -1,19 +0,0 @@ - -{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'} - {$arrayDataTable.message} -{else} - {if count($arrayDataTable) == 0} - {'Home_CategoryNoData'|translate} - {else} - {foreach from=$arrayDataTable item=row} - - {foreach from=$dataTableColumns key=idColumn item=column} - - {* sometimes all columns are not set in the datatable, we assume the value 0 *} - {if isset($row.columns[$column.name])}{$row.columns[$column.name]}{else}0{/if} - - {/foreach} - - {/foreach} - {/if} -{/if} diff --git a/plugins/Home/templates/datatable_footer.tpl b/plugins/Home/templates/datatable_footer.tpl deleted file mode 100644 index 0fcaeb993b..0000000000 --- a/plugins/Home/templates/datatable_footer.tpl +++ /dev/null @@ -1,36 +0,0 @@ -
- - - - - - - - - < {'General_Previous'|translate} - {'General_Next'|translate} > -
- - - - - - {'General_LoadingData'|translate} -
-
- -
diff --git a/plugins/Home/templates/datatable_js.tpl b/plugins/Home/templates/datatable_js.tpl deleted file mode 100644 index 83043606f4..0000000000 --- a/plugins/Home/templates/datatable_js.tpl +++ /dev/null @@ -1,12 +0,0 @@ - - diff --git a/plugins/Home/templates/date.js b/plugins/Home/templates/date.js deleted file mode 100644 index e13446a1a5..0000000000 --- a/plugins/Home/templates/date.js +++ /dev/null @@ -1,89 +0,0 @@ -$(document).ready(function(){ - $("#periodString").hide(); - $("#otherPeriods").hide(); - $("#calendar").hide(); - $("#periodString").show(); - - // we get the content of the div before modifying it (append image, etc.) - // so we can restore its value when we want - var savedCurrentPeriod = $("#periodString #currentPeriod").html(); - - // timeout used to fadeout the menu - var timeout = null; - var timeoutLength; - - // restore the normal style of the current period type eg "DAY" - function restoreCurrentPeriod() - { - $("#currentPeriod") - .removeClass("hoverPeriod") - .html(savedCurrentPeriod); - } - // remove the sub menu created that contains the other periods availble - // eg. week | month | year - function removePeriodMenu() { - $("#otherPeriods").fadeOut('fast'); - setCurrentPeriodStyle = true; - } - - // state machine a bit complex and was hard to come up with - // there should be a simpler way to do it with jquery... - // if set to true, means that we want to style our current period - // for example add bold and append the image - var setCurrentPeriodStyle = true; - - $("#periodString #periods") - .hover(function(){ - $(this).css({ cursor: "pointer"}); - - // cancel the timeout - // indeed if the user goes away of the div and goes back on - // we don't hide the submenu! - if(timeout != null) - { - clearTimeout(timeout); - timeout = null; - timeoutLength = 500; - } - else - { - timeoutLength = 0; - setCurrentPeriodStyle = true; - } - if( setCurrentPeriodStyle == true) - { - $("#currentPeriod:not(.hoverPeriod)") - .addClass("hoverPeriod") - .append(' '); - } - }, function(){ - restoreCurrentPeriod(); - // we callback the function to hide the sub menu - // only if it was visible (otherwise it messes the state machine) - if($("#otherPeriods").is(":visible")) - { - timeout = setTimeout( removePeriodMenu , timeoutLength); - } - setCurrentPeriodStyle = false; - }) - .click( function() { - // we restore the initial style on the DAY link - restoreCurrentPeriod(); - // the menu shall fadeout after 500ms - timeoutLength = 500; - // appearance! - $("#otherPeriods").fadeIn(); - - } - ); - - $("#periodString #date") - .hover( function(){ - $(this).css({ cursor: "pointer"}); - }, function(){ - - }) - .click(function(){ - $("#calendar").toggle(); - }); -} ); \ No newline at end of file diff --git a/plugins/Home/templates/graph.tpl b/plugins/Home/templates/graph.tpl deleted file mode 100644 index 1d1f6546a1..0000000000 --- a/plugins/Home/templates/graph.tpl +++ /dev/null @@ -1,16 +0,0 @@ -
-{$jsInvocationTag} - -{if $showFooter} -

-
- Embed - - | {'General_GraphData'|translate} -
- - {include file="Home/templates/datatable_footer.tpl"} - {include file="Home/templates/datatable_js.tpl"} -{/if} - -
diff --git a/plugins/Home/templates/header.tpl b/plugins/Home/templates/header.tpl deleted file mode 100644 index e00ff7faf0..0000000000 --- a/plugins/Home/templates/header.tpl +++ /dev/null @@ -1,8 +0,0 @@ - - - Piwik is a collaborative project and still Beta.
- If you want to help, please contact us.
-
- -{include file="Home/templates/logo.tpl"} -{include file="Home/templates/period_select.tpl"} \ No newline at end of file diff --git a/plugins/Home/templates/images/bg_header.jpg b/plugins/Home/templates/images/bg_header.jpg deleted file mode 100644 index 1733b0e355..0000000000 Binary files a/plugins/Home/templates/images/bg_header.jpg and /dev/null differ diff --git a/plugins/Home/templates/images/bullet1.gif b/plugins/Home/templates/images/bullet1.gif deleted file mode 100644 index d4ed73eea7..0000000000 Binary files a/plugins/Home/templates/images/bullet1.gif and /dev/null differ diff --git a/plugins/Home/templates/images/bullet2.gif b/plugins/Home/templates/images/bullet2.gif deleted file mode 100644 index d51d938dd1..0000000000 Binary files a/plugins/Home/templates/images/bullet2.gif and /dev/null differ diff --git a/plugins/Home/templates/images/more.png b/plugins/Home/templates/images/more.png deleted file mode 100644 index cba03a05f5..0000000000 Binary files a/plugins/Home/templates/images/more.png and /dev/null differ diff --git a/plugins/Home/templates/images/more_date.gif b/plugins/Home/templates/images/more_date.gif deleted file mode 100644 index 87da6b4963..0000000000 Binary files a/plugins/Home/templates/images/more_date.gif and /dev/null differ diff --git a/plugins/Home/templates/images/more_period.gif b/plugins/Home/templates/images/more_period.gif deleted file mode 100644 index b0c9787851..0000000000 Binary files a/plugins/Home/templates/images/more_period.gif and /dev/null differ diff --git a/plugins/Home/templates/images/reset_search.png b/plugins/Home/templates/images/reset_search.png deleted file mode 100644 index cb1d9e80a2..0000000000 Binary files a/plugins/Home/templates/images/reset_search.png and /dev/null differ diff --git a/plugins/Home/templates/images/search.png b/plugins/Home/templates/images/search.png deleted file mode 100644 index 6d1f037c69..0000000000 Binary files a/plugins/Home/templates/images/search.png and /dev/null differ diff --git a/plugins/Home/templates/index.tpl b/plugins/Home/templates/index.tpl deleted file mode 100644 index 74b9f91a65..0000000000 --- a/plugins/Home/templates/index.tpl +++ /dev/null @@ -1,77 +0,0 @@ - - - - -Piwik - Your Web Analytics Reports - -{loadJavascriptTranslations modules='Home'} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{include file="Home/templates/top_bar.tpl"} - -
- - - - - -
-{include file="Home/templates/menu.tpl"} - -
- -
{'General_LoadingData'|translate}
-
{'General_ErrorRequest'|translate}
- -
-{if $content}{$content}{/if} -
- -{include file="Home/templates/piwik_tag.tpl"} - - diff --git a/plugins/Home/templates/logo.tpl b/plugins/Home/templates/logo.tpl deleted file mode 100644 index ce2656865e..0000000000 --- a/plugins/Home/templates/logo.tpl +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/plugins/Home/templates/menu.css b/plugins/Home/templates/menu.css deleted file mode 100644 index 00baa61df0..0000000000 --- a/plugins/Home/templates/menu.css +++ /dev/null @@ -1,111 +0,0 @@ -.nav,.nav * { - margin: 0; - padding: 0; -} - -.nav { - padding-bottom: 2.5em; - height: 2.5em; - float: left; - line-height: 1.0; - margin-bottom: 1.5em; - position: relative; -} - -.nav ul { - background: #fff; /*IE6 needs this*/ - float: left; - position: relative; -} - -/* LEVEL1 NORMAL */ -.nav li { - background: #DFE6FF; - border-left: 1px solid #fff; - float: left; - list-style: none; - z-index: 49; -} - -.nav li.current ul { - z-index: 49; -} - -.nav li.sfHover ul,ul.nav li:hover ul { - z-index: 50; -} - -/* LEVEL2 NORMAL */ -.nav li li { - background: #FBFFFF; - border-left-color: #AABDE6; -} - -.nav a { - border-bottom: 1px solid #CFDEFF; - color: #13a; - display: block; - float: left; - padding: .75em 0 .75em 1em; - text-decoration: none; - width: 8em; -} - -.nav li ul { - left: 0; - top: -999em; - position: absolute; - width: 48em; -} - -/* LEVEL1 HOVER */ -.nav li:hover,.nav li.sfHover,.nav li.current,.nav a:focus,.nav a:hover,.nav a:active - { - background: #C9D5FF; -} - -.nav li { - font-weight: normal; -} - -.nav li.sfHover { - font-weight: bold; -} - -/* LEVEL2 HOVER */ -.nav li li:hover,.nav li li.sfHover,.nav li li a:focus,.nav li li a:hover,.nav li li a:active - { - background: #C9F6FF; - font-weight: bold; -} - -.nav li.sfHover a,.nav li.current a,.nav a:focus,.nav a:hover,.nav a:active - { - border-bottom: none; -} - -.nav li li.current a { - font-weight: bold; -} - -.nav li:hover ul, /* pure CSS hover is removed below */ body .nav li.current ul, - /* this must be more specific than the .superfish override below */ ul.nav li.sfHover ul - { - top: 2.5em; -} - -.nav li:hover li ul,.nav li.sfHover li ul { - top: -999em; -} - -.nav li li:hover ul, /* pure CSS hover is removed below */ ul.nav li li.sfHover ul - { - top: 2.5em; -} - -/*following rule negates pure CSS hovers -so submenu remains hidden and JS controls -when and how it appears*/ -.superfish li:hover ul,.superfish li li:hover ul { - top: -999em; -} \ No newline at end of file diff --git a/plugins/Home/templates/menu.js b/plugins/Home/templates/menu.js deleted file mode 100644 index c87d894a05..0000000000 --- a/plugins/Home/templates/menu.js +++ /dev/null @@ -1,126 +0,0 @@ -// menu constructor -function menu() -{ - this.param = new Object; -} - -// this should be in the menu prototype but I couldn't figure out -// how to use it as a callback in the jquery ajax request - - -//Prototype of the DataTable object -menu.prototype = -{ - menuSectionLoaded: function (content, urlLoaded) - { - if(urlLoaded == menu.prototype.lastUrlRequested) - { - $('#content').html( content ).show(); - $('#loadingPiwik').hide(); - menu.prototype.lastUrlRequested = null; - //console.log('display '+urlLoaded); - } - else - { - //console.log('loaded '+urlLoaded+' but expecting to display '+menu.prototype.lastUrlRequested); - } - }, - - customAjaxHandleError: function () - { - menu.prototype.lastUrlRequested = null; - ajaxHandleError(); - }, - - overMainLI: function () - { - $(this).siblings().removeClass('sfHover'); - }, - - outMainLI: function () - { - }, - - onClickLI: function () - { - var self = this; - var urlAjax = $('a',this).attr('name'); - function menuSectionLoaded(content) - { - menu.prototype.menuSectionLoaded(content, urlAjax); - } - - // showing loading... - $('#loadingPiwik').show(); - $('#content').hide(); - - if(menu.prototype.lastUrlRequested == urlAjax) - { - return false; - } - menu.prototype.lastUrlRequested = urlAjax; - - // we are in the SUB UL LI - if($(this).find('ul li').size() == 0) - { - // console.log('clicked SUB LI'); - $(this).addClass('sfHover'); - } - // we clicked on a MAIN LI - else - { - $(this).find('>ul li:first').addClass('sfHover'); - } - - //prepare the ajax request - ajaxRequest = - { - type: 'GET', - url: urlAjax, - dataType: 'html', - async: true, - error: menu.prototype.customAjaxHandleError, // Callback when the request fails - success: menuSectionLoaded, // Callback when the request succeeds - data: new Object - }; - $.ajax(ajaxRequest); - - return false; - - }, - - init: function() - { - var self = this; - this.param.superfish = $('.nav') - .superfish({ - pathClass : 'current', - animation : {opacity:'show'}, - delay : 1000 - }); - this.param.superfish.find("li") - .click( self.onClickLI ) - ; - - this.param.superfish - .find("li:has(ul)") - .hover(self.overMainLI, self.outMainLI) - ; - }, - - loadFirstSection: function() - { - var self=this; - $('li:first', self.param.superfish) - .click() - .each(function(){ - $(this).showSuperfishUl(); - }); - } -} - -$(document).ready( function(){ - piwikMenu = new menu(); - piwikMenu.init(); - piwikMenu.loadFirstSection(); -}); \ No newline at end of file diff --git a/plugins/Home/templates/menu.tpl b/plugins/Home/templates/menu.tpl deleted file mode 100644 index d7f036cbc3..0000000000 --- a/plugins/Home/templates/menu.tpl +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/plugins/Home/templates/period_select.tpl b/plugins/Home/templates/period_select.tpl deleted file mode 100644 index f74e9b0c30..0000000000 --- a/plugins/Home/templates/period_select.tpl +++ /dev/null @@ -1,13 +0,0 @@ - - {$prettyDate} -  - - {$periodsNames.$period} - - {foreach from=$otherPeriods item=thisPeriod} | {$periodsNames.$thisPeriod}{/foreach} - - -
- -
-
- diff --git a/plugins/Home/templates/piwik_tag.tpl b/plugins/Home/templates/piwik_tag.tpl deleted file mode 100644 index 3f207f6bda..0000000000 --- a/plugins/Home/templates/piwik_tag.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{if ereg('http://127.0.0.1|http://localhost|http://piwik.org', $url)} -{literal} - - - - - - -{/literal} -{/if} \ No newline at end of file diff --git a/plugins/Home/templates/sites_select.tpl b/plugins/Home/templates/sites_select.tpl deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/plugins/Home/templates/sparkline.js b/plugins/Home/templates/sparkline.js deleted file mode 100644 index 2ab68d18c7..0000000000 --- a/plugins/Home/templates/sparkline.js +++ /dev/null @@ -1,59 +0,0 @@ - -$(document).ready( function(){ - - //for every section - $("a[name='evolutionGraph']").each( - function() - { - //try to find the graph - var graph = $(this); - - if(graph && graph.size() > 0) - { - //console.log($(this).parent()); - //try to find sparklines and add them clickable behaviour - $(this).parent().find('p').each( - function() - { - var url = ""; - //find the sparkline and get it's src attribute - $(".sparkline", this).each( - function() - { - //search viewDataTable parameter and replace it with value for chart - var reg = new RegExp("(viewDataTable=sparkline)", "g"); - url = this.src.replace(reg,'viewDataTable=generateDataChartEvolution'); - } - ); - - if(url != "") - { - $("*", this).each( - function() - { - //on click, reload the graph with the new url - $(this).click( - function() - { - //get the main page graph and reload with new data - findSWFGraph(graph.attr('graphId')+"Chart_swf").reload(url); - lazyScrollTo(graph[0], 400); - } - ); - - //on hover, change cursor to indicate clickable item - $(this).hover( - function() - { - $(this).css({ cursor: "pointer"}); - }, function (){} - ); - } - ); - } - } - ); - } - } - ); -}); diff --git a/plugins/Home/templates/style.css b/plugins/Home/templates/style.css deleted file mode 100644 index c7ab9408ad..0000000000 --- a/plugins/Home/templates/style.css +++ /dev/null @@ -1,258 +0,0 @@ -/* reset style */ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td - { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-size: 100%; - vertical-align: baseline; - background: transparent; -} - -body { - line-height: 1.33; - background-color: white; - color: black; -} - -ol,ul { - list-style: none; -} - -blockquote,q { - quotes: none; -} - -/* remember to define focus styles! */ -:focus { - outline: 0; -} - -/* remember to highlight inserts somehow! */ -ins { - text-decoration: none; -} - -del { - text-decoration: line-through; -} - -/* start piwik styles */ -body { - font-family: Georgia, "Trebuchet MS", Verdana, Arial, Helvetica, - sans-serif; - font-size: 1em; -} - -#title { - align: left; -} - -h1 { - font-size: 2em; - color: #0F1B2E; - padding-bottom: 1em; -} - -h2 { - font-size: 1.6em; - color: #1D3256; - padding-bottom: 0.5em; -} - -h3 { - font-size: 1.3em; - margin-top: 2em; - color: #1D3256; -} - -a { - color: #0F1B2E; -} - -p { - padding-bottom: 1em; - margin-right: 1em; -} - -/* Content */ -#content { - margin-left: 10px; -} - -/* 2 columns reports */ -#leftcolumn { - float: left; - width: 45%; - padding-left: 10px; - padding-right: 20px; -} - -#rightcolumn { - float: right; - width: 45%; - padding-left: 20px; -} - -#header { - line-height: 1; -} - -#logo { - float: left; - display: inline; - font-size: 45pt; - padding-left: 15px; - padding-left: 15px; -} - -#righttext { - position: relative; - text-align: left; - float: right; - margin-top: 10px; - font-size: 1em; - width: 300px; - line-height: 1.33; -} - -#calendar { - display: block; -} - -#periodString #date,#periodString #periods,#periodString #date a,#periodString #periods a - { - color: #520202; - font-size: 15pt; -} - -#periodString { - padding-top: 2em; - margin-left: 350px; - display: block; -} - -/* Calendar*/ -.calendar td.dateToday,.calendar td.dateToday a { - font-weight: bold; -} - -.calendar td.dateUsedStats,.calendar td.dateUsedStats a { - color: #2E85FF; - border-color: #2E85FF; -} - -.calendar td.calendar_unselectable { - color: #F2F7FF; -} - -.calendar { - line-height: 1.33; -} - -#otherPeriods a { - text-decoration: none; -} - -#otherPeriods a:hover { - text-decoration: underline; -} - -#currentPeriod { - border-bottom: 1px dotted #520202; -} - -.hoverPeriod { - cursor: pointer; - font-weight: bold; - border-bottom: 1px solid #520202; -} - -/* OTHER */ -#loadingError { - font-weight: bold; - font-size: 1.1em; - color: #F88D22; - padding: 0.5em; - margin-left: 30%; - display: none; -} - -#loadingPiwik { - font-weight: bold; - font-size: 1.1em; - color: #193B6C; - padding: 0.5em; - margin-left: 30%; -} - -#bar,#user { - font-family: arial, sans-serif !important; - height: 20px; - padding: 4px 10px 0px !important; - background-color: #FFFFFF; - font-size: 13px; - padding-top: 4px !important; -} - -#bar { - float: left; - height: 22px; - padding-left: 10px; -} - -.bar-elem { - height: 22px; - margin-right: 0.73em; - vertical-align: top; - color: #000000; - margin-bottom: 0px; -} - -.line { - left: 0pt; - position: absolute; - top: 30px; - width: 100%; - border-top: 1px solid #C9D7F1; - font-size: 0pt; - height: 0pt; -} - -#periodSelection,#periodSelection a { - color: #8D92AA; -} - -#messageToUsers,#messageToUsers a { - color: red; - font-size: 0.9em; - text-decoration: none; - width: 100%; -} - -.sparkline { - vertical-align: middle; - padding-right: 10px; -} - -/* top right bar */ -#loggued { - float: right; - text-align: right; - margin-right: 20px; - padding-bottom: 5px; - padding-top: 5px; - padding-left: 5px; - border-bottom: 1px dotted #E2E3FE; - border-left: 1px dotted #E2E3FE; -} - -#loggued form { - display: inline; -} - -#javascriptDisable,#javascriptDisable a { - font-weight: bold; - color: #F88D22; -} \ No newline at end of file diff --git a/plugins/Home/templates/top_bar.tpl b/plugins/Home/templates/top_bar.tpl deleted file mode 100644 index 8abdac824c..0000000000 --- a/plugins/Home/templates/top_bar.tpl +++ /dev/null @@ -1,31 +0,0 @@ -
-Your Dashboard -API -Widgets -Send us feedback -
- - -
-
- -
- - {$userLogin} - | -Admin | -Site -{hiddenurl idSite=null} - | {if $userLogin=='anonymous'}{'Login_LogIn'|translate}{else}{'Login_Logout'|translate}{/if} - -
-
-
-
- diff --git a/plugins/Installation/Installation.php b/plugins/Installation/Installation.php index c9b0732201..416a155904 100644 --- a/plugins/Installation/Installation.php +++ b/plugins/Installation/Installation.php @@ -25,7 +25,7 @@ class Piwik_Installation extends Piwik_Plugin $info = array( // name must be the className prefix! 'name' => 'Installation', - 'description' => 'Description', + 'description' => 'Installation process of Piwik. The Installation is usually done once only. If the configuration file config/config.inc.php is deleted, the installation will start again.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Login/Auth.php b/plugins/Login/Auth.php index 66d8c5ba62..fe1dd2a5cc 100644 --- a/plugins/Login/Auth.php +++ b/plugins/Login/Auth.php @@ -1,52 +1,51 @@ superuser->login; $rootPassword = Zend_Registry::get('config')->superuser->password; - $rootToken = Piwik_UsersManager_API::getTokenAuth($rootLogin,$rootPassword); + $rootToken = Piwik_UsersManager_API::getTokenAuth($rootLogin, $rootPassword); - if($this->_identity == $rootLogin - && $this->_credential == $rootToken) + if($this->login == $rootLogin + && $this->token_auth == $rootToken) { - return new Piwik_Auth_Result(Piwik_Auth::SUCCESS_SUPERUSER_AUTH_CODE, $this->_identity ); + return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, $this->login, $this->token_auth ); } - if(is_null($this->_identity)) + if($this->token_auth === $rootToken) { - if($this->_credential === $rootToken) - { - return new Piwik_Auth_Result(Piwik_Auth::SUCCESS_SUPERUSER_AUTH_CODE, $rootLogin ); - } + return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS_SUPERUSER_AUTH_CODE, $rootLogin, $rootToken ); + } - $login = Zend_Registry::get('db')->fetchOne( - 'SELECT login FROM '.Piwik::prefixTable('user').' WHERE token_auth = ?', - array($this->_credential) - ); - if($login !== false) + $login = Zend_Registry::get('db')->fetchOne( + 'SELECT login FROM '.Piwik::prefixTable('user').' WHERE token_auth = ?', + array($this->token_auth) + ); + if($login !== false) + { + if(is_null($this->login) + || $this->login == $login) { - return new Piwik_Auth_Result(Zend_Auth_Result::SUCCESS, $login ); + return new Piwik_Auth_Result(Piwik_Auth_Result::SUCCESS, $login, $this->token_auth ); } - return new Piwik_Auth_Result( Zend_Auth_Result::FAILURE, $this->_identity ); } - - // if not then we return the result of the database authentification provided by zend - return parent::authenticate(); + return new Piwik_Auth_Result( Piwik_Auth_Result::FAILURE, $this->login, $this->token_auth ); } - public function getTokenAuth() + public function setLogin($login) + { + $this->login = $login; + } + + public function setTokenAuth($token_auth) { - return $this->_credential; + $this->token_auth = $token_auth; } } diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php index c6c9f6f4bc..44a1122c81 100644 --- a/plugins/Login/Controller.php +++ b/plugins/Login/Controller.php @@ -75,13 +75,14 @@ class Piwik_Login_Controller extends Piwik_Controller Piwik_Login::prepareAuthObject($login, $tokenAuth); $auth = Zend_Registry::get('auth'); - if($auth->authenticate()->isValid()) + $authResult = $auth->authenticate(); + if($authResult->isValid()) { $authCookieName = 'piwik-auth'; $authCookieExpiry = time() + 3600; $cookie = new Piwik_Cookie($authCookieName, $authCookieExpiry); $cookie->set('login', $login); - $cookie->set('token_auth', $auth->getTokenAuth()); + $cookie->set('token_auth', $authResult->getTokenAuth()); $cookie->save(); $urlToRedirect = htmlspecialchars_decode($urlToRedirect); @@ -168,6 +169,6 @@ class Piwik_Login_Controller extends Piwik_Controller $authCookieName = 'piwik-auth'; $cookie = new Piwik_Cookie($authCookieName); $cookie->delete(); - Piwik::redirectToModule('Home'); + Piwik::redirectToModule('CoreHome'); } } diff --git a/plugins/Login/Login.php b/plugins/Login/Login.php index a63a74f3f5..0c13cb2f6b 100644 --- a/plugins/Login/Login.php +++ b/plugins/Login/Login.php @@ -22,7 +22,7 @@ class Piwik_Login extends Piwik_Plugin { $info = array( 'name' => 'Login', - 'description' => 'Description', + 'description' => 'Login Authentication plugin, reading the credentials from the config/config.inc.php file for the Super User, and from the Database for the other users. Can be easily replaced to introduce a new Authentication mechanism (OpenID, htaccess, custom Auth, etc.).', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', @@ -33,7 +33,7 @@ class Piwik_Login extends Piwik_Plugin function getListHooksRegistered() { $hooks = array( - 'FrontController.authSetCredentials' => 'authSetCredentials', + 'FrontController.initAuthenticationObject' => 'initAuthenticationObject', 'FrontController.NoAccessException' => 'noAccess', ); return $hooks; @@ -48,17 +48,17 @@ class Piwik_Login extends Piwik_Plugin $controller->login($exceptionMessage); } - function authSetCredentials($notification) + function initAuthenticationObject($notification) { $authAdapter = new Piwik_Login_Auth(); Zend_Registry::set('auth', $authAdapter); if(Piwik::getModule() === 'API') { - $tokenAuthAPIInUrl = Piwik_Common::getRequestVar('token_auth', '', 'string'); + $tokenAuthAPIInUrl = Piwik_Common::getRequestVar('token_auth', 'anonymous', 'string'); if( !empty($tokenAuthAPIInUrl)) { - $authAdapter->setCredential($tokenAuthAPIInUrl); + $authAdapter->setTokenAuth($tokenAuthAPIInUrl); } } else @@ -80,10 +80,7 @@ class Piwik_Login extends Piwik_Plugin static function prepareAuthObject( $login, $tokenAuth ) { $auth = Zend_Registry::get('auth'); - $auth->setTableName(Piwik::prefixTable('user')) - ->setIdentityColumn('login') - ->setCredentialColumn('token_auth') - ->setIdentity($login) - ->setCredential($tokenAuth); + $auth->setLogin($login); + $auth->setTokenAuth($tokenAuth); } } diff --git a/plugins/PluginsAdmin/Controller.php b/plugins/PluginsAdmin/Controller.php deleted file mode 100644 index 0623bd1071..0000000000 --- a/plugins/PluginsAdmin/Controller.php +++ /dev/null @@ -1,65 +0,0 @@ -readPluginsDirectory(); - - $loadedPlugins = Piwik_PluginsManager::getInstance()->getLoadedPlugins(); - $plugins = array(); - - foreach($listPlugins as $pluginName) - { - $oPlugin = Piwik_PluginsManager::getInstance()->loadPlugin($pluginName); - $plugins[$pluginName]= array( 'activated' => Piwik_PluginsManager::getInstance()->isPluginEnabled($pluginName), - 'alwaysActivated' => Piwik_PluginsManager::getInstance()->isPluginAlwaysActivated($pluginName), - 'info' => $oPlugin->getInformation() - ); - } - - $view = new Piwik_View('PluginsAdmin/templates/manage.tpl'); - - $view->pluginsName = $plugins; - - echo $view->render(); - } - - function deactivate() - { - Piwik::checkUserIsSuperUser(); - - $pluginName = Piwik_Common::getRequestVar('pluginName', null, 'string'); - Piwik_PluginsManager::getInstance()->deactivatePlugin($pluginName); - - Piwik_Url::redirectToUrl('index.php?module=AdminHome&action=showInContext&moduleToLoad=PluginsAdmin'); - - } - function activate() - { - Piwik::checkUserIsSuperUser(); - - $pluginName = Piwik_Common::getRequestVar('pluginName', null, 'string'); - Piwik_PluginsManager::getInstance()->activatePlugin($pluginName); - - Piwik_Url::redirectToUrl('index.php?module=AdminHome&action=showInContext&moduleToLoad=PluginsAdmin'); - - } -} diff --git a/plugins/PluginsAdmin/PluginsAdmin.php b/plugins/PluginsAdmin/PluginsAdmin.php deleted file mode 100644 index 000b2c70ab..0000000000 --- a/plugins/PluginsAdmin/PluginsAdmin.php +++ /dev/null @@ -1,32 +0,0 @@ - 'PluginsAdmin', - 'description' => '', - 'author' => 'Piwik', - 'homepage' => 'http://piwik.org/', - 'version' => '0.1', - ); - } - - function postLoad() - { - Piwik_AddAdminMenu(Piwik_Translate('PluginsAdmin_MenuPlugins'), array('module' => 'PluginsAdmin')); - } -} - - diff --git a/plugins/PluginsAdmin/templates/manage.tpl b/plugins/PluginsAdmin/templates/manage.tpl deleted file mode 100644 index 1cf15dbc47..0000000000 --- a/plugins/PluginsAdmin/templates/manage.tpl +++ /dev/null @@ -1,29 +0,0 @@ - - -

Plugins

- - - - - - - - - - - - - {foreach from=$pluginsName key=name item=plugin} - -{if $plugin.activated}{else}{/if} - - - - - - -{/foreach} - - -
NameDescriptionAuthorVersionAction
{$name}{$plugin.info.description} {$plugin.info.author}{$plugin.info.version}{if $plugin.alwaysActivated}{'PluginsAdmin_Activated'|translate}{elseif $plugin.activated}{'PluginsAdmin_Deactivate'|translate} -{else}{'PluginsAdmin_Activate'|translate}{/if}
diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php index f152512fa7..f7b60e3e43 100644 --- a/plugins/Provider/Provider.php +++ b/plugins/Provider/Provider.php @@ -19,7 +19,7 @@ class Piwik_Provider extends Piwik_Plugin { $info = array( 'name' => 'Provider', - 'description' => 'Provider // lookup during logging + archive + display', + 'description' => 'Reports the Provider of the visitors.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Referers/Referers.php b/plugins/Referers/Referers.php index 485b6277d4..0207c526f0 100644 --- a/plugins/Referers/Referers.php +++ b/plugins/Referers/Referers.php @@ -25,7 +25,7 @@ class Piwik_Referers extends Piwik_Plugin { $info = array( 'name' => 'Referers', - 'description' => 'Computes all reports about the referers', + 'description' => 'Reports the Referers data: Search Engines, Keywords, Websites, Newsletters tracking, Campaign Tracking, Direct Entry. ', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Referers/index.tpl b/plugins/Referers/index.tpl index 2855b2adca..40d2877aff 100644 --- a/plugins/Referers/index.tpl +++ b/plugins/Referers/index.tpl @@ -1,4 +1,4 @@ - +

{'Referers_Evolution'|translate}

diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php index f6a5e15669..8be2e042f0 100644 --- a/plugins/SitesManager/SitesManager.php +++ b/plugins/SitesManager/SitesManager.php @@ -18,9 +18,8 @@ class Piwik_SitesManager extends Piwik_Plugin public function getInformation() { $info = array( - // name must be the className prefix! 'name' => 'SitesManager', - 'description' => 'Description', + 'description' => 'Websites Management in Piwik: Add a new Website, Edit an existing one, Show the Javascript code to include on your pages. All the actions are also available through the API.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/SitesManager/templates/SitesManager.js b/plugins/SitesManager/templates/SitesManager.js index ace93f743a..3faf03d0a8 100644 --- a/plugins/SitesManager/templates/SitesManager.js +++ b/plugins/SitesManager/templates/SitesManager.js @@ -21,6 +21,7 @@ function getDeleteSiteAJAX( idSite ) parameters.format = 'json'; parameters.method = 'SitesManager.deleteSite'; parameters.idSite = idSite; + parameters.token_auth = piwik_token_auth; ajaxRequest.data = parameters; @@ -43,16 +44,16 @@ function getAddSiteAJAX( row ) request += '&module=API'; request += '&format=json'; request += '&method=SitesManager.addSite'; - siteName = getEncoded(siteName); request += '&siteName='+siteName; - $.each(urls, function (key,value){ request+= '&urls[]='+escape(value);} ); - + request += '&token_auth='+piwik_token_auth; + ajaxRequest.data = request; return ajaxRequest; } + function getUpdateSiteAJAX( row ) { var ajaxRequest = getStandardAjaxConf(); @@ -70,15 +71,14 @@ function getUpdateSiteAJAX( row ) request += '&siteName='+siteName; request += '&idSite='+idSite; $.each(urls, function (key,value){ if(value.length>1) request+= '&urls[]='+value;} ); - + request += '&token_auth='+piwik_token_auth; + ajaxRequest.data = request; return ajaxRequest; - } - - $(document).ready( function() { +$(document).ready( function() { $('.addRowSite').click( function() { ajaxHideError(); $(this).toggle(); @@ -148,9 +148,6 @@ function getUpdateSiteAJAX( row ) .prepend( $('') .click( function(){ $.ajax( getUpdateSiteAJAX( $('tr#'+idRow) ) ); } ) ); - - - } ); diff --git a/plugins/SitesManager/templates/SitesManager.tpl b/plugins/SitesManager/templates/SitesManager.tpl index 559fc6de69..541e56a271 100644 --- a/plugins/SitesManager/templates/SitesManager.tpl +++ b/plugins/SitesManager/templates/SitesManager.tpl @@ -12,16 +12,22 @@ padding:1em; font-weight:bold; } + +#editSites { + valign: top; +} {/literal} -

{'SitesManager_Sites'|translate}

+

Websites Management

+

Your Web Analytics reports need Websites! Add, update, delete Websites, and show the Javascript to insert in your pages.

+ {if $sites|@count == 0} {'SitesManager_NoWebsites'|translate} {else} - +
diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php index c29ca03608..4f1d4e2322 100644 --- a/plugins/UserCountry/UserCountry.php +++ b/plugins/UserCountry/UserCountry.php @@ -20,7 +20,7 @@ class Piwik_UserCountry extends Piwik_Plugin { $info = array( 'name' => 'UserCountry', - 'description' => 'UserCountry', + 'description' => 'Reports the Country of the visitors.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/UserCountry/index.tpl b/plugins/UserCountry/index.tpl index c6cf0bf0da..ffefd09fc7 100644 --- a/plugins/UserCountry/index.tpl +++ b/plugins/UserCountry/index.tpl @@ -1,6 +1,6 @@ {postEvent name="template_headerUserCountry"} - +

{'UserCountry_Country'|translate}

{$dataTableCountry} diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php index 4f591c7ada..22c801f406 100644 --- a/plugins/UserSettings/UserSettings.php +++ b/plugins/UserSettings/UserSettings.php @@ -15,6 +15,20 @@ */ class Piwik_UserSettings extends Piwik_Plugin { + + public function getInformation() + { + $info = array( + 'name' => 'UserSettings', + 'description' => 'Reports various User Settings: Browser, Browser Family, Operating System, Plugins, Resolution, Global Settings.', + 'author' => 'Piwik', + 'homepage' => 'http://piwik.org/', + 'version' => '0.1', + ); + + return $info; + } + // source: http://en.wikipedia.org/wiki/List_of_web_browsers static public $browserType = array( "ie" => array("IE"), @@ -30,19 +44,6 @@ class Piwik_UserSettings extends Piwik_Plugin 'opera' => 'Opera' ); - public function getInformation() - { - $info = array( - 'name' => 'UserSettings', - 'description' => 'UserSettings', - 'author' => 'Piwik', - 'homepage' => 'http://piwik.org/', - 'version' => '0.1', - ); - - return $info; - } - function postLoad() { Piwik_AddWidget( 'UserSettings', 'getResolution', Piwik_Translate('UserSettings_WidgetResolutions')); diff --git a/plugins/UsersManager/API.php b/plugins/UsersManager/API.php index 09f09c0813..46024d1295 100755 --- a/plugins/UsersManager/API.php +++ b/plugins/UsersManager/API.php @@ -327,7 +327,8 @@ class Piwik_UsersManager_API extends Piwik_Apiable { $email = $userInfo['email']; } - else + + if($email != $userInfo['email']) { self::checkEmail($email); } @@ -391,16 +392,15 @@ class Piwik_UsersManager_API extends Piwik_Apiable * * @return bool true if the user is known */ - static public function userEmailExists( $userEmail ) { - Piwik::checkUserHasSomeAdminAccess(); + Piwik::checkUserHasSomeAdminAccess(); $count = Zend_Registry::get('db')->fetchOne("SELECT count(*) FROM ".Piwik::prefixTable("user"). " WHERE email = ?", $userEmail); return $count != 0; } - + /** * Set an access level to a given user for a list of websites ID. * diff --git a/plugins/UsersManager/Controller.php b/plugins/UsersManager/Controller.php index 38621278dc..7a96e937e2 100644 --- a/plugins/UsersManager/Controller.php +++ b/plugins/UsersManager/Controller.php @@ -42,7 +42,7 @@ class Piwik_UsersManager_Controller extends Piwik_Controller $usersLogin = Piwik_UsersManager_API::getUsersLogin(); // we dont want to display the user currently logged so that the user can't change his settings from admin to view... - $currentlyLogged = Zend_Registry::get('access')->getIdentity(); + $currentlyLogged = Piwik::getCurrentUserLogin(); foreach($usersLogin as $login) { diff --git a/plugins/UsersManager/UsersManager.php b/plugins/UsersManager/UsersManager.php index 7c2f82c922..74a6a9db94 100644 --- a/plugins/UsersManager/UsersManager.php +++ b/plugins/UsersManager/UsersManager.php @@ -20,7 +20,7 @@ class Piwik_UsersManager extends Piwik_Plugin $info = array( // name must be the className prefix! 'name' => 'UsersManager', - 'description' => 'Description', + 'description' => 'Users Management in Piwik: add a new User, edit an existing one, update the permissions. All the actions are also available through the API.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/UsersManager/templates/UsersManager.js b/plugins/UsersManager/templates/UsersManager.js index c36f1523e2..d5c745e500 100644 --- a/plugins/UsersManager/templates/UsersManager.js +++ b/plugins/UsersManager/templates/UsersManager.js @@ -1,11 +1,8 @@ - - function getUpdateUserAJAX( row ) { var ajaxRequest = getStandardAjaxConf(); toggleAjaxLoading(); - // prepare the API parameters to update the user var parameters = new Object; parameters.module = 'API'; parameters.format = 'json'; @@ -15,11 +12,11 @@ function getUpdateUserAJAX( row ) if(password != '-') parameters.password = password; parameters.email = $(row).find('input[@id=email]').val(); parameters.alias = $(row).find('input[@id=alias]').val(); + parameters.token_auth = piwik_token_auth; ajaxRequest.data = parameters; return ajaxRequest; - } function getDeleteUserAJAX( login ) @@ -27,12 +24,12 @@ function getDeleteUserAJAX( login ) var ajaxRequest = getStandardAjaxConf(); toggleAjaxLoading(); - // prepare the API parameters to update the user var parameters = new Object; parameters.module = 'API'; parameters.format = 'json'; parameters.method = 'UsersManager.deleteUser'; parameters.userLogin = login; + parameters.token_auth = piwik_token_auth; ajaxRequest.data = parameters; @@ -44,7 +41,6 @@ function getAddUserAJAX( row ) var ajaxRequest = getStandardAjaxConf(); toggleAjaxLoading(); - // prepare the API parameters to add the user var parameters = new Object; parameters.module = 'API'; parameters.format = 'json'; @@ -53,6 +49,7 @@ function getAddUserAJAX( row ) parameters.password = $(row).find('input[@id=useradd_password]').val(); parameters.email = $(row).find('input[@id=useradd_email]').val(); parameters.alias = $(row).find('input[@id=useradd_alias]').val(); + parameters.token_auth = piwik_token_auth; ajaxRequest.data = parameters; @@ -71,7 +68,6 @@ function getUpdateUserAccess(login, access, successCallback) ajaxRequest.success = successCallback; ajaxRequest.async = false; - // prepare the API parameters to add the user var parameters = new Object; parameters.module = 'API'; parameters.format = 'json'; @@ -79,6 +75,7 @@ function getUpdateUserAccess(login, access, successCallback) parameters.userLogin = login; parameters.access = access; parameters.idSites = getIdSites(); + parameters.token_auth = piwik_token_auth; ajaxRequest.data = parameters; @@ -95,10 +92,8 @@ function submitOnEnter(e) } } - function launchAjaxRequest(self, successCallback) { - //launching AJAX request $.ajax( getUpdateUserAccess( $(self).parent().parent().find('#login').html(),//if changed change also the modal $(self).parent().attr('id'), @@ -125,7 +120,6 @@ function bindUpdateAccess() { ajaxHideError(); - //once successful $(self).parent().parent().find('.accessGranted') .attr("src","plugins/UsersManager/images/no-access.png" ) .attr("class","updateAccess" ) @@ -182,7 +176,7 @@ $(document).ready( function() { var idName = $(n).attr('id'); if(idName != 'userLogin') { - var contentAfter = ''; + var contentAfter = ''; $(n).html(contentAfter); } } @@ -246,4 +240,3 @@ $(document).ready( function() { .click( bindUpdateAccess ) ; }); - diff --git a/plugins/UsersManager/templates/UsersManager.tpl b/plugins/UsersManager/templates/UsersManager.tpl index b81c7fcb00..a686d72a3e 100644 --- a/plugins/UsersManager/templates/UsersManager.tpl +++ b/plugins/UsersManager/templates/UsersManager.tpl @@ -16,6 +16,32 @@ font-weight:bold; text-align:center; } + +#addrow img { + vertical-align: middle; +} + +#addrow a { + text-decoration: none; +} + +#accessUpdated { + color: red; + text-align: center; + font-weight: bold; + width: 350px; + margin: 10px; + padding: 10px; + display: none; + border: 3px solid green; + color: green; +} +#access td, #users td { + spacing: 0px; + padding: 2px 5px 5px 4px; + border: 1px solid #660000; + width: 100px; +} .editable:hover, .addrow:hover, .updateAccess:hover, .accessGranted:hover, .adduser:hover, .edituser:hover, .deleteuser:hover, .updateuser:hover, .cancel:hover{ cursor: pointer; } @@ -29,7 +55,7 @@ {/literal}

{'UsersManager_ManageAccess'|translate}

- +

Decide which users have which Piwik access on your Websites. You can also set the permissions on all the Websites at once.

{'UsersManager_Sites'|translate}:

{'SitesManager_Id'|translate}
+
@@ -79,11 +105,12 @@ -

Manage users

- +
+

Users Management

+

Create new users or update the existing users. You can then set their permissions above.

-
{'UsersManager_User'|translate}
+
diff --git a/plugins/VisitFrequency/VisitFrequency.php b/plugins/VisitFrequency/VisitFrequency.php index 42a96dd68c..dee4fcfdee 100644 --- a/plugins/VisitFrequency/VisitFrequency.php +++ b/plugins/VisitFrequency/VisitFrequency.php @@ -19,7 +19,7 @@ class Piwik_VisitFrequency extends Piwik_Plugin { $info = array( 'name' => 'VisitFrequency', - 'description' => 'VisitorFrequency', + 'description' => 'Reports various statistics about the Returning Visitor versus the First time visitor.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/VisitFrequency/index.tpl b/plugins/VisitFrequency/index.tpl index dc41be7b11..87b32ce599 100644 --- a/plugins/VisitFrequency/index.tpl +++ b/plugins/VisitFrequency/index.tpl @@ -1,5 +1,5 @@ {postEvent name="template_headerVisitsFrequency"} - +

{'VisitFrequency_Evolution'|translate}

diff --git a/plugins/VisitTime/VisitTime.php b/plugins/VisitTime/VisitTime.php index b0f0a379cb..13201583da 100644 --- a/plugins/VisitTime/VisitTime.php +++ b/plugins/VisitTime/VisitTime.php @@ -20,7 +20,7 @@ class Piwik_VisitTime extends Piwik_Plugin { $info = array( 'name' => 'VisitTime', - 'description' => 'Visit Local & Server Time', + 'description' => 'Reports the Local and Server time. Server time information can be useful to schedule a maintenance on the Website.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php index d7004fe3a9..2b3c0aaa65 100644 --- a/plugins/VisitorInterest/VisitorInterest.php +++ b/plugins/VisitorInterest/VisitorInterest.php @@ -15,6 +15,18 @@ */ class Piwik_VisitorInterest extends Piwik_Plugin { + public function getInformation() + { + $info = array( + 'name' => 'VisitorInterest', + 'description' => 'Reports about the Visitor Interest: number of pages viewed, time spent on the Website.', + 'author' => 'Piwik', + 'homepage' => 'http://piwik.org/', + 'version' => '0.1', + ); + + return $info; + } protected $timeGap = array( array(0, 0.5), @@ -41,18 +53,6 @@ class Piwik_VisitorInterest extends Piwik_Plugin array(20) ); - public function getInformation() - { - $info = array( - 'name' => 'VisitorInterest', - 'description' => 'Several stats related to the visitor interest', - 'author' => 'Piwik', - 'homepage' => 'http://piwik.org/', - 'version' => '0.1', - ); - - return $info; - } function postLoad() { diff --git a/plugins/VisitsSummary/VisitsSummary.php b/plugins/VisitsSummary/VisitsSummary.php index 5fd9d29e0e..a26d7c166a 100644 --- a/plugins/VisitsSummary/VisitsSummary.php +++ b/plugins/VisitsSummary/VisitsSummary.php @@ -20,7 +20,7 @@ class Piwik_VisitsSummary extends Piwik_Plugin $info = array( // name must be the className prefix! 'name' => 'VisitsSummary', - 'description' => 'Description', + 'description' => 'Reports the general Analytics numbers: visits, unique visitors, number of actions, Bounce Rate, etc.', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/VisitsSummary/index.tpl b/plugins/VisitsSummary/index.tpl index 0507835d79..bacb8d761e 100644 --- a/plugins/VisitsSummary/index.tpl +++ b/plugins/VisitsSummary/index.tpl @@ -1,4 +1,4 @@ - +

{'VisitsSummary_Evolution'|translate:$period}

diff --git a/plugins/Widgetize/Widgetize.php b/plugins/Widgetize/Widgetize.php index f3bb9db578..3fc9f9fdd1 100644 --- a/plugins/Widgetize/Widgetize.php +++ b/plugins/Widgetize/Widgetize.php @@ -16,7 +16,7 @@ class Piwik_Widgetize extends Piwik_Plugin return array( // name must be the className prefix! 'name' => 'Widgetize', - 'description' => '', + 'description' => 'The plugin makes it very easy to export any Piwik Widget in your Blog, Website or on Igoogle and Netvibes!', 'author' => 'Piwik', 'homepage' => 'http://piwik.org/', 'version' => '0.1', diff --git a/plugins/Widgetize/templates/iframe.tpl b/plugins/Widgetize/templates/iframe.tpl index 45dee7d99f..7f736249dd 100644 --- a/plugins/Widgetize/templates/iframe.tpl +++ b/plugins/Widgetize/templates/iframe.tpl @@ -1,7 +1,7 @@ -{loadJavascriptTranslations modules='Home'} +{loadJavascriptTranslations modules='CoreHome'} @@ -11,8 +11,8 @@ - - + + {$content} diff --git a/plugins/Widgetize/templates/js.tpl b/plugins/Widgetize/templates/js.tpl index 3915ccbfde..78e2a8d545 100644 --- a/plugins/Widgetize/templates/js.tpl +++ b/plugins/Widgetize/templates/js.tpl @@ -1,4 +1,4 @@ -{loadJavascriptTranslations noHtml=1 modules='Home'} +{loadJavascriptTranslations noHtml=1 modules='CoreHome'} document.write('<\/scr'+'ipt>'); document.write('<\/scr'+'ipt>'); @@ -6,11 +6,11 @@ document.write('<\/scr'+'ipt>'); document.write('<\/scr'+'ipt>'); document.write('<\/scr'+'ipt>'); -document.write('<\/scr'+'ipt>'); +document.write('<\/scr'+'ipt>'); document.write('<\/scr'+'ipt>'); -document.write(''); +document.write(''); var content = '{$content|escape:'javascript'}'; document.write(content); \ No newline at end of file -- cgit v1.2.3
{'UsersManager_Login'|translate}