当前位置: 首页>>代码示例>>PHP>>正文


PHP owa_coreAPI::getGroupNavigation方法代码示例

本文整理汇总了PHP中owa_coreAPI::getGroupNavigation方法的典型用法代码示例。如果您正苦于以下问题:PHP owa_coreAPI::getGroupNavigation方法的具体用法?PHP owa_coreAPI::getGroupNavigation怎么用?PHP owa_coreAPI::getGroupNavigation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在owa_coreAPI的用法示例。


在下文中一共展示了owa_coreAPI::getGroupNavigation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pre

 /**
  * Pre Action
  * Current user is fully authenticated and loaded by this point
  *
  */
 function pre()
 {
     $sites = $this->getSitesAllowedForCurrentUser();
     $this->set('sites', $sites);
     $this->set('currentSiteId', $this->getParam('siteId'));
     // pass full set of params to view
     $this->data['params'] = $this->params;
     // setup the time period object in $this->period
     $this->setPeriod();
     // check to see if the period is a default period. TODO move this ot view where needed.
     $this->set('is_default_period', $this->period->isDefaultPeriod());
     $this->setView('base.report');
     $this->setViewMethod('delegate');
     $this->dom_id = str_replace('.', '-', $this->getParam('do'));
     $this->data['dom_id'] = $this->dom_id;
     $this->data['do'] = $this->getParam('do');
     $nav = owa_coreAPI::getGroupNavigation('Reports');
     // setup tabs
     $siteId = $this->get('siteId');
     if ($siteId) {
         $gm = owa_coreAPI::supportClassFactory('base', 'goalManager', $siteId);
         $tabs = array();
         $site_usage = array('tab_label' => 'Site Usage', 'metrics' => 'visits,pagesPerVisit,visitDuration,bounceRate,uniqueVisitors', 'sort' => 'visits-', 'trendchartmetric' => 'visits');
         $tabs['site_usage'] = $site_usage;
         // ecommerce tab
         if (owa_coreAPI::getSiteSetting($this->getParam('siteId'), 'enableEcommerceReporting')) {
             $ecommerce = array('tab_label' => 'e-commerce', 'metrics' => 'visits,transactions,transactionRevenue,revenuePerVisit,revenuePerTransaction,ecommerceConversionRate', 'sort' => 'transactionRevenue-', 'trendchartmetric' => 'transactions');
             $tabs['ecommerce'] = $ecommerce;
         }
         $goal_groups = $gm->getActiveGoalGroups();
         if ($goal_groups) {
             foreach ($goal_groups as $group) {
                 $goal_metrics = 'visits';
                 $active_goals = $gm->getActiveGoalsByGroup($group);
                 if ($active_goals) {
                     foreach ($active_goals as $goal) {
                         $goal_metrics .= sprintf(',goal%sCompletions', $goal);
                     }
                 }
                 $goal_metrics .= ',goalValueAll';
                 $goal_group = array('tab_label' => $gm->getGoalGroupLabel($group), 'metrics' => $goal_metrics, 'sort' => 'goalValueAll-', 'trendchartmetric' => 'visits');
                 $name = 'goal_group_' . $group;
                 $tabs[$name] = $goal_group;
             }
         }
         $this->set('tabs', $tabs);
         $this->set('tabs_json', json_encode($tabs));
         if (!owa_coreAPI::getSiteSetting($this->getParam('siteId'), 'enableEcommerceReporting')) {
             unset($nav['Ecommerce']);
         }
     }
     //$this->body->set('sub_nav', owa_coreAPI::getNavigation($this->get('nav_tab'), 'sub_nav'));
     $this->set('top_level_report_nav', $nav);
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:59,代码来源:owa_reportController.php

示例2: pre

 /**
  * pre action
  *
  */
 function pre()
 {
     // site lists
     $sites = owa_coreAPI::getSitesList();
     $this->set('sites', $sites);
     // set default siteId if none exists on request
     $site_id = $this->getParam('siteId');
     if (!$site_id) {
         $site_id = $this->getParam('site_id');
     }
     if (!$site_id) {
         $site_id = $sites[0]['site_id'];
     }
     $this->setParam('siteId', $site_id);
     // pass full set of params to view
     $this->data['params'] = $this->params;
     // set default period if necessary
     if (!$this->getParam('period') && !$this->getParam('startDate')) {
         $this->set('is_default_period', true);
         $period = 'last_seven_days';
         $this->params['period'] = $period;
     } elseif (!$this->getParam('period') && $this->getParam('startDate')) {
         $period = 'date_range';
         $this->params['period'] = $period;
     } else {
         $period = $this->getParam('period');
     }
     $this->setPeriod($period);
     $this->setView('base.report');
     $this->setViewMethod('delegate');
     $this->dom_id = str_replace('.', '-', $this->getParam('do'));
     $this->data['dom_id'] = $this->dom_id;
     $this->data['do'] = $this->getParam('do');
     // setup tabs
     $siteId = $this->get('siteId');
     $gm = owa_coreAPI::supportClassFactory('base', 'goalManager', $siteId);
     $tabs = array();
     $site_usage = array('tab_label' => 'Site Usage', 'metrics' => 'visits,pagesPerVisit,visitDuration,bounceRate,uniqueVisitors', 'sort' => 'visits-');
     $tabs['site_usage'] = $site_usage;
     // ecommerce tab
     if (owa_coreAPI::getSiteSetting($this->getParam('siteId'), 'enableEcommerceReporting')) {
         $ecommerce = array('tab_label' => 'e-commerce', 'metrics' => 'visits,transactions,transactionRevenue,revenuePerVisit,revenuePerTransaction,ecommerceConversionRate', 'sort' => 'transactionRevenue-');
         $tabs['ecommerce'] = $ecommerce;
     }
     $goal_groups = $gm->getActiveGoalGroups();
     if ($goal_groups) {
         foreach ($goal_groups as $group) {
             $goal_metrics = 'visits';
             $active_goals = $gm->getActiveGoalsByGroup($group);
             if ($active_goals) {
                 foreach ($active_goals as $goal) {
                     $goal_metrics .= sprintf(',goal%sCompletions', $goal);
                 }
             }
             $goal_metrics .= ',goalValueAll';
             $goal_group = array('tab_label' => $gm->getGoalGroupLabel($group), 'metrics' => $goal_metrics, 'sort' => 'goalValueAll-');
             $name = 'goal_group_' . $group;
             $tabs[$name] = $goal_group;
         }
     }
     $this->set('tabs', $tabs);
     $this->set('tabs_json', json_encode($tabs));
     //$this->body->set('sub_nav', owa_coreAPI::getNavigation($this->get('nav_tab'), 'sub_nav'));
     $nav = owa_coreAPI::getGroupNavigation('Reports');
     if (!owa_coreAPI::getSiteSetting($this->getParam('siteId'), 'enableEcommerceReporting')) {
         unset($nav['Ecommerce']);
     }
     $this->set('top_level_report_nav', $nav);
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:73,代码来源:owa_reportController.php


注:本文中的owa_coreAPI::getGroupNavigation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。