[Piwik-svn] r257 - in trunk: modules plugins/Actions plugins/Dashboard plugins/Home plugins/Home/templates plugins/Provider plugins/Referers plugins/UserCountry plugins/UserSettings plugins/VisitFrequency plugins/VisitTime plugins/VisitorInterest plugins/VisitsSummary

svnmaster at piwik.org svnmaster at piwik.org
Fri Feb 1 05:17:23 CET 2008


Author: matt
Date: 2008-02-01 05:17:22 +0100 (Fri, 01 Feb 2008)
New Revision: 257

Added:
   trunk/plugins/Actions/Controller.php
   trunk/plugins/Referers/Controller.php
   trunk/plugins/Referers/index.tpl
   trunk/plugins/Referers/searchEngines_Keywords.tpl
   trunk/plugins/UserSettings/Controller.php
   trunk/plugins/UserSettings/index.tpl
   trunk/plugins/VisitFrequency/Controller.php
   trunk/plugins/VisitFrequency/index.tpl
   trunk/plugins/VisitTime/Controller.php
   trunk/plugins/VisitTime/index.tpl
   trunk/plugins/VisitorInterest/Controller.php
   trunk/plugins/VisitorInterest/index.tpl
Modified:
   trunk/modules/Controller.php
   trunk/plugins/Actions/Actions.php
   trunk/plugins/Dashboard/Controller.php
   trunk/plugins/Home/Controller.php
   trunk/plugins/Home/templates/index.tpl
   trunk/plugins/Home/templates/links_misc_modules.tpl
   trunk/plugins/Home/templates/menu.tpl
   trunk/plugins/Provider/Provider.php
   trunk/plugins/Referers/Referers.php
   trunk/plugins/UserCountry/UserCountry.php
   trunk/plugins/UserSettings/UserSettings.php
   trunk/plugins/VisitFrequency/VisitFrequency.php
   trunk/plugins/VisitTime/VisitTime.php
   trunk/plugins/VisitorInterest/VisitorInterest.php
   trunk/plugins/VisitsSummary/VisitsSummary.php
Log:
finished splitting HomeController in all the plugins controller

Modified: trunk/modules/Controller.php
===================================================================
--- trunk/modules/Controller.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/modules/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -17,7 +17,8 @@
 {
 	function __construct()
 	{
-	
+		$aPluginName = explode('_', get_class($this));
+		$this->pluginName = $aPluginName[1];
 		$this->strDate = Piwik_Common::getRequestVar('date', 'yesterday','string');
 		
 		// the date looks like YYYY-MM-DD we can build it

Modified: trunk/plugins/Actions/Actions.php
===================================================================
--- trunk/plugins/Actions/Actions.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Actions/Actions.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -293,3 +293,12 @@
 	}
 }
 
+
+Piwik_AddWidget( 'Actions', 'getDownloads', 'Downloads');
+Piwik_AddWidget( 'Actions', 'getOutlinks', 'Outlinks');
+Piwik_AddWidget( 'Actions', 'getActions', 'Pages');
+
+Piwik_AddMenu('Actions', 'Pages', array('module' => 'Actions', 'action' => 'getActions'));
+Piwik_AddMenu('Actions', 'Outlinks', array('module' => 'Actions', 'action' => 'getOutlinks'));
+Piwik_AddMenu('Actions', 'Downloads', array('module' => 'Actions', 'action' => 'getDownloads'));
+

Added: trunk/plugins/Actions/Controller.php
===================================================================
--- trunk/plugins/Actions/Controller.php	                        (rev 0)
+++ trunk/plugins/Actions/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,172 @@
+<?php
+
+require_once "ViewDataTable.php";
+class Piwik_Actions_Controller extends Piwik_Controller 
+{
+	function index()
+	{
+		$view = new Piwik_View('Actions/index.tpl');
+		
+		/* Actions / Downloads / Outlinks */
+		$view->dataTableActions = $this->getActions( true );
+		$view->dataTableDownloads = $this->getDownloads( true );
+		$view->dataTableOutlinks = $this->getOutlinks( true );
+		
+		echo $view->render();
+	}
+	
+		/*
+		 * 
+
+List of the public methods for the class Piwik_Actions_API
+- getActions : [idSite, period, date, expanded = , idSubtable = ]
+- getDownloads : [idSite, period, date, expanded = , idSubtable = ]
+- getOutlinks : [idSite, period, date, expanded = , idSubtable = ]
+
+		 */
+	protected function getActionsView($currentControllerName,
+						$currentMethod,
+						$methodToCall = 'Actions.getActions', 
+						$subMethod = 'getActionsSubDataTable')
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init(  	$currentControllerName,
+						$currentMethod, 
+						$methodToCall, 
+						$subMethod );
+		$view->setTemplate('Home/templates/datatable_actions.tpl');
+		
+		if(Piwik_Common::getRequestVar('idSubtable', -1) != -1)
+		{
+			$view->setTemplate('Home/templates/datatable_actions_subdatable.tpl');
+		}
+		$view->setSearchRecursive();
+		
+		$currentlySearching = $view->setRecursiveLoadDataTableIfSearchingForPattern();
+		if($currentlySearching)
+		{
+			$view->setTemplate('Home/templates/datatable_actions_recursive.tpl');
+		}
+		$view->disableSort();
+		
+		$view->setSortedColumn( 'nb_hits', 'desc' );
+		
+		$view->disableOffsetInformation();
+		
+		$view->setColumnsToDisplay( array(0,1,2) );
+		$view->setLimit( 100 );
+		
+		// computing minimum value to exclude
+		
+		$visitsInfo = Piwik_VisitsSummary_Controller::getVisitsSummary(); 
+		$nbActions = $visitsInfo->getColumn('nb_actions');
+		$nbActionsLowPopulationThreshold = floor(0.02 * $nbActions); // 2 percent of the total number of actions
+		$view->setExcludeLowPopulation( $nbActionsLowPopulationThreshold, 'nb_hits' );
+		
+		$view->main();
+		
+		// we need to rewrite the phpArray so it contains all the recursive arrays
+		if($currentlySearching)
+		{
+			$phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->dataTable);
+//			var_dump($phpArrayRecursive);exit;
+			$view->view->arrayDataTable = $phpArrayRecursive;
+		}
+//		var_dump( $view->view->arrayDataTable);exit;
+		return $view;
+	}
+	
+	protected function getArrayFromRecursiveDataTable( $dataTable, $depth = 0 )
+	{
+		$table = array();
+		foreach($dataTable->getRows() as $row)
+		{
+			$phpArray = array();
+			if(($idSubtable = $row->getIdSubDataTable()) !== null)
+			{
+				$subTable = Piwik_DataTable_Manager::getInstance()->getTable( $idSubtable );
+					
+				if($subTable->getRowsCount() > 0)
+				{
+//					$filter = new Piwik_DataTable_Filter_ReplaceColumnNames(
+//									$subTable,
+//									Piwik_Actions::getColumnsMap()
+//								);				
+					$phpArray = $this->getArrayFromRecursiveDataTable( $subTable, $depth + 1 );
+				}
+			}
+			
+			$label = $row->getColumn('label');
+			$newRow = array(
+				'level' => $depth,
+				'columns' => $row->getColumns(),
+				'details' => $row->getDetails(),
+				'idsubdatatable' => $row->getIdSubDataTable()
+				);
+			$table[] = $newRow;
+			if(count($phpArray) > 0)
+			{
+				$table = array_merge( $table,  $phpArray);
+			}
+		}
+		return $table;
+	}
+	
+	
+	function getDownloads($fetch = false)
+	{
+		$view = $this->getActionsView( 	$this->pluginName, 
+										__FUNCTION__,
+										'Actions.getDownloads', 
+										'getDownloadsSubDataTable' );
+		
+		return $this->renderView($view, $fetch);
+	}
+	function getDownloadsSubDataTable($fetch = false)
+	{
+		$view = $this->getActionsView( 	$this->pluginName, 
+										__FUNCTION__,
+										'Actions.getDownloads', 
+										'getDownloadsSubDataTable' );
+		
+		return $this->renderView($view, $fetch);
+	}
+	function getActions($fetch = false)
+	{
+		$view = $this->getActionsView(	$this->pluginName, 
+										__FUNCTION__,
+										'Actions.getActions', 
+										'getActionsSubDataTable' );
+		
+		return $this->renderView($view, $fetch);
+	}
+	function getActionsSubDataTable($fetch = false)
+	{
+		$view = $this->getActionsView( 	$this->pluginName, 
+										__FUNCTION__,
+										'Actions.getActions', 
+										'getActionsSubDataTable'  );
+		
+		return $this->renderView($view, $fetch);
+	}
+	function getOutlinks($fetch = false)
+	{
+		$view = $this->getActionsView(	$this->pluginName, 
+										__FUNCTION__,
+										'Actions.getOutlinks', 
+										'getOutlinksSubDataTable' );
+		
+		return $this->renderView($view, $fetch);
+	}
+	function getOutlinksSubDataTable($fetch = false)
+	{
+		$view = $this->getActionsView( 	$this->pluginName, 
+										__FUNCTION__,
+										'Actions.getOutlinks', 
+										'getOutlinksSubDataTable'  );
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	
+}

