/**
  * Parse into template
  */
 private function parseReferrers()
 {
     $results = BackendAnalyticsModel::getRecentReferrers();
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setPaging();
         $dataGrid->setColumnsHidden('id', 'date', 'url');
         $dataGrid->setColumnURL('referrer', '[url]');
     }
     // parse the datagrid
     return !empty($results) ? $dataGrid->getContent() : '<table class="dataGrid"><tr><td>' . BL::msg('NoReferrers') . '</td></tr></table>';
 }
Esempio n. 2
0
 /**
  * Parses the most important referrals
  */
 private function parseImportantReferrals()
 {
     $results = BackendAnalyticsModel::getTopReferrals($this->startTimestamp, $this->endTimestamp, 25);
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setColumnsHidden(array('referral_long'));
         $dataGrid->setColumnURL('referral', 'http://[referral_long]', '[referral_long]');
         // set headers
         $dataGrid->setHeaderLabels(array('pageviews' => SpoonFilter::ucfirst(BL::lbl('Views')), 'pageviews_percentage' => '% ' . SpoonFilter::ucfirst(BL::lbl('Views'))));
         // parse the datagrid
         $this->tpl->assign('dgReferrers', $dataGrid->getContent());
     }
 }
Esempio n. 3
0
 /**
  * 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') . '&amp;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());
     }
 }
Esempio n. 4
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // assign id, name
     $this->tpl->assign('id', $this->id);
     $this->tpl->assign('name', $this->record['name']);
     // assign usage-datagrid
     $this->tpl->assign('usage', $this->dgUsage->getNumResults() != 0 ? $this->dgUsage->getContent() : false);
 }
Esempio n. 5
0
 /**
  * Parse exit pages datagrid
  */
 private function parseExitPages()
 {
     $results = BackendAnalyticsModel::getExitPages($this->startTimestamp, $this->endTimestamp);
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setPaging();
         $dataGrid->setColumnHidden('page_encoded');
         // check if this action is allowed
         if (BackendAuthentication::isAllowedAction('detail_page', $this->getModule())) {
             $dataGrid->setColumnURL('page', BackendModel::createURLForAction('detail_page') . '&amp;page=[page_encoded]');
         }
         // parse the datagrid
         $this->tpl->assign('dgPages', $dataGrid->getContent());
     }
 }
Esempio n. 6
0
 /**
  * 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') . '&amp;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());
     }
 }
Esempio n. 7
0
 /**
  * Parses the most important referrals
  *
  * @return	void
  */
 private function parseImportantReferrals()
 {
     // get results
     $results = BackendAnalyticsModel::getTopReferrals($this->startTimestamp, $this->endTimestamp, 25);
     // there are some results
     if (!empty($results)) {
         // get the datagrid
         $dataGrid = new BackendDataGridArray($results);
         // hide columns
         $dataGrid->setColumnsHidden(array('referral_long'));
         // set headers values
         $headers['pageviews'] = ucfirst(BL::lbl('Views'));
         $headers['pageviews_percentage'] = '% ' . ucfirst(BL::lbl('Views'));
         // set column url
         $dataGrid->setColumnURL('referral', 'http://[referral_long]', '[referral_long]');
         // set headers
         $dataGrid->setHeaderLabels($headers);
         // parse the datagrid
         $this->tpl->assign('dgReferrers', $dataGrid->getContent());
     }
 }
Esempio n. 8
0
 /**
  * Parse exit pages datagrid
  *
  * @return	void
  */
 private function parseExitPages()
 {
     // get results
     $results = BackendAnalyticsModel::getExitPages($this->startTimestamp, $this->endTimestamp);
     // there are some results
     if (!empty($results)) {
         // get the datagrid
         $dataGrid = new BackendDataGridArray($results);
         // no pagination
         $dataGrid->setPaging();
         // hide columns
         $dataGrid->setColumnHidden('page_encoded');
         // set url
         $dataGrid->setColumnURL('page', BackendModel::createURLForAction('detail_page') . '&amp;page=[page_encoded]');
         // parse the datagrid
         $this->tpl->assign('dgPages', $dataGrid->getContent());
     }
 }
