Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2008-07-28 03:07:52 +0400
committermattpiwik <matthieu.aubry@gmail.com>2008-07-28 03:07:52 +0400
commit9bcf3f24892e3ce52e0ce9cb4c38465b9084059c (patch)
tree6f5c6359390128afa87da03e68eed0a3fd5ddaf2 /plugins
parente33f6ef1b6bb66a040dea3dc824f85eb51b5f777 (diff)
- 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
Diffstat (limited to 'plugins')
-rw-r--r--plugins/API/API.php4
-rw-r--r--plugins/API/Controller.php2
-rw-r--r--plugins/Actions/Actions.php2
-rw-r--r--plugins/Actions/Controller.php6
-rw-r--r--plugins/AdminHome/AdminHome.php27
-rw-r--r--plugins/AdminHome/Controller.php66
-rw-r--r--plugins/AdminHome/templates/index.tpl48
-rw-r--r--plugins/AdminHome/templates/menu.css37
-rw-r--r--plugins/AdminHome/templates/menu.tpl5
-rw-r--r--plugins/Dashboard/Controller.php2
-rw-r--r--plugins/Dashboard/Dashboard.php2
-rw-r--r--plugins/Dashboard/templates/header.tpl10
-rw-r--r--plugins/Dashboard/templates/index.tpl4
-rw-r--r--plugins/ExampleAPI/API.php (renamed from plugins/ExamplePlugin/API.php)31
-rw-r--r--plugins/ExampleAPI/ExampleAPI.php15
-rw-r--r--plugins/ExampleFeedburner/ExampleFeedburner.php73
-rw-r--r--plugins/ExampleFeedburner/feedburner.tpl (renamed from plugins/ExamplePlugin/feedburner.tpl)0
-rw-r--r--plugins/ExamplePlugin/ExamplePlugin.php121
-rw-r--r--plugins/ExampleRssWidget/ExampleRssWidget.php4
-rw-r--r--plugins/Feedback/Controller.php1
-rw-r--r--plugins/Feedback/Feedback.php2
-rw-r--r--plugins/Feedback/index.tpl2
-rw-r--r--plugins/Home/Controller.php134
-rw-r--r--plugins/Home/Home.php26
-rw-r--r--plugins/Home/templates/calendar.js172
-rw-r--r--plugins/Home/templates/cloud.tpl68
-rw-r--r--plugins/Home/templates/datatable.css339
-rw-r--r--plugins/Home/templates/datatable.js988
-rw-r--r--plugins/Home/templates/datatable.tpl40
-rw-r--r--plugins/Home/templates/datatable_actions.tpl40
-rw-r--r--plugins/Home/templates/datatable_actions_js.tpl12
-rw-r--r--plugins/Home/templates/datatable_actions_recursive.tpl44
-rw-r--r--plugins/Home/templates/datatable_actions_subdatable.tpl19
-rw-r--r--plugins/Home/templates/datatable_footer.tpl36
-rw-r--r--plugins/Home/templates/datatable_js.tpl12
-rw-r--r--plugins/Home/templates/date.js89
-rw-r--r--plugins/Home/templates/graph.tpl16
-rw-r--r--plugins/Home/templates/header.tpl8
-rw-r--r--plugins/Home/templates/images/bg_header.jpgbin9097 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/bullet1.gifbin47 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/bullet2.gifbin55 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/more.pngbin1045 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/more_date.gifbin56 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/more_period.gifbin53 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/reset_search.pngbin1021 -> 0 bytes
-rw-r--r--plugins/Home/templates/images/search.pngbin136 -> 0 bytes
-rw-r--r--plugins/Home/templates/index.tpl77
-rw-r--r--plugins/Home/templates/logo.tpl14
-rw-r--r--plugins/Home/templates/menu.css111
-rw-r--r--plugins/Home/templates/menu.js126
-rw-r--r--plugins/Home/templates/menu.tpl16
-rw-r--r--plugins/Home/templates/period_select.tpl13
-rw-r--r--plugins/Home/templates/piwik_tag.tpl19
-rw-r--r--plugins/Home/templates/sites_select.tpl0
-rw-r--r--plugins/Home/templates/sparkline.js59
-rw-r--r--plugins/Home/templates/style.css258
-rw-r--r--plugins/Home/templates/top_bar.tpl31
-rw-r--r--plugins/Installation/Installation.php2
-rw-r--r--plugins/Login/Auth.php57
-rw-r--r--plugins/Login/Controller.php7
-rw-r--r--plugins/Login/Login.php17
-rw-r--r--plugins/PluginsAdmin/Controller.php65
-rw-r--r--plugins/PluginsAdmin/PluginsAdmin.php32
-rw-r--r--plugins/PluginsAdmin/templates/manage.tpl29
-rw-r--r--plugins/Provider/Provider.php2
-rw-r--r--plugins/Referers/Referers.php2
-rw-r--r--plugins/Referers/index.tpl2
-rw-r--r--plugins/SitesManager/SitesManager.php3
-rw-r--r--plugins/SitesManager/templates/SitesManager.js17
-rw-r--r--plugins/SitesManager/templates/SitesManager.tpl10
-rw-r--r--plugins/UserCountry/UserCountry.php2
-rw-r--r--plugins/UserCountry/index.tpl2
-rw-r--r--plugins/UserSettings/UserSettings.php27
-rwxr-xr-xplugins/UsersManager/API.php8
-rw-r--r--plugins/UsersManager/Controller.php2
-rw-r--r--plugins/UsersManager/UsersManager.php2
-rw-r--r--plugins/UsersManager/templates/UsersManager.js17
-rw-r--r--plugins/UsersManager/templates/UsersManager.tpl37
-rw-r--r--plugins/VisitFrequency/VisitFrequency.php2
-rw-r--r--plugins/VisitFrequency/index.tpl2
-rw-r--r--plugins/VisitTime/VisitTime.php2
-rw-r--r--plugins/VisitorInterest/VisitorInterest.php24
-rw-r--r--plugins/VisitsSummary/VisitsSummary.php2
-rw-r--r--plugins/VisitsSummary/index.tpl2
-rw-r--r--plugins/Widgetize/Widgetize.php2
-rw-r--r--plugins/Widgetize/templates/iframe.tpl6
-rw-r--r--plugins/Widgetize/templates/js.tpl6
87 files changed, 301 insertions, 3320 deletions
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 <a href=http://dev.piwik.org/trac/wiki/API/Reference>Piwik APIs</a>.',
'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 "<style>body{ font-family:georgia,arial; font-size:0.95em;}
#token_auth {
background-color:#E8FFE9;
diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php
index 100887340f..591a45bb28 100644
--- a/plugins/Actions/Actions.php
+++ b/plugins/Actions/Actions.php
@@ -33,7 +33,7 @@ class Piwik_Actions extends Piwik_Plugin
{
$info = array(
'name' => 'Actions',
- 'description' => 'Computes all reports about the actions',
+ 'description' => 'Reports about the page views, the outlinks and downloads. Outlinks and Downloads tracking is automatic!',
'author' => 'Piwik',
'homepage' => 'http://piwik.org/',
'version' => '0.1',
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php
index 3c71e9357c..9492589ae2 100644
--- a/plugins/Actions/Controller.php
+++ b/plugins/Actions/Controller.php
@@ -117,17 +117,17 @@ class Piwik_Actions_Controller extends Piwik_Controller
$currentMethod,
$methodToCall,
$subMethod );
- $view->setTemplate('Home/templates/datatable_actions.tpl');
+ $view->setTemplate('CoreHome/templates/datatable_actions.tpl');
if(Piwik_Common::getRequestVar('idSubtable', -1) != -1)
{
- $view->setTemplate('Home/templates/datatable_actions_subdatable.tpl');
+ $view->setTemplate('CoreHome/templates/datatable_actions_subdatable.tpl');
}
$currentlySearching = $view->setSearchRecursive();
if($currentlySearching)
{
- $view->setTemplate('Home/templates/datatable_actions_recursive.tpl');
+ $view->setTemplate('CoreHome/templates/datatable_actions_recursive.tpl');
}
$view->disableSort();
diff --git a/plugins/AdminHome/AdminHome.php b/plugins/AdminHome/AdminHome.php
deleted file mode 100644
index 447632b6f5..0000000000
--- a/plugins/AdminHome/AdminHome.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id: ExamplePlugin.php 169 2008-01-14 05:41:15Z matt $
- *
- * @package Piwik_AdminHome
- */
-
-
-class Piwik_AdminHome extends Piwik_Plugin
-{
- public function getInformation()
- {
- return array(
- // name must be the className prefix!
- 'name' => 'AdminHome',
- 'description' => '',
- 'author' => 'Piwik',
- 'homepage' => 'http://piwik.org/',
- 'version' => '0.1',
- );
- }
-}
-
diff --git a/plugins/AdminHome/Controller.php b/plugins/AdminHome/Controller.php
deleted file mode 100644
index b3af41c730..0000000000
--- a/plugins/AdminHome/Controller.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version
- *
- * @package Piwik_AdminHome
- *
- */
-
-require_once "API/Request.php";
-
-
-/**
- *
- * @package Piwik_AdminHome
- */
-class Piwik_AdminHome_Controller extends Piwik_Controller
-{
- function getDefaultAction()
- {
- return 'redirectToIndex';
- }
- function redirectToIndex()
- {
- header("Location:index.php?module=AdminHome&action=showInContext&moduleToLoad=PluginsAdmin");
- }
-
- 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('AdminHome/templates/index.tpl');
- $view->menu = Piwik_GetAdminMenu();
- $view->menuJson = json_encode($view->menu);
-
- $view->userLogin = Piwik::getCurrentUserLogin();
- $view->sites = Piwik_SitesManager_API::getSitesWithAtLeastViewAccess();
- $view->url = Piwik_Url::getCurrentUrl();
-
- $view->basicHtmlView = false;
- $view->content = '';
- return $view;
- }
-
- public function index()
- {
- Piwik::checkUserIsSuperUser();
-
- $view = $this->getDefaultIndexView();
- echo $view->render();
- }
-}
-
diff --git a/plugins/AdminHome/templates/index.tpl b/plugins/AdminHome/templates/index.tpl
deleted file mode 100644
index 477cf0069a..0000000000
--- a/plugins/AdminHome/templates/index.tpl
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-{literal}
-<style>
-#h1, #h1 a {
- color: #136F8B;
- font-size: 45px;
- font-weight: lighter;
- text-decoration : none;
- margin:5px;
-}
-
-#subh1 {
- color: #879dbd;
- font-size: 25px;
- font-weight: lighter;
-}
-</style>
-{/literal}
-<script type="text/javascript" src="libs/jquery/jquery.js"></script>
-<script type="text/javascript" src="themes/default/common.js"></script>
-
-<link rel="stylesheet" type="text/css" href="plugins/AdminHome/templates/menu.css">
-<link rel="stylesheet" href="themes/default/common-admin.css">
-
-</head>
-<body>
-<span id="h1">Piwik admin</span> &nbsp;
-<span><a href='index.php'>Back to Piwik</a></span>
-<br /><br />
-
-<div id="menu">
-{include file="AdminHome/templates/menu.tpl"}
-</div>
-
-<div style="clear:both;">
-</div>
-
-<div id='content'>
-{if $content}{$content}{/if}
-</div>
-
-<div id="footer" style="border-top:1px solid gray; margin-top:20px;padding-top:10px;">
-<a href='?module=Home'>{'General_BackToHomepage'|translate}</a>
-
-</div>
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 @@
-<ul id="tablist">
-{foreach from=$menu key=name item=url name=menu}
- <li><a name='{$url|@urlRewriteAdminView}' href='{$url|@urlRewriteAdminView}'>{$name}</a></li>
-{/foreach}
-</ul>
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*}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
-{loadJavascriptTranslations modules='Home Dashboard'}
+{loadJavascriptTranslations modules='CoreHome Dashboard'}
<script type="text/javascript" src="libs/jquery/jquery.js"></script>
@@ -13,13 +13,13 @@
<script type="text/javascript" src="libs/jquery/jquery-calendar.js"></script>
<script type="text/javascript" src="libs/swfobject/swfobject.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/datatable.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/calendar.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/date.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/datatable.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/calendar.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/date.js"></script>
<script type="text/javascript" src="libs/jquery/jquery.blockUI.js"></script>
<script type="text/javascript" src="libs/jquery/ui.mouse.js"></script>
<script type="text/javascript" src="libs/jquery/ui.sortable_modif.js"></script>
-<link rel="stylesheet" href="plugins/Home/templates/datatable.css">
+<link rel="stylesheet" href="plugins/CoreHome/templates/datatable.css">
<link rel="stylesheet" href="plugins/Dashboard/templates/dashboard.css">
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'}
<script type="text/javascript">
{* define some global constants for the following javascript includes *}
@@ -8,7 +8,7 @@
piwik.dashboardLayout = '{$layout}';
{else}
// Load default layout...
- piwik.dashboardLayout = 'VisitsSummary.getLastVisitsGraph~VisitorInterest.getNumberOfVisitsPerVisitDuration~UserSettings.getBrowser~ExamplePlugin.feedburner|Referers.getKeywords~Referers.getWebsites|Referers.getSearchEngines~VisitTime.getVisitInformationPerServerTime~ExampleRssWidget.rssPiwik|';
+ piwik.dashboardLayout = 'VisitsSummary.getLastVisitsGraph~VisitorInterest.getNumberOfVisitsPerVisitDuration~UserSettings.getBrowser~ExampleFeedburner.feedburner|Referers.getKeywords~Referers.getWebsites|Referers.getSearchEngines~VisitTime.getVisitInformationPerServerTime~ExampleRssWidget.rssPiwik|';
{/if}
piwik.availableWidgets = {$availableWidgets};
diff --git a/plugins/ExamplePlugin/API.php b/plugins/ExampleAPI/API.php
index 72c5bde7e1..0907e0a125 100644
--- a/plugins/ExamplePlugin/API.php
+++ b/plugins/ExampleAPI/API.php
@@ -4,7 +4,7 @@
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
+ * @version $Id: API.php 482 2008-05-18 17:22:35Z matt $
*
* @package Piwik_ExamplePlugin
*/
@@ -20,19 +20,7 @@
*
* @package Piwik_ExamplePlugin
*/
-class MagicObject
-{
- function Incredible(){ return 'Incroyable'; }
- protected $wonderful = 'magnifique';
- public $great = 'formidable';
-}
-
-
-/**
- *
- * @package Piwik_ExamplePlugin
- */
-class Piwik_ExamplePlugin_API extends Piwik_Apiable
+class Piwik_ExampleAPI_API extends Piwik_Apiable
{
static private $instance = null;
static public function getInstance()
@@ -55,18 +43,22 @@ class Piwik_ExamplePlugin_API extends Piwik_Apiable
//http://en.wikipedia.org/wiki/Golden_ratio
return 1.618033988749894848204586834365;
}
+
public function getObject()
{
return new MagicObject();
}
+
public function getNull()
{
return null;
}
+
public function getDescriptionArray()
{
return array('piwik','open source','web analytics','free');
}
+
public function getCompetitionDatatable()
{
$dataTable = new Piwik_DataTable();
@@ -87,3 +79,14 @@ class Piwik_ExamplePlugin_API extends Piwik_Apiable
}
+
+/**
+ *
+ * @package Piwik_ExamplePlugin
+ */
+class MagicObject
+{
+ function Incredible(){ return 'Incroyable'; }
+ protected $wonderful = 'magnifique';
+ public $great = 'formidable';
+}
diff --git a/plugins/ExampleAPI/ExampleAPI.php b/plugins/ExampleAPI/ExampleAPI.php
new file mode 100644
index 0000000000..b9e24f1e9e
--- /dev/null
+++ b/plugins/ExampleAPI/ExampleAPI.php
@@ -0,0 +1,15 @@
+<?php
+class Piwik_ExampleAPI extends Piwik_Plugin
+{
+ public function getInformation()
+ {
+ return array(
+ // name must be the className prefix!
+ 'name' => 'ExampleAPI',
+ 'description' => 'Example Plugin: How to create an API for your plugin, to export your data in multiple formats without any special coding? Visit the <a href="index.php?module=CoreAdminHome&action=showInContext&moduleToLoad=API&actionToLoad=listAllAPI&module=CoreAdminHome&action=showInContext#ExampleAPI">ExampleAPI example methods</a>.',
+ 'author' => 'Piwik',
+ 'homepage' => 'http://piwik.org/',
+ 'version' => '0.1',
+ );
+ }
+} \ No newline at end of file
diff --git a/plugins/ExampleFeedburner/ExampleFeedburner.php b/plugins/ExampleFeedburner/ExampleFeedburner.php
new file mode 100644
index 0000000000..4dd75f0462
--- /dev/null
+++ b/plugins/ExampleFeedburner/ExampleFeedburner.php
@@ -0,0 +1,73 @@
+<?php
+
+class Piwik_ExampleFeedburner extends Piwik_Plugin
+{
+ public function getInformation()
+ {
+ return array(
+ // name must be the className prefix!
+ 'name' => 'ExampleFeedburner',
+ 'description' => 'Example Plugin: How to display your Feedburner subscriber in a Widget 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`");
+ }
+}
+
+Piwik_AddWidget('ExampleFeedburner', 'feedburner', 'Feedburner statistics');
+
+class Piwik_ExampleFeedburner_Controller extends Piwik_Controller
+{
+
+ /**
+ * Simple feedburner statistics output
+ *
+ */
+ function feedburner()
+ {
+ $view = new Piwik_View('ExampleFeedburner/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'))
+ );
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/ExamplePlugin/feedburner.tpl b/plugins/ExampleFeedburner/feedburner.tpl
index c3673bf529..c3673bf529 100644
--- a/plugins/ExamplePlugin/feedburner.tpl
+++ b/plugins/ExampleFeedburner/feedburner.tpl
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
{
/**
@@ -56,6 +41,35 @@ class Piwik_ExamplePlugin_Controller extends Piwik_Controller
}
/**
+ * See the result on piwik/?module=ExamplePlugin&action=exampleWidget
+ * or in the dashboard > Add a new widget
+ *
+ */
+ function exampleWidget()
+ {
+ echo "Hello world! <br> You can output whatever you want in widgets, and put them on dashboard or everywhere on the web (in your blog, website, etc.).
+ <br>Widgets can include graphs, tables, flash, text, images, etc.
+ <br>It's very easy to create a new plugin and widgets in Piwik. Have a look at this example file (/plugins/ExamplePlugin/ExamplePlugin.php).
+ <br><i>Happy coding!</i>";
+ }
+
+ /**
+ * Embed Matt's blog using widgetbox.com widget code
+ */
+ function blogMatthieu()
+ {
+ echo '
+ <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" type="application/x-shockwave-flash" width="400px" height="338px" id="InsertWidget_3fe0d93d-bae5-42f9-bec4-4235cb6285a8" align="middle">
+ <param name="movie" value="http://widgetserver.com/syndication/flash/wrapper/InsertWidget.swf?appId=3fe0d93d-bae5-42f9-bec4-4235cb6285a8"/>
+ <param name="quality" value="high" />
+ <param name="wmode" value="transparent" />
+ <param name="menu" value="false" />
+ <embed src="http://widgetserver.com/syndication/flash/wrapper/InsertWidget.swf?appId=3fe0d93d-bae5-42f9-bec4-4235cb6285a8" name="InsertWidget_3fe0d93d-bae5-42f9-bec4-4235cb6285a8" width="400px" height="338px" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" align="middle" /> </object>
+ <img style="visibility:hidden;width:0px;height:0px;" border="0" width="0" height="0" src="http://runtime.widgetbox.com/syndication/track/3fe0d93d-bae5-42f9-bec4-4235cb6285a8.gif" />
+ ';
+ }
+
+ /**
* 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! <br> You can output whatever you want in widgets, and put them on dashboard or everywhere on the web (in your blog, website, etc.).
- <br>Widgets can include graphs, tables, flash, text, images, etc.
- <br>It's very easy to create a new plugin and widgets in Piwik. Have a look at this example file (/plugins/ExamplePlugin/ExamplePlugin.php).
- <br><i>Happy coding!</i>";
- }
-
- /**
- * Embed Matthieu's blog using widgetbox.com widget code
- *
- */
- function blogMatthieu()
- {
- echo '
- <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" type="application/x-shockwave-flash" width="400px" height="338px" id="InsertWidget_3fe0d93d-bae5-42f9-bec4-4235cb6285a8" align="middle">
- <param name="movie" value="http://widgetserver.com/syndication/flash/wrapper/InsertWidget.swf?appId=3fe0d93d-bae5-42f9-bec4-4235cb6285a8"/>
- <param name="quality" value="high" />
- <param name="wmode" value="transparent" />
- <param name="menu" value="false" />
- <embed src="http://widgetserver.com/syndication/flash/wrapper/InsertWidget.swf?appId=3fe0d93d-bae5-42f9-bec4-4235cb6285a8" name="InsertWidget_3fe0d93d-bae5-42f9-bec4-4235cb6285a8" width="400px" height="338px" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" align="middle" /> </object>
- <img style="visibility:hidden;width:0px;height:0px;" border="0" width="0" height="0" src="http://runtime.widgetbox.com/syndication/track/3fe0d93d-bae5-42f9-bec4-4235cb6285a8.gif" />
- ';
- }
-
- /**
- * 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/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 {
<br /><input type="text" name="email" size="40" /></p>
<p><strong>Body:</strong>
-<br /><textarea name="body" cols="40" rows="15"></textarea></p>
+<br /><textarea name="body" cols="40" rows="13"></textarea></p>
<p><input type="submit" value="Send feedback" />
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 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id$
- *
- * @package Piwik_Home
- *
- */
-
-
-require_once "API/Request.php";
-require_once "ViewDataTable.php";
-
-/**
- *
- * @package Piwik_Home
- */
-class Piwik_Home_Controller extends Piwik_Controller
-{
- function getDefaultAction()
- {
- return 'redirectToIndex';
- }
- function redirectToIndex()
- {
- $sitesId = Piwik_SitesManager_API::getSitesIdWithAtLeastViewAccess();
- if(!empty($sitesId))
- {
- $firstSiteId = $sitesId[0];
- $firstSite = new Piwik_Site($firstSiteId);
- if ($firstSite->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).
- "<br /><br />&nbsp;&nbsp;&nbsp;<b><a href='?module=Login&amp;action=logout'>&rsaquo; ".Piwik_Translate('General_Logout')."</a></b><br />");
- }
- 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 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id: ExamplePlugin.php 169 2008-01-14 05:41:15Z matt $
- *
- * @package Piwik_PluginsAdmin
- */
-
-class Piwik_Home extends Piwik_Plugin
-{
- public function getInformation()
- {
- return array(
- // name must be the className prefix!
- 'name' => '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 @@
-<div id="{$id}" class="parentDiv">
-{literal}
-<style>
-
-#tagCloud{
- width:100%;
-}
-img {
- border:0;
-}
-.word a {
- text-decoration:none;
-}
-.word {
- padding: 4px 4px 4px 4px;
-}
-.valueIsZero {
- text-decoration: line-through;
-}
-span.size0, span.size0 a {
- color: #344971;
- font-size: 28px;
-}
-span.size1, span.size1 a {
- color: #344971;
- font-size: 24px;
-}
-span.size2, span.size2 a {
- color: #4B74AD;
- font-size:20px;
-}
-span.size3, span.size3 a {
- color: #A3A8B6;
- font-size: 16px;
-}
-span.size4, span.size4 a {
- color: #A3A8B6;
- font-size: 15px;
-}
-span.size5, span.size5 a {
- color: #A3A8B6;
- font-size: 14px;
-}
-span.size6, span.size6 a {
- color: #A3A8B6;
- font-size: 11px;
-}
-</style>
-{/literal}
-
-<div id="tagCloud">
-{if count($cloudValues) == 0}
- <div id="emptyDatatable">No data for this tag cloud.</div>
-{else}
- {foreach from=$cloudValues key=word item=value}
- <span title="{$value.word} ({$labelMetadata[$value.word].hits} hits)" class="word size{$value.size} {* we strike tags with 0 hits *} {if $labelMetadata[$value.word].hits == 0}valueIsZero{/if}">
- {if false !== $labelMetadata[$value.word].url}<a href="{$labelMetadata[$value.word].url}" target="_blank">{/if}
- {if false !== $labelMetadata[$value.word].logo}<img src="{$labelMetadata[$value.word].logo}" width="{$value.logoWidth}">{else}
-
- {$value.wordTruncated}{/if}{if false !== $labelMetadata[$value.word].url}</a>{/if}</span>
- {/foreach}
-{/if}
-{if $showFooter}
- {include file="Home/templates/datatable_footer.tpl"}
-{/if}
-{include file="Home/templates/datatable_js.tpl"}
-</div>
-</div>
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('<div id="sortIconContainer"><img id="sortIcon" width="'+imageSortWidth+'" height="'+imageSortHeight+'" src="themes/default/images/sort'+prefixSortIcon+ self.param.filter_sort_order+'.png" /></div>');
- }
- },
-
- // 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 = $('<span style="position: relative;">\
- <img src="plugins/Home/templates/images/reset_search.png" style="position: absolute; top: 4px; left: -15px; cursor: pointer; display: inline;" title="Clear"/>\
- </span>')
- .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 <span id="urlLink"> 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 = '<img width="'+imageLinkWidth+'" height="'+imageLinkHeight+'" src="themes/default/images/link.gif" /> ';
- }
- var urlToLink = $('#urlLink',this).text();
-
- $(this).html(
- '<a target="_blank" href="' + urlToLink + '">' + imgToPrepend + $(this).html() + '</a>'
- );
- });
-
-
- // 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( '\
- <tr>\
- <td colspan="'+numberOfColumns+'" class="cellSubDataTable">\
- <div id="'+divIdToReplaceWithSubTable+'">\
- <span id="loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" />'+ _pk_translate('Home_Loading') +'</span>\
- </div>\
- </td>\
- </tr>\
- ');
-
- 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('<img width="'+imagePlusMinusWidth+'" height="'+imagePlusMinusHeight+'" class="plusMinus" src="" />');
- 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( '\
- <tr id="'+divIdToReplaceWithSubTable+'" class="cellSubDataTable">\
- <td colspan="'+numberOfColumns+'">\
- <span id="loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" /> Loading...</span>\
- </td>\
- </tr>\
- ');
- 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 @@
-<div id="{$id}" class="parentDiv">
- {if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
- {$arrayDataTable.message}
- {else}
- {if count($arrayDataTable) == 0}
- <div id="emptyDatatable">{'Home_TableNoData'|translate}</div>
- {else}
- <a name="{$id}"></a>
- <table cellspacing="0" class="dataTable">
- <thead>
- <tr>
- {foreach from=$dataTableColumns item=column}
- <th class="sortable" id="{$column.id}"><div id="thDIV">{$column.displayName}</div></th>
- {/foreach}
- </tr>
- </thead>
-
- <tbody>
- {foreach from=$arrayDataTable item=row}
- <tr {if $row.idsubdatatable}class="subDataTable" id="{$row.idsubdatatable}"{/if}>
- {foreach from=$dataTableColumns key=idColumn item=column}
- <td>
- {if $idColumn==0 && isset($row.metadata.url)}<span id="urlLink">{$row.metadata.url}</span>{/if}
- {if $idColumn==0 && isset($row.metadata.logo)}<img {if isset($row.metadata.logoWidth)}width="{$row.metadata.logoWidth}"{/if} {if isset($row.metadata.logoHeight)}height="{$row.metadata.logoHeight}"{/if} src="{$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}
- </td>
- {/foreach}
- </tr>
- {/foreach}
- </tbody>
- </table>
- {/if}
-
- {if $showFooter}
- {include file="Home/templates/datatable_footer.tpl"}
- {/if}
- {include file="Home/templates/datatable_js.tpl"}
- {/if}
-</div>
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 @@
-<div id="{$id}" class="parentDivActions">
-{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
- {$arrayDataTable.message}
-{else}
- {if count($arrayDataTable) == 0}
- <div id="emptyDatatable">{'Home_TableNoData'|translate}</div>
- {else}
- <table cellspacing="0" class="dataTable dataTableActions">
- <thead>
- <tr>
- {foreach from=$dataTableColumns item=column}
- <th class="sortable" id="{$column.id}">{$column.name}</td>
- {/foreach}
- </tr>
- </thead>
-
- <tbody>
- {foreach from=$arrayDataTable item=row}
- <tr {if $row.idsubdatatable}class="rowToProcess subActionsDataTable" id="{$row.idsubdatatable}"{else} class="actionsDataTable rowToProcess"{/if}>
- {foreach from=$dataTableColumns key=idColumn item=column}
- <td>
- {* 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}
- </td>
- {/foreach}
- </tr>
- {/foreach}
- </tbody>
-
- </tfoot>
- </table>
- {/if}
-
- {if $showFooter}
- {include file="Home/templates/datatable_footer.tpl"}
- {/if}
- {include file="Home/templates/datatable_actions_js.tpl"}
-
- {/if}
-</div>
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 @@
-
-<script type="text/javascript" defer="defer">
-$(document).ready(function(){literal}{{/literal}
- actionDataTables['{$id}'] = new actionDataTable();
- actionDataTables['{$id}'].param = {literal}{{/literal}
- {foreach from=$javascriptVariablesToSet key=name item=value name=loop}
- {$name}: '{$value}'{if !$smarty.foreach.loop.last},{/if}
- {/foreach}
- {literal}};{/literal}
- actionDataTables['{$id}'].init('{$id}');
-{literal}}{/literal});
-</script>
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 @@
-<div id="{$id}" class="parentDivActions">
-{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
- {$arrayDataTable.message}
-{else}
- {if count($arrayDataTable) == 0}
- <div id="emptyDatatable">{'Home_TableNoData'|translate}</div>
- {else}
- <table cellspacing="0" class="dataTable dataTableActions">
- <thead>
- <tr>
- {foreach from=$dataTableColumns item=column}
- <th class="sortable" id="{$column.id}">{$column.displayName}</td>
- {/foreach}
- </tr>
- </thead>
-
- <tbody>
- {foreach from=$arrayDataTable item=row}
- <tr {if $row.idsubdatatable}class="level{$row.level} rowToProcess subActionsDataTable" id="{$row.idsubdatatable}"{else}class="actionsDataTable rowToProcess level{$row.level}"{/if}>
- {foreach from=$dataTableColumns key=idColumn item=column}
- <td>
- {* 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}
- </td>
- {/foreach}
- </tr>
- {/foreach}
- </tbody>
-
-
- </foot>
- <tr><td colspan="{$dataTableColumns|@count}">
-
- </td>
- </tr>
- </tfoot>
- </table>
- {/if}
-
- {include file="Home/templates/datatable_footer.tpl"}
- {include file="Home/templates/datatable_actions_js.tpl"}
-
- {/if}
-</div>
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 @@
-<tr id="{$id}"></tr>
-{if isset($arrayDataTable.result) and $arrayDataTable.result == 'error'}
- {$arrayDataTable.message}
-{else}
- {if count($arrayDataTable) == 0}
- <tr><td colspan="{$nbColumns}">{'Home_CategoryNoData'|translate}</td></tr>
- {else}
- {foreach from=$arrayDataTable item=row}
- <tr {if $row.idsubdatatable}class="subActionsDataTable" id="{$row.idsubdatatable}"{else}class="actionsDataTable"{/if}>
- {foreach from=$dataTableColumns key=idColumn item=column}
- <td>
- {* 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}
- </td>
- {/foreach}
- </tr>
- {/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 @@
-<div id="dataTableFeatures">
- <span id="dataTableExcludeLowPopulation"></span>
-
- <span id="dataTableSearchPattern">
- <input id="keyword" type="text" length="15" />
- <input type="submit" value="{'General_Search'|translate}" />
- </span>
-
- <span id="dataTablePages"></span>
- <span id="dataTablePrevious">&lt; {'General_Previous'|translate}</span>
- <span id="dataTableNext">{'General_Next'|translate} &gt;</span>
- <div>
- <span id="exportDataTable">
- <span id="exportToFormat" style="display:none">
- <img width="16" height="16" src="themes/default/images/export.png" />
- <span id="linksExportToFormat" style="display:none">
- <a target="_blank" class="exportToFormat" methodToCall="{$method}" format="CSV" filter_limit="100">CSV</a> |
- <a target="_blank" class="exportToFormat" methodToCall="{$method}" format="XML" filter_limit="100">XML</a> |
- <a target="_blank" class="exportToFormat" methodToCall="{$method}" format="JSON" filter_limit="100">Json</a> |
- <a target="_blank" class="exportToFormat" methodToCall="{$method}" format="PHP" filter_limit="100">Php</a>
- </span>
- <a class="viewDataTable" format="table"><img width="16" height="16" src="themes/default/images/table.png" title="{'General_Table'|translate}" /></a>
- <a class="viewDataTable" format="cloud"><img width="16" height="16" src="themes/default/images/tagcloud.png" title="{'General_TagCloud'|translate}" /></a>
- <a class="viewDataTable" format="graphVerticalBar"><img width="16" height="16" src="themes/default/images/chart_bar.png" title="{'General_VBarGraph'|translate}" /></a>
- <a class="viewDataTable" format="graphPie"><img width="16" height="16" src="themes/default/images/chart_pie.png" title="{'General_Piechart'|translate}" /></a>
- </span>
- <span id="exportDataTableShow" style="display:none">
- <img src="plugins/Home/templates/images/more.png" />
- </span>
- </span>
-
- <span id="loadingDataTable"><img src="themes/default/images/loading-blue.gif" /> {'General_LoadingData'|translate}</span>
- </div>
-</div>
-
-<div class="dataTableSpacer" />
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 @@
-
-<script type="text/javascript" defer="defer">
-$(document).ready(function(){literal}{{/literal}
- dataTables['{$id}'] = new dataTable();
- dataTables['{$id}'].param = {literal}{{/literal}
- {foreach from=$javascriptVariablesToSet key=name item=value name=loop}
- {$name}: '{$value}'{if !$smarty.foreach.loop.last},{/if}
- {/foreach}
- {literal}};{/literal}
- dataTables['{$id}'].init('{$id}');
-{literal}}{/literal});
-</script>
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('&nbsp;<img src="plugins/Home/templates/images/more_period.gif" style="vertical-align:middle">');
- }
- }, 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 @@
-<div id="{$id}" class="{if $graphType=='evolution'}parentDivGraphEvolution{else}parentDivGraph{/if}">
-{$jsInvocationTag}
-
-{if $showFooter}
- <br/><br/>
- <form class="formEmbedCode" id="{$formId}">
- Embed <input name="embed_code" value="{$codeEmbed}" onclick="javascript:document.getElementById('{$formId}').embed_code.focus();document.getElementById('{$formId}').embed_code.select();" readonly="true" type="text">
-
- | <a target="_blank" href="{$urlData}">{'General_GraphData'|translate}</a>
- </form>
-
- {include file="Home/templates/datatable_footer.tpl"}
- {include file="Home/templates/datatable_js.tpl"}
-{/if}
-
-</div>
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 @@
-
-<span id="righttext">
- <span id="messageToUsers"><a href='http://piwik.org'>Piwik</a> is a collaborative project and still Beta. <br />
- If you want to help, please <u><a href="mailto:hello@piwik.org?subject=Piwik">contact us</a></u>.</span>
-</span>
-
-{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
--- a/plugins/Home/templates/images/bg_header.jpg
+++ /dev/null
Binary files differ
diff --git a/plugins/Home/templates/images/bullet1.gif b/plugins/Home/templates/images/bullet1.gif
deleted file mode 100644
index d4ed73eea7..0000000000
--- a/plugins/Home/templates/images/bullet1.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/Home/templates/images/bullet2.gif b/plugins/Home/templates/images/bullet2.gif
deleted file mode 100644
index d51d938dd1..0000000000
--- a/plugins/Home/templates/images/bullet2.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/Home/templates/images/more.png b/plugins/Home/templates/images/more.png
deleted file mode 100644
index cba03a05f5..0000000000
--- a/plugins/Home/templates/images/more.png
+++ /dev/null
Binary files 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
--- a/plugins/Home/templates/images/more_date.gif
+++ /dev/null
Binary files 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
--- a/plugins/Home/templates/images/more_period.gif
+++ /dev/null
Binary files 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
--- a/plugins/Home/templates/images/reset_search.png
+++ /dev/null
Binary files differ
diff --git a/plugins/Home/templates/images/search.png b/plugins/Home/templates/images/search.png
deleted file mode 100644
index 6d1f037c69..0000000000
--- a/plugins/Home/templates/images/search.png
+++ /dev/null
Binary files 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 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<title>Piwik - Your Web Analytics Reports</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-{loadJavascriptTranslations modules='Home'}
-
-<script type="text/javascript">
-var period = "{$period}";
-var currentDateStr = "{$date}";
-var minDateYear = {$minDateYear};
-var minDateMonth = {$minDateMonth};
-var minDateDay = {$minDateDay};
-</script>
-
-<script type="text/javascript" src="libs/jquery/jquery.js"></script>
-
-<script type="text/javascript" src="themes/default/common.js"></script>
-<script type="text/javascript" src="libs/jquery/jquery.dimensions.js"></script>
-<script type="text/javascript" src="libs/jquery/tooltip/jquery.tooltip.js"></script>
-<script type="text/javascript" src="libs/jquery/truncate/jquery.truncate.js"></script>
-<script type="text/javascript" src="libs/jquery/jquery.scrollTo.js"></script>
-<script type="text/javascript" src="libs/jquery/jquery-calendar.js"></script>
-<script type="text/javascript" src="libs/swfobject/swfobject.js"></script>
-
-<script type="text/javascript" src="plugins/Home/templates/datatable.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/calendar.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/date.js"></script>
-
-<script type="text/javascript" src="libs/jquery/jquery.blockUI.js"></script>
-<script type="text/javascript" src="libs/jquery/ui.mouse.js"></script>
-<script type="text/javascript" src="libs/jquery/ui.sortable_modif.js"></script>
-
-<link rel="stylesheet" href="plugins/Home/templates/datatable.css" />
-<link rel="stylesheet" href="plugins/Dashboard/templates/dashboard.css" />
-<style type="text/css">@import url(libs/jquery/jquery-calendar.css);</style>
-
-<script type="text/javascript" src="libs/jquery/superfish_modified.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/menu.js"></script>
-<link rel="stylesheet" type="text/css" href="plugins/Home/templates/menu.css" media="screen" />
-<link rel="stylesheet" type="text/css" href="plugins/Home/templates/style.css" media="screen" />
-
-<script type="text/javascript" src="libs/jquery/thickbox.js"></script>
-<link rel="stylesheet" href="libs/jquery/thickbox.css" />
-</head>
-<body>
-
-{include file="Home/templates/top_bar.tpl"}
-
-<br clear="all" />
-
-<div id="header">
-{include file="Home/templates/header.tpl"}
-</div>
-
-<noscript>
-<span id="javascriptDisable">
-{'Home_JavascriptDisabled'|translate:'<a href="">':'</a>'}
-</span>
-</noscript>
-
-<br />
-{include file="Home/templates/menu.tpl"}
-
-<div style='clear:both'></div>
-
-<div id="loadingPiwik" {if $basicHtmlView}style="display:none"{/if}><img src="themes/default/images/loading-blue.gif" alt="" /> {'General_LoadingData'|translate}</div>
-<div id="loadingError">{'General_ErrorRequest'|translate}</div>
-
-<div id='content'>
-{if $content}{$content}{/if}
-</div>
-
-{include file="Home/templates/piwik_tag.tpl"}
-</body>
-</html>
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 @@
-<span id="logo">
-<a href="http://piwik.org" target="_blank" title="open source web analytics" style="text-decoration: none;">
- <span style="color: rgb(245, 223, 114);">P</span><span style="color: rgb(241, 175, 108);">i</span><span style="color: rgb(241, 117, 117);">w</span><span style="color: rgb(155, 106, 58);">i</span><span style="color: rgb(107, 50, 11);">k</span>
- <!--
- <span style="font-size: 20pt; letter-spacing: -1pt;">
- <span style="color: rgb(107, 50, 11);">#</span>
- <span style="color: rgb(107, 50, 11);"> Open</span>
- <span style="color: rgb(107, 50, 11);"> source </span>
- <span style="color: rgb(107, 50, 11);">web </span>
- <span style="color: rgb(107, 50, 11);">analytics</span>
- </span>
- -->
-</a>
-</span> \ 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 @@
-
-<ul class="nav">
-{foreach from=$menu key=level1 item=level2 name=menu}
-<li>
- <a name='{$level2._url|@urlRewriteWithParameters}' href='{$level2._url|@urlRewriteBasicView}'>{$level1} &#8595;</a>
- <ul>
- {foreach from=$level2 key=name item=urlParameters name=level2}
- {if $name != '_url'}
- <li><a name='{$urlParameters|@urlRewriteWithParameters}' href='{$urlParameters|@urlRewriteBasicView}'>{$name}</a></li>
- {/if}
- {/foreach}
- </ul>
-</li>
-{/foreach}
-</ul>
-
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 @@
-<span id="periodString">
- <span id="date"><img src='plugins/Home/templates/images/more_date.gif' style="vertical-align:middle" alt="" /> {$prettyDate}</span> -&nbsp;
- <span id="periods">
- <span id="currentPeriod">{$periodsNames.$period}</span>
- <span id="otherPeriods">
- {foreach from=$otherPeriods item=thisPeriod} | <a href='{url period=$thisPeriod}'>{$periodsNames.$thisPeriod}</a>{/foreach}
- </span>
- </span>
- <br/>
- <span id="calendar"></span>
-</span>
-<div style="clear:both"></div>
-
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}
-<!-- Piwik -->
-<a href="http://piwik.org" title="Web analytics" onclick="window.open(this.href);return(false);">
-<script language="javascript" src="piwik.js" type="text/javascript"></script>
-<script type="text/javascript">
-<!--
-piwik_action_name = '';
-piwik_idsite = 1;
-piwik_url = 'piwik.php';
-piwik_vars = { 'video_play':1, 'video_finished':0 };
-piwik_log(piwik_action_name, piwik_idsite, piwik_url, piwik_vars);
-//-->
-</script><object>
-<noscript><p>Web analytics <img src="piwik.php" style="border:0" alt="piwik"/></p>
-</noscript></object></a>
-<!-- /Piwik -->
-{/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
--- a/plugins/Home/templates/sites_select.tpl
+++ /dev/null
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 @@
-<div id="bar">
-<span class="bar-elem"><b>Your Dashboard</b></span>
-<span class="bar-elem"><a href='?module=AdminHome&amp;action=showInContext&amp;moduleToLoad=API&amp;actionToLoad=listAllAPI&amp;module=AdminHome&amp;action=showInContext'>API</a></span>
-<span class="bar-elem"><a href='?module=Widgetize'>Widgets</a></span>
-<span class="bar-elem"><a href='?module=Feedback&amp;action=index&amp;keepThis=true&amp;TB_iframe=true&amp;height=400&amp;width=400' title="Send us feedback" class="thickbox">Send us feedback</a></span>
-</div>
-
-
-<div align="right">
-<div id="user" align="right" width="100%" style="padding: 0pt 0pt 4px; font-size: 84%;">
-<nobr>
-<form action="{url idSite=null}" method="get" id="siteSelection">
-<small>
- <strong>{$userLogin}</strong>
- |
-<a href='?module=AdminHome'>Admin</a> |
-<span id="sitesSelection">Site <select name="idSite" onchange='javascript:this.form.submit()'>
- <optgroup label="Sites">
- {foreach from=$sites item=info}
- <option label="{$info.name}" value="{$info.idsite}" {if $idSite==$info.idsite} selected="selected"{/if}>{$info.name}</option>
- {/foreach}
- </optgroup>
-</select>
-{hiddenurl idSite=null}
-</span> | {if $userLogin=='anonymous'}<a href='?module=Login'>{'Login_LogIn'|translate}</a>{else}<a href='?module=Login&amp;action=logout'>{'Login_Logout'|translate}</a>{/if}
-</small>
-</form>
-</nobr>
-</div>
-</div>
-
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 @@
<?php
-
/**
* @package Piwik
*/
-class Piwik_Login_Auth extends Zend_Auth_Adapter_DbTable implements Piwik_Auth
+class Piwik_Login_Auth implements Piwik_Auth
{
- public function __construct()
- {
- $db = Zend_Registry::get('db');
- parent::__construct($db);
- }
-
+ protected $login = null;
+ protected $token_auth = null;
+
public function authenticate()
{
$rootLogin = Zend_Registry::get('config')->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 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id: Controller.php 169 2008-01-14 05:41:15Z matt $
- *
- * @package Piwik_ExamplePlugin
- */
-
-
-
-/**
- *
- * @package Piwik_ExamplePlugin
- */
-class Piwik_PluginsAdmin_Controller extends Piwik_Controller
-{
- function index()
- {
- Piwik::checkUserIsSuperUser();
-
- $listPlugins = Piwik_PluginsManager::getInstance()->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 @@
-<?php
-/**
- * Piwik - Open source web analytics
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
- * @version $Id: ExamplePlugin.php 169 2008-01-14 05:41:15Z matt $
- *
- * @package Piwik_PluginsAdmin
- */
-
-class Piwik_PluginsAdmin extends Piwik_Plugin
-{
- public function getInformation()
- {
- return array(
- // name must be the className prefix!
- 'name' => '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 @@
-<link rel="stylesheet" href="themes/default/common-admin.css">
-
-<h2>Plugins</h2>
-
-<table id="plugins">
-
-<thead>
- <th width="150px">Name</th>
- <th width="400px">Description</th>
- <th>Author</th>
- <th>Version</th>
- <th>Action</th>
-</thead>
-
-<tbody>
- {foreach from=$pluginsName key=name item=plugin}
-
-{if $plugin.activated}<tr class="activate">{else}<tr class="deactivate">{/if}
- <td><b>{$name}</b></td>
- <td>{$plugin.info.description}&nbsp;</td>
- <td class="center"><a href="{$plugin.info.homepage}">{$plugin.info.author}</a></td>
- <td>{$plugin.info.version}</td>
- <td class="switch">{if $plugin.alwaysActivated}<span title="{'PluginsAdmin_ActivatedHelp'|translate}">{'PluginsAdmin_Activated'|translate}</span>{elseif $plugin.activated}<a href=?module=PluginsAdmin&action=deactivate&pluginName={$name}>{'PluginsAdmin_Deactivate'|translate}</a>
-{else}<a href=?module=PluginsAdmin&action=activate&pluginName={$name}>{'PluginsAdmin_Activate'|translate}</a>{/if}</td>
- </tr>
-{/foreach}
-
-</tbody>
-</table>
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 @@
-<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/sparkline.js"></script>
<a name="evolutionGraph" graphId="{$nameGraphEvolutionReferers}"></a>
<h2>{'Referers_Evolution'|translate}</h2>
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( $('<img src="plugins/UsersManager/images/ok.png" class="updateSite">')
.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;
+}
</style>
{/literal}
-<h2>{'SitesManager_Sites'|translate}</h2>
+<h2>Websites Management</h2>
+<p>Your Web Analytics reports need Websites! Add, update, delete Websites, and show the Javascript to insert in your pages.</p>
+
<div id="ajaxError" style="display:none"></div>
<div id="ajaxLoading" style="display:none">{'General_LoadingData'|translate} <img src="themes/default/loading.gif" alt="" /></div>
{if $sites|@count == 0}
{'SitesManager_NoWebsites'|translate}
{else}
- <table id="editSites" border=1 cellpadding="10">
+ <table class="admin" id="editSites" border=1 cellpadding="10">
<thead>
<tr>
<th>{'SitesManager_Id'|translate}</th>
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"}
-<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/sparkline.js"></script>
<h2>{'UserCountry_Country'|translate}</h2>
{$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 = '<input id="'+idName+'" value="'+contentBefore+'" size="10">';
+ var contentAfter = '<input id="'+idName+'" value="'+contentBefore+'" size="25">';
$(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}
<h2>{'UsersManager_ManageAccess'|translate}</h2>
-
+<p>Decide which users have which Piwik access on your Websites. You can also set the permissions on all the Websites at once.</p>
<div id="sites">
<form method="post" action="{url actionToLoad=index}" id="accessSites">
<p>{'UsersManager_Sites'|translate}: <select id="selectIdsite" name="idsite" onchange="this.form.submit()">
@@ -47,7 +73,7 @@
</form>
</div>
-<table id="access">
+<table class="admin" id="access">
<thead>
<tr>
<th>{'UsersManager_User'|translate}</th>
@@ -79,11 +105,12 @@
<input id="no" type="button" value="{'General_No'|translate}"/>
</div>
-<h2>Manage users</h2>
-
+<br/>
+<h2>Users Management</h2>
+<p>Create new users or update the existing users. You can then set their permissions above.</p>
<div id="ajaxError" style="display:none"></div>
<div id="ajaxLoading" style="display:none">{'General_LoadingData'|translate} <img src="themes/default/loading.gif"></div>
-<table id="users">
+<table class="admin" id="users">
<thead>
<tr>
<th>{'UsersManager_Login'|translate}</th>
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"}
-<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/sparkline.js"></script>
<a name="evolutionGraph" graphId="VisitFrequencygetLastVisitsReturningGraph"></a>
<h2>{'VisitFrequency_Evolution'|translate}</h2>
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 @@
-<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script>
+<script type="text/javascript" src="plugins/CoreHome/templates/sparkline.js"></script>
<a name="evolutionGraph" graphId="VisitsSummarygetLastVisitsGraph"></a>
<h2>{'VisitsSummary_Evolution'|translate:$period}</h2>
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 @@
<html>
<body>
-{loadJavascriptTranslations modules='Home'}
+{loadJavascriptTranslations modules='CoreHome'}
<script type="text/javascript" src="libs/jquery/jquery.js"></script>
<script type="text/javascript" src="themes/default/common.js"></script>
@@ -11,8 +11,8 @@
<script type="text/javascript" src="libs/swfobject/swfobject.js"></script>
-<script type="text/javascript" src="plugins/Home/templates/datatable.js"></script>
-<link rel="stylesheet" href="plugins/Home/templates/datatable.css">
+<script type="text/javascript" src="plugins/CoreHome/templates/datatable.js"></script>
+<link rel="stylesheet" href="plugins/CoreHome/templates/datatable.css">
{$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 language="javascript" src="{$piwikUrl}libs/jquery/jquery.js"><\/scr'+'ipt>');
document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}themes/default/common.js"><\/scr'+'ipt>');
@@ -6,11 +6,11 @@ document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/jquery/jqu
document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/jquery/tooltip/jquery.tooltip.js"><\/scr'+'ipt>');
document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/jquery/truncate/jquery.truncate.js"><\/scr'+'ipt>');
document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/swfobject/swfobject.js"><\/scr'+'ipt>');
-document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}plugins/Home/templates/datatable.js"><\/scr'+'ipt>');
+document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}plugins/CoreHome/templates/datatable.js"><\/scr'+'ipt>');
document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/jquery/ui.mouse.js"><\/scr'+'ipt>');
-document.write('<link rel="stylesheet" href="{$piwikUrl}plugins/Home/templates/datatable.css">');
+document.write('<link rel="stylesheet" href="{$piwikUrl}plugins/CoreHome/templates/datatable.css">');
var content = '{$content|escape:'javascript'}';
document.write(content); \ No newline at end of file