當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Common::isActionsPluginEnabled方法代碼示例

本文整理匯總了PHP中Piwik\Common::isActionsPluginEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Common::isActionsPluginEnabled方法的具體用法?PHP Common::isActionsPluginEnabled怎麽用?PHP Common::isActionsPluginEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik\Common的用法示例。


在下文中一共展示了Common::isActionsPluginEnabled方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getApiMetrics

 /**
  * @ignore
  */
 public static function getApiMetrics($enhanced)
 {
     $metrics = self::$baseMetrics;
     if (Common::isActionsPluginEnabled()) {
         $metrics[self::NB_PAGEVIEWS_LABEL] = array(self::METRIC_TRANSLATION_KEY => 'General_ColumnPageviews', self::METRIC_EVOLUTION_COL_NAME_KEY => 'pageviews_evolution', self::METRIC_RECORD_NAME_KEY => self::NB_PAGEVIEWS_METRIC, self::METRIC_COL_NAME_KEY => self::NB_PAGEVIEWS_LABEL, self::METRIC_IS_ECOMMERCE_KEY => false);
     }
     if (Common::isGoalPluginEnabled()) {
         // goal revenue metric
         $metrics[self::GOAL_REVENUE_METRIC] = array(self::METRIC_TRANSLATION_KEY => 'General_ColumnRevenue', self::METRIC_EVOLUTION_COL_NAME_KEY => self::GOAL_REVENUE_METRIC . '_evolution', self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_REVENUE_METRIC), self::METRIC_COL_NAME_KEY => self::GOAL_REVENUE_METRIC, self::METRIC_IS_ECOMMERCE_KEY => false);
         if ($enhanced) {
             // number of goal conversions metric
             $metrics[self::GOAL_CONVERSION_METRIC] = array(self::METRIC_TRANSLATION_KEY => 'Goals_ColumnConversions', self::METRIC_EVOLUTION_COL_NAME_KEY => self::GOAL_CONVERSION_METRIC . '_evolution', self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_CONVERSION_METRIC), self::METRIC_COL_NAME_KEY => self::GOAL_CONVERSION_METRIC, self::METRIC_IS_ECOMMERCE_KEY => false);
             // number of orders
             $metrics[self::ECOMMERCE_ORDERS_METRIC] = array(self::METRIC_TRANSLATION_KEY => 'General_EcommerceOrders', self::METRIC_EVOLUTION_COL_NAME_KEY => self::ECOMMERCE_ORDERS_METRIC . '_evolution', self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_CONVERSION_METRIC, 0), self::METRIC_COL_NAME_KEY => self::ECOMMERCE_ORDERS_METRIC, self::METRIC_IS_ECOMMERCE_KEY => true);
             // eCommerce revenue
             $metrics[self::ECOMMERCE_REVENUE_METRIC] = array(self::METRIC_TRANSLATION_KEY => 'General_ProductRevenue', self::METRIC_EVOLUTION_COL_NAME_KEY => self::ECOMMERCE_REVENUE_METRIC . '_evolution', self::METRIC_RECORD_NAME_KEY => Archiver::getRecordName(self::GOAL_REVENUE_METRIC, 0), self::METRIC_COL_NAME_KEY => self::ECOMMERCE_REVENUE_METRIC, self::METRIC_IS_ECOMMERCE_KEY => true);
         }
     }
     return $metrics;
 }
開發者ID:bossrabbit,項目名稱:piwik,代碼行數:23,代碼來源:API.php

