Exemple #1
0
 /**
  * Parse this page
  */
 protected function parse()
 {
     parent::parse();
     $warnings = BackendAnalyticsModel::checkSettings();
     $this->tpl->assign('warnings', $warnings);
     if (empty($warnings)) {
         $this->parseOverviewData();
         $this->parseLineChartData();
         $this->parsePieChartData();
         $this->parseImportantReferrals();
         $this->parseImportantKeywords();
         $googleURL = BackendAnalyticsModel::GOOGLE_ANALYTICS_URL . '/%1$s?id=%2$s&pdr=%3$s';
         $googleTableId = str_replace('ga:', '', BackendAnalyticsModel::getTableId());
         $googleDate = date('Ymd', $this->startTimestamp) . '-' . date('Ymd', $this->endTimestamp);
         $this->tpl->assign('googleTopReferrersURL', sprintf($googleURL, 'referring_sources', $googleTableId, $googleDate));
         $this->tpl->assign('googleTopKeywordsURL', sprintf($googleURL, 'keywords', $googleTableId, $googleDate));
         $this->tpl->assign('googleTopContentURL', sprintf($googleURL, 'top_content', $googleTableId, $googleDate));
         $this->tpl->assign('googleTrafficSourcesURL', sprintf($googleURL, 'sources', $googleTableId, $googleDate));
         $this->tpl->assign('googleVisitorsURL', sprintf($googleURL, 'visitors', $googleTableId, $googleDate));
         $this->tpl->assign('googlePageviewsURL', sprintf($googleURL, 'pageviews', $googleTableId, $googleDate));
         $this->tpl->assign('googleTimeOnSiteURL', sprintf($googleURL, 'time_on_site', $googleTableId, $googleDate));
         $this->tpl->assign('googleVisitorTypesURL', sprintf($googleURL, 'visitor_types', $googleTableId, $googleDate));
         $this->tpl->assign('googleBouncesURL', sprintf($googleURL, 'bounce_rate', $googleTableId, $googleDate));
         $this->tpl->assign('googleAveragePageviewsURL', sprintf($googleURL, 'average_pageviews', $googleTableId, $googleDate));
     }
 }
 /**
  * Parse this page
  *
  * @return	void
  */
 protected function parse()
 {
     // call parent parse
     parent::parse();
     // get results
     $results = BackendAnalyticsModel::getLandingPages($this->startTimestamp, $this->endTimestamp);
     // there are some results
     if (!empty($results)) {
         // get the datagrid
         $dataGrid = new BackendDataGridArray($results);
         // hide columns
         $dataGrid->setColumnsHidden('start_date', 'end_date', 'updated_on', 'page_encoded');
         // set headers values
         $headers['page_path'] = ucfirst(BL::lbl('Page'));
         // set headers
         $dataGrid->setHeaderLabels($headers);
         // set url
         $dataGrid->setColumnURL('page_path', BackendModel::createURLForAction('detail_page') . '&page=[page_encoded]');
         // add the multicheckbox column
         $dataGrid->setMassActionCheckboxes('checkbox', '[id]');
         // add mass action dropdown
         $ddmMassAction = new SpoonFormDropdown('action', array('delete_landing_page' => BL::lbl('Delete')), 'delete');
         $dataGrid->setMassAction($ddmMassAction);
         // parse the datagrid
         $this->tpl->assign('dgPages', $dataGrid->getContent());
     }
 }
Exemple #3
0
 /**
  * Execute the action
  *
  * @return	void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // call to get_data script
     $this->getData();
     // parse
     $this->parse();
     // display the page
     $this->display();
 }
 /**
  * Parse this page
  */
 protected function parse()
 {
     parent::parse();
     $this->parseOverviewData();
     $this->parseChartData();
     $this->parseExitPages();
     $googleURL = BackendAnalyticsModel::GOOGLE_ANALYTICS_URL . '/%1$s?id=%2$s&pdr=%3$s';
     $googleTableId = str_replace('ga:', '', BackendAnalyticsModel::getTableId());
     $googleDate = date('Ymd', $this->startTimestamp) . '-' . date('Ymd', $this->endTimestamp);
     // parse links to google
     $this->tpl->assign('googleTopExitPagesURL', sprintf($googleURL, 'exits', $googleTableId, $googleDate));
 }
 /**
  * Parse this page
  */
 protected function parse()
 {
     parent::parse();
     // get data
     $data = BackendAnalyticsModel::getDataForPage($this->pagePath, $this->startTimestamp, $this->endTimestamp);
     $this->parseOverviewData($data['aggregates']);
     $this->parseLineChartData($data['entries']['metrics_per_day']);
     // parse the page path
     $this->tpl->assign('pagePath', 'http://' . $data['entries']['hostname'] . $this->pagePath);
     $googleURL = BackendAnalyticsModel::GOOGLE_ANALYTICS_URL . '/%1$s?id=%2$s&pdr=%3$s';
     $googleTableId = str_replace('ga:', '', BackendAnalyticsModel::getTableId());
     $googleDate = date('Ymd', $this->startTimestamp) . '-' . date('Ymd', $this->endTimestamp);
     // parse links to google
     $this->tpl->assign('googleContentDetailURL', sprintf($googleURL, 'content_detail', $googleTableId, $googleDate) . '&d1=' . urlencode($this->pagePath));
 }
Exemple #6
0
 /**
  * Parse this page
  *
  * @return	void
  */
 protected function parse()
 {
     // call parent parse
     parent::parse();
     // overview data
     $this->parseOverviewData();
     // get and parse data for chart
     $this->parseChartData();
     // parse pages
     $this->parsePages();
     // init google url
     $googleURL = BackendAnalyticsModel::GOOGLE_ANALYTICS_URL . '/%1$s?id=%2$s&pdr=%3$s';
     $googleTableId = str_replace('ga:', '', BackendAnalyticsModel::getTableId());
     $googleDate = date('Ymd', $this->startTimestamp) . '-' . date('Ymd', $this->endTimestamp);
     // parse links to google
     $this->tpl->assign('googleTopContentURL', sprintf($googleURL, 'top_content', $googleTableId, $googleDate));
 }
Exemple #7
0
 /**
  * Parse this page
  */
 protected function parse()
 {
     parent::parse();
     $page = $this->pageId != '' ? BackendAnalyticsModel::getPageForId($this->pageId) : null;
     // update date_viewed for this page
     BackendAnalyticsModel::updatePageDateViewed($this->pageId);
     // parse redirect link
     $this->tpl->assign('redirectGet', isset($page) ? 'page=' . $page : '');
     $this->tpl->assign('page', $this->redirectAction);
     $this->tpl->assign('identifier', ($this->pageId != '' ? $this->pageId . '_' : '') . $this->identifier);
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction($this->redirectAction, $this->getModule())) {
         $this->tpl->assign('redirect', BackendModel::createURLForAction($this->redirectAction));
     }
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('settings', $this->getModule())) {
         $this->tpl->assign('settingsUrl', BackendModel::createURLForAction('settings'));
     }
 }
 /**
  * Parse this page
  */
 protected function parse()
 {
     parent::parse();
     $results = BackendAnalyticsModel::getLandingPages($this->startTimestamp, $this->endTimestamp);
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setColumnsHidden('start_date', 'end_date', 'updated_on', 'page_encoded');
         $dataGrid->setMassActionCheckboxes('checkbox', '[id]');
         // check if this action is allowed
         if (BackendAuthentication::isAllowedAction('detail_page', $this->getModule())) {
             $dataGrid->setColumnURL('page_path', BackendModel::createURLForAction('detail_page') . '&page=[page_encoded]');
         }
         // set headers
         $dataGrid->setHeaderLabels(array('page_path' => SpoonFilter::ucfirst(BL::lbl('Page'))));
         // add mass action dropdown
         $ddmMassAction = new SpoonFormDropdown('action', array('delete_landing_page' => BL::lbl('Delete')), 'delete');
         $dataGrid->setMassAction($ddmMassAction);
         // parse the datagrid
         $this->tpl->assign('dgPages', $dataGrid->getContent());
     }
 }