Example #1
0
 /**
  * Parse the correct messages into the template
  */
 protected function parse()
 {
     parent::parse();
     // grab the error-type from the parameters
     $errorType = $this->getParameter('type');
     // set correct headers
     switch ($errorType) {
         case 'module-not-allowed':
         case 'action-not-allowed':
             SpoonHTTP::setHeadersByCode(403);
             break;
         case 'not-found':
             SpoonHTTP::setHeadersByCode(404);
             break;
     }
     // querystring provided?
     if ($this->getParameter('querystring') !== null) {
         // split into file and parameters
         $chunks = explode('?', $this->getParameter('querystring'));
         // get extension
         $extension = SpoonFile::getExtension($chunks[0]);
         // if the file has an extension it is a non-existing-file
         if ($extension != '' && $extension != $chunks[0]) {
             // set correct headers
             SpoonHTTP::setHeadersByCode(404);
             // give a nice error, so we can detect which file is missing
             echo 'Requested file (' . htmlspecialchars($this->getParameter('querystring')) . ') not found.';
             // stop script execution
             exit;
         }
     }
     // assign the correct message into the template
     $this->tpl->assign('message', BL::err(SpoonFilter::toCamelCase(htmlspecialchars($errorType), '-')));
 }
Example #2
0
 /**
  * Parse
  */
 protected function parse()
 {
     parent::parse();
     // form info
     $this->tpl->assign('name', $this->record['name']);
     $this->tpl->assign('formId', $this->record['id']);
     // sent info
     $this->tpl->assign('id', $this->data['id']);
     $this->tpl->assign('sentOn', $this->data['sent_on']);
     // init
     $data = array();
     // prepare data
     foreach ($this->data['fields'] as $field) {
         // implode arrays
         if (is_array($field['value'])) {
             $field['value'] = implode(', ', $field['value']);
         } else {
             $field['value'] = nl2br($field['value']);
         }
         // add to data
         $data[] = $field;
     }
     // assign
     $this->tpl->assign('data', $data);
     $this->tpl->assign('filter', $this->filter);
 }
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // parse the datagrid
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // parse mailing record
     $this->tpl->assign('mailing', $this->mailing);
 }
Example #4
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', BackendLanguage::getInterfaceLanguage());
     $this->frm->parse($this->tpl);
     $this->frmForgotPassword->parse($this->tpl);
 }
Example #5
0
 /**
  * Parse the dataGrids and the reports
  */
 protected function parse()
 {
     parent::parse();
     // parse dataGrids
     if (!empty($this->dataGrids)) {
         $this->tpl->assign('dataGrids', $this->dataGrids);
     }
     $this->tpl->assign('emptyDatagrid', $this->emptyDatagrid->getContent());
 }
Example #6
0
 /**
  * Parse the datagrid
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // get settings
     $settings = BackendModel::getModuleSettings();
     // assign to template
     $this->tpl->assign('items', BackendLocationModel::getAll());
     $this->tpl->assign('settings', $settings['location']);
 }
Example #7
0
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // parse the datagrid
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // parse group record in template
     $this->tpl->assign('group', $this->group);
 }
Example #8
0
 /**
  * Parse the datagrid and the reports
  */
 protected function parse()
 {
     parent::parse();
     // datagrid
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // form info
     $this->tpl->assign('name', $this->record['name']);
     $this->tpl->assign('id', $this->record['id']);
     $this->tpl->assignArray($this->filter);
 }
Example #9
0
 /**
  * Parse the datagrid
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     $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 #10
0
 /**
  * Parse the datagrid
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', $this->dataGrid->getContent());
 }
Example #11
0
 /**
  * Parse & display the page.
  */
 protected function parse()
 {
     parent::parse();
     // parse datagrid
     $this->tpl->assign('dgProfiles', $this->dgProfiles->getNumResults() != 0 ? $this->dgProfiles->getContent() : false);
     // parse paging & sorting
     $this->tpl->assign('offset', (int) $this->dgProfiles->getOffset());
     $this->tpl->assign('order', (string) $this->dgProfiles->getOrder());
     $this->tpl->assign('sort', (string) $this->dgProfiles->getSort());
     // parse filter
     $this->tpl->assign($this->filter);
 }
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // parse the datagrid
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // parse the campaign record
     $this->tpl->assign('campaign', $this->campaign);
     // parse statistics
     $this->tpl->assign('stats', $this->statistics);
 }