示例2: setSparklinesAndNumbers

 protected function setSparklinesAndNumbers($view)
 {
     $view->urlSparklineNbVisits = $this->getUrlSparkline('getEvolutionGraph', array('columns' => $view->displayUniqueVisitors ? array('nb_visits', 'nb_uniq_visitors') : array('nb_visits')));
     $view->urlSparklineNbPageviews = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_pageviews', 'nb_uniq_pageviews')));
     $view->urlSparklineNbDownloads = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_downloads', 'nb_uniq_downloads')));
     $view->urlSparklineNbOutlinks = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_outlinks', 'nb_uniq_outlinks')));
     $view->urlSparklineAvgVisitDuration = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('avg_time_on_site')));
     $view->urlSparklineMaxActions = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('max_actions')));
     $view->urlSparklineActionsPerVisit = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_actions_per_visit')));
     $view->urlSparklineBounceRate = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('bounce_rate')));
     $view->urlSparklineAvgGenerationTime = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('avg_time_generation')));
     $idSite = Common::getRequestVar('idSite');
     $displaySiteSearch = Site::isSiteSearchEnabledFor($idSite);
     if ($displaySiteSearch) {
         $view->urlSparklineNbSearches = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_searches', 'nb_keywords')));
     }
     $view->displaySiteSearch = $displaySiteSearch;
     $dataTableVisit = self::getVisitsSummary();
     $dataRow = $dataTableVisit->getRowsCount() == 0 ? new Row() : $dataTableVisit->getFirstRow();
     $view->nbUniqVisitors = (int) $dataRow->getColumn('nb_uniq_visitors');
     $nbVisits = (int) $dataRow->getColumn('nb_visits');
     $view->nbVisits = $nbVisits;
     $view->averageVisitDuration = $dataRow->getColumn('avg_time_on_site');
     $nbBouncedVisits = $dataRow->getColumn('bounce_count');
     $view->bounceRate = Piwik::getPercentageSafe($nbBouncedVisits, $nbVisits);
     $view->maxActions = (int) $dataRow->getColumn('max_actions');
     $view->nbActionsPerVisit = $dataRow->getColumn('nb_actions_per_visit');
     if (Common::isActionsPluginEnabled()) {
         $view->showActionsPluginReports = true;
         $dataTableActions = APIActions::getInstance()->get($idSite, Common::getRequestVar('period'), Common::getRequestVar('date'), \Piwik\API\Request::getRawSegmentFromRequest());
         $dataActionsRow = $dataTableActions->getRowsCount() == 0 ? new Row() : $dataTableActions->getFirstRow();
         $view->nbPageviews = (int) $dataActionsRow->getColumn('nb_pageviews');
         $view->nbUniquePageviews = (int) $dataActionsRow->getColumn('nb_uniq_pageviews');
         $view->nbDownloads = (int) $dataActionsRow->getColumn('nb_downloads');
         $view->nbUniqueDownloads = (int) $dataActionsRow->getColumn('nb_uniq_downloads');
         $view->nbOutlinks = (int) $dataActionsRow->getColumn('nb_outlinks');
         $view->nbUniqueOutlinks = (int) $dataActionsRow->getColumn('nb_uniq_outlinks');
         $view->averageGenerationTime = $dataActionsRow->getColumn('avg_time_generation');
         if ($displaySiteSearch) {
             $view->nbSearches = (int) $dataActionsRow->getColumn('nb_searches');
             $view->nbKeywords = (int) $dataActionsRow->getColumn('nb_keywords');
         }
         // backward compatibility:
         // show actions if the finer metrics are not archived
         $view->showOnlyActions = false;
         if ($dataActionsRow->getColumn('nb_pageviews') + $dataActionsRow->getColumn('nb_downloads') + $dataActionsRow->getColumn('nb_outlinks') == 0 && $dataRow->getColumn('nb_actions') > 0) {
             $view->showOnlyActions = true;
             $view->nbActions = $dataRow->getColumn('nb_actions');
             $view->urlSparklineNbActions = $this->getUrlSparkline('getEvolutionGraph', array('columns' => array('nb_actions')));
         }
     }
 }
開發者ID:carriercomm,項目名稱:piwik,代碼行數:52,代碼來源:Controller.php

示例3: addSparklineColumns

 private function addSparklineColumns(Sparklines $view)
 {
     $currentPeriod = Common::getRequestVar('period');
     $currentIdSite = Common::getRequestVar('idSite');
     $currentDate = Common::getRequestVar('date');
     $displayUniqueVisitors = SettingsPiwik::isUniqueVisitorsEnabled($currentPeriod);
     $isActionPluginEnabled = Common::isActionsPluginEnabled();
     $view->config->addSparklineMetric($displayUniqueVisitors ? array('nb_visits', 'nb_uniq_visitors') : array('nb_visits'), 5);
     if ($isActionPluginEnabled) {
         $view->config->addSparklineMetric(array('nb_actions'), 10);
         // either actions or pageviews will be displayed
         $view->config->addSparklineMetric(array('nb_pageviews', 'nb_uniq_pageviews'), 20);
     } else {
         // make sure to still create a div on the right side for this, just leave it empty
         $view->config->addPlaceholder(10);
     }
     $userId = new UserId();
     if ($userId->isUsedInAtLeastOneSite(array($currentIdSite), $currentPeriod, $currentDate)) {
         $view->config->addSparklineMetric(array('nb_users'), 30);
         $view->config->addPlaceholder(31);
     }
     $view->config->addSparklineMetric(array('avg_time_on_site'), 40);
     $idSite = Common::getRequestVar('idSite');
     if ($isActionPluginEnabled && Site::isSiteSearchEnabledFor($idSite)) {
         $view->config->addSparklineMetric(array('nb_searches', 'nb_keywords'), 50);
     } else {
         // make sure to still create a div on the right side for this, just leave it empty
         $view->config->addPlaceholder(50);
     }
     $view->config->addSparklineMetric(array('bounce_rate'), 60);
     if ($isActionPluginEnabled) {
         $view->config->addSparklineMetric(array('nb_downloads', 'nb_uniq_downloads'), 70);
         $view->config->addSparklineMetric(array('nb_actions_per_visit'), 71);
         $view->config->addSparklineMetric(array('nb_outlinks', 'nb_uniq_outlinks'), 72);
         $view->config->addSparklineMetric(array('avg_time_generation'), 73);
         $view->config->addSparklineMetric(array('max_actions'), 74);
     }
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:38,代碼來源:Get.php


注:本文中的Piwik\Common::isActionsPluginEnabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。