示例#1
0
 protected function addToolBar()
 {
     // set title
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     $backupIcon = RSFormProHelper::isJ('3.0') ? 'download' : 'archive';
     $restoreIcon = RSFormProHelper::isJ('3.0') ? 'upload' : 'unarchive';
     JToolBarHelper::custom('backup.download', $backupIcon, $backupIcon, JText::_('RSFP_BACKUP_GENERATE'), false);
     JToolBarHelper::custom('restore.process', $restoreIcon, $restoreIcon, JText::_('RSFP_RESTORE'), false);
     require_once JPATH_COMPONENT . '/helpers/toolbar.php';
     RSFormProToolbarHelper::addToolbar('backuprestore');
 }
示例#2
0
 function display($tpl = null)
 {
     $this->addToolbar();
     $doc = JFactory::getDocument();
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/dashboard.css');
     $this->isJ30 = RSFormProHelper::isJ('3.0');
     $this->buttons = $this->get('Buttons');
     $this->code = $this->get('code');
     $this->version = (string) new RSFormProVersion();
     $this->sidebar = $this->get('SideBar');
     parent::display($tpl);
 }
示例#3
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);
 }
示例#4
0
 function __construct()
 {
     parent::__construct();
     if (RSFormProHelper::isJ16()) {
         JHTML::_('behavior.framework');
     }
     $this->_db = JFactory::getDBO();
     $version = new RSFormProVersion();
     $v = $version->revision;
     $doc = JFactory::getDocument();
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.js?v=' . $v);
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/script.js?v=' . $v);
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/tablednd.js?v=' . $v);
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.scrollto.js?v=' . $v);
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style.css?v=' . $v);
     if (RSFormProHelper::isJ('2.5') && !RSFormProHelper::isJ('3.0')) {
         $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style25.css?v=' . $v);
     } elseif (RSFormProHelper::isJ('3.0')) {
         $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style30.css?v=' . $v);
     }
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/rsdesign.css?v=' . $v);
 }
示例#5
0
 protected function renderHTML()
 {
     $args = func_get_args();
     if (RSFormProHelper::isJ('3.0')) {
         if ($args[0] == 'select.booleanlist') {
             // 0 - type
             // 1 - name
             // 2 - additional
             // 3 - value
             // 4 - yes
             // 5 - no
             // get the radio element
             $radio = JFormHelper::loadFieldType('radio');
             // setup the properties
             $name = $this->escape($args[1]);
             $additional = isset($args[2]) ? (string) $args[2] : '';
             $value = $args[3];
             $yes = isset($args[4]) ? $this->escape($args[4]) : 'JYES';
             $no = isset($args[5]) ? $this->escape($args[5]) : 'JNO';
             // prepare the xml
             $element = new SimpleXMLElement('<field name="' . $name . '" type="radio" class="btn-group"><option ' . $additional . ' value="0">' . $no . '</option><option ' . $additional . ' value="1">' . $yes . '</option></field>');
             // run
             $radio->setup($element, $value);
             return $radio->input;
         }
     } else {
         if ($args[0] == 'select.booleanlist') {
             $name = $args[1];
             $additional = isset($args[2]) ? (string) $args[2] : '';
             $value = $args[3];
             $yes = isset($args[4]) ? $this->escape($args[4]) : 'JYES';
             $no = isset($args[5]) ? $this->escape($args[5]) : 'JNO';
             return JHtml::_($args[0], $name, $additional, $value, $yes, $no);
         }
     }
 }
示例#6
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);
 }
示例#7
0
 function mappingDBO($config)
 {
     $database = JFactory::getDBO();
     if ($config['connection']) {
         $options = array('driver' => 'mysql', 'host' => $config['host'], 'user' => $config['username'], 'password' => $config['password'], 'database' => $config['database']);
         if (!strlen($config['database'])) {
             return 'Please select a database first.';
         }
         if (RSFormProHelper::isJ('3.0')) {
             $database2 = JDatabaseDriver::getInstance($options);
         } else {
             $database2 = JDatabase::getInstance($options);
         }
         try {
             $database2->connect();
         } catch (RuntimeException $e) {
             return $e->getMessage();
         }
         if (is_a($database2, 'JException') || is_a($database2, 'JError')) {
             return $database2->getMessage();
         }
         if ($database2->getErrorNum()) {
             return $database2->getErrorMsg();
         }
         return $database2;
     }
     return $database;
 }
示例#8
0
}
?>
	</table>
	</div>
	
	<table class="adminlist table table-striped" id="articleList">
	<tfoot>
		<tr>
			<td>
				<div class="pull-left">
					<?php 
echo $this->pagination->getListFooter();
?>
				</div>
				<?php 
if (RSFormProHelper::isJ('3.0')) {
    ?>
				<div class="pull-right">
					<label for="limit" class="element-invisible"><?php 
    echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');
    ?>
</label>
					<?php 
    echo $this->pagination->getLimitBox();
    ?>
				</div>
				<?php 
}
?>
			</td>
		</tr>