Modified: trunk/plugins/Dashboard/Controller.php
===================================================================
--- trunk/plugins/Dashboard/Controller.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Dashboard/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -23,7 +23,6 @@
 	function __construct()
 	{
 		parent::__construct();
-		$this->currentControllerName = 'Dashboard';
 		
 		//FIXME: copy paste of Home controller => should be refactored
 		//in a 'master' controller for statistics (tracs #91)

Modified: trunk/plugins/Home/Controller.php
===================================================================
--- trunk/plugins/Home/Controller.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Home/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -20,12 +20,6 @@
  */
 class Piwik_Home_Controller extends Piwik_Controller
 {
-	function __construct()
-	{
-		parent::__construct();
-		$this->currentControllerName = 'Home';
-
-	}
 	function getDefaultAction()
 	{
 		return 'redirectToIndex';
@@ -87,747 +81,11 @@
 		$view->minDateMonth = $minDate->toString('m');
 		$view->minDateDay = $minDate->toString('d');
 		
-		/* Actions / Downloads / Outlinks */
-		$view->dataTableActions = $this->getActions( true );
-		$view->dataTableDownloads = $this->getDownloads( true );
-		$view->dataTableOutlinks = $this->getOutlinks( true );
-		
 
-		
-		
-		/* User settings */		
-		$view->dataTablePlugin = $this->getPlugin( true );
-		$view->dataTableResolution = $this->getResolution( true );
-		$view->dataTableConfiguration = $this->getConfiguration( true );
-		$view->dataTableOS = $this->getOS( true );
-		$view->dataTableBrowser = $this->getBrowser( true );
-		$view->dataTableBrowserType = $this->getBrowserType ( true );
-		$view->dataTableWideScreen = $this->getWideScreen( true );
-		
-		/* VisitorTime */
-		$view->dataTableVisitInformationPerLocalTime = $this->getVisitInformationPerLocalTime(true);
-		$view->dataTableVisitInformationPerServerTime = $this->getVisitInformationPerServerTime(true);
-		
-		/* VisitFrequency */
-		//$view->graphEvolutionVisitFrequency = $this->getLastVisitsReturningGraph( true );
-		
-		$view->urlSparklineNbVisitsReturning 		= $this->getUrlSparkline( 'getLastVisitsReturningGraph');
-		$view->urlSparklineNbActionsReturning 		= $this->getUrlSparkline( 'getLastActionsReturningGraph');
-		$view->urlSparklineSumVisitLengthReturning 	= $this->getUrlSparkline( 'getLastSumVisitsLengthReturningGraph');
-		$view->urlSparklineMaxActionsReturning 		= $this->getUrlSparkline( 'getLastMaxActionsReturningGraph');
-		$view->urlSparklineBounceCountReturning 	= $this->getUrlSparkline( 'getLastBounceCountReturningGraph');
-		
-		$dataTableFrequency = $this->getSummary(true);
-		
-		$view->nbVisitsReturning = $dataTableFrequency->getColumn('nb_visits_returning');
-		$view->nbActionsReturning = $dataTableFrequency->getColumn('nb_actions_returning');
-		$view->maxActionsReturning = $dataTableFrequency->getColumn('max_actions_returning');
-		$view->sumVisitLengthReturning = $dataTableFrequency->getColumn('sum_visit_length_returning');
-		$view->bounceCountReturning = $dataTableFrequency->getColumn('bounce_count_returning');
-		
-		/* Visitor Interest */
-		$view->dataTableNumberOfVisitsPerVisitDuration = $this->getNumberOfVisitsPerVisitDuration(true);
-		$view->dataTableNumberOfVisitsPerPage = $this->getNumberOfVisitsPerPage(true);
-				
-		/* Referers */
-		//$view->graphEvolutionReferers = $this->getLastDistinctKeywordsGraph(true);
-			
-		$view->dataTableKeywords = $this->getKeywords(true);
-		$view->dataTableSearchEngines = $this->getSearchEngines(true);
-		$view->dataTableWebsites = $this->getWebsites(true);
-		$view->dataTablePartners = $this->getPartners(true);
-		$view->dataTableCampaigns = $this->getCampaigns(true);
-		
-		$view->numberDistinctSearchEngines 	= $this->getNumberOfDistinctSearchEngines(true);
-		$view->numberDistinctKeywords 		= $this->getNumberOfDistinctKeywords(true);
-		$view->numberDistinctWebsites 		= $this->getNumberOfDistinctWebsites(true);
-		$view->numberDistinctWebsitesUrls 	= $this->getNumberOfDistinctWebsitesUrls(true);
-		$view->numberDistinctPartners 		= $this->getNumberOfDistinctPartners(true);
-		$view->numberDistinctPartnersUrls 	= $this->getNumberOfDistinctPartnersUrls(true);
-		$view->numberDistinctCampaigns 		= $this->getNumberOfDistinctCampaigns(true);
-		
-		// building the referers summary report 
-		$view->dataTableRefererType = $this->getRefererType(true);
-		
-		
-		$nameValues = $this->getReferersVisitorsByType();
-		foreach($nameValues as $name => $value)
-		{
-			$view->$name = $value;
-		}
-		// sparkline for the historical data of the above values
-		$view->urlSparklineSearchEngines	= $this->getUrlSparkline('getLastSearchEnginesGraph');
-		$view->urlSparklineDirectEntry 		= $this->getUrlSparkline('getLastDirectEntryGraph');
-		$view->urlSparklineWebsites 		= $this->getUrlSparkline('getLastWebsitesGraph');
-		$view->urlSparklineCampaigns 		= $this->getUrlSparkline('getLastCampaignsGraph');
-		$view->urlSparklineNewsletters 		= $this->getUrlSparkline('getLastNewslettersGraph');
-		$view->urlSparklinePartners 		= $this->getUrlSparkline('getLastPartnersGraph');
-		
-		// sparklines for the evolution of the distinct keywords count/websites count/ etc
-		$view->urlSparklineDistinctSearchEngines 	= $this->getUrlSparkline('getLastDistinctSearchEnginesGraph');
-		$view->urlSparklineDistinctKeywords 		= $this->getUrlSparkline('getLastDistinctKeywordsGraph');
-		$view->urlSparklineDistinctWebsites 		= $this->getUrlSparkline('getLastDistinctWebsitesGraph');
-		$view->urlSparklineDistinctPartners 		= $this->getUrlSparkline('getLastDistinctPartnersGraph');
-		$view->urlSparklineDistinctCampaigns 		= $this->getUrlSparkline('getLastDistinctCampaignsGraph');
-		
+	
 		echo $view->render();		
 	}
 
 	
-		/*
-		 * 
 
-List of the public methods for the class Piwik_Actions_API
-- getActions : [idSite, period, date, expanded = , idSubtable = ]
-- getDownloads : [idSite, period, date, expanded = , idSubtable = ]
-- getOutlinks : [idSite, period, date, expanded = , idSubtable = ]
-
-		 */
-	protected function getActionsView($currentControllerName,
-						$currentMethod,
-						$methodToCall = 'Actions.getActions', 
-						$subMethod = 'getActionsSubDataTable')
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init(  	$currentControllerName,
-						$currentMethod, 
-						$methodToCall, 
-						$subMethod );
-		$view->setTemplate('Home/templates/datatable_actions.tpl');
-		
-		if(Piwik_Common::getRequestVar('idSubtable', -1) != -1)
-		{
-			$view->setTemplate('Home/templates/datatable_actions_subdatable.tpl');
-		}
-		$view->setSearchRecursive();
-		
-		$currentlySearching = $view->setRecursiveLoadDataTableIfSearchingForPattern();
-		if($currentlySearching)
-		{
-			$view->setTemplate('Home/templates/datatable_actions_recursive.tpl');
-		}
-		$view->disableSort();
-		
-		$view->setSortedColumn( 'nb_hits', 'desc' );
-		
-		$view->disableOffsetInformation();
-		
-		$view->setColumnsToDisplay( array(0,1,2) );
-		$view->setLimit( 100 );
-		
-		// computing minimum value to exclude
-		
-		$visitsInfo = Piwik_VisitsSummary_Controller::getVisitsSummary(); 
-		$nbActions = $visitsInfo->getColumn('nb_actions');
-		$nbActionsLowPopulationThreshold = floor(0.02 * $nbActions); // 2 percent of the total number of actions
-		$view->setExcludeLowPopulation( $nbActionsLowPopulationThreshold, 'nb_hits' );
-		
-		$view->main();
-		
-		// we need to rewrite the phpArray so it contains all the recursive arrays
-		if($currentlySearching)
-		{
-			$phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->dataTable);
-//			var_dump($phpArrayRecursive);exit;
-			$view->view->arrayDataTable = $phpArrayRecursive;
-		}
-//		var_dump( $view->view->arrayDataTable);exit;
-		return $view;
-	}
-	
-	protected function getArrayFromRecursiveDataTable( $dataTable, $depth = 0 )
-	{
-		$table = array();
-		foreach($dataTable->getRows() as $row)
-		{
-			$phpArray = array();
-			if(($idSubtable = $row->getIdSubDataTable()) !== null)
-			{
-				$subTable = Piwik_DataTable_Manager::getInstance()->getTable( $idSubtable );
-					
-				if($subTable->getRowsCount() > 0)
-				{
-//					$filter = new Piwik_DataTable_Filter_ReplaceColumnNames(
-//									$subTable,
-//									Piwik_Actions::getColumnsMap()
-//								);				
-					$phpArray = $this->getArrayFromRecursiveDataTable( $subTable, $depth + 1 );
-				}
-			}
-			
-			$label = $row->getColumn('label');
-			$newRow = array(
-				'level' => $depth,
-				'columns' => $row->getColumns(),
-				'details' => $row->getDetails(),
-				'idsubdatatable' => $row->getIdSubDataTable()
-				);
-			$table[] = $newRow;
-			if(count($phpArray) > 0)
-			{
-				$table = array_merge( $table,  $phpArray);
-			}
-		}
-		return $table;
-	}
-	
-	
-	function getDownloads($fetch = false)
-	{
-		$view = $this->getActionsView( 	$this->currentControllerName, 
-										__FUNCTION__,
-										'Actions.getDownloads', 
-										'getDownloadsSubDataTable' );
-		
-		return $this->renderView($view, $fetch);
-	}
-	function getDownloadsSubDataTable($fetch = false)
-	{
-		$view = $this->getActionsView( 	$this->currentControllerName, 
-										__FUNCTION__,
-										'Actions.getDownloads', 
-										'getDownloadsSubDataTable' );
-		
-		return $this->renderView($view, $fetch);
-	}
-	function getActions($fetch = false)
-	{
-		$view = $this->getActionsView(	$this->currentControllerName, 
-										__FUNCTION__,
-										'Actions.getActions', 
-										'getActionsSubDataTable' );
-		
-		return $this->renderView($view, $fetch);
-	}
-	function getActionsSubDataTable($fetch = false)
-	{
-		$view = $this->getActionsView( 	$this->currentControllerName, 
-										__FUNCTION__,
-										'Actions.getActions', 
-										'getActionsSubDataTable'  );
-		
-		return $this->renderView($view, $fetch);
-	}
-	function getOutlinks($fetch = false)
-	{
-		$view = $this->getActionsView(	$this->currentControllerName, 
-										__FUNCTION__,
-										'Actions.getOutlinks', 
-										'getOutlinksSubDataTable' );
-		
-		return $this->renderView($view, $fetch);
-	}
-	function getOutlinksSubDataTable($fetch = false)
-	{
-		$view = $this->getActionsView( 	$this->currentControllerName, 
-										__FUNCTION__,
-										'Actions.getOutlinks', 
-										'getOutlinksSubDataTable'  );
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	/**
-	 * VisitFrequency
-	 */
-	function getSummary( )
-	{		
-		$requestString = 'method='."VisitFrequency.getSummary".'&format=original';
-		$request = new Piwik_API_Request($requestString);
-		return $request->process();
-	}
-	
-	function getLastVisitsReturningGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "VisitFrequency.getVisitsReturning");
-		return $this->renderView($view, $fetch);
-	}
-		
-	function getLastActionsReturningGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "VisitFrequency.getActionsReturning");
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getLastSumVisitsLengthReturningGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "VisitFrequency.getSumVisitsLengthReturning");
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getLastMaxActionsReturningGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "VisitFrequency.getMaxActionsReturning");
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getLastBounceCountReturningGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "VisitFrequency.getBounceCountReturning");
-		return $this->renderView($view, $fetch);
-	}
-	
-	
-	/**
-	 * VisitTime
-	 */
-	function getVisitInformationPerServerTime( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory(null, 'graphVerticalBar');
-		$view->init( $this->currentControllerName,  __FUNCTION__, 
-								"VisitTime.getVisitInformationPerServerTime" );
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		$view->setSortedColumn( 0, 'asc' );
-		$view->setLimit( 24 );
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->disableOffsetInformation();
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getVisitInformationPerLocalTime( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory(null, 'graphVerticalBar');
-		$view->init( $this->currentControllerName,  __FUNCTION__, 
-								"VisitTime.getVisitInformationPerLocalTime" );
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		$view->setSortedColumn( 0, 'asc' );
-		$view->setLimit( 24 );
-		$view->setGraphLimit( 24 );
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->disableOffsetInformation();
-		
-		return $this->renderView($view, $fetch);
-	}
-	/**
-	 * VisitorInterest
-	 */
-	function getNumberOfVisitsPerVisitDuration( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory( null, 'cloud' );
-		$view->init( $this->currentControllerName,  __FUNCTION__, 
-									"VisitorInterest.getNumberOfVisitsPerVisitDuration" );
-		
-		$view->setColumnsToDisplay( array(0,1) );
-		$view->disableSort();
-		$view->disableExcludeLowPopulation();
-		$view->disableOffsetInformation();
-		$view->disableSearchBox();
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getNumberOfVisitsPerPage( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  __FUNCTION__, 
-									"VisitorInterest.getNumberOfVisitsPerPage" );
-		
-		$view->setColumnsToDisplay( array(0,1) );
-		$view->setSortedColumn( 'nb_visits' );
-		$view->disableExcludeLowPopulation();
-		$view->disableOffsetInformation();
-		$view->disableSearchBox();
-		$view->disableSort();
-		$view->main();
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	/**
-	 * User settings
-	 */
-	function getStandardDataTableUserSettings( $currentControllerAction, 
-												$APItoCall )
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  $currentControllerAction, $APItoCall );
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		$view->setSortedColumn( 1 );
-		$view->setLimit( 5 );
-		$view->setGraphLimit(5);
-		return $view;
-	}
-	
-	function getResolution( $fetch = false)
-	{
-		$view = $this->getStandardDataTableUserSettings(
-										__FUNCTION__, 
-										'UserSettings.getResolution'
-									);
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getConfiguration( $fetch = false)
-	{
-		$view =  $this->getStandardDataTableUserSettings(
-										__FUNCTION__, 
-										'UserSettings.getConfiguration'
-									);
-		$view->setLimit( 3 );
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getOS( $fetch = false)
-	{
-		$view =  $this->getStandardDataTableUserSettings(
-										__FUNCTION__, 
-										'UserSettings.getOS'
-									);
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getBrowser( $fetch = false)
-	{
-		$view =  $this->getStandardDataTableUserSettings(
-										__FUNCTION__, 
-										'UserSettings.getBrowser'
-									);
-		$view->setGraphLimit(7);
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getBrowserType ( $fetch = false)
-	{
-		$view =  $this->getStandardDataTableUserSettings(
-										__FUNCTION__, 
-										'UserSettings.getBrowserType'
-									);
-		$view->disableOffsetInformation();
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getWideScreen( $fetch = false)
-	{
-		$view =  $this->getStandardDataTableUserSettings(
-										__FUNCTION__, 
-										'UserSettings.getWideScreen'
-									);
-		$view->disableOffsetInformation();
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getPlugin( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  __FUNCTION__, 'UserSettings.getPlugin' );
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->disableSort();
-		$view->disableOffsetInformation();
-		
-		$view->setColumnsToDisplay( array(0,1) );
-		$view->setSortedColumn( 2 );
-		$view->setLimit( 10 );
-		
-		return $this->renderView($view, $fetch);
-	}
-
-
-
-	/**
-	 * Referers
-	 */
-	function getRefererType( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory(null, 'cloud');
-		$view->init( $this->currentControllerName,  	
-									'getRefererType', 
-									'Referers.getRefererType'
-								);
-		$view->disableSearchBox();
-		$view->disableOffsetInformation();
-		$view->disableExcludeLowPopulation();
-		$view->doNotShowFooter();
-		
-		$view->setColumnsToDisplay( array(0,1,2) );
-		
-		return $this->renderView($view, $fetch);
-	}
-
-	function getKeywords( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		
-		$view->init( $this->currentControllerName, 	'getKeywords', 
-											'Referers.getKeywords', 
-											'getSearchEnginesFromKeywordId'
-								);
-		$view->disableExcludeLowPopulation();
-		$view->setColumnsToDisplay( array(0,2));
-
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getSearchEnginesFromKeywordId( $fetch = false )
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName, 	'getSearchEnginesFromKeywordId', 
-											'Referers.getSearchEnginesFromKeywordId'
-								);
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setColumnsToDisplay( array(0,2));
-
-		return $this->renderView($view, $fetch);
-	}
-	
-	
-	function getSearchEngines( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  	'getSearchEngines', 
-											'Referers.getSearchEngines', 
-											'getKeywordsFromSearchEngineId'
-								);
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	
-	function getKeywordsFromSearchEngineId( $fetch = false )
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName, 	'getKeywordsFromSearchEngineId', 
-											'Referers.getKeywordsFromSearchEngineId'
-								);
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setColumnsToDisplay( array(0,2));
-
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getWebsites( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  	'getWebsites', 
-											'Referers.getWebsites',
-											'getUrlsFromWebsiteId'
-								);
-		$view->disableExcludeLowPopulation();
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		
-		$view->setLimit(5);
-		$view->setGraphLimit(12);
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getCampaigns( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  	'getCampaigns', 
-											'Referers.getCampaigns',
-											'getKeywordsFromCampaignId'
-								);
-
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setLimit( 5 );
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getKeywordsFromCampaignId( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName, 	'getKeywordsFromCampaignId', 
-											'Referers.getKeywordsFromCampaignId'
-								);
-
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setColumnsToDisplay( array(0,2));
-
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getUrlsFromWebsiteId( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName, 	'getUrlsFromWebsiteId', 
-											'Referers.getUrlsFromWebsiteId'
-								);
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setColumnsToDisplay( array(0,2));
-
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getPartners( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName,  	'getPartners', 
-											'Referers.getPartners',
-											'getUrlsFromPartnerId'
-								);
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setLimit( 5 );
-		
-		$view->setColumnsToDisplay( array(0,2) );
-		
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getUrlsFromPartnerId( $fetch = false)
-	{
-		$view = Piwik_ViewDataTable::factory();
-		$view->init( $this->currentControllerName, 	'getUrlsFromPartnerId', 
-											'Referers.getUrlsFromPartnerId'
-								);
-		$view->disableSearchBox();
-		$view->disableExcludeLowPopulation();
-		$view->setColumnsToDisplay( array(0,2));
-
-		return $this->renderView($view, $fetch);
-	}
-	
-	
-	function getReferersType()
-	{
-		// we disable the queued filters because here we want to get the visits coming from search engines
-		// if the filters were applied we would have to look up for a label looking like "Search Engines" 
-		// which is not good when we have translations
-		$requestString = 'method='."Referers.getRefererType".'&format=original'.'&disable_queued_filters=1';
-		$request = new Piwik_API_Request($requestString);
-		return $request->process();
-	}
-	
-	protected function getReferersVisitorsByType()
-	{
-		// this is raw data (no filters applied, on purpose) so we select the data using the magic integers ID 
-		$dataTableReferersType = $this->getReferersType(true);
-		
-		$nameToColumnId = array(
-			'visitorsFromSearchEngines' => Piwik_Common::REFERER_TYPE_SEARCH_ENGINE,
-			'visitorsFromDirectEntry' =>  Piwik_Common::REFERER_TYPE_DIRECT_ENTRY,
-			'visitorsFromWebsites'  => Piwik_Common::REFERER_TYPE_WEBSITE,
-			'visitorsFromCampaigns' =>  Piwik_Common::REFERER_TYPE_CAMPAIGN,
-			'visitorsFromNewsletters' =>  Piwik_Common::REFERER_TYPE_NEWSLETTER,
-			'visitorsFromPartners' =>  Piwik_Common::REFERER_TYPE_PARTNER,
-		);
-		$return = array();
-		foreach($nameToColumnId as $nameVar => $columnId)
-		{
-			$value = 0;
-			$row = $dataTableReferersType->getRowFromLabel($columnId);
-			if($row !== false)
-			{
-				$value = $row->getColumn(Piwik_Archive::INDEX_NB_UNIQ_VISITORS);
-			}
-			$return[$nameVar] = $value;
-		}
-		
-		return $return;
-	}
-	function getLastSearchEnginesGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, 'Referers.getRefererType');
-		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_SEARCH_ENGINE, 'label');
-		return $this->renderView($view, $fetch);
-	}
-	function getLastDirectEntryGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, 'Referers.getRefererType');
-		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_DIRECT_ENTRY, 'label');
-		return $this->renderView($view, $fetch);
-	}
-	function getLastWebsitesGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, 'Referers.getRefererType');
-		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_WEBSITE, 'label');
-		return $this->renderView($view, $fetch);
-	}
-	function getLastCampaignsGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, 'Referers.getRefererType');
-		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_CAMPAIGN, 'label');
-		return $this->renderView($view, $fetch);
-	}
-	function getLastNewslettersGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, 'Referers.getRefererType');
-		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_NEWSLETTER, 'label');
-		return $this->renderView($view, $fetch);
-	}
-	function getLastPartnersGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, 'Referers.getRefererType');
-		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_PARTNER, 'label');
-		return $this->renderView($view, $fetch);
-	}
-	
-	function getLastDistinctSearchEnginesGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "Referers.getNumberOfDistinctSearchEngines");
-		return $this->renderView($view, $fetch);
-	}
-	function getLastDistinctKeywordsGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "Referers.getNumberOfDistinctKeywords");
-		return $this->renderView($view, $fetch);
-	}
-	function getLastDistinctWebsitesGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "Referers.getNumberOfDistinctWebsites");
-		return $this->renderView($view, $fetch);
-	}
-	function getLastDistinctPartnersGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "Referers.getNumberOfDistinctPartners");
-		return $this->renderView($view, $fetch);
-	}
-	function getLastDistinctCampaignsGraph( $fetch = false )
-	{
-		$view = $this->getLastUnitGraph(__FUNCTION__, "Referers.getNumberOfDistinctCampaigns");
-		return $this->renderView($view, $fetch);
-	}
-
-	function getNumberOfDistinctSearchEngines( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-
-	function getNumberOfDistinctKeywords( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-	function getNumberOfDistinctCampaigns( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-	function getNumberOfDistinctWebsites( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-	function getNumberOfDistinctWebsitesUrls( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-	function getNumberOfDistinctPartners( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-	function getNumberOfDistinctPartnersUrls ( $fetch = false)
-	{
-		return $this->getNumericValue('Referers.' . __FUNCTION__);
-	}
-	
 }
\ No newline at end of file

Modified: trunk/plugins/Home/templates/index.tpl
===================================================================
--- trunk/plugins/Home/templates/index.tpl	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Home/templates/index.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -270,127 +270,16 @@
 
 <span id="loadingPiwik"><img src="themes/default/images/loading-blue.gif"> Loading data...</span>
 
-{include file="Home/templates/menu.tpl"}
+{include file="Home/templates/period_select.tpl"}
 
 <br><br>
+{include file="Home/templates/menu.tpl"}
+
 <div style='clear:both'></div>
-{include file="Home/templates/period_select.tpl"}
 
 <div id='content'>
 
 </div>
 
-{php}exit;{/php}
 {* useful when working on the UI, the page generation is faster to skip other reports...
-{php}exit;{/php}*}
-
-<div class="section" id="Referers">
-
-	<a name="evolutionGraph" graphId="getLastDistinctKeywordsGraph"></a>
-	<h3>Evolution over the period</h3>
-	{$graphEvolutionReferers}
-	
-	<h3>Referer Type</h3>
-	<table>
-		<tr><td>
-			<p><img class="sparkline" src="{$urlSparklineDirectEntry}" /> <span><strong>{$visitorsFromDirectEntry} </strong> direct entries</span></p>
-			<p><img class="sparkline" src="{$urlSparklineSearchEngines}" /> <span><strong>{$visitorsFromSearchEngines} </strong>  from search engines</span></p>
-			<p><img class="sparkline" src="{$urlSparklinePartners}" /> <span><strong>{$visitorsFromPartners} </strong> from partners</span></p>
-		</td><td>
-			<p><img class="sparkline" src="{$urlSparklineWebsites}" /> <span><strong>{$visitorsFromWebsites} </strong> from websites</span></p>
-			<p><img class="sparkline" src="{$urlSparklineNewsletters}" /> <span><strong>{$visitorsFromNewsletters} </strong>  from newsletters</span></p>
-			<p><img class="sparkline" src="{$urlSparklineCampaigns}" /> <span><strong>{$visitorsFromCampaigns} </strong>  from campaigns</span></p>
-		</td></tr>
-	</table>
-	
-	<h3>Search Engines</h3>
-	{$dataTableSearchEngines}
-	
-	<h3>Keywords</h3>
-	{$dataTableKeywords}
-	
-	<h3>Websites</h3>
-	{$dataTableWebsites}
-	
-	<h3>Partners</h3>
-	{$dataTablePartners}
-	
-	<h3>Campaigns</h3>
-	{$dataTableCampaigns}
-	
-	
-	<h3>Other</h3>
-	<table>
-		<tr><td>
-			<p><img class="sparkline" src="{$urlSparklineDistinctSearchEngines}" /> <span><strong>{$numberDistinctSearchEngines} </strong>  distinct search engines</span></p>
-			<p><img class="sparkline" src="{$urlSparklineDistinctKeywords}" /> <span><strong>{$numberDistinctKeywords} </strong> distinct keywords</span></p>
-		</td><td>
-			<p><img class="sparkline" src="{$urlSparklineDistinctWebsites}" /> <span><strong>{$numberDistinctWebsites} </strong>  distinct websites (using <strong>{$numberDistinctWebsitesUrls}</strong> distinct urls)</span></p>
-			<p><img class="sparkline" src="{$urlSparklineDistinctPartners}" /> <span><strong>{$numberDistinctPartners} </strong>   distinct partners (using <strong>{$numberDistinctPartnersUrls}</strong> distinct urls)</span></p>
-			<p><img class="sparkline" src="{$urlSparklineDistinctCampaigns}" /> <span><strong>{$numberDistinctCampaigns} </strong>  distinct campaigns</span></p>
-			</td></tr>
-	</table>
-	
-	<p>Tag cloud output</p>
-	{$dataTableRefererType}
-</div>
-<div class="section" id="Actions">
-	<h3>Actions</h3>
-	{$dataTableActions} 
-	<h3>Downloads</h3>
-	{$dataTableDownloads} 
-	<h3>Outlinks</h3>
-	{$dataTableOutlinks}
-</div>
-
-<div class="section" id="User_Settings">
-	<h3>Configurations</h3>
-	{$dataTableConfiguration}
-	
-	<h3>Resolutions</h3>
-	{$dataTableResolution}
-	
-	<h3>Operating systems</h3>
-	{$dataTableOS}
-	
-	<h3>Browsers</h3>
-	{$dataTableBrowser}
-	
-	<h3>Browser families</h3>
-	{$dataTableBrowserType}
-	
-	<h3>Wide Screen</h3>
-	{$dataTableWideScreen}
-	
-	<h3>Plugins</h3>
-	{$dataTablePlugin}
-</div>
-
-
-<div class="section" id="Frequency">
-
-	<a name="evolutionGraph" graphId="getLastVisitsReturningGraph"></a>
-	<h3>Evolution over the period</h3>
-	{$graphEvolutionVisitFrequency}
-
-	<p><img class="sparkline" src="{$urlSparklineNbVisitsReturning}" /> <span><strong>{$nbVisitsReturning} </strong> returning visits</span></p>
-	<p><img class="sparkline" src="{$urlSparklineNbActionsReturning}" /> <span><strong>{$nbActionsReturning} </strong> actions by the returning visits</span></p>
-	<p><img class="sparkline" src="{$urlSparklineMaxActionsReturning}" /> <span><strong>{$maxActionsReturning} </strong> maximum actions by a returning visit</span></p>
-	<p><img class="sparkline" src="{$urlSparklineSumVisitLengthReturning}" /> <span><strong>{$sumVisitLengthReturning|sumtime} </strong> total time spent by returning visits</span></p>
-	<p><img class="sparkline" src="{$urlSparklineBounceCountReturning}" /> <span><strong>{$bounceCountReturning} </strong> times that a returning visit has bounced (left the site after one page) </span></p>
-</div>
-
-<div class="section" id="Visit_Time">
-	<h3>Visit per local time</h3>
-	{$dataTableVisitInformationPerLocalTime}
-	<h3>Visit per server time</h3>
-	{$dataTableVisitInformationPerServerTime}
-</div>
-
-<div class="section" id="Visitor_Interest">
-	<h3>Visits per visit duration</h3>
-	{$dataTableNumberOfVisitsPerVisitDuration}
-	<h3>Visits per number of pages</h3>
-	{$dataTableNumberOfVisitsPerPage}
-</div>
-
+{php}exit;{/php}*}

Modified: trunk/plugins/Home/templates/links_misc_modules.tpl
===================================================================
--- trunk/plugins/Home/templates/links_misc_modules.tpl	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Home/templates/links_misc_modules.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -5,6 +5,7 @@
 		<a href='?module=API&action=listAllAPI'>API examples</a></li>
 		<li>View examples of how to embed graphs/tables as widgets
 		<br><a href='?module=Widgetize'>Widgetize!</a></li>
+		<li><a href='?module=PluginsAdmin'>Admin plugins</a></li>
 		<li><a href='?module=SitesManager'>Admin websites</a></li>
 		<li><a href='?module=UsersManager'>Admin users</a></li>
 		<li><a href='?module=SitesManager&action=displayJavascriptCode&idsite={$idSite}'>Show the javascript code to insert</a></li>

Modified: trunk/plugins/Home/templates/menu.tpl
===================================================================
--- trunk/plugins/Home/templates/menu.tpl	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Home/templates/menu.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -2,7 +2,7 @@
 <ul class="nav">
 {foreach from=$menu key=level1 item=level2}
 <li>
-	<a href=''>{$level1} &#8595;</a>
+	<a href='#'>{$level1} &#8595;</a>
 	<ul>
 	{foreach from=$level2 key=name item=urlParameters}
 		<li><a href='{$urlParameters|@urlRewriteWithParameters}'>{$name}</a></li>

Modified: trunk/plugins/Provider/Provider.php
===================================================================
--- trunk/plugins/Provider/Provider.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Provider/Provider.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -219,4 +219,4 @@
 
 Piwik_AddWidget( 'Provider', 'getProvider', 'Providers');
 
-Piwik_AddMenu('User Country', 'Provider', array('module' => 'Provider', 'action'=> 'getProvider'));
+Piwik_AddMenu('Visitors', 'Provider', array('module' => 'Provider', 'action'=> 'getProvider'));

Added: trunk/plugins/Referers/Controller.php
===================================================================
--- trunk/plugins/Referers/Controller.php	                        (rev 0)
+++ trunk/plugins/Referers/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,352 @@
+<?php
+require_once "ViewDataTable.php";
+
+class Piwik_Referers_Controller extends Piwik_Controller 
+{
+	function index()
+	{
+		$view = new Piwik_View('Referers/index.tpl');
+		
+		$view->graphEvolutionReferers = $this->getLastDistinctKeywordsGraph(true);
+		
+		$view->numberDistinctSearchEngines 	= $this->getNumberOfDistinctSearchEngines(true);
+		$view->numberDistinctKeywords 		= $this->getNumberOfDistinctKeywords(true);
+		$view->numberDistinctWebsites 		= $this->getNumberOfDistinctWebsites(true);
+		$view->numberDistinctWebsitesUrls 	= $this->getNumberOfDistinctWebsitesUrls(true);
+		$view->numberDistinctPartners 		= $this->getNumberOfDistinctPartners(true);
+		$view->numberDistinctPartnersUrls 	= $this->getNumberOfDistinctPartnersUrls(true);
+		$view->numberDistinctCampaigns 		= $this->getNumberOfDistinctCampaigns(true);
+		
+		// building the referers summary report 
+		$view->dataTableRefererType = $this->getRefererType(true);
+		
+		
+		$nameValues = $this->getReferersVisitorsByType();
+		foreach($nameValues as $name => $value)
+		{
+			$view->$name = $value;
+		}
+		// sparkline for the historical data of the above values
+		$view->urlSparklineSearchEngines	= $this->getUrlSparkline('getLastSearchEnginesGraph');
+		$view->urlSparklineDirectEntry 		= $this->getUrlSparkline('getLastDirectEntryGraph');
+		$view->urlSparklineWebsites 		= $this->getUrlSparkline('getLastWebsitesGraph');
+		$view->urlSparklineCampaigns 		= $this->getUrlSparkline('getLastCampaignsGraph');
+		$view->urlSparklineNewsletters 		= $this->getUrlSparkline('getLastNewslettersGraph');
+		$view->urlSparklinePartners 		= $this->getUrlSparkline('getLastPartnersGraph');
+		
+		// sparklines for the evolution of the distinct keywords count/websites count/ etc
+		$view->urlSparklineDistinctSearchEngines 	= $this->getUrlSparkline('getLastDistinctSearchEnginesGraph');
+		$view->urlSparklineDistinctKeywords 		= $this->getUrlSparkline('getLastDistinctKeywordsGraph');
+		$view->urlSparklineDistinctWebsites 		= $this->getUrlSparkline('getLastDistinctWebsitesGraph');
+		$view->urlSparklineDistinctPartners 		= $this->getUrlSparkline('getLastDistinctPartnersGraph');
+		$view->urlSparklineDistinctCampaigns 		= $this->getUrlSparkline('getLastDistinctCampaignsGraph');
+		
+		echo $view->render();
+	}
+	
+	function getSearchEnginesAndKeywords()
+	{
+		$view = new Piwik_View('Referers/searchEngines_Keywords.tpl');
+		$view->searchEngines = $this->getSearchEngines(true) ;
+		$view->keywords = $this->getKeywords(true);
+		echo $view->render();
+	}
+	/**
+	 * Referers
+	 */
+	function getRefererType( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory(null, 'cloud');
+		$view->init( $this->pluginName,  	
+									'getRefererType', 
+									'Referers.getRefererType'
+								);
+		$view->disableSearchBox();
+		$view->disableOffsetInformation();
+		$view->disableExcludeLowPopulation();
+		$view->doNotShowFooter();
+		
+		$view->setColumnsToDisplay( array(0,1,2) );
+		
+		return $this->renderView($view, $fetch);
+	}
+
+	function getKeywords( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		
+		$view->init( $this->pluginName, 	'getKeywords', 
+											'Referers.getKeywords', 
+											'getSearchEnginesFromKeywordId'
+								);
+		$view->disableExcludeLowPopulation();
+		$view->setColumnsToDisplay( array(0,2));
+
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getSearchEnginesFromKeywordId( $fetch = false )
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName, 	'getSearchEnginesFromKeywordId', 
+											'Referers.getSearchEnginesFromKeywordId'
+								);
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setColumnsToDisplay( array(0,2));
+
+		return $this->renderView($view, $fetch);
+	}
+	
+	
+	function getSearchEngines( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  	'getSearchEngines', 
+											'Referers.getSearchEngines', 
+											'getKeywordsFromSearchEngineId'
+								);
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	
+	function getKeywordsFromSearchEngineId( $fetch = false )
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName, 	'getKeywordsFromSearchEngineId', 
+											'Referers.getKeywordsFromSearchEngineId'
+								);
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setColumnsToDisplay( array(0,2));
+
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getWebsites( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  	'getWebsites', 
+											'Referers.getWebsites',
+											'getUrlsFromWebsiteId'
+								);
+		$view->disableExcludeLowPopulation();
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		
+		$view->setLimit(5);
+		$view->setGraphLimit(12);
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getCampaigns( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  	'getCampaigns', 
+											'Referers.getCampaigns',
+											'getKeywordsFromCampaignId'
+								);
+
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setLimit( 5 );
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getKeywordsFromCampaignId( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName, 	'getKeywordsFromCampaignId', 
+											'Referers.getKeywordsFromCampaignId'
+								);
+
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setColumnsToDisplay( array(0,2));
+
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getUrlsFromWebsiteId( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName, 	'getUrlsFromWebsiteId', 
+											'Referers.getUrlsFromWebsiteId'
+								);
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setColumnsToDisplay( array(0,2));
+
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getPartners( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  	'getPartners', 
+											'Referers.getPartners',
+											'getUrlsFromPartnerId'
+								);
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setLimit( 5 );
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getUrlsFromPartnerId( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName, 	'getUrlsFromPartnerId', 
+											'Referers.getUrlsFromPartnerId'
+								);
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->setColumnsToDisplay( array(0,2));
+
+		return $this->renderView($view, $fetch);
+	}
+	
+	
+	function getReferersType()
+	{
+		// we disable the queued filters because here we want to get the visits coming from search engines
+		// if the filters were applied we would have to look up for a label looking like "Search Engines" 
+		// which is not good when we have translations
+		$requestString = 'method='."Referers.getRefererType".'&format=original'.'&disable_queued_filters=1';
+		$request = new Piwik_API_Request($requestString);
+		return $request->process();
+	}
+	
+	protected function getReferersVisitorsByType()
+	{
+		// this is raw data (no filters applied, on purpose) so we select the data using the magic integers ID 
+		$dataTableReferersType = $this->getReferersType(true);
+		
+		$nameToColumnId = array(
+			'visitorsFromSearchEngines' => Piwik_Common::REFERER_TYPE_SEARCH_ENGINE,
+			'visitorsFromDirectEntry' =>  Piwik_Common::REFERER_TYPE_DIRECT_ENTRY,
+			'visitorsFromWebsites'  => Piwik_Common::REFERER_TYPE_WEBSITE,
+			'visitorsFromCampaigns' =>  Piwik_Common::REFERER_TYPE_CAMPAIGN,
+			'visitorsFromNewsletters' =>  Piwik_Common::REFERER_TYPE_NEWSLETTER,
+			'visitorsFromPartners' =>  Piwik_Common::REFERER_TYPE_PARTNER,
+		);
+		$return = array();
+		foreach($nameToColumnId as $nameVar => $columnId)
+		{
+			$value = 0;
+			$row = $dataTableReferersType->getRowFromLabel($columnId);
+			if($row !== false)
+			{
+				$value = $row->getColumn(Piwik_Archive::INDEX_NB_UNIQ_VISITORS);
+			}
+			$return[$nameVar] = $value;
+		}
+		
+		return $return;
+	}
+	function getLastSearchEnginesGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, 'Referers.getRefererType');
+		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_SEARCH_ENGINE, 'label');
+		return $this->renderView($view, $fetch);
+	}
+	function getLastDirectEntryGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, 'Referers.getRefererType');
+		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_DIRECT_ENTRY, 'label');
+		return $this->renderView($view, $fetch);
+	}
+	function getLastWebsitesGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, 'Referers.getRefererType');
+		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_WEBSITE, 'label');
+		return $this->renderView($view, $fetch);
+	}
+	function getLastCampaignsGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, 'Referers.getRefererType');
+		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_CAMPAIGN, 'label');
+		return $this->renderView($view, $fetch);
+	}
+	function getLastNewslettersGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, 'Referers.getRefererType');
+		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_NEWSLETTER, 'label');
+		return $this->renderView($view, $fetch);
+	}
+	function getLastPartnersGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, 'Referers.getRefererType');
+		$view->setSearchPattern(Piwik_Common::REFERER_TYPE_PARTNER, 'label');
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getLastDistinctSearchEnginesGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, "Referers.getNumberOfDistinctSearchEngines");
+		return $this->renderView($view, $fetch);
+	}
+	function getLastDistinctKeywordsGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, "Referers.getNumberOfDistinctKeywords");
+		return $this->renderView($view, $fetch);
+	}
+	function getLastDistinctWebsitesGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, "Referers.getNumberOfDistinctWebsites");
+		return $this->renderView($view, $fetch);
+	}
+	function getLastDistinctPartnersGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, "Referers.getNumberOfDistinctPartners");
+		return $this->renderView($view, $fetch);
+	}
+	function getLastDistinctCampaignsGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName,__FUNCTION__, "Referers.getNumberOfDistinctCampaigns");
+		return $this->renderView($view, $fetch);
+	}
+
+	function getNumberOfDistinctSearchEngines( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+
+	function getNumberOfDistinctKeywords( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+	function getNumberOfDistinctCampaigns( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+	function getNumberOfDistinctWebsites( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+	function getNumberOfDistinctWebsitesUrls( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+	function getNumberOfDistinctPartners( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+	function getNumberOfDistinctPartnersUrls ( $fetch = false)
+	{
+		return $this->getNumericValue('Referers.' . __FUNCTION__);
+	}
+	
+}
\ No newline at end of file

Modified: trunk/plugins/Referers/Referers.php
===================================================================
--- trunk/plugins/Referers/Referers.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/Referers/Referers.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -313,4 +313,16 @@
 //		Piwik::printMemoryUsage("End of ".get_class($this)." "); 
 //		echo "after serialization = ". $timer;
 	}
-}
\ No newline at end of file
+}
+
+
+
+Piwik_AddWidget( 'Referers', 'getKeywords', 'Keywords');
+Piwik_AddWidget( 'Referers', 'getLastDistinctWebsitesGraph', 'Distinct websites graph');
+
+Piwik_AddMenu('Referers', 'Evolution', array('module' => 'Referers'));
+Piwik_AddMenu('Referers', 'Search engines & keywords', array('module' => 'Referers', 'action' => 'getSearchEnginesAndKeywords'));
+Piwik_AddMenu('Referers', 'Websites', array('module' => 'Referers', 'action' => 'getWebsites'));
+Piwik_AddMenu('Referers', 'Campaigns', array('module' => 'Referers', 'action' => 'getCampaigns'));
+Piwik_AddMenu('Referers', 'Partners', array('module' => 'Referers', 'action' => 'getPartners'));
+

Added: trunk/plugins/Referers/index.tpl
===================================================================
--- trunk/plugins/Referers/index.tpl	                        (rev 0)
+++ trunk/plugins/Referers/index.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,33 @@
+<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script>
+
+	<a name="evolutionGraph" graphId="getLastDistinctKeywordsGraph"></a>
+	<h3>Evolution over the period</h3>
+	{$graphEvolutionReferers}
+	
+	<h3>Referer Type</h3>
+	<table>
+		<tr><td>
+			<p><img class="sparkline" src="{$urlSparklineDirectEntry}" /> <span><strong>{$visitorsFromDirectEntry} </strong> direct entries</span></p>
+			<p><img class="sparkline" src="{$urlSparklineSearchEngines}" /> <span><strong>{$visitorsFromSearchEngines} </strong>  from search engines</span></p>
+			<p><img class="sparkline" src="{$urlSparklinePartners}" /> <span><strong>{$visitorsFromPartners} </strong> from partners</span></p>
+		</td><td>
+			<p><img class="sparkline" src="{$urlSparklineWebsites}" /> <span><strong>{$visitorsFromWebsites} </strong> from websites</span></p>
+			<p><img class="sparkline" src="{$urlSparklineNewsletters}" /> <span><strong>{$visitorsFromNewsletters} </strong>  from newsletters</span></p>
+			<p><img class="sparkline" src="{$urlSparklineCampaigns}" /> <span><strong>{$visitorsFromCampaigns} </strong>  from campaigns</span></p>
+		</td></tr>
+	</table>
+	
+	<h3>Other</h3>
+	<table>
+		<tr><td>
+			<p><img class="sparkline" src="{$urlSparklineDistinctSearchEngines}" /> <span><strong>{$numberDistinctSearchEngines} </strong>  distinct search engines</span></p>
+			<p><img class="sparkline" src="{$urlSparklineDistinctKeywords}" /> <span><strong>{$numberDistinctKeywords} </strong> distinct keywords</span></p>
+		</td><td>
+			<p><img class="sparkline" src="{$urlSparklineDistinctWebsites}" /> <span><strong>{$numberDistinctWebsites} </strong>  distinct websites (using <strong>{$numberDistinctWebsitesUrls}</strong> distinct urls)</span></p>
+			<p><img class="sparkline" src="{$urlSparklineDistinctPartners}" /> <span><strong>{$numberDistinctPartners} </strong>   distinct partners (using <strong>{$numberDistinctPartnersUrls}</strong> distinct urls)</span></p>
+			<p><img class="sparkline" src="{$urlSparklineDistinctCampaigns}" /> <span><strong>{$numberDistinctCampaigns} </strong>  distinct campaigns</span></p>
+			</td></tr>
+	</table>
+	
+	<p>Tag cloud output</p>
+	{$dataTableRefererType}
\ No newline at end of file

Added: trunk/plugins/Referers/searchEngines_Keywords.tpl
===================================================================
--- trunk/plugins/Referers/searchEngines_Keywords.tpl	                        (rev 0)
+++ trunk/plugins/Referers/searchEngines_Keywords.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,6 @@
+
+<h3>Search engines</h3>
+{$searchEngines}
+
+<h3>Keywords</h3>
+{$keywords}

Modified: trunk/plugins/UserCountry/UserCountry.php
===================================================================
--- trunk/plugins/UserCountry/UserCountry.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/UserCountry/UserCountry.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -158,5 +158,5 @@
 Piwik_AddWidget( 'UserCountry', 'getContinent', 'Visitor continents');
 Piwik_AddWidget( 'UserCountry', 'getCountry', 'Visitor countries');
 
-Piwik_AddMenu('User Country', 'Overview', array('module' => 'UserCountry'));
+Piwik_AddMenu('Visitors', 'Locations', array('module' => 'UserCountry'));
 

Added: trunk/plugins/UserSettings/Controller.php
===================================================================
--- trunk/plugins/UserSettings/Controller.php	                        (rev 0)
+++ trunk/plugins/UserSettings/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,114 @@
+<?php
+require_once "ViewDataTable.php";
+
+class Piwik_UserSettings_Controller extends Piwik_Controller 
+{
+	function index()
+	{
+		$view = new Piwik_View('UserSettings/index.tpl');
+		
+		/* User settings */		
+		$view->dataTablePlugin = $this->getPlugin( true );
+		$view->dataTableResolution = $this->getResolution( true );
+		$view->dataTableConfiguration = $this->getConfiguration( true );
+		$view->dataTableOS = $this->getOS( true );
+		$view->dataTableBrowser = $this->getBrowser( true );
+		$view->dataTableBrowserType = $this->getBrowserType ( true );
+		$view->dataTableWideScreen = $this->getWideScreen( true );
+		
+		echo $view->render();
+	}
+	
+
+	/**
+	 * User settings
+	 */
+	function getStandardDataTableUserSettings( $currentControllerAction, 
+												$APItoCall )
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  $currentControllerAction, $APItoCall );
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		$view->setSortedColumn( 1 );
+		$view->setLimit( 5 );
+		$view->setGraphLimit(5);
+		return $view;
+	}
+	
+	function getResolution( $fetch = false)
+	{
+		$view = $this->getStandardDataTableUserSettings(
+										__FUNCTION__, 
+										'UserSettings.getResolution'
+									);
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getConfiguration( $fetch = false)
+	{
+		$view =  $this->getStandardDataTableUserSettings(
+										__FUNCTION__, 
+										'UserSettings.getConfiguration'
+									);
+		$view->setLimit( 3 );
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getOS( $fetch = false)
+	{
+		$view =  $this->getStandardDataTableUserSettings(
+										__FUNCTION__, 
+										'UserSettings.getOS'
+									);
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getBrowser( $fetch = false)
+	{
+		$view =  $this->getStandardDataTableUserSettings(
+										__FUNCTION__, 
+										'UserSettings.getBrowser'
+									);
+		$view->setGraphLimit(7);
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getBrowserType ( $fetch = false)
+	{
+		$view =  $this->getStandardDataTableUserSettings(
+										__FUNCTION__, 
+										'UserSettings.getBrowserType'
+									);
+		$view->disableOffsetInformation();
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getWideScreen( $fetch = false)
+	{
+		$view =  $this->getStandardDataTableUserSettings(
+										__FUNCTION__, 
+										'UserSettings.getWideScreen'
+									);
+		$view->disableOffsetInformation();
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getPlugin( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  __FUNCTION__, 'UserSettings.getPlugin' );
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->disableSort();
+		$view->disableOffsetInformation();
+		
+		$view->setColumnsToDisplay( array(0,1) );
+		$view->setSortedColumn( 2 );
+		$view->setLimit( 10 );
+		
+		return $this->renderView($view, $fetch);
+	}
+}
\ No newline at end of file

Modified: trunk/plugins/UserSettings/UserSettings.php
===================================================================
--- trunk/plugins/UserSettings/UserSettings.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/UserSettings/UserSettings.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -218,3 +218,7 @@
 }
 
 
+Piwik_AddWidget( 'UserSettings', 'getResolution', 'Screen resolutions');
+Piwik_AddWidget( 'UserSettings', 'getBrowser', 'Visitor browsers');
+
+Piwik_AddMenu('Visitors', 'Settings', array('module' => 'UserSettings'));

Added: trunk/plugins/UserSettings/index.tpl
===================================================================
--- trunk/plugins/UserSettings/index.tpl	                        (rev 0)
+++ trunk/plugins/UserSettings/index.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,21 @@
+
+	<h3>Configurations</h3>
+	{$dataTableConfiguration}
+	
+	<h3>Resolutions</h3>
+	{$dataTableResolution}
+	
+	<h3>Operating systems</h3>
+	{$dataTableOS}
+	
+	<h3>Browsers</h3>
+	{$dataTableBrowser}
+	
+	<h3>Browser families</h3>
+	{$dataTableBrowserType}
+	
+	<h3>Wide Screen</h3>
+	{$dataTableWideScreen}
+	
+	<h3>Plugins</h3>
+	{$dataTablePlugin}
\ No newline at end of file

Added: trunk/plugins/VisitFrequency/Controller.php
===================================================================
--- trunk/plugins/VisitFrequency/Controller.php	                        (rev 0)
+++ trunk/plugins/VisitFrequency/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,70 @@
+<?php
+
+require_once "ViewDataTable.php";
+class Piwik_VisitFrequency_Controller extends Piwik_Controller 
+{
+	function index()
+	{
+		$view = new Piwik_View('VisitFrequency/index.tpl');
+		/* VisitFrequency */
+		$view->graphEvolutionVisitFrequency = $this->getLastVisitsReturningGraph( true );
+		
+		$view->urlSparklineNbVisitsReturning 		= $this->getUrlSparkline( 'getLastVisitsReturningGraph');
+		$view->urlSparklineNbActionsReturning 		= $this->getUrlSparkline( 'getLastActionsReturningGraph');
+		$view->urlSparklineSumVisitLengthReturning 	= $this->getUrlSparkline( 'getLastSumVisitsLengthReturningGraph');
+		$view->urlSparklineMaxActionsReturning 		= $this->getUrlSparkline( 'getLastMaxActionsReturningGraph');
+		$view->urlSparklineBounceCountReturning 	= $this->getUrlSparkline( 'getLastBounceCountReturningGraph');
+		
+		$dataTableFrequency = $this->getSummary(true);
+		
+		$view->nbVisitsReturning = $dataTableFrequency->getColumn('nb_visits_returning');
+		$view->nbActionsReturning = $dataTableFrequency->getColumn('nb_actions_returning');
+		$view->maxActionsReturning = $dataTableFrequency->getColumn('max_actions_returning');
+		$view->sumVisitLengthReturning = $dataTableFrequency->getColumn('sum_visit_length_returning');
+		$view->bounceCountReturning = $dataTableFrequency->getColumn('bounce_count_returning');
+		
+		echo $view->render();
+	}
+	
+	
+	/**
+	 * VisitFrequency
+	 */
+	function getSummary( )
+	{		
+		$requestString = 'method='."VisitFrequency.getSummary".'&format=original';
+		$request = new Piwik_API_Request($requestString);
+		return $request->process();
+	}
+	
+	function getLastVisitsReturningGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, "VisitFrequency.getVisitsReturning");
+		return $this->renderView($view, $fetch);
+	}
+		
+	function getLastActionsReturningGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, "VisitFrequency.getActionsReturning");
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getLastSumVisitsLengthReturningGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, "VisitFrequency.getSumVisitsLengthReturning");
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getLastMaxActionsReturningGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, "VisitFrequency.getMaxActionsReturning");
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getLastBounceCountReturningGraph( $fetch = false )
+	{
+		$view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, "VisitFrequency.getBounceCountReturning");
+		return $this->renderView($view, $fetch);
+	}
+	
+}

