示例#1
0
 public function display($tpl = null)
 {
     $this->app = JFactory::getApplication();
     $this->doc = JFactory::getDocument();
     $this->document =& $this->doc;
     $this->params = $this->app->getParams('com_rsform');
     $this->layout = $this->getLayout();
     $this->directory = $this->get('Directory');
     $this->tooltipClass = RSFormProHelper::getTooltipClass();
     if ($this->layout == 'view') {
         $this->doc->addStyleSheet(JURI::root(true) . '/components/com_rsform/assets/css/directory.css');
         $this->template = $this->get('template');
         $this->canEdit = RSFormProHelper::canEdit($this->params->get('formId'), $this->app->input->getInt('id', 0));
         $this->id = $this->app->input->getInt('id', 0);
         // Add custom CSS and JS
         if ($this->directory->JS) {
             $this->doc->addCustomTag($this->directory->JS);
         }
         if ($this->directory->CSS) {
             $this->doc->addCustomTag($this->directory->CSS);
         }
         // Add pathway
         $this->app->getPathway()->addItem(JText::_('RSFP_SUBM_DIR_VIEW'), '');
     } elseif ($this->layout == 'edit') {
         if (RSFormProHelper::canEdit($this->params->get('formId'), $this->app->input->getInt('id', 0))) {
             $this->doc->addStyleSheet(JURI::root(true) . '/components/com_rsform/assets/css/directory.css');
             $this->fields = $this->get('EditFields');
         } else {
             $this->app->redirect(JURI::root());
         }
         // Add pathway
         $this->app->getPathway()->addItem(JText::_('RSFP_SUBM_DIR_EDIT'), '');
     } else {
         $this->search = $this->get('Search');
         $this->items = $this->get('Items');
         $this->uploadFields = $this->get('uploadFields');
         $this->multipleFields = $this->get('multipleFields');
         $this->unescapedFields = array_merge($this->multipleFields, $this->uploadFields);
         $this->fields = $this->get('Fields');
         $this->headers = RSFormProHelper::getDirectoryStaticHeaders();
         $this->hasDetailFields = $this->hasDetailFields();
         $this->hasSearchFields = $this->hasSearchFields();
         $this->viewableFields = $this->getViewableFields();
         $this->pagination = $this->get('Pagination');
         $this->filter_search = $this->get('Search');
         $this->filter_order = $this->get('ListOrder');
         $this->filter_order_Dir = $this->get('ListDirn');
         // Add custom CSS and JS
         if ($this->directory->JS) {
             $this->doc->addCustomTag($this->directory->JS);
         }
         if ($this->directory->CSS) {
             $this->doc->addCustomTag($this->directory->CSS);
         }
     }
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
     if ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = JFactory::getConfig()->get('sitename');
     } elseif (JFactory::getConfig()->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', JFactory::getConfig()->get('sitename'), $title);
     } elseif (JFactory::getConfig()->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, JFactory::getConfig()->get('sitename'));
     }
     $this->document->setTitle($title);
     parent::display($tpl);
 }