Esempio n. 9
0
 /**
  * Load the form
  *
  * @return	void
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('add');
     // widgets available?
     if (isset($this->widgets)) {
         // loop through widgets
         foreach ($this->widgets as $j => $widget) {
             // add widget checkboxes
             $widgetBoxes[$j]['checkbox'] = '<span>' . $this->frm->addCheckbox('widgets_' . $widget['label'])->parse() . '</span>';
             $widgetBoxes[$j]['widget'] = $widget['label'];
             $widgetBoxes[$j]['description'] = $widget['description'];
         }
     }
     // loop through modules
     foreach ($this->modules as $key => $module) {
         // add module label
         $permissionBoxes[$key]['label'] = $module['label'];
         // init var
         $addedBundles = array();
         // loop through actions
         foreach ($this->actions[$module['value']] as $i => $action) {
             // action is bundled?
             if (array_key_exists('group', $action)) {
                 // bundle not yet in array?
                 if (!in_array($action['group'], $addedBundles)) {
                     // assign bundled action boxes
                     $actionBoxes[$key]['actions'][$i]['checkbox'] = '<span>' . $this->frm->addCheckbox('actions_' . $module['label'] . '_' . 'Group_' . ucfirst($action['group']))->parse() . '</span>';
                     $actionBoxes[$key]['actions'][$i]['action'] = ucfirst($action['group']);
                     $actionBoxes[$key]['actions'][$i]['description'] = $this->actionGroups[$action['group']];
                     // add the group to the added bundles
                     $addedBundles[] = $action['group'];
                 }
             } else {
                 // assign action boxes
                 $actionBoxes[$key]['actions'][$i]['checkbox'] = '<span>' . $this->frm->addCheckbox('actions_' . $module['label'] . '_' . $action['label'])->parse() . '</span>';
                 $actionBoxes[$key]['actions'][$i]['action'] = $action['label'];
                 $actionBoxes[$key]['actions'][$i]['description'] = $action['description'];
             }
         }
         // widgetboxes available?
         if (isset($widgetBoxes)) {
             // create datagrid
             $widgetGrid = new BackendDataGridArray($widgetBoxes);
             $widgetGrid->setHeaderLabels(array('checkbox' => '<span class="checkboxHolder"><input type="checkbox" name="toggleChecks" value="toggleChecks" /></span>'));
             // get content
             $widgets = $widgetGrid->getContent();
         }
         // create datagrid
         $actionGrid = new BackendDataGridArray($actionBoxes[$key]['actions']);
         // disable paging
         $actionGrid->setPaging(false);
         // get content of datagrids
         $permissionBoxes[$key]['actions']['dataGrid'] = $actionGrid->getContent();
         $permissionBoxes[$key]['chk'] = $this->frm->addCheckbox($module['label'], null, 'inputCheckbox checkBeforeUnload selectAll')->parse();
     }
     // create elements
     $this->frm->addText('name');
     $this->frm->addDropdown('manage_users', array('Deny', 'Allow'));
     $this->frm->addDropdown('manage_groups', array('Deny', 'Allow'));
     $this->tpl->assign('permissions', $permissionBoxes);
     $this->tpl->assign('widgets', isset($widgets) ? $widgets : false);
 }
Esempio n. 10
0
 /**
  * Load the datagrid for unsubscriptions
  *
  * @return	void
  */
 private function loadUnsubscriptions()
 {
     // get results
     $results = BackendMailmotorModel::getUnsubscribedAddressesByGroupID($this->groupId, self::PAGING_LIMIT);
     // there are some results
     if (!empty($results)) {
         // get the datagrid
         $dataGrid = new BackendDataGridArray($results);
         // no pagination
         $dataGrid->setPaging(false);
         // set edit link
         $dataGrid->setColumnURL('email', BackendModel::createURLForAction('edit_address', 'mailmotor') . '&amp;email=[email]');
         // set column functions
         $dataGrid->setColumnFunction(array('BackendDataGridFunctions', 'getTimeAgo'), array('[created_on]'), 'created_on', true);
         // parse the datagrid
         $this->tpl->assign('dgMailmotorUnsubscriptions', $dataGrid->getContent());
     }
 }
