Example #1
0
 function display($tpl = null)
 {
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     if (RSFormProHelper::isJ16()) {
         $lang =& JFactory::getLanguage();
         $lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit', true);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
     }
     JToolBarHelper::apply('configuration.apply');
     JToolBarHelper::save('configuration.save');
     JToolBarHelper::cancel('');
     $params = array('startOffset' => JRequest::getInt('tabposition', 0));
     $tabs =& JPane::getInstance('Tabs', $params, true);
     $this->assignRef('tabs', $tabs);
     $this->assign('code', RSFormProHelper::getConfig('global.register.code'));
     $lists['global.iis'] = JHTML::_('select.booleanlist', 'rsformConfig[global.iis]', 'class="inputbox"', RSFormProHelper::getConfig('global.iis'));
     $lists['global.editor'] = JHTML::_('select.booleanlist', 'rsformConfig[global.editor]', 'class="inputbox"', RSFormProHelper::getConfig('global.editor'));
     $lists['global.codemirror'] = JHTML::_('select.booleanlist', 'rsformConfig[global.codemirror]', 'class="inputbox"', RSFormProHelper::getConfig('global.codemirror'));
     $lists['auto_responsive'] = JHTML::_('select.booleanlist', 'rsformConfig[auto_responsive]', 'class="inputbox"', RSFormProHelper::getConfig('auto_responsive'));
     $this->assignRef('lists', $lists);
     parent::display($tpl);
 }
Example #2
0
 public static function expression($calculation, $formId)
 {
     $return = '';
     $pattern = '#{(.*?):value}#is';
     $expression = $calculation->expression;
     $filter = JFilterInput::getInstance();
     preg_match_all($pattern, $calculation->expression, $matches);
     if ($matches) {
         foreach ($matches[0] as $i => $match) {
             $field = $filter->clean($matches[1][$i] . "_" . $formId, 'cmd');
             $return .= "\t total" . $field . " = 0;\n";
             $return .= "\t values" . $field . " = rsfp_getValue(" . $formId . ", '" . $matches[1][$i] . "');\n";
             $return .= "\t if (typeof values" . $field . " == 'object') { \n";
             $return .= "\t\t for(i=0;i<values" . $field . ".length;i++) {\n";
             $return .= "\t\t\t thevalue = values" . $field . "[i]; \n";
             $return .= "\t\t\t if (isset(RSFormProPrices['" . $formId . "_" . $matches[1][$i] . "'])) { \n";
             $return .= "\t\t\t\t total" . $field . " += isset(RSFormProPrices['" . $formId . "_" . $matches[1][$i] . "'][thevalue]) ? parseFloat(RSFormProPrices['" . $formId . "_" . $matches[1][$i] . "'][thevalue]) : 0; \n";
             $return .= "\t\t\t }\n";
             $return .= "\t\t }\n";
             $return .= "\t } else { \n";
             $return .= "\t\t total" . $field . " += (values" . $field . ".indexOf(',') == -1 && values" . $field . ".indexOf('.') == -1) ? parseFloat(values" . $field . ") :  parseFloat(rsfp_toNumber(values" . $field . ",'" . self::escape(RSFormProHelper::getConfig('calculations.decimal')) . "','" . self::escape(RSFormProHelper::getConfig('calculations.thousands')) . "')); \n";
             $return .= "\t } \n";
             $return .= "\t total" . $field . " = !isNaN(total" . $field . ") ? total" . $field . " : 0; \n\n";
             $expression = str_replace($match, 'total' . $field, $expression);
         }
         $return .= "\n\t grandTotal" . $calculation->id . $formId . " = " . $expression . ";\n";
         $return .= "\t document.getElementById('" . $calculation->total . "').value = number_format(grandTotal" . $calculation->id . $formId . "," . (int) RSFormProHelper::getConfig('calculations.nodecimals') . ",'" . self::escape(RSFormProHelper::getConfig('calculations.decimal')) . "','" . self::escape(RSFormProHelper::getConfig('calculations.thousands')) . "'); \n\n";
     }
     return $return;
 }
Example #3
0
 function columns()
 {
     $model = $this->getModel('mappings');
     $post = JRequest::get('post');
     $type = JRequest::getVar('type', 'set');
     $config = array('connection' => $post['connection'], 'host' => $post['host'], 'port' => $post['port'], 'username' => $post['username'], 'password' => $post['password'], 'database' => $post['database'], 'table' => $post['table']);
     echo RSFormProHelper::mappingsColumns($config, $type);
     exit;
 }
Example #4
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');
 }
 function rsfp_getPayment(&$items, $formId)
 {
     if ($components = RSFormProHelper::componentExists($formId, $this->componentId)) {
         $data = RSFormProHelper::getComponentProperties($components[0]);
         $item = new stdClass();
         $item->value = $this->componentValue;
         $item->text = $data['LABEL'];
         // add to array
         $items[] = $item;
     }
 }
Example #6
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);
 }
Example #7
0
 function save()
 {
     $model = $this->getModel('mappings');
     $row = $model->save();
     $html = '<script type="text/javascript">';
     if ($row === false) {
         $html .= RSFormProHelper::isJ16() ? 'window.parent.SqueezeBox.close();' : 'window.parent.document.getElementById(\'sbox-window\').close()';
     } else {
         $html .= 'window.parent.ShowMappings(' . $row->formId . ')' . "\n";
         $html .= RSFormProHelper::isJ16() ? 'window.parent.SqueezeBox.close();' : 'window.parent.document.getElementById(\'sbox-window\').close()';
     }
     $html .= '</script>';
     echo $html;
     die;
 }
Example #8
0
 function preview()
 {
     $formId = JRequest::getInt('formId');
     $opener = JRequest::getCmd('opener');
     $db = JFactory::getDBO();
     $db->setQuery("SELECT `" . $opener . "` FROM #__rsform_forms WHERE FormId='" . $formId . "'");
     $value = $db->loadResult();
     $model = $this->getModel('forms');
     $model->getForm();
     $lang = $model->getLang();
     $translations = RSFormProHelper::getTranslations('forms', $formId, $lang);
     if ($translations && isset($translations[$opener])) {
         $value = $translations[$opener];
     }
     echo $value;
 }
Example #9
0
 function display($tpl = null)
 {
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     if (RSFormProHelper::isJ16()) {
         $lang =& JFactory::getLanguage();
         $lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage', true);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
     }
     $this->assign('code', RSFormProHelper::genKeyCode());
     parent::display($tpl);
 }
Example #10
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     if (RSFormProHelper::isJ16()) {
         $lang = JFactory::getLanguage();
         $lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage', true);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
     }
     $this->formId = JRequest::getInt('formId');
     $this->formTitle = $this->get('formtitle');
     $this->menus = $this->get('menus');
     $this->pagination = $this->get('pagination');
     parent::display($tpl);
 }
 public static function checkOrderData($formData, $invalid = array(), $ccDataPrefix = 'cc_')
 {
     if ($formData == null) {
         $formData = $_POST['form'];
     }
     if (self::canAcquireCCData($formData)) {
         $prefix = $ccDataPrefix;
         foreach ($formData as $key => $value) {
             // for each field
             if (substr($key, 0, strlen($prefix)) === $prefix) {
                 // if it is a field we are searching for (prefixed)
                 if ($value == '') {
                     // if the value for the field is empty
                     $invalid[] = RSFormProHelper::getComponentId($key);
                     // add it to the invalid array
                 }
             }
         }
     }
 }
Example #12
0
 function display($tpl = null)
 {
     $this->params = $this->get('Params');
     $this->formId = $this->get('FormId');
     $this->isJ16 = RSFormProHelper::isJ16();
     if ($this->isJ16) {
         $app =& JFactory::getApplication();
         $doc =& JFactory::getDocument();
         $title = $this->params->get('page_title', '');
         if (empty($title)) {
             $title = $app->getCfg('sitename');
         } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
             $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
         } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
             $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
         }
         $doc->setTitle($title);
     }
     parent::display($tpl);
 }
Example #13
0
 function save()
 {
     $config = JRequest::getVar('rsformConfig', array(0), 'post');
     $db = JFactory::getDBO();
     foreach ($config as $name => $value) {
         $db->setQuery("UPDATE #__rsform_config SET SettingValue = '" . $db->escape($value) . "' WHERE SettingName = '" . $db->escape($name) . "'");
         $db->execute();
     }
     RSFormProHelper::readConfig(true);
     $task = $this->getTask();
     switch ($task) {
         case 'apply':
             $tabposition = JRequest::getInt('tabposition', 0);
             $link = 'index.php?option=com_rsform&task=configuration.edit&tabposition=' . $tabposition;
             break;
         case 'save':
             $link = 'index.php?option=com_rsform';
             break;
     }
     $this->setRedirect($link, JText::_('RSFP_CONFIGURATION_SAVED'));
 }
Example #14
0
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     if (RSFormProHelper::isJ16()) {
         $lang =& JFactory::getLanguage();
         $lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore', true);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
     }
     $this->assign('writable', $this->get('isWritable'));
     $this->assign('zlib', extension_loaded('zlib'));
     $this->assignRef('forms', $this->get('forms'));
     $tabs =& JPane::getInstance('Tabs', array(), true);
     $this->assignRef('tabs', $tabs);
     parent::display($tpl);
 }
Example #15
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);
 }
Example #16
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);
 }
Example #17
0
 function RSFormProCaptcha($componentId = 0)
 {
     $this->data = RSFormProHelper::getComponentProperties($componentId);
     if (!isset($this->data['IMAGETYPE'])) {
         $this->data['IMAGETYPE'] = 'FREETYPE';
     }
     if (!isset($this->data['LENGTH'])) {
         $this->data['LENGTH'] = 4;
     }
     if ($this->data['IMAGETYPE'] == 'INVISIBLE') {
         die;
     }
     if (!function_exists('imagecreate')) {
         header('Location:' . JURI::root() . 'components/com_rsform/assets/images/nogd.gif');
         die;
     }
     header('Content-type: image/png');
     $this->Length = $this->data['LENGTH'];
     $this->Size = is_numeric($this->data['SIZE']) && $this->data['SIZE'] > 0 ? $this->data['SIZE'] : 15;
     $this->fontpath = JPATH_SITE . DS . 'components' . DS . 'com_rsform' . DS . 'assets' . DS . 'fonts';
     $this->fonts = $this->getFonts();
     if ($this->data['IMAGETYPE'] == 'FREETYPE') {
         if (!count($this->fonts)) {
             $error = new RSFormProCaptchaError();
             $error->addError('No fonts available!');
             $error->displayError();
             die;
         }
         if (!function_exists('imagettftext')) {
             $error = new RSFormProCaptchaError();
             $error->addError('The function imagettftext does not exist.');
             $error->displayError();
             die;
         }
     }
     $this->stringGenerate();
     $this->makeCaptcha($componentId);
 }
Example #18
0
 function __construct()
 {
     parent::__construct();
     if (RSFormProHelper::isJ16()) {
         JHTML::_('behavior.framework');
     }
     if (!RSFormProHelper::isJ16()) {
         if (!headers_sent()) {
             header('Content-type: text/html; charset=utf-8');
         }
     }
     $this->_db = JFactory::getDBO();
     $doc =& JFactory::getDocument();
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/tablednd.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/jquery.scrollto.js');
     $doc->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/js/script.js?v=44');
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style.css?v=44');
     if (RSFormProHelper::isJ16()) {
         $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/style16.css');
     }
     $doc->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/css/rsdesign.css');
 }
Example #19
0
 function getComponentData()
 {
     $componentId = $this->getComponentId();
     $data = array();
     if ($componentId > 0) {
         $data = RSFormProHelper::getComponentProperties($componentId);
     }
     return $data;
 }
Example #20
0
 function viewFile()
 {
     $app = JFactory::getApplication();
     $id = JRequest::getInt('id');
     $this->_db->setQuery("SELECT * FROM #__rsform_submission_values WHERE SubmissionValueId='" . $id . "'");
     $result = $this->_db->loadObject();
     // Not found
     if (empty($result)) {
         $app->redirect('index.php?option=com_rsform&view=submissions');
     }
     // Not an upload field
     $this->_db->setQuery("SELECT c.ComponentTypeId FROM #__rsform_properties p LEFT JOIN #__rsform_components c ON (p.ComponentId=c.ComponentId) WHERE p.PropertyName='NAME' AND p.PropertyValue='" . $this->_db->escape($result->FieldName) . "'");
     $type = $this->_db->loadResult();
     if ($type != 9) {
         $app->redirect('index.php?option=com_rsform&view=submissions', JText::_('RSFP_VIEW_FILE_NOT_UPLOAD'));
     }
     jimport('joomla.filesystem.file');
     if (JFile::exists($result->FieldValue)) {
         RSFormProHelper::readFile($result->FieldValue);
     }
     $app->redirect('index.php?option=com_rsform&view=submissions', JText::_('RSFP_VIEW_FILE_NOT_FOUND'));
 }
Example #21
0
 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]-->');
     if (RSFormProHelper::getConfig('global.codemirror')) {
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/lib/codemirror.js');
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/css/css.js');
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/htmlmixed/htmlmixed.js');
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/javascript/javascript.js');
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/php/php.js');
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/clike/clike.js');
         $document->addScript(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/mode/xml/xml.js');
         $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/lib/codemirror.css');
         $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_rsform/assets/codemirror/theme/default.css');
     }
     JToolBarHelper::title('RSForm! Pro', 'rsform');
     if (RSFormProHelper::isJ16()) {
         $lang =& JFactory::getLanguage();
         $lang->load('com_rsform.sys', JPATH_ADMINISTRATOR);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_FORMS'), 'index.php?option=com_rsform&task=forms.manage', true);
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_MANAGE_SUBMISSIONS'), 'index.php?option=com_rsform&task=submissions.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_CONFIGURATION'), 'index.php?option=com_rsform&task=configuration.edit');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_BACKUP_RESTORE'), 'index.php?option=com_rsform&task=backup.restore');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_UPDATES'), 'index.php?option=com_rsform&task=updates.manage');
         JSubMenuHelper::addEntry(JText::_('COM_RSFORM_PLUGINS'), 'index.php?option=com_rsform&task=goto.plugins');
     }
     $layout = $this->getLayout();
     $this->assign('isComponent', JRequest::getVar('tmpl') == 'component');
     if ($layout == 'edit') {
         JToolBarHelper::apply('forms.apply');
         JToolBarHelper::save('forms.save');
         JToolBarHelper::spacer();
         JToolBarHelper::custom('forms.preview', 'preview', 'preview', RSFormProHelper::isJ16() ? JText::_('JGLOBAL_PREVIEW') : JText::_('PREVIEW'), false);
         JToolBarHelper::custom('submissions.manage', 'forward', 'forward', JText::_('RSFP_SUBMISSIONS'), 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::_('VALIDDELETEITEMS'), 'components.remove', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_DELETE') : JText::_('DELETE'));
         JToolBarHelper::publishList('components.publish', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_PUBLISH') : JText::_('Publish'));
         JToolBarHelper::unpublishList('components.unpublish', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_UNPUBLISH') : JText::_('Unpublish'));
         JToolBarHelper::spacer();
         JToolBarHelper::cancel('forms.cancel');
         $this->assignRef('tabposition', JRequest::getInt('tabposition', 0));
         $this->assignRef('tab', JRequest::getInt('tab', 0));
         $this->assignRef('form', $this->get('form'));
         $this->assignRef('form_post', $this->get('formPost'));
         $this->assign('hasSubmitButton', $this->get('hasSubmitButton'));
         JToolBarHelper::title('RSForm! Pro <small>[' . JText::sprintf('RSFP_EDITING_FORM', $this->form->FormTitle) . ']</small>', 'rsform');
         $this->assignRef('fields', $this->get('fields'));
         $this->assignRef('quickfields', $this->get('quickfields'));
         $this->assignRef('pagination', $this->get('fieldspagination'));
         $lists['Published'] = JHTML::_('select.booleanlist', 'Published', 'class="inputbox"', $this->form->Published);
         $lists['keepdata'] = JHTML::_('select.booleanlist', 'Keepdata', 'class="inputbox"', $this->form->Keepdata);
         $lists['confirmsubmission'] = JHTML::_('select.booleanlist', 'ConfirmSubmission', 'class="inputbox"', $this->form->ConfirmSubmission);
         $lists['ShowThankyou'] = JHTML::_('select.booleanlist', 'ShowThankyou', 'class="inputbox" onclick="enableThankyou(this.value);"', $this->form->ShowThankyou);
         $lists['ShowContinue'] = JHTML::_('select.booleanlist', 'ShowContinue', 'class="inputbox"' . (!$this->form->ShowThankyou ? 'disabled="disabled"' : ''), $this->form->ShowContinue);
         $lists['UserEmailMode'] = JHTML::_('select.booleanlist', 'UserEmailMode', 'class="inputbox" onclick="enableEmailMode(\'User\', this.value)"', $this->form->UserEmailMode, JText::_('HTML'), JText::_('RSFP_COMP_FIELD_TEXT'));
         $lists['UserEmailAttach'] = JHTML::_('select.booleanlist', 'UserEmailAttach', 'class="inputbox" onclick="enableAttachFile(this.value)"', $this->form->UserEmailAttach);
         $lists['AdminEmailMode'] = JHTML::_('select.booleanlist', 'AdminEmailMode', 'class="inputbox" onclick="enableEmailMode(\'Admin\', this.value)"', $this->form->AdminEmailMode, JText::_('HTML'), JText::_('RSFP_COMP_FIELD_TEXT'));
         $lists['MetaTitle'] = JHTML::_('select.booleanlist', 'MetaTitle', 'class="inputbox"', $this->form->MetaTitle);
         $lists['TextareaNewLines'] = JHTML::_('select.booleanlist', 'TextareaNewLines', 'class="inputbox"', $this->form->TextareaNewLines);
         $lists['AjaxValidation'] = JHTML::_('select.booleanlist', 'AjaxValidation', 'class="inputbox"', $this->form->AjaxValidation);
         $lists['post_enabled'] = JHTML::_('select.booleanlist', 'form_post[enabled]', 'class="inputbox"', $this->form_post->enabled);
         $lists['post_method'] = JHTML::_('select.booleanlist', 'form_post[method]', 'class="inputbox"', $this->form_post->method, JText::_('RSFP_POST_METHOD_POST'), JText::_('RSFP_POST_METHOD_GET'));
         $lists['post_silent'] = JHTML::_('select.booleanlist', 'form_post[silent]', 'class="inputbox"', $this->form_post->silent);
         $this->assignRef('themes', $this->get('themes'));
         $this->assignRef('lang', $this->get('lang'));
         $lists['Languages'] = JHTML::_('select.genericlist', $this->get('languages'), 'Language', 'onchange="submitbutton(\'changeLanguage\')"', 'value', 'text', $this->lang);
         $this->assignRef('mappings', $this->get('mappings'));
         $this->assignRef('mpagination', $this->get('mpagination'));
         $this->assignRef('conditions', $this->get('conditions'));
         $this->assignRef('formId', $this->form->FormId);
         $this->assignRef('emails', $this->get('emails'));
         $this->assignRef('lists', $lists);
     } elseif ($layout == 'new') {
         JToolBarHelper::custom('forms.new.steptwo', 'forward', 'forward', RSFormProHelper::isJ16() ? JText::_('JNEXT') : JText::_('Next'), false);
         JToolBarHelper::cancel('forms.cancel');
     } elseif ($layout == 'new2') {
         JToolBarHelper::custom('forms.new.stepthree', 'forward', 'forward', RSFormProHelper::isJ16() ? JText::_('JNEXT') : JText::_('Next'), false);
         JToolBarHelper::cancel('forms.cancel');
         $lists['AdminEmail'] = JHTML::_('select.booleanlist', 'AdminEmail', 'class="inputbox" onclick="changeAdminEmail(this.value)"', 1);
         $lists['UserEmail'] = JHTML::_('select.booleanlist', 'UserEmail', 'class="inputbox"', 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->assignRef('adminEmail', $this->get('adminEmail'));
         $this->assignRef('lists', $lists);
         $this->assignRef('editor', JFactory::getEditor());
     } elseif ($layout == 'new3') {
         JToolBarHelper::custom('forms.new.stepfinal', 'forward', 'forward', JText::_('Finish'), false);
         JToolBarHelper::cancel('forms.cancel');
         $lists['predefinedForms'] = JHTML::_('select.genericlist', $this->get('predefinedforms'), 'predefinedForm', '');
         $this->assignRef('lists', $lists);
     } elseif ($layout == 'component_copy') {
         JToolBarHelper::custom('components.copy.process', 'copy', 'copy', 'Copy', false);
         JToolBarHelper::cancel('components.copy.cancel');
         $formlist = $this->get('formlist');
         $lists['forms'] = JHTML::_('select.genericlist', $formlist, 'toFormId', '', 'value', 'text');
         $this->assign('formId', JRequest::getInt('formId'));
         $this->assign('cids', JRequest::getVar('cid', array()));
         $this->assignRef('lists', $lists);
     } elseif ($layout == 'richtext') {
         $this->assignRef('editor', JFactory::getEditor());
         $this->assign('noEditor', JRequest::getInt('noEditor'));
         $this->assign('formId', JRequest::getInt('formId'));
         $this->assign('editorName', JRequest::getCmd('opener'));
         $this->assign('editorText', $this->get('editorText'));
     } elseif ($layout == 'edit_mappings') {
         $formId = JRequest::getInt('formId');
         $this->assignRef('mappings', $this->get('mappings'));
         $this->assignRef('mpagination', $this->get('mpagination'));
         $this->assignRef('formId', $formId);
     } elseif ($layout == 'edit_conditions') {
         $formId = JRequest::getInt('formId');
         $this->assignRef('conditions', $this->get('conditions'));
         $this->assignRef('formId', $formId);
     } elseif ($layout == 'edit_emails') {
         $this->assignRef('emails', $this->get('emails'));
     } 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->assignRef('formId', $formId);
     } elseif ($layout == 'emails') {
         $this->assignRef('row', $this->get('email'));
         $lists['mode'] = JHTML::_('select.booleanlist', 'mode', 'class="inputbox" onclick="showMode(this.value);"', $this->row->mode, JText::_('HTML'), JText::_('Text'));
         $this->assignRef('lists', $lists);
         $this->assignRef('editor', JFactory::getEditor());
         $this->assignRef('quickfields', $this->get('quickfields'));
         $this->assignRef('lang', $this->get('emaillang'));
         $lists['Languages'] = JHTML::_('select.genericlist', $this->get('languages'), 'ELanguage', 'onchange="submitbutton(\'changeEmailLanguage\')"', 'value', 'text', $this->lang);
     } else {
         JToolBarHelper::addNewX('forms.add', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_NEW') : JText::_('New'));
         JToolBarHelper::spacer();
         JToolBarHelper::custom('forms.copy', 'copy.png', 'copy_f2.png', JText::_('RSFP_DUPLICATE'), false);
         JToolBarHelper::spacer();
         JToolBarHelper::deleteList(JText::_('VALIDDELETEITEMS'), 'forms.delete', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_DELETE') : JText::_('DELETE'));
         JToolBarHelper::spacer();
         JToolBarHelper::publishList('forms.publish', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_PUBLISH') : JText::_('Publish'));
         JToolBarHelper::unpublishList('forms.unpublish', RSFormProHelper::isJ16() ? JText::_('JTOOLBAR_UNPUBLISH') : JText::_('Unpublish'));
         $this->assignRef('forms', $this->get('forms'));
         $this->assignRef('pagination', $this->get('pagination'));
         $this->assignRef('sortColumn', $this->get('sortColumn'));
         $this->assignRef('sortOrder', $this->get('sortOrder'));
     }
     parent::display($tpl);
 }
Example #22
0
 protected function getValue($item, $field)
 {
     if (in_array($field->FieldName, $this->unescapedFields)) {
         return $item->{$field->FieldName};
     } else {
         // Static header?
         if ($field->componentId < 0 && isset($this->headers[$field->componentId])) {
             $header = $this->headers[$field->componentId];
             if ($header == 'DateSubmitted') {
                 $value = RSFormProHelper::getDate($item->{$header});
             } else {
                 $value = $item->{$header};
             }
         } else {
             // Dynamic header.
             $value = $item->{$field->FieldName};
         }
         return $this->escape($value);
     }
 }
Example #23
0
 protected function storeDirectory()
 {
     // Add directory #__rsform_directory & #__rsform_directory_fields
     if ($directory = $this->getDirectory()) {
         // No need for these
         unset($directory->formId);
         $headers = RSFormProHelper::getDirectoryStaticHeaders();
         $this->xml->add('directory');
         foreach ($directory as $property => $value) {
             if ($property == 'fields') {
                 $this->xml->add('fields');
                 foreach ($value as $field) {
                     // No need for this.
                     unset($field->formId);
                     // Special case - static headers
                     if ($field->componentId < 0 && isset($headers[$field->componentId])) {
                         // Do nothing
                     } else {
                         $field->componentId = isset($this->fields[$field->componentId]) ? $this->fields[$field->componentId] : '';
                     }
                     $this->xml->add('field');
                     foreach ($field as $property => $value) {
                         $this->xml->add($property, $value);
                     }
                     $this->xml->add('/field');
                 }
                 $this->xml->add('/fields');
             } else {
                 $this->xml->add($property, $value);
             }
         }
         $this->xml->add('/directory');
     }
 }
Example #24
0
<?php

/**
* @version 1.4.0
* @package RSform!Pro 1.4.0
* @copyright (C) 2007-2011 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
defined('_JEXEC') or die('Restricted access');
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_rsform' . DS . 'helpers' . DS . 'rsform.php';
global $RSadapter;
$RSadapter = RSFormProHelper::getLegacyAdapter();
$GLOBALS['RSadapter'] = $RSadapter;
Example #25
0
 function ajaxValidate()
 {
     $form = JRequest::getVar('form');
     $formId = (int) @$form['formId'];
     $this->_db->setQuery("SELECT ComponentId, ComponentTypeId FROM #__rsform_components WHERE `FormId`='" . $formId . "' AND `Published`='1' ORDER BY `Order`");
     $components = $this->_db->loadObjectList();
     $page = JRequest::getInt('page');
     if ($page) {
         $current_page = 1;
         foreach ($components as $i => $component) {
             if ($current_page != $page) {
                 unset($components[$i]);
             }
             if ($component->ComponentTypeId == 41) {
                 $current_page++;
             }
         }
     }
     $removeUploads = array();
     $removeRecaptcha = array();
     $formComponents = array();
     foreach ($components as $component) {
         $formComponents[] = $component->ComponentId;
         if ($component->ComponentTypeId == 9) {
             $removeUploads[] = $component->ComponentId;
         }
         if ($component->ComponentTypeId == 24) {
             $removeRecaptcha[] = $component->ComponentId;
         }
     }
     echo implode(',', $formComponents);
     echo "\n";
     $invalid = RSFormProHelper::validateForm($formId);
     if (count($invalid)) {
         foreach ($invalid as $i => $componentId) {
             if (in_array($componentId, $removeUploads) || in_array($componentId, $removeRecaptcha)) {
                 unset($invalid[$i]);
             }
         }
         $invalidComponents = array_intersect($formComponents, $invalid);
         echo implode(',', $invalidComponents);
     }
     if (isset($invalidComponents)) {
         echo "\n";
         $pages = RSFormProHelper::componentExists($formId, 41);
         $pages = count($pages);
         if ($pages && !$page) {
             $first = reset($invalidComponents);
             $current_page = 1;
             foreach ($components as $i => $component) {
                 if ($component->ComponentId == $first) {
                     break;
                 }
                 if ($component->ComponentTypeId == 41) {
                     $current_page++;
                 }
             }
             echo $current_page;
             echo "\n";
             echo $pages;
         }
     }
     jexit();
 }
Example #26
0
			}
		
		if (isChecked)
			submitform(task);
		else
			alert('<?php 
echo JText::_('RSFP_EXPORT_PLEASE_SELECT', true);
?>
');
	}
	else
		submitform(task);
}

<?php 
if (RSFormProHelper::isJ16()) {
    ?>
	Joomla.submitbutton = submitbutton;
<?php 
}
?>

function updateCSVPreview()
{
	<?php 
if ($this->exportType != 'csv') {
    ?>
	return;
	<?php 
}
?>
Example #27
0
        echo $i;
        ?>
">
					<?php 
        echo !empty($row->database) ? $this->escape($row->database) . '.' : '';
        ?>
`<?php 
        echo $this->escape($row->table);
        ?>
` (<?php 
        echo $row->connection ? JText::_('RSFP_FORM_MAPPINGS_CONNECTION_REMOTE') : JText::_('RSFP_FORM_MAPPINGS_CONNECTION_LOCAL');
        ?>
)
				</td>
				<td><?php 
        echo function_exists('wordwrap') ? wordwrap($this->escape(RSFormProHelper::getMappingQuery($row)), 150, '<br />', true) : $this->escape(RSFormProHelper::getMappingQuery($row));
        ?>
</td>
				<td class="order">
					<span><?php 
        echo str_replace(array('cb' . $i, 'listItemTask'), array('mp' . $i, 'orderMapping'), $this->mpagination->orderUpIcon($i, true, 'orderup', 'Move Up', 'ordering'));
        ?>
</span>
					<span><?php 
        echo str_replace(array('cb' . $i, 'listItemTask'), array('mp' . $i, 'orderMapping'), $this->mpagination->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', 'ordering'));
        ?>
</span>
					<input type="text" name="mporder[]" size="5" value="<?php 
        echo $row->ordering;
        ?>
" disabled="disabled" class="text_area" style="text-align:center" />
Example #28
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);
         }
     }
 }
Example #29
0
 public function download($clean = true)
 {
     $tar = $this->getPath();
     $gzip = substr($tar, 0, -3) . 'tgz';
     // If there's a .TAR archive, we no longer need it, remove it.
     if ($clean && file_exists($tar)) {
         @unlink($tar);
     }
     if (!file_exists($gzip)) {
         throw new Exception(sprintf('File %s does not exist!', $gzip));
     }
     if (!is_readable($gzip)) {
         throw new Exception(sprintf('File %s is not readable!', $gzip));
     }
     if (!is_null($this->name)) {
         $name = $this->prepareName($this->name);
     } else {
         $name = 'backup';
     }
     RSFormProHelper::readFile($gzip, $name . '.tgz');
 }
Example #30
0
				</table>
				</td>
			</tr>
			<tr>
				<td width="25%" align="right" nowrap="nowrap" class="key"><?php 
echo JText::_('RSFP_EMAILS_MODE');
?>
</td>
				<td><?php 
echo $this->lists['UserEmailMode'];
?>
</td>
			</tr>
			<tr>
				<td width="25%" align="right" nowrap="nowrap" class="key"><?php 
echo RSFormProHelper::translateIcon();
?>
  <span style="color: red"><?php 
echo JText::_('RSFP_EMAILS_TEXT');
?>
</span></td>
				<td>
					<button class="rs_button rs_left" id="rsform_edit_user_email" onclick="openRSModal('<?php 
echo JRoute::_('index.php?option=com_rsform&task=richtext.show&opener=UserEmailText&formId=' . $this->form->FormId . '&tmpl=component' . (!$this->form->UserEmailMode ? '&noEditor=1' : ''));
?>
')" type="button"><span class="rsform_edit"><?php 
echo JText::_('RSFP_EMAILS_EDIT_TEXT');
?>
</span></button>
					<button class="rs_button rs_left" onclick="openRSModal('<?php 
echo JRoute::_('index.php?option=com_rsform&task=richtext.preview&opener=UserEmailText&formId=' . $this->form->FormId . '&tmpl=component');