Reports about the page views, the outlinks and downloads.
Inheritance: extends Piwik\Plugin
Exemplo n.º 1
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addActionsItem('', $this->urlForAction('menuGetPageUrls'), 15);
     $actions = new Actions();
     if ($actions->isSiteSearchEnabled()) {
         $menu->addActionsItem('Actions_SubmenuSitesearch', $this->urlForAction('indexSiteSearch'), 5);
     }
 }
Exemplo n.º 2
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $urlParams = array('module' => 'Actions', 'action' => 'menuGetPageUrls');
     $menu->addActionsItem('', $urlParams, 15);
     $actions = new Actions();
     if ($actions->isSiteSearchEnabled()) {
         $menu->addActionsItem('Actions_SubmenuSitesearch', array('module' => 'Actions', 'action' => 'indexSiteSearch'), 5);
     }
 }
Exemplo n.º 3
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->addActionsItem('', $this->urlForAction('menuGetPageUrls'), 15);
     $idSite = Common::getRequestVar('idSite', 0, 'int');
     $idSites = Common::getRequestVar('idSites', '', 'string');
     $actions = new Actions();
     if ($actions->isSiteSearchEnabled($idSites, $idSite)) {
         $menu->addActionsItem('Actions_SubmenuSitesearch', $this->urlForAction('indexSiteSearch'), 5);
     }
 }
Exemplo n.º 4
0
 public function configureReportingMenu(MenuReporting $menu)
 {
     $menu->add('General_Actions', '', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 15);
     $menu->add('General_Actions', 'General_Pages', array('module' => 'Actions', 'action' => 'indexPageUrls'), true, 1);
     $menu->add('General_Actions', 'Actions_SubmenuPagesEntry', array('module' => 'Actions', 'action' => 'indexEntryPageUrls'), true, 2);
     $menu->add('General_Actions', 'Actions_SubmenuPagesExit', array('module' => 'Actions', 'action' => 'indexExitPageUrls'), true, 3);
     $menu->add('General_Actions', 'Actions_SubmenuPageTitles', array('module' => 'Actions', 'action' => 'indexPageTitles'), true, 4);
     $menu->add('General_Actions', 'General_Outlinks', array('module' => 'Actions', 'action' => 'indexOutlinks'), true, 6);
     $menu->add('General_Actions', 'General_Downloads', array('module' => 'Actions', 'action' => 'indexDownloads'), true, 7);
     $actions = new Actions();
     if ($actions->isSiteSearchEnabled()) {
         $menu->add('General_Actions', 'Actions_SubmenuSitesearch', array('module' => 'Actions', 'action' => 'indexSiteSearch'), true, 5);
     }
 }
Exemplo n.º 5
0
 private function addSearchWidgets(WidgetsList $widgetsList, $controller)
 {
     $category = 'Actions_SubmenuSitesearch';
     $widgetsList->add($category, 'Actions_WidgetSearchKeywords', $controller, 'getSiteSearchKeywords');
     if (Actions::isCustomVariablesPluginsEnabled()) {
         $widgetsList->add($category, 'Actions_WidgetSearchCategories', $controller, 'getSiteSearchCategories');
     }
     $widgetsList->add($category, 'Actions_WidgetSearchNoResultKeywords', $controller, 'getSiteSearchNoResultKeywords');
     $widgetsList->add($category, 'Actions_WidgetPageUrlsFollowingSearch', $controller, 'getPageUrlsFollowingSiteSearch');
     $widgetsList->add($category, 'Actions_WidgetPageTitlesFollowingSearch', $controller, 'getPageTitlesFollowingSiteSearch');
 }
Exemplo n.º 6
0
 public function indexSiteSearch()
 {
     $view = new View('@Actions/indexSiteSearch');
     $keyword = Report::factory($this->pluginName, 'getSiteSearchKeywords');
     $noResult = Report::factory($this->pluginName, 'getSiteSearchNoResultKeywords');
     $pageUrls = Report::factory($this->pluginName, 'getPageUrlsFollowingSiteSearch');
     $view->keywords = $keyword->render();
     $view->noResultKeywords = $noResult->render();
     $view->pagesUrlsFollowingSiteSearch = $pageUrls->render();
     $categoryTrackingEnabled = Actions::isCustomVariablesPluginsEnabled();
     if ($categoryTrackingEnabled) {
         $categories = Report::factory($this->pluginName, 'getSiteSearchCategories');
         $view->categories = $categories->render();
     }
     return $view->render();
 }