Modified: trunk/plugins/VisitFrequency/VisitFrequency.php
===================================================================
--- trunk/plugins/VisitFrequency/VisitFrequency.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/VisitFrequency/VisitFrequency.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -99,4 +99,17 @@
 		}
 		
 	}
-}
\ No newline at end of file
+}
+
+
+Piwik_AddWidget( 'VisitFrequency', 'getSummary', 'Visitor frequency');
+Piwik_AddWidget( 'VisitFrequency', 'getLastVisitsReturningGraph', 'Graph returning visits');
+Piwik_AddWidget( 'VisitFrequency', 'getLastActionsReturningGraph', 'Graph returning actions');
+Piwik_AddWidget( 'VisitFrequency', 'getLastSumVisitsLengthReturningGraph', 'Graph duration returning visits');
+Piwik_AddWidget( 'VisitFrequency', 'getLastMaxActionsReturningGraph', 'Graph max actions for returning visits');
+Piwik_AddWidget( 'VisitFrequency', 'getLastBounceCountReturningGraph', 'Graph boucing returning visits');
+
+Piwik_AddMenu('General', 'Frequency', array('module' => 'VisitFrequency'));
+
+
+

Added: trunk/plugins/VisitFrequency/index.tpl
===================================================================
--- trunk/plugins/VisitFrequency/index.tpl	                        (rev 0)
+++ trunk/plugins/VisitFrequency/index.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,11 @@
+<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script>
+
+	<a name="evolutionGraph" graphId="getLastVisitsReturningGraph"></a>
+	<h3>Evolution over the period</h3>
+	{$graphEvolutionVisitFrequency}
+
+	<p><img class="sparkline" src="{$urlSparklineNbVisitsReturning}" /> <span><strong>{$nbVisitsReturning} </strong> returning visits</span></p>
+	<p><img class="sparkline" src="{$urlSparklineNbActionsReturning}" /> <span><strong>{$nbActionsReturning} </strong> actions by the returning visits</span></p>
+	<p><img class="sparkline" src="{$urlSparklineMaxActionsReturning}" /> <span><strong>{$maxActionsReturning} </strong> maximum actions by a returning visit</span></p>
+	<p><img class="sparkline" src="{$urlSparklineSumVisitLengthReturning}" /> <span><strong>{$sumVisitLengthReturning|sumtime} </strong> total time spent by returning visits</span></p>
+	<p><img class="sparkline" src="{$urlSparklineBounceCountReturning}" /> <span><strong>{$bounceCountReturning} </strong> times that a returning visit has bounced (left the site after one page) </span></p>

