コード例 #1
0
ファイル: Base.php プロジェクト: piwik/piwik
 public function configureWidgets(WidgetsList $widgetsList, ReportWidgetFactory $factory)
 {
     if (!$this->isSubtableReport) {
         $widget = $factory->createWidget()->setParameters(array('secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($this->action)));
         $widgetsList->addToContainerWidget('Events', $widget);
     }
 }
コード例 #2
0
ファイル: Widgets.php プロジェクト: kreynen/elmsln
 public function configure(WidgetsList $widgetsList)
 {
     foreach (Events::getLabelTranslations() as $apiMethod => $labels) {
         $params = array('secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($apiMethod));
         $widgetsList->add('Events_Events', $labels[0], 'Events', $apiMethod, $params);
     }
 }
コード例 #3
0
ファイル: Controller.php プロジェクト: brienomatty/elmsln
 private function getLeftMenuReports()
 {
     $reports = new View\ReportsByDimension('Events');
     foreach (Events::getLabelTranslations() as $apiAction => $translations) {
         // 'getCategory' is the API method, but we are loading 'indexCategory' which displays <h2>
         $count = 1;
         $controllerAction = str_replace("get", "index", $apiAction, $count);
         $params = array('secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($apiAction));
         $reports->addReport('Events_TopEvents', $translations[0], 'Events.' . $controllerAction, $params);
     }
     return $reports->render();
 }
コード例 #4
0
ファイル: Base.php プロジェクト: pombredanne/ArcherSys
 private function addRelatedReports($view, $secondaryDimension)
 {
     if (empty($secondaryDimension)) {
         // eg. Row Evolution
         return;
     }
     $events = new Events();
     $view->config->show_related_reports = true;
     $apiMethod = $view->requestConfig->getApiMethodToRequest();
     $secondaryDimensions = API::getInstance()->getSecondaryDimensions($apiMethod);
     if (empty($secondaryDimensions)) {
         return;
     }
     $secondaryDimensionTranslation = $events->getDimensionLabel($secondaryDimension);
     $view->config->related_reports_title = Piwik::translate('Events_SecondaryDimension', $secondaryDimensionTranslation) . "<br/>" . Piwik::translate('Events_SwitchToSecondaryDimension', '');
     foreach ($secondaryDimensions as $dimension) {
         if ($dimension == $secondaryDimension) {
             // don't show as related report the currently selected dimension
             continue;
         }
         $dimensionTranslation = $events->getDimensionLabel($dimension);
         $view->config->addRelatedReport($view->requestConfig->apiMethodToRequestDataTable, $dimensionTranslation, array('secondaryDimension' => $dimension));
     }
 }
コード例 #5
0
ファイル: Base.php プロジェクト: josl/CGE-File-Sharing
 protected function init()
 {
     $this->category = 'Events_Events';
     $this->processedMetrics = false;
     $this->widgetParams = array('secondaryDimension' => API::getInstance()->getDefaultSecondaryDimension($this->action));
 }