Files
YuCheng Hu 8784f4170d 添加 Piwik 到代码库中。
+YUCHENG HU+

git-svn-id: https://svn.code.sf.net/p/hawebs/svn@448 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
2010-07-10 02:21:32 +00:00

61 lines
1.9 KiB
PHP

<?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 2308 2010-06-16 13:47:41Z matt $
*
* @category Piwik_Plugins
* @package Piwik_VisitTime
*/
/**
*
* @package Piwik_VisitTime
*/
class Piwik_VisitTime_Controller extends Piwik_Controller
{
public function index()
{
$view = Piwik_View::factory('index');
$view->dataTableVisitInformationPerLocalTime = $this->getVisitInformationPerLocalTime(true);
$view->dataTableVisitInformationPerServerTime = $this->getVisitInformationPerServerTime(true);
echo $view->render();
}
public function getVisitInformationPerServerTime( $fetch = false)
{
$view = Piwik_ViewDataTable::factory( 'graphVerticalBar');
$view->init( $this->pluginName, __FUNCTION__, "VisitTime.getVisitInformationPerServerTime" );
$view->setColumnsToDisplay( array('label','nb_visits') );
$view->setSortedColumn( 'label', 'asc' );
$view->setColumnTranslation('label', Piwik_Translate('VisitTime_ColumnServerTime'));
$view->setLimit( 24 );
$view->setGraphLimit( 24 );
$view->disableSearchBox();
$view->disableExcludeLowPopulation();
$view->disableOffsetInformation();
$view->enableShowGoals();
return $this->renderView($view, $fetch);
}
public function getVisitInformationPerLocalTime( $fetch = false)
{
$view = Piwik_ViewDataTable::factory( 'graphVerticalBar');
$view->init( $this->pluginName, __FUNCTION__, "VisitTime.getVisitInformationPerLocalTime" );
$view->setColumnTranslation('label', Piwik_Translate('VisitTime_ColumnLocalTime'));
$view->setColumnsToDisplay( array('label','nb_visits') );
$view->setSortedColumn( 'label', 'asc' );
$view->setLimit( 24 );
$view->setGraphLimit( 24 );
$view->disableSearchBox();
$view->disableExcludeLowPopulation();
$view->disableOffsetInformation();
return $this->renderView($view, $fetch);
}
}