Added: trunk/plugins/VisitTime/Controller.php
===================================================================
--- trunk/plugins/VisitTime/Controller.php	                        (rev 0)
+++ trunk/plugins/VisitTime/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,52 @@
+<?php
+
+require_once "ViewDataTable.php";
+class Piwik_VisitTime_Controller extends Piwik_Controller 
+{
+	function index()
+	{
+		$view = new Piwik_View('VisitTime/index.tpl');
+		
+		/* VisitorTime */
+		$view->dataTableVisitInformationPerLocalTime = $this->getVisitInformationPerLocalTime(true);
+		$view->dataTableVisitInformationPerServerTime = $this->getVisitInformationPerServerTime(true);
+		
+		echo $view->render();
+	}
+		
+	/**
+	 * VisitTime
+	 */
+	function getVisitInformationPerServerTime( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory(null, 'graphVerticalBar');
+		$view->init( $this->pluginName,  __FUNCTION__, 
+								"VisitTime.getVisitInformationPerServerTime" );
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		$view->setSortedColumn( 0, 'asc' );
+		$view->setLimit( 24 );
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->disableOffsetInformation();
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getVisitInformationPerLocalTime( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory(null, 'graphVerticalBar');
+		$view->init( $this->pluginName,  __FUNCTION__, 
+								"VisitTime.getVisitInformationPerLocalTime" );
+		
+		$view->setColumnsToDisplay( array(0,2) );
+		$view->setSortedColumn( 0, 'asc' );
+		$view->setLimit( 24 );
+		$view->setGraphLimit( 24 );
+		$view->disableSearchBox();
+		$view->disableExcludeLowPopulation();
+		$view->disableOffsetInformation();
+		
+		return $this->renderView($view, $fetch);
+	}
+}

Modified: trunk/plugins/VisitTime/VisitTime.php
===================================================================
--- trunk/plugins/VisitTime/VisitTime.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/VisitTime/VisitTime.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -95,4 +95,11 @@
 			}
 		}
 	}
