parse() public method

Parse the form
public parse ( TwigTemplate $tpl )
$tpl TwigTemplate The template instance wherein the form will be parsed.
Example #1
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     if ($this->frm) {
         $this->frm->parse($this->tpl);
     }
 }
Example #2
0
 /**
  * Parse the action into the template
  */
 public function parse()
 {
     parent::parse();
     // assign the interface language ourself, because it won't be assigned automagically
     $this->tpl->assign('INTERFACE_LANGUAGE', BL::getInterfaceLanguage());
     $this->frm->parse($this->tpl);
     $this->frmForgotPassword->parse($this->tpl);
 }
Example #3
0
 protected function parse()
 {
     parent::parse();
     $this->form->parse($this->tpl);
     if ($this->get('fork.settings')->get($this->getModule(), 'web_property_id')) {
         $this->tpl->assign('web_property_id', $this->get('fork.settings')->get($this->getModule(), 'web_property_id'));
     }
     if ($this->get('fork.settings')->get($this->getModule(), 'profile')) {
         $this->tpl->assign('profile', $this->get('fork.settings')->get($this->getModule(), 'profile'));
     }
 }
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // Add jsTree plugin
     $this->header->addJS('jstree.min.js', $this->getModule(), false, false);
     $this->header->addCSS('jstree/style.min.css', $this->getModule(), false, false);
     // Show the API key form if we don't have one set
     if (!isset($this->apiKey)) {
         $this->tpl->assign('NoApiKey', true);
         $this->tpl->assign('Wizard', true);
         // create api key form
         $this->frmApiKey = new BackendForm('apiKey');
         $this->frmApiKey->addText('key', $this->apiKey);
         if ($this->frmApiKey->isSubmitted()) {
             $this->frmApiKey->getField('key')->isFilled(BL::err('FieldIsRequired'));
             if ($this->frmApiKey->isCorrect()) {
                 BackendModel::setModuleSetting($this->getModule(), 'api_key', $this->frmApiKey->getField('key')->getValue());
                 $this->redirect(BackendModel::createURLForAction('Settings') . '&report=saved');
             }
         }
         $this->frmApiKey->parse($this->tpl);
     } else {
         // show the settings form
         $this->tpl->assign('EverythingIsPresent', true);
         $this->loadCompressionSettingsForm();
         $this->tpl->assign('directoryTree', $this->directoryTreeHtml);
         $this->validateCompressionSettingsForm();
         $this->frmCompressionSettings->parse($this->tpl);
     }
 }
Example #5
0
 /**
  * Parse the form.
  */
 protected function parse()
 {
     parent::parse();
     $this->frm->parse($this->tpl);
     // parse not yet installed themes
     $this->tpl->assign('installableThemes', $this->installableThemes);
 }
Example #6
0
 /**
  * Load the form.
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('filter', BackendModel::createURLForAction(), 'get');
     // add fields
     $this->frm->addText('name', $this->filter['name']);
     // manually parse fields
     $this->frm->parse($this->tpl);
 }
Example #7
0
 /**
  * Parse the datagrid
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', (string) $this->dataGrid->getContent());
     $this->tpl->assign('godUser', BackendAuthentication::getUser()->isGod());
     // assign to template
     $this->tpl->assign('items', $this->items);
     $this->tpl->assign('settings', $this->settings);
     $this->form->parse($this->tpl);
 }
Example #8
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // assign to template
     $this->tpl->assign('item', $this->record);
     $this->tpl->assign('settings', $this->settings);
     $this->tpl->assign('godUser', BackendAuthentication::getUser()->isGod());
     $this->settingsForm->parse($this->tpl);
     // assign message if address was not be geocoded
     if ($this->record['lat'] == null || $this->record['lng'] == null) {
         $this->tpl->assign('errorMessage', BL::err('AddressCouldNotBeGeocoded'));
     }
 }
Example #9
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     $this->frm = new BackendForm('filter', BackendModel::createURLForAction(), 'get');
     $this->frm->addDropdown('application', array('' => '-', 'Backend' => 'Backend', 'Frontend' => 'Frontend'), $this->filter['application']);
     $this->frm->addText('name', $this->filter['name']);
     $this->frm->addText('value', $this->filter['value']);
     $this->frm->addMultiCheckbox('language', BackendLocaleModel::getLanguagesForMultiCheckbox($this->isGod), $this->filter['language'], 'noFocus');
     $this->frm->addMultiCheckbox('type', BackendLocaleModel::getTypesForMultiCheckbox(), $this->filter['type'], 'noFocus');
     $this->frm->addDropdown('module', BackendModel::getModulesForDropDown(), $this->filter['module']);
     $this->frm->getField('module')->setDefaultElement('-');
     // manually parse fields
     $this->frm->parse($this->tpl);
 }
Example #10
0
 protected function parse()
 {
     parent::parse();
     $this->header->addJS('highcharts.js', 'Core', false);
     $this->form->parse($this->tpl);
     $this->tpl->assign('startTimestamp', $this->startDate);
     $this->tpl->assign('endTimestamp', $this->endDate);
     // if we don't have a token anymore, redirect to the settings page
     if ($this->get('fork.settings')->get($this->getModule(), 'certificate') === null || $this->get('fork.settings')->get($this->getModule(), 'account') === null || $this->get('fork.settings')->get($this->getModule(), 'web_property_id') === null || $this->get('fork.settings')->get($this->getModule(), 'profile') === null) {
         $this->redirect(Model::createURLForAction('Settings'));
     }
     $analytics = $this->get('analytics.connector');
     $this->tpl->assign('page_views', $analytics->getPageViews($this->startDate, $this->endDate));
     $this->tpl->assign('visitors', $analytics->getVisitors($this->startDate, $this->endDate));
     $this->tpl->assign('pages_per_visit', $analytics->getPagesPerVisit($this->startDate, $this->endDate));
     $this->tpl->assign('time_on_site', $analytics->getTimeOnSite($this->startDate, $this->endDate));
     $this->tpl->assign('new_sessions_percentage', $analytics->getNewSessionsPercentage($this->startDate, $this->endDate));
     $this->tpl->assign('bounce_rate', $analytics->getBounceRate($this->startDate, $this->endDate));
     $this->tpl->assign('visitors_graph_data', $analytics->getVisitorsGraphData($this->startDate, $this->endDate));
     $this->tpl->assign('source_graph_data', $analytics->getSourceGraphData($this->startDate, $this->endDate));
     $dataGrid = new DataGridArray($analytics->getMostVisitedPagesData($this->startDate, $this->endDate));
     $this->tpl->assign('dataGridMostViewedPages', (string) $dataGrid->getContent());
 }
Example #11
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('filter', null, 'get');
     // add fields
     $this->frm->addText('email', $this->filter['email']);
     $this->frm->addHidden('group_id', $this->group['id']);
     // manually parse fields
     $this->frm->parse($this->tpl);
     // check if the filter form was set
     if ($this->frm->isSubmitted()) {
         $this->tpl->assign('oPost', true);
     }
 }
Example #12
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // show options
     if ($this->needsAkismet) {
         $this->tpl->assign('needsAkismet', true);
     }
     if ($this->needsGoogleMaps) {
         $this->tpl->assign('needsGoogleMaps', true);
     }
     // parse the form
     $this->frm->parse($this->tpl);
     // parse the warnings
     $this->parseWarnings();
 }
Example #13
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // parse settings in template
     $this->tpl->assign('account', $this->accountLinked);
     // parse client ID
     if ($this->accountLinked && !empty($this->settings['cm_client_id'])) {
         $this->tpl->assign('clientId', $this->settings['cm_client_id']);
     }
     // parse god status
     $this->tpl->assign('userIsGod', BackendAuthentication::getUser()->isGod());
     // add all forms to template
     $this->frmAccount->parse($this->tpl);
     $this->frmClient->parse($this->tpl);
     $this->frmGeneral->parse($this->tpl);
 }
Example #14
0
 /**
  * Load the form.
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('filter', BackendModel::createURLForAction(), 'get');
     // add fields
     $this->frm->addText('email', $this->filter['email']);
     $this->frm->addText('name', $this->filter['name']);
     // get categories
     $groups = BackendMailengineModel::getAllGroupsForDropdown();
     $groups = array("0" => "") + $groups;
     // multiple categories?
     if (count($groups) > 1) {
         // create element
         $this->frm->addDropdown('group', $groups, $this->filter["group"]);
         $this->frm->getField('group')->setDefaultElement('');
     }
     // manually parse fields
     $this->frm->parse($this->tpl);
 }
Example #15
0
 /**
  * Load the form.
  */
 private function loadForm()
 {
     // create form
     $this->frm = new BackendForm('filter', BackendModel::createURLForAction(), 'get');
     // values for dropdowns
     $status = BackendProfilesModel::getStatusForDropDown();
     $groups = BackendProfilesModel::getGroups();
     // add fields
     $this->frm->addText('email', $this->filter['email']);
     $this->frm->addDropdown('status', $status, $this->filter['status']);
     $this->frm->getField('status')->setDefaultElement('');
     // add a group filter if wa have groups
     if (!empty($groups)) {
         $this->frm->addDropdown('group', $groups, $this->filter['group']);
         $this->frm->getField('group')->setDefaultElement('');
     }
     // manually parse fields
     $this->frm->parse($this->tpl);
 }
Example #16
0
 /**
  * Load the form
  */
 private function loadForm()
 {
     $startDate = '';
     $endDate = '';
     if (isset($this->filter['start_date']) && $this->filter['start_date'] != '') {
         $chunks = explode('/', $this->filter['start_date']);
         $startDate = (int) mktime(0, 0, 0, (int) $chunks[1], (int) $chunks[0], (int) $chunks[2]);
         if ($startDate == 0) {
             $startDate = '';
         }
     }
     if (isset($this->filter['end_date']) && $this->filter['end_date'] != '') {
         $chunks = explode('/', $this->filter['end_date']);
         $endDate = (int) mktime(0, 0, 0, (int) $chunks[1], (int) $chunks[0], (int) $chunks[2]);
         if ($endDate == 0) {
             $endDate = '';
         }
     }
     $this->frm = new BackendForm('filter', BackendModel::createURLForAction() . '&id=' . $this->id, 'get');
     $this->frm->addDate('start_date', $startDate);
     $this->frm->addDate('end_date', $endDate);
     // manually parse fields
     $this->frm->parse($this->tpl);
 }
Example #17
0
 /**
  * Parse the page
  */
 protected function parse()
 {
     // parse the datagrid for all products
     $this->tpl->assign('dgProducts', $this->dgProducts->getNumResults() != 0 ? $this->dgProducts->getContent() : false);
     // get categories
     $categories = BackendCatalogModel::getCategories(true);
     // multiple categories?
     if (count($categories) > 1) {
         // create form
         $frm = new BackendForm('filter', null, 'get', true);
         // create element
         $frm->addDropdown('category', $categories, $this->categoryId);
         $frm->getField('category')->setDefaultElement('');
         // parse the form
         $frm->parse($this->tpl);
     }
     // parse category
     if (!empty($this->category)) {
         $this->tpl->assign('filterCategory', $this->category);
     }
 }
Example #18
0
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // parse the datagrid for the drafts
     $this->tpl->assign('dgDrafts', (string) $this->dgDrafts->getContent());
     // parse the datagrid for all blogposts
     $this->tpl->assign('dgPosts', (string) $this->dgPosts->getContent());
     // parse the datagrid for the most recent blogposts
     $this->tpl->assign('dgRecent', is_object($this->dgRecent) ? $this->dgRecent->getContent() : false);
     // get categories
     $categories = BackendBlogModel::getCategories(true);
     $hasMultipleCategories = count($categories) > 1;
     $this->tpl->assign('hasMultipleCategories', $hasMultipleCategories);
     // multiple categories?
     if ($hasMultipleCategories) {
         // create form
         $frm = new BackendForm('filter', null, 'get', false);
         // create element
         $frm->addDropdown('category', $categories, $this->categoryId);
         $frm->getField('category')->setDefaultElement('');
         // parse the form
         $frm->parse($this->tpl);
     }
     // parse category
     if (!empty($this->category)) {
         $this->tpl->assign('filterCategory', $this->category);
     }
 }
Example #19
0
 /**
  * @param TwigTemplate $template
  */
 public function parse(TwigTemplate $template)
 {
     $this->form->parse($template);
     $template->assign('startTimestamp', $this->dateRange->getStartDate());
     $template->assign('endTimestamp', $this->dateRange->getEndDate());
 }
 /**
  * @param TwigTemplate $template
  */
 public function parse(TwigTemplate $template)
 {
     $this->form->parse($template);
 }
Example #21
0
 private function loadFilterForm()
 {
     // get categories
     $groups = BackendAddressesModel::getAllGroupsTree();
     //$groups = array('') + $groups;
     // multiple categories?
     if (count($groups) > 1) {
         // create form
         $frm = new BackendForm('filter', null, 'get', false);
         // create element
         $frm->addDropdown('group', $groups, $this->groupId);
         //			$frm->getField('category')->setDefaultElement('');
         // parse the form
         $frm->parse($this->tpl);
     }
     // parse category
     if (!empty($this->category)) {
         $this->tpl->assign('filterGroup', $this->group);
     }
 }
Example #22
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // parse the form
     $this->frm->parse($this->tpl);
 }
 /**
  * Parses the form to the template
  *
  * @param SpoonTemplate $template
  */
 public function parse(SpoonTemplate $template)
 {
     $this->form->parse($template);
 }
Example #24
0
 private function loadFilterForm()
 {
     // get categories
     $categories = BackendCatalogModel::getCategories(true);
     // multiple categories?
     if (count($categories) > 1) {
         // create form
         $frm = new BackendForm('filter', null, 'get', false);
         // create element
         $frm->addDropdown('category', $categories, $this->categoryId);
         //			$frm->getField('category')->setDefaultElement('');
         // parse the form
         $frm->parse($this->tpl);
     }
     // parse category
     if (!empty($this->category)) {
         $this->tpl->assign('filterCategory', $this->category);
     }
 }