Esempio n. 11
0
 /**
  * Parse the referrers datagrid
  */
 private function parseReferrers()
 {
     $results = BackendAnalyticsModel::getRecentReferrers();
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setPaging(false);
         $dataGrid->setColumnsHidden('id', 'date', 'url');
         $dataGrid->setColumnURL('referrer', '[url]');
         // parse the datagrid
         $this->tpl->assign('dgAnalyticsReferrers', $dataGrid->getContent());
     }
 }
Esempio n. 12
0
 /**
  * Parses the most important pages
  *
  * @return	void
  */
 private function parseImportantPages()
 {
     // get results
     $results = BackendAnalyticsModel::getTopPages($this->startTimestamp, $this->endTimestamp);
     // there are some results
     if (!empty($results)) {
         // get the datagrid
         $dataGrid = new BackendDataGridArray($results);
         // hide columns
         $dataGrid->setColumnHidden('page_encoded');
         // set headers values
         $headers['pageviews_percentage'] = '% ' . ucfirst(BL::lbl('Pageviews'));
         // set headers
         $dataGrid->setHeaderLabels($headers);
         // set url
         $dataGrid->setColumnURL('page', BackendModel::createURLForAction('detail_page') . '&amp;page=[page_encoded]');
         // parse the datagrid
         $this->tpl->assign('dgContent', $dataGrid->getContent());
     }
 }
Esempio n. 13
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->frm = new BackendForm('edit');
     // get selected permissions
     $modulePermissions = BackendGroupsModel::getModulePermissions($this->id);
     $actionPermissions = BackendGroupsModel::getActionPermissions($this->id);
     // add selected modules to array
     foreach ($modulePermissions as $permission) {
         $selectedModules[] = $permission['module'];
     }
     // loop through modules
     foreach ($this->modules as $key => $module) {
         // widgets available?
         if (isset($this->widgets)) {
             // loop through widgets
             foreach ($this->widgets as $j => $widget) {
                 // widget is present?
                 if (isset($this->dashboardSequence[$module['value']][$widget['value']]['present']) && $this->dashboardSequence[$module['value']][$widget['value']]['present'] === true) {
                     // add to array
                     $selectedWidgets[$j] = $widget['value'];
                 }
                 // add widget checkboxes
                 $widgetBoxes[$j]['checkbox'] = '<span>' . $this->frm->addCheckbox('widgets_' . $widget['label'], isset($selectedWidgets[$j]) ? $selectedWidgets[$j] : null)->parse() . '</span>';
                 $widgetBoxes[$j]['widget'] = '<label for="widgets' . SpoonFilter::toCamelCase($widget['label']) . '">' . $widget['label'] . '</label>';
                 $widgetBoxes[$j]['description'] = $widget['description'];
             }
         }
         $selectedActions = array();
         // loop through action permissions
         foreach ($actionPermissions as $permission) {
             // add to selected actions
             if ($permission['module'] == $module['value']) {
                 $selectedActions[] = $permission['action'];
             }
         }
         // add module labels
         $permissionBoxes[$key]['label'] = $module['label'];
         // init var
         $addedBundles = array();
         // loop through actions
         foreach ($this->actions[$module['value']] as $i => $action) {
             // action is bundled?
             if (array_key_exists('group', $action)) {
                 // bundle not yet in array?
                 if (!in_array($action['group'], $addedBundles)) {
                     // assign bundled action boxes
                     $actionBoxes[$key]['actions'][$i]['checkbox'] = $this->frm->addCheckbox('actions_' . $module['label'] . '_' . 'Group_' . SpoonFilter::ucfirst($action['group']), in_array($action['value'], $selectedActions))->parse();
                     $actionBoxes[$key]['actions'][$i]['action'] = SpoonFilter::ucfirst($action['group']);
                     $actionBoxes[$key]['actions'][$i]['description'] = $this->actionGroups[$action['group']];
                     // add the group to the added bundles
                     $addedBundles[] = $action['group'];
                 }
             } else {
                 // assign action boxes
                 $actionBoxes[$key]['actions'][$i]['checkbox'] = $this->frm->addCheckbox('actions_' . $module['label'] . '_' . $action['label'], in_array($action['value'], $selectedActions))->parse();
                 $actionBoxes[$key]['actions'][$i]['action'] = '<label for="actions' . SpoonFilter::toCamelCase($module['label'] . '_' . $action['label']) . '">' . $action['label'] . '</label>';
                 $actionBoxes[$key]['actions'][$i]['description'] = $action['description'];
             }
         }
         // widgetboxes available?
         if (isset($widgetBoxes)) {
             // create datagrid
             $widgetGrid = new BackendDataGridArray($widgetBoxes);
             $widgetGrid->setHeaderLabels(array('checkbox' => '<span class="checkboxHolder"><input id="toggleChecksWidgets" type="checkbox" name="toggleChecks" value="toggleChecks" /></span>'));
             // get content
             $widgets = $widgetGrid->getContent();
         }
         // create datagrid
         $actionGrid = new BackendDataGridArray($actionBoxes[$key]['actions']);
         // disable paging
         $actionGrid->setPaging(false);
         // get content of datagrids
         $permissionBoxes[$key]['actions']['dataGrid'] = $actionGrid->getContent();
         $permissionBoxes[$key]['chk'] = $this->frm->addCheckbox($module['label'], null, 'inputCheckbox checkBeforeUnload selectAll')->parse();
         $permissionBoxes[$key]['id'] = SpoonFilter::toCamelCase($module['label']);
     }
     // create elements
     $this->frm->addText('name', $this->record['name']);
     $this->frm->addDropdown('manage_users', array('Deny', 'Allow'));
     $this->frm->addDropdown('manage_groups', array('Deny', 'Allow'));
     $this->tpl->assign('permissions', $permissionBoxes);
     $this->tpl->assign('widgets', isset($widgets) ? $widgets : false);
 }