-}
\ No newline at end of file
+}
+
+
+Piwik_AddWidget( 'VisitTime', 'getVisitInformationPerLocalTime', 'Visits by local time');
+Piwik_AddWidget( 'VisitTime', 'getVisitInformationPerServerTime', 'Visits by server time');
+
+Piwik_AddMenu('General', 'Time', array('module' => 'VisitTime'));
+

Added: trunk/plugins/VisitTime/index.tpl
===================================================================
--- trunk/plugins/VisitTime/index.tpl	                        (rev 0)
+++ trunk/plugins/VisitTime/index.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,5 @@
+
+	<h3>Visit per local time</h3>
+	{$dataTableVisitInformationPerLocalTime}
+	<h3>Visit per server time</h3>
+	{$dataTableVisitInformationPerServerTime}
\ No newline at end of file

Added: trunk/plugins/VisitorInterest/Controller.php
===================================================================
--- trunk/plugins/VisitorInterest/Controller.php	                        (rev 0)
+++ trunk/plugins/VisitorInterest/Controller.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,53 @@
+<?php
+
+require_once "ViewDataTable.php";
+class Piwik_VisitorInterest_Controller extends Piwik_Controller 
+{
+	function index()
+	{
+		$view = new Piwik_View('VisitorInterest/index.tpl');
+		
+		/* Visitor Interest */
+		$view->dataTableNumberOfVisitsPerVisitDuration = $this->getNumberOfVisitsPerVisitDuration(true);
+		$view->dataTableNumberOfVisitsPerPage = $this->getNumberOfVisitsPerPage(true);
+				
+		echo $view->render();
+	}
+	
+	/**
+	 * VisitorInterest
+	 */
+	function getNumberOfVisitsPerVisitDuration( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory( null, 'cloud' );
+		$view->init( $this->pluginName,  __FUNCTION__, 
+									"VisitorInterest.getNumberOfVisitsPerVisitDuration" );
+		
+		$view->setColumnsToDisplay( array(0,1) );
+		$view->disableSort();
+		$view->disableExcludeLowPopulation();
+		$view->disableOffsetInformation();
+		$view->disableSearchBox();
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	function getNumberOfVisitsPerPage( $fetch = false)
+	{
+		$view = Piwik_ViewDataTable::factory();
+		$view->init( $this->pluginName,  __FUNCTION__, 
+									"VisitorInterest.getNumberOfVisitsPerPage" );
+		
+		$view->setColumnsToDisplay( array(0,1) );
+		$view->setSortedColumn( 'nb_visits' );
+		$view->disableExcludeLowPopulation();
+		$view->disableOffsetInformation();
+		$view->disableSearchBox();
+		$view->disableSort();
+		$view->main();
+		
+		return $this->renderView($view, $fetch);
+	}
+	
+	
+}

Modified: trunk/plugins/VisitorInterest/VisitorInterest.php
===================================================================
--- trunk/plugins/VisitorInterest/VisitorInterest.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/VisitorInterest/VisitorInterest.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -159,4 +159,13 @@
 //		echo $table;
 		return $table;
 	}
-}
\ No newline at end of file
+}
+
+
+
+Piwik_AddWidget( 'VisitorInterest', 'getNumberOfVisitsPerVisitDuration', 'Visits lengths');
+Piwik_AddWidget( 'VisitorInterest', 'getNumberOfVisitsPerPage', 'Pages per visit');
+
+Piwik_AddMenu('General', 'Loyalty', array('module' => 'VisitorInterest'));
+
+

Added: trunk/plugins/VisitorInterest/index.tpl
===================================================================
--- trunk/plugins/VisitorInterest/index.tpl	                        (rev 0)
+++ trunk/plugins/VisitorInterest/index.tpl	2008-02-01 04:17:22 UTC (rev 257)
@@ -0,0 +1,5 @@
+
+	<h3>Visits per visit duration</h3>
+	{$dataTableNumberOfVisitsPerVisitDuration}
+	<h3>Visits per number of pages</h3>
+	{$dataTableNumberOfVisitsPerPage}
\ No newline at end of file

Modified: trunk/plugins/VisitsSummary/VisitsSummary.php
===================================================================
--- trunk/plugins/VisitsSummary/VisitsSummary.php	2008-02-01 02:48:48 UTC (rev 256)
+++ trunk/plugins/VisitsSummary/VisitsSummary.php	2008-02-01 04:17:22 UTC (rev 257)
@@ -122,4 +122,4 @@
 Piwik_AddWidget( 'VisitsSummary', 'getLastVisitsGraph', 'Last visits graph');
 Piwik_AddWidget( 'VisitsSummary', 'getLastUniqueVisitorsGraph', 'Last unique visitors graph');
 
-Piwik_AddMenu('Visits Summary', 'Overview', array('module' => 'VisitsSummary'));
\ No newline at end of file
+Piwik_AddMenu('General', 'Overview', array('module' => 'VisitsSummary'));
\ No newline at end of file



More information about the Piwik-svn mailing list