Example #13
0
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // CSV parameter (this is set when an import partially fails)
     $csv = $this->getParameter('csv');
     $download = $this->getParameter('download', 'bool', false);
     // a failed import just happened
     if (!empty($csv)) {
         // assign the CSV URL to the template
         $this->tpl->assign('csvURL', BackendModel::createURLForAction('addresses') . '&csv=' . $csv . '&download=1');
         // we should download the file
         if ($download) {
             $this->downloadCSV(BACKEND_CACHE_PATH . '/mailmotor/' . $csv);
         }
     }
     // parse the datagrid
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // parse paging & sorting
     $this->tpl->assign('offset', (int) $this->dataGrid->getOffset());
     $this->tpl->assign('order', (string) $this->dataGrid->getOrder());
     $this->tpl->assign('sort', (string) $this->dataGrid->getSort());
     // parse filter
     $this->tpl->assign($this->filter);
 }
Example #14
0
 /**
  * Parse the page with its widgets.
  */
 protected function parse()
 {
     parent::parse();
     // show report
     if ($this->getParameter('password_reset') == 'success') {
         $this->tpl->assign('reportMessage', BL::msg('PasswordResetSuccess', 'core'));
         $this->tpl->assign('report', true);
     }
     // assign
     $this->tpl->assign('leftColumn', $this->widgets['left']);
     $this->tpl->assign('middleColumn', $this->widgets['middle']);
     $this->tpl->assign('rightColumn', $this->widgets['right']);
 }
Example #15
0
 /**
  * Parse.
  */
 protected function parse()
 {
     parent::parse();
     // assign theme data
     $this->tpl->assign('name', $this->currentTheme);
     $this->tpl->assign('warnings', $this->warnings);
     $this->tpl->assign('information', $this->information);
     $this->tpl->assign('showExtensionsInstallTheme', !BackendExtensionsModel::isThemeInstalled($this->currentTheme) && BackendAuthentication::isAllowedAction('install_theme'));
     // data grids
     $this->tpl->assign('dataGridTemplates', isset($this->dataGridTemplates) && $this->dataGridTemplates->getNumResults() > 0 ? $this->dataGridTemplates->getContent() : false);
 }
Example #16
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     $this->frm->parse($this->tpl);
 }
Example #17
0
 /**
  * Parse.
  */
 protected function parse()
 {
     parent::parse();
     // assign module data
     $this->tpl->assign('name', $this->currentModule);
     $this->tpl->assign('warnings', $this->warnings);
     $this->tpl->assign('information', $this->information);
     $this->tpl->assign('showExtensionsInstallModule', !BackendExtensionsModel::isModuleInstalled($this->currentModule) && BackendAuthentication::isAllowedAction('install_module'));
     // data grids
     $this->tpl->assign('dataGridEvents', isset($this->dataGridEvents) && $this->dataGridEvents->getNumResults() > 0 ? $this->dataGridEvents->getContent() : false);
     $this->tpl->assign('dataGridCronjobs', isset($this->dataGridCronjobs) && $this->dataGridCronjobs->getNumResults() > 0 ? $this->dataGridCronjobs->getContent() : false);
 }
Example #18
0
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // parse the datagrid
     if (!empty($this->statistics['clicked_links'])) {
         $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     }
     // parse the mailing record
     $this->tpl->assign('mailing', $this->mailing);
     // parse statistics
     $this->tpl->assign('stats', $this->statistics);
 }
Example #19
0
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // a campaign was found, so parse the campaign record
     if (!empty($this->campaign)) {
         $this->tpl->assign($this->campaign);
     }
     // parse the datagrid for all unsent mailings
     $this->tpl->assign('dgUnsentMailings', $this->dgUnsentMailings->getNumResults() != 0 ? $this->dgUnsentMailings->getContent() : false);
     // parse the datagrid for all sent mailings
     $this->tpl->assign('dgSentMailings', $this->dgSentMailings->getNumResults() != 0 ? $this->dgSentMailings->getContent() : false);
     // parse the datagrid for all queued mailings
     $this->tpl->assign('dgQueuedMailings', $this->dgQueuedMailings->getNumResults() != 0 ? $this->dgQueuedMailings->getContent() : false);
 }
Example #20
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();
 }
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // manually parse fields
     $this->frm->parse($this->tpl);
     // parse the datagrid
     if (!empty($this->statistics['clicked_links_by'][$this->linkURL])) {
         $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     }
     // parse the mailing ID and url
     $this->tpl->assign('url', $this->linkURL);
     // parse statistics
     $this->tpl->assign('stats', $this->statistics);
     // parse mailing record
     $this->tpl->assign('mailing', $this->mailing);
 }
Example #22
0
 /**
  * Parse the datagrids and the reports.
  */
 protected function parse()
 {
     parent::parse();
     // parse data grid
     $this->tpl->assign('dataGridInstallableModules', (string) $this->dataGridInstallableModules->getContent());
     $this->tpl->assign('dataGridInstalledModules', (string) $this->dataGridInstalledModules->getContent());
     // parse installer warnings
     $this->tpl->assign('warnings', (array) SpoonSession::get('installer_warnings'));
 }