Exemplo n.º 7
0
Arquivo: Base.php Projeto: piwik/piwik
 protected function addBaseDisplayProperties(ViewDataTable $view)
 {
     $view->config->datatable_js_type = 'ActionsDataTable';
     $view->config->search_recursive = true;
     $view->config->show_table_all_columns = false;
     $view->requestConfig->filter_limit = Actions::ACTIONS_REPORT_ROWS_DISPLAY;
     $view->config->show_all_views_icons = false;
     if ($view->isViewDataTableId(HtmlTable::ID)) {
         $view->config->show_embedded_subtable = true;
     }
     if (Request::shouldLoadExpanded()) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->show_expanded = true;
         }
         $view->config->filters[] = function ($dataTable) {
             Actions::setDataTableRowLevels($dataTable);
         };
     }
     $view->config->filters[] = function ($dataTable) use($view) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->datatable_css_class = 'dataTableActions';
         }
     };
 }
Exemplo n.º 8
0
 private function addBaseDisplayProperties(ViewDataTable $view)
 {
     $view->config->datatable_js_type = 'ActionsDataTable';
     $view->config->search_recursive = true;
     $view->config->show_table_all_columns = false;
     $view->requestConfig->filter_limit = self::ACTIONS_REPORT_ROWS_DISPLAY;
     $view->config->show_all_views_icons = false;
     if ($view->isViewDataTableId(HtmlTable::ID)) {
         $view->config->show_embedded_subtable = true;
     }
     // if the flat parameter is not provided, make sure it is set to 0 in the URL,
     // so users can see that they can set it to 1 (see #3365)
     $view->config->custom_parameters = array('flat' => 0);
     if (Request::shouldLoadExpanded()) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->show_expanded = true;
         }
         $view->config->filters[] = function ($dataTable) {
             Actions::setDataTableRowLevels($dataTable);
         };
     }
     $view->config->filters[] = function ($dataTable) use($view) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->datatable_css_class = 'dataTableActions';
         }
     };
 }
Exemplo n.º 9
0
 /**
  * @param int $idSite
  * @param string $period
  * @param Date $date
  * @param bool $segment
  *
  * @return DataTable|DataTable\Map
  */
 public function getSiteSearchCategories($idSite, $period, $date, $segment = false)
 {
     Actions::checkCustomVariablesPluginEnabled();
     $customVariables = APICustomVariables::getInstance()->getCustomVariables($idSite, $period, $date, $segment, $expanded = false, $_leavePiwikCoreVariables = true);
     $customVarNameToLookFor = ActionSiteSearch::CVAR_KEY_SEARCH_CATEGORY;
     $dataTable = new DataTable();
     // Handle case where date=last30&period=day
     // FIXMEA: this logic should really be refactored somewhere, this is ugly!
     if ($customVariables instanceof DataTable\Map) {
         $dataTable = $customVariables->getEmptyClone();
         $customVariableDatatables = $customVariables->getDataTables();
         foreach ($customVariableDatatables as $key => $customVariableTableForDate) {
             // we do not enter the IF, in the case idSite=1,3 AND period=day&date=datefrom,dateto,
             if ($customVariableTableForDate instanceof DataTable && $customVariableTableForDate->getMetadata(Archive\DataTableFactory::TABLE_METADATA_PERIOD_INDEX)) {
                 $row = $customVariableTableForDate->getRowFromLabel($customVarNameToLookFor);
                 if ($row) {
                     $dateRewrite = $customVariableTableForDate->getMetadata(Archive\DataTableFactory::TABLE_METADATA_PERIOD_INDEX)->getDateStart()->toString();
                     $idSubtable = $row->getIdSubDataTable();
                     $categories = APICustomVariables::getInstance()->getCustomVariablesValuesFromNameId($idSite, $period, $dateRewrite, $idSubtable, $segment);
                     $dataTable->addTable($categories, $key);
                 }
             }
         }
     } elseif ($customVariables instanceof DataTable) {
         $row = $customVariables->getRowFromLabel($customVarNameToLookFor);
         if ($row) {
             $idSubtable = $row->getIdSubDataTable();
             $dataTable = APICustomVariables::getInstance()->getCustomVariablesValuesFromNameId($idSite, $period, $date, $idSubtable, $segment);
         }
     }
     $this->filterActionsDataTable($dataTable);
     $this->addPagesPerSearchColumn($dataTable, $columnToRead = 'nb_actions');
     return $dataTable;
 }
Exemplo n.º 10
0
 public function isEnabled()
 {
     $actions = new Actions();
     return $actions->isSiteSearchEnabled();
 }
Exemplo n.º 11
0
 protected function isEnabledForIdSites($idSites, $idSite)
 {
     $actions = new Actions();
     return $actions->isSiteSearchEnabled($idSites, $idSite);
 }
Exemplo n.º 12
0
 protected function isEnabledForIdSites($idSites, $idSite)
 {
     return parent::isEnabledForIdSites($idSites, $idSite) && Actions::isCustomVariablesPluginsEnabled();
 }
Exemplo n.º 13
0
 public function isEnabled()
 {
     return parent::isEnabled() && Actions::isCustomVariablesPluginsEnabled();
 }