示例#1
0
 public function display($tpl = null)
 {
     // set title
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     // adding the toolbar on 2.5
     if (!RSFormProHelper::isJ('3.0')) {
         $this->addToolbar();
     }
     $layout = strtolower($this->getLayout());
     if ($layout == 'edit') {
         JToolBarHelper::apply('directory.apply');
         JToolBarHelper::save('directory.save');
         JToolBarHelper::cancel('directory.cancel');
         $backIcon = RSFormProHelper::isJ('3.0') ? 'previous' : 'back';
         JToolBarHelper::custom('directory.cancelform', $backIcon, $backIcon, JText::_('RSFP_BACK_TO_FORM'), false);
         RSFormProHelper::loadCodeMirror();
         $this->directory = $this->get('Directory');
         $this->formId = JRequest::getInt('formId', 0);
         $this->tab = JRequest::getInt('tab', 0);
         $this->emails = $this->get('emails');
         $this->fields = RSFormProHelper::getDirectoryFields($this->formId);
         $this->quickfields = $this->get('QuickFields');
         $lists['ViewLayoutAutogenerate'] = RSFormProHelper::renderHTML('select.booleanlist', 'jform[ViewLayoutAutogenerate]', 'onclick="changeDirectoryAutoGenerateLayout(' . $this->formId . ', this.value);"', $this->directory->ViewLayoutAutogenerate);
         $lists['enablepdf'] = RSFormProHelper::renderHTML('select.booleanlist', 'jform[enablepdf]', '', $this->directory->enablepdf);
         $lists['enablecsv'] = RSFormProHelper::renderHTML('select.booleanlist', 'jform[enablecsv]', '', $this->directory->enablecsv);
         $this->lists = $lists;
     } elseif ($layout == 'edit_emails') {
         $this->emails = $this->get('emails');
     } else {
         $this->addToolbar();
         JToolBarHelper::title(JText::_('RSFP_SUBM_DIR'), 'rsform');
         JToolbarHelper::deleteList('', 'directory.remove');
         $this->sidebar = $this->get('Sidebar');
         $this->forms = $this->get('forms');
         $this->pagination = $this->get('pagination');
         $this->sortColumn = $this->get('sortColumn');
         $this->sortOrder = $this->get('sortOrder');
     }
     parent::display($tpl);
 }
示例#2
0
 public function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $document = JFactory::getDocument();
     $document->addCustomTag('<!--[if IE 7]><link href="' . JURI::root() . 'administrator/components/com_rsform/assets/css/styleie.css" rel="stylesheet" type="text/css" /><![endif]-->');
     RSFormProHelper::loadCodeMirror();
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     // adding the toolbar on 2.5
     if (!RSFormProHelper::isJ('3.0')) {
         $this->addToolbar();
     }
     $layout = $this->getLayout();
     $this->isComponent = JRequest::getVar('tmpl') == 'component';
     $this->tooltipClass = RSFormPRoHelper::getTooltipClass();
     if ($layout == 'edit') {
         $submissionsIcon = RSFormProHelper::isJ('3.0') ? 'database' : 'forward';
         $previewIcon = RSFormProHelper::isJ('3.0') ? 'new tab' : 'preview';
         $directoryIcon = RSFormProHelper::isJ('3.0') ? 'folder' : 'forward';
         JToolBarHelper::apply('forms.apply');
         JToolBarHelper::save('forms.save');
         JToolBarHelper::spacer();
         JToolBarHelper::custom('forms.preview', $previewIcon, $previewIcon, JText::_('JGLOBAL_PREVIEW'), false);
         JToolBarHelper::custom('submissions.back', $submissionsIcon, $submissionsIcon, JText::_('RSFP_SUBMISSIONS'), false);
         JToolBarHelper::custom('forms.directory', $directoryIcon, $directoryIcon, JText::_('RSFP_DIRECTORY'), false);
         JToolBarHelper::custom('components.copy', 'copy', 'copy', JText::_('RSFP_COPY_TO_FORM'), false);
         JToolBarHelper::custom('components.duplicate', 'copy', 'copy', JText::_('RSFP_DUPLICATE'), false);
         JToolBarHelper::deleteList(JText::_('RSFP_ARE_YOU_SURE_DELETE'), 'components.remove', JText::_('JTOOLBAR_DELETE'));
         JToolBarHelper::publishList('components.publish', JText::_('JTOOLBAR_PUBLISH'));
         JToolBarHelper::unpublishList('components.unpublish', JText::_('JTOOLBAR_UNPUBLISH'));
         JToolBarHelper::spacer();
         JToolBarHelper::cancel('forms.cancel');
         $this->tabposition = JRequest::getInt('tabposition', 0);
         $this->tab = JRequest::getInt('tab', 0);
         $this->form = $this->get('form');
         $this->form_post = $this->get('formPost');
         $this->hasSubmitButton = $this->get('hasSubmitButton');
         JToolBarHelper::title('RSForm! Pro <small>[' . JText::sprintf('RSFP_EDITING_FORM', $this->form->FormTitle) . ']</small>', 'rsform');
         $lists['Published'] = $this->renderHTML('select.booleanlist', 'Published', '', $this->form->Published);
         $lists['ShowFormTitle'] = $this->renderHTML('select.booleanlist', 'ShowFormTitle', '', $this->form->ShowFormTitle);
         $lists['keepdata'] = $this->renderHTML('select.booleanlist', 'Keepdata', '', $this->form->Keepdata);
         $lists['confirmsubmission'] = $this->renderHTML('select.booleanlist', 'ConfirmSubmission', '', $this->form->ConfirmSubmission);
         $lists['ShowThankyou'] = $this->renderHTML('select.booleanlist', 'ShowThankyou', 'onclick="enableThankyou(this.value);"', $this->form->ShowThankyou);
         $lists['ShowContinue'] = $this->renderHTML('select.booleanlist', 'ShowContinue', !$this->form->ShowThankyou ? 'disabled="true"' : '', $this->form->ShowContinue);
         $lists['UserEmailMode'] = $this->renderHTML('select.booleanlist', 'UserEmailMode', 'onclick="enableEmailMode(\'User\', this.value)"', $this->form->UserEmailMode, JText::_('HTML'), JText::_('RSFP_COMP_FIELD_TEXT'));
         $lists['UserEmailAttach'] = $this->renderHTML('select.booleanlist', 'UserEmailAttach', 'onclick="enableAttachFile(this.value)"', $this->form->UserEmailAttach);
         $lists['AdminEmailMode'] = $this->renderHTML('select.booleanlist', 'AdminEmailMode', 'onclick="enableEmailMode(\'Admin\', this.value)"', $this->form->AdminEmailMode, JText::_('HTML'), JText::_('RSFP_COMP_FIELD_TEXT'));
         $lists['MetaTitle'] = $this->renderHTML('select.booleanlist', 'MetaTitle', '', $this->form->MetaTitle);
         $lists['TextareaNewLines'] = $this->renderHTML('select.booleanlist', 'TextareaNewLines', '', $this->form->TextareaNewLines);
         $lists['AjaxValidation'] = $this->renderHTML('select.booleanlist', 'AjaxValidation', '', $this->form->AjaxValidation);
         $lists['FormLayoutAutogenerate'] = $this->renderHTML('select.booleanlist', 'FormLayoutAutogenerate', 'onclick="changeFormAutoGenerateLayout(' . $this->form->FormId . ', this.value);"', $this->form->FormLayoutAutogenerate);
         $lists['post_enabled'] = $this->renderHTML('select.booleanlist', 'form_post[enabled]', '', $this->form_post->enabled);
         $lists['post_method'] = $this->renderHTML('select.booleanlist', 'form_post[method]', '', $this->form_post->method, JText::_('RSFP_POST_METHOD_POST'), JText::_('RSFP_POST_METHOD_GET'));
         $lists['post_silent'] = $this->renderHTML('select.booleanlist', 'form_post[silent]', '', $this->form_post->silent);
         $this->themes = $this->get('themes');
         $this->lang = $this->get('lang');
         // workaround for first time visit
         $session = JFactory::getSession();
         $session->set('com_rsform.form.' . $this->form->FormId . '.lang', $this->lang);
         $this->fields = $this->get('fields');
         $this->totalFields = $this->get('totalfields');
         $this->quickfields = $this->get('quickfields');
         $this->pagination = $this->get('fieldspagination');
         $this->calculations = RSFormProHelper::getCalculations($this->form->FormId);
         $lists['Languages'] = JHTML::_('select.genericlist', $this->get('languages'), 'Language', 'onchange="submitbutton(\'changeLanguage\')"', 'value', 'text', $this->lang);
         $lists['totalFields'] = JHTML::_('select.genericlist', $this->get('languages'), 'Language', 'onchange="submitbutton(\'changeLanguage\')"', 'value', 'text', $this->lang);
         $this->mappings = $this->get('mappings');
         $this->mpagination = $this->get('mpagination');
         $this->conditions = $this->get('conditions');
         $this->formId = $this->form->FormId;
         $this->emails = $this->get('emails');
         $this->lists = $lists;
     } elseif ($layout == 'new') {
         $nextIcon = RSFormProHelper::isJ('3.0') ? 'next' : 'forward';
         JToolBarHelper::custom('forms.new.steptwo', $nextIcon, $nextIcon, JText::_('JNEXT'), false);
         JToolBarHelper::cancel('forms.cancel');
     } elseif ($layout == 'new2') {
         $nextIcon = RSFormProHelper::isJ('3.0') ? 'next' : 'forward';
         JToolBarHelper::custom('forms.new.stepthree', $nextIcon, $nextIcon, JText::_('JNEXT'), false);
         JToolBarHelper::cancel('forms.cancel');
         $lists['AdminEmail'] = $this->renderHTML('select.booleanlist', 'AdminEmail', 'onclick="changeAdminEmail(this.value)"', 1);
         $lists['UserEmail'] = $this->renderHTML('select.booleanlist', 'UserEmail', '', 1);
         $actions = array(JHTML::_('select.option', 'refresh', JText::_('RSFP_SUBMISSION_REFRESH_PAGE')), JHTML::_('select.option', 'thankyou', JText::_('RSFP_SUBMISSION_THANKYOU')), JHTML::_('select.option', 'redirect', JText::_('RSFP_SUBMISSION_REDIRECT_TO')));
         $lists['SubmissionAction'] = JHTML::_('select.genericlist', $actions, 'SubmissionAction', 'onclick="changeSubmissionAction(this.value)"');
         $this->adminEmail = $this->get('adminEmail');
         $this->lists = $lists;
         $this->editor = JFactory::getEditor();
     } elseif ($layout == 'new3') {
         $nextIcon = RSFormProHelper::isJ('3.0') ? 'next' : 'forward';
         JToolBarHelper::custom('forms.new.stepfinal', $nextIcon, $nextIcon, JText::_('RSFP_FINISH'), false);
         JToolBarHelper::cancel('forms.cancel');
         $lists['predefinedForms'] = JHTML::_('select.genericlist', $this->get('predefinedforms'), 'predefinedForm', '');
         $this->lists = $lists;
     } elseif ($layout == 'component_copy') {
         JToolBarHelper::custom('components.copy.process', 'copy', 'copy', JText::_('RSFP_COPY'), false);
         JToolBarHelper::cancel('components.copy.cancel');
         $formlist = $this->get('formlist');
         $lists['forms'] = JHTML::_('select.genericlist', $formlist, 'toFormId', '', 'value', 'text');
         $this->formId = JRequest::getInt('formId');
         $this->cids = JRequest::getVar('cid', array());
         $this->lists = $lists;
     } elseif ($layout == 'richtext') {
         $this->editor = JFactory::getEditor();
         $this->noEditor = JRequest::getInt('noEditor');
         $this->formId = JRequest::getInt('formId');
         $this->editorName = JRequest::getCmd('opener');
         $this->editorText = $this->get('editorText');
     } elseif ($layout == 'edit_mappings') {
         $formId = JRequest::getInt('formId');
         $this->mappings = $this->get('mappings');
         $this->mpagination = $this->get('mpagination');
         $this->formId = $formId;
     } elseif ($layout == 'edit_conditions') {
         $formId = JRequest::getInt('formId');
         $this->conditions = $this->get('conditions');
         $this->formId = $formId;
     } elseif ($layout == 'edit_emails') {
         $this->emails = $this->get('emails');
         $this->lang = $this->get('emaillang');
     } elseif ($layout == 'show') {
         $db = JFactory::getDBO();
         $lang = JFactory::getLanguage();
         $lang->load('com_rsform', JPATH_SITE);
         $formId = JRequest::getInt('formId');
         $db->setQuery("SELECT FormTitle FROM #__rsform_forms WHERE FormId = " . $formId . " ");
         JToolBarHelper::title($db->loadResult(), 'rsform');
         $this->formId = $formId;
     } elseif ($layout == 'emails') {
         $this->row = $this->get('email');
         $this->lang = $this->get('emaillang');
         $lists['mode'] = $this->renderHTML('select.booleanlist', 'mode', 'onclick="showMode(this.value);"', $this->row->mode, JText::_('HTML'), JText::_('Text'));
         $lists['Languages'] = JHTML::_('select.genericlist', $this->get('languages'), 'ELanguage', 'onchange="submitbutton(\'changeEmailLanguage\')"', 'value', 'text', $this->lang);
         $this->lists = $lists;
         $this->editor = JFactory::getEditor();
         $this->quickfields = $this->get('quickfields');
     } else {
         $this->addToolbar();
         $this->sidebar = $this->get('Sidebar');
         JToolbarHelper::addNew('forms.add', JText::_('JTOOLBAR_NEW'));
         JToolBarHelper::spacer();
         JToolBarHelper::custom('forms.copy', 'copy.png', 'copy_f2.png', JText::_('RSFP_DUPLICATE'), false);
         JToolBarHelper::spacer();
         JToolBarHelper::deleteList(JText::_('RSFP_ARE_YOU_SURE_DELETE'), 'forms.delete', JText::_('JTOOLBAR_DELETE'));
         JToolBarHelper::spacer();
         JToolBarHelper::publishList('forms.publish', JText::_('JTOOLBAR_PUBLISH'));
         JToolBarHelper::unpublishList('forms.unpublish', JText::_('JTOOLBAR_UNPUBLISH'));
         $this->forms = $this->get('forms');
         $this->pagination = $this->get('pagination');
         $this->sortColumn = $this->get('sortColumn');
         $this->sortOrder = $this->get('sortOrder');
     }
     parent::display($tpl);
 }