示例#2
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     // adding the toolbar on 2.5
     if (!RSFormProHelper::isJ('3.0')) {
         $this->addToolbar();
     }
     $this->tooltipClass = RSFormProHelper::getTooltipClass();
     $layout = strtolower($this->getLayout());
     if ($layout == 'export') {
         JToolBarHelper::custom('submissions.export.task', 'archive', 'archive', JText::_('RSFP_EXPORT'), false);
         JToolBarHelper::spacer();
         JToolBarHelper::cancel('submissions.manage');
         $this->formId = $this->get('formId');
         $this->headers = $this->get('headers');
         $this->staticHeaders = $this->get('staticHeaders');
         $previewArray = array();
         $i = 0;
         foreach ($this->staticHeaders as $header) {
             $i++;
             $previewArray[] = 'Value ' . $i;
         }
         foreach ($this->headers as $header) {
             $i++;
             $previewArray[] = 'Value ' . $i;
         }
         $this->previewArray = $previewArray;
         $this->formTitle = $this->get('formTitle');
         $this->exportSelected = $this->get('exportSelected');
         $this->exportSelectedCount = count($this->exportSelected);
         $this->exportAll = $this->exportSelectedCount == 0;
         $this->exportType = $this->get('exportType');
         $this->exportFile = $this->get('exportFile');
         $formTitle = $this->get('formTitle');
         JToolBarHelper::title('RSForm! Pro <small>[' . JText::sprintf('RSFP_EXPORTING', $this->exportType, $formTitle) . ']</small>', 'rsform');
         // tabs
         $this->tabs = $this->get('RSTabs');
     } elseif ($layout == 'exportprocess') {
         $this->limit = 500;
         $this->total = $this->get('exportTotal');
         $this->file = JRequest::getCmd('ExportFile');
         $this->exportType = JRequest::getCmd('exportType');
         $this->formId = $this->get('FormId');
         $formTitle = $this->get('formTitle');
         JToolBarHelper::title('RSForm! Pro <small>[' . JText::sprintf('RSFP_EXPORTING', $this->exportType, $formTitle) . ']</small>', 'rsform');
     } elseif ($layout == 'edit') {
         JToolBarHelper::custom('submission.export.pdf', 'archive', 'archive', JText::_('RSFP_EXPORT_PDF'), false);
         JToolBarHelper::spacer();
         JToolBarHelper::apply('submissions.apply');
         JToolBarHelper::save('submissions.save');
         JToolBarHelper::spacer();
         JToolBarHelper::cancel('submissions.manage');
         $this->formId = $this->get('submissionFormId');
         $this->submissionId = $this->get('submissionId');
         $this->submission = $this->get('submission');
         $this->staticHeaders = $this->get('staticHeaders');
         $this->staticFields = $this->get('staticFields');
         $this->fields = $this->get('editFields');
     } else {
         JToolBarHelper::custom('submissions.export.csv', 'archive', 'archive', JText::_('RSFP_EXPORT_CSV'), false);
         JToolBarHelper::custom('submissions.export.ods', 'archive', 'archive', JText::_('RSFP_EXPORT_ODS'), false);
         JToolBarHelper::custom('submissions.export.excelxml', 'archive', 'archive', JText::_('RSFP_EXPORT_EXCEL_XML'), false);
         JToolBarHelper::custom('submissions.export.excel', 'archive', 'archive', JText::_('RSFP_EXPORT_EXCEL'), false);
         JToolBarHelper::custom('submissions.export.xml', 'archive', 'archive', JText::_('RSFP_EXPORT_XML'), false);
         JToolBarHelper::spacer();
         $backIcon = RSFormProHelper::isJ('3.0') ? 'previous' : 'back';
         $sendIcon = RSFormProHelper::isJ('3.0') ? 'mail' : 'send';
         JToolBarHelper::custom('submissions.cancelform', $backIcon, $backIcon, JText::_('RSFP_BACK_TO_FORM'), false);
         JToolBarHelper::spacer();
         JToolBarHelper::custom('submissions.resend', $sendIcon, $sendIcon, JText::_('RSFP_RESEND_EMAILS'), false);
         JToolbarHelper::editList('submissions.edit', JText::_('JTOOLBAR_EDIT'));
         JToolBarHelper::deleteList(JText::_('RSFP_ARE_YOU_SURE_DELETE'), 'submissions.delete', JText::_('JTOOLBAR_DELETE'));
         JToolBarHelper::spacer();
         JToolBarHelper::cancel('submissions.cancel', JText::_('JTOOLBAR_CLOSE'));
         $forms = $this->get('forms');
         $formId = $this->get('formId');
         $formTitle = $this->get('formTitle');
         JToolBarHelper::title('RSForm! Pro <small>[' . $formTitle . ']</small>', 'rsform');
         $this->headers = $this->get('headers');
         $this->uploads = $this->get('uploadFields');
         $this->staticHeaders = $this->get('staticHeaders');
         $this->submissions = $this->get('submissions');
         $this->pagination = $this->get('pagination');
         $this->sortColumn = $this->get('sortColumn');
         $this->sortOrder = $this->get('sortOrder');
         $this->filter = $this->get('filter');
         $this->formId = $formId;
         $calendars['from'] = JHTML::calendar($this->get('dateFrom'), 'dateFrom', 'dateFrom');
         $calendars['to'] = JHTML::calendar($this->get('dateTo'), 'dateTo', 'dateTo');
         $this->calendars = $calendars;
         $lists['Languages'] = JHTML::_('select.genericlist', $this->get('languages'), 'Language', '', 'value', 'text', $this->get('lang'));
         $lists['forms'] = JHTML::_('select.genericlist', $forms, 'formId', 'onchange="submissionChangeForm(this.value)"', 'value', 'text', $formId);
         $this->lists = $lists;
     }
     parent::display($tpl);
 }