Esempio n. 14
0
 /**
  * Load the datagrid for unsubscriptions
  */
 private function loadUnsubscriptions()
 {
     // get results
     $results = BackendMailmotorModel::getRecentUnsubscriptions(self::PAGING_LIMIT);
     // there are some results
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setPaging(false);
         $dataGrid->setColumnFunction(array('BackendDataGridFunctions', 'getTimeAgo'), array('[unsubscribed_on]'), 'unsubscribed_on', true);
         // check if this action is allowed
         if (BackendAuthentication::isAllowedAction('edit_address')) {
             $dataGrid->setColumnURL('email', BackendModel::createURLForAction('edit_address', 'mailmotor') . '&amp;email=[email]');
         }
         // parse the datagrid
         $this->tpl->assign('dgMailmotorUnsubscriptions', $dataGrid->getContent());
     }
 }
Esempio n. 15
0
 /**
  * Parses the most important pages
  */
 private function parseImportantPages()
 {
     $results = BackendAnalyticsModel::getTopPages($this->startTimestamp, $this->endTimestamp);
     if (!empty($results)) {
         $dataGrid = new BackendDataGridArray($results);
         $dataGrid->setColumnHidden('page_encoded');
         // check if this action is allowed
         if (BackendAuthentication::isAllowedAction('detail_page', $this->getModule())) {
             $dataGrid->setColumnURL('page', BackendModel::createURLForAction('detail_page') . '&amp;page=[page_encoded]');
         }
         // set headers
         $dataGrid->setHeaderLabels(array('pageviews_percentage' => '% ' . SpoonFilter::ucfirst(BL::lbl('Pageviews'))));
         // parse the datagrid
         $this->tpl->assign('dgContent', $dataGrid->getContent());
     }
 }
 /**
  * Parse into template
  *
  * @return	void
  */
 private function parseReferrers()
 {
     // get results
     $results = BackendAnalyticsModel::getRecentReferrers();
     // there are some results
     if (!empty($results)) {
         // get the datagrid
         $dataGrid = new BackendDataGridArray($results);
         // no pagination
         $dataGrid->setPaging();
         // hide columns
         $dataGrid->setColumnsHidden('id', 'date', 'url');
         // set url
         $dataGrid->setColumnURL('referrer', '[url]');
     }
     // parse the datagrid
     return !empty($results) ? $dataGrid->getContent() : '<table border="0" cellspacing="0" cellpadding="0" class="dataGrid"><tr><td>' . BL::msg('NoKeywords') . '</td></tr></table>';
 }