Example #23
0
 /**
  * Parse & display the page
  */
 protected function parse()
 {
     parent::parse();
     // published datagrid and num results
     $this->tpl->assign('dgPublished', $this->dgPublished->getNumResults() != 0 ? $this->dgPublished->getContent() : false);
     $this->tpl->assign('numPublished', $this->dgPublished->getNumResults());
     // moderaton datagrid and num results
     $this->tpl->assign('dgModeration', $this->dgModeration->getNumResults() != 0 ? $this->dgModeration->getContent() : false);
     $this->tpl->assign('numModeration', $this->dgModeration->getNumResults());
     // spam datagrid and num results
     $this->tpl->assign('dgSpam', $this->dgSpam->getNumResults() != 0 ? $this->dgSpam->getContent() : false);
     $this->tpl->assign('numSpam', $this->dgSpam->getNumResults());
 }
Example #24
0
 /**
  * Parse the datagrid and the reports
  */
 protected function parse()
 {
     parent::parse();
     // parse dgRecentlyEdited
     $this->tpl->assign('dgRecentlyEdited', $this->dgRecentlyEdited->getNumResults() != 0 ? $this->dgRecentlyEdited->getContent() : false);
     $this->tpl->assign('dgDrafts', $this->dgDrafts->getNumResults() != 0 ? $this->dgDrafts->getContent() : false);
     // parse the tree
     $this->tpl->assign('tree', BackendPagesModel::getTreeHTML());
     // open the tree on a specific page
     if ($this->getParameter('id', 'int') !== null) {
         $this->tpl->assign('openedPageId', $this->getParameter('id', 'int'));
     } else {
         $this->tpl->assign('openedPageId', 1);
     }
 }
Example #25
0
 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     // parse the form
     $this->frm->parse($this->tpl);
 }
Example #26
0
 /**
  * Parse & display the page
  */
 protected function parse()
 {
     parent::parse();
     // parse datagrids
     $this->tpl->assign('dgLabels', $this->dgLabels->getNumResults() != 0 ? $this->dgLabels->getContent() : false);
     $this->tpl->assign('dgMessages', $this->dgMessages->getNumResults() != 0 ? $this->dgMessages->getContent() : false);
     $this->tpl->assign('dgErrors', $this->dgErrors->getNumResults() != 0 ? $this->dgErrors->getContent() : false);
     $this->tpl->assign('dgActions', $this->dgActions->getNumResults() != 0 ? $this->dgActions->getContent() : false);
     // is filtered?
     if ($this->getParameter('form', 'string', '') == 'filter') {
         $this->tpl->assign('filter', true);
     }
     // parse filter as query
     $this->tpl->assign('filter', $this->filterQuery);
     // parse isGod
     $this->tpl->assign('isGod', $this->isGod);
     // parse noItems, if all the datagrids are empty
     $this->tpl->assign('noItems', $this->dgLabels->getNumResults() == 0 && $this->dgMessages->getNumResults() == 0 && $this->dgErrors->getNumResults() == 0 && $this->dgActions->getNumResults() == 0);
     // parse the add URL
     $this->tpl->assign('addURL', BackendModel::createURLForAction('add', null, null, null) . $this->filterQuery);
 }
Example #27
0
 /**
  * Parse & display the page
  */
 protected function parse()
 {
     parent::parse();
     // parse datagrid
     $this->tpl->assign('dgBackend', $this->dgBackend->getNumResults() != 0 ? $this->dgBackend->getContent() : false);
     $this->tpl->assign('dgFrontend', $this->dgFrontend->getNumResults() != 0 ? $this->dgFrontend->getContent() : false);
     // parse filter
     $this->tpl->assign('language', BackendLanguage::getWorkingLanguage());
 }
Example #28
0
 /**
  * Parse & display the page
  */
 protected function parse()
 {
     parent::parse();
     // assign the datagrid
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
 }
Example #29
0
 /**
  * Parse all datagrids
  */
 protected function parse()
 {
     parent::parse();
     // parse the datagrid for the drafts
     $this->tpl->assign('dgDrafts', $this->dgDrafts->getNumResults() != 0 ? $this->dgDrafts->getContent() : false);
     // parse the datagrid for all blogposts
     $this->tpl->assign('dgPosts', $this->dgPosts->getNumResults() != 0 ? $this->dgPosts->getContent() : false);
     // parse the datagrid for the most recent blogposts
     $this->tpl->assign('dgRecent', is_object($this->dgRecent) && $this->dgRecent->getNumResults() != 0 ? $this->dgRecent->getContent() : false);
     // get categories
     $categories = BackendBlogModel::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);
     }
 }