function RSAdapter() { // Get Joomla! Configuration $this->jconfig = JFactory::getConfig(); // Define tables $prefix = $this->jconfig->getValue('config.dbprefix'); $this->tbl_rsform_config = $prefix . 'rsform_config'; $this->tbl_rsform_components = $prefix . 'rsform_components'; $this->tbl_rsform_component_types = $prefix . 'rsform_component_types'; $this->tbl_rsform_component_type_fields = $prefix . 'rsform_component_type_fields'; $this->tbl_rsform_forms = $prefix . 'rsform_forms'; $this->tbl_rsform_mappings = $prefix . 'rsform_mappings'; $this->tbl_rsform_properties = $prefix . 'rsform_properties'; $this->tbl_rsform_submissions = $prefix . 'rsform_submissions'; $this->tbl_rsform_submission_values = $prefix . 'rsform_submission_values'; $this->tbl_users = $prefix . 'users'; // Build old config $this->config = array(); RSFormProHelper::readConfig(); $config = RSFormProHelper::getConfig(null); foreach ($config as $item => $value) { $this->config[$item] = $value; } $this->config['list_limit'] = $this->jconfig->getValue('config.list_limit'); $this->config['absolute_path'] = JPATH_SITE; $this->config['live_site'] = JURI::root(); $this->config['mail_from'] = $this->jconfig->getValue('config.mailfrom'); $this->config['sitename'] = $this->jconfig->getValue('config.sitename'); $this->config['dbprefix'] = $prefix; $this->config['db'] = $this->jconfig->getValue('config.db'); $this->config['component_ids'] = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); $this->config['absolute_path'] = JPATH_SITE; }
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')); }
/** * Configuration Save process */ function configurationSave() { $config = JRequest::getVar('rsformConfig', array(0), 'post'); $db = JFactory::getDBO(); foreach ($config as $name => $value) { $db->setQuery("UPDATE #__rsform_config SET SettingValue = '" . $db->getEscaped($value) . "' WHERE SettingName = '" . $db->getEscaped($name) . "'"); $db->query(); } $task = JRequest::getWord('task'); $task = strtolower($task); if ($task == 'configurationsave') { $link = 'index.php?option=com_rsform'; } else { $tabposition = JRequest::getInt('tabposition', 0); $link = 'index.php?option=com_rsform&task=configuration.edit&tabposition=' . $tabposition; } RSFormProHelper::readConfig(true); $this->setRedirect($link, JText::_('RSFP_CONFIGURATION_SAVED')); }
* @license GPL, http://www.gnu.org/copyleft/gpl.html */ defined('_JEXEC') or die('Restricted access'); if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } // ACL Check $user = JFactory::getUser(); if (!$user->authorise('core.manage', 'com_rsform')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } // Require the base controller require_once JPATH_COMPONENT . '/controller.php'; require_once JPATH_COMPONENT . '/helpers/rsform.php'; require_once JPATH_COMPONENT . '/helpers/adapter.php'; RSFormProHelper::readConfig(); // See if this is a request for a specific controller $controller = JRequest::getWord('controller'); $controller_exists = false; $task = JRequest::getCmd('task'); if (!$controller && strpos($task, '.')) { list($controller, $controller_task) = explode('.', $task, 2); } if (!empty($controller) && file_exists(JPATH_COMPONENT . '/controllers/' . $controller . '.php')) { require_once JPATH_COMPONENT . '/controllers/' . $controller . '.php'; $controller = 'RSFormController' . $controller; $RSFormController = new $controller(); $controller_exists = true; } else { $RSFormController = new RSFormController(); }
function rsfp_bk_onAfterCreateFrontComponentBody($args) { $lang = JFactory::getLanguage(); $lang->load('plg_system_rsfprecaptcha', JPATH_ADMINISTRATOR); $this->loadLibrary(); RSFormProHelper::readConfig(); $config = JFactory::getConfig(); $u = JFactory::getURI(); $use_ssl = $config->get('force_ssl') == 2 || $u->isSSL(); if ($args['r']['ComponentTypeId'] == 24) { // Get a key from http://recaptcha.net/api/getkey $publickey = RSFormProHelper::getConfig('recaptcha.public.key'); // the response from reCAPTCHA $resp = null; // the error code from reCAPTCHA, if any $error = null; $args['out'] = '<script type="text/javascript">' . "\n"; $args['out'] .= 'var RecaptchaOptions = {' . "\n"; $args['out'] .= "\t" . "theme : '" . RSFormProHelper::getConfig('recaptcha.theme') . "'," . "\n"; $tag = $lang->getTag(); $tag = explode('-', $tag); $tag = strtolower($tag[0]); //$known_languages = array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr'); $known_languages = array('en'); if (in_array($tag, $known_languages)) { $args['out'] .= "\t" . "lang : '" . $tag . "'" . "\n"; } else { $args['out'] .= "\t" . "lang : '" . $tag . "'," . "\n"; $args['out'] .= "\t" . "custom_translations : {" . "\n" . "\t" . "\t" . 'instructions_visual : \'' . JText::_('RSFP_INSTRUCTIONS_VISUAL', true) . '\',' . "\n" . "\t" . "\t" . 'instructions_audio : \'' . JText::_('RSFP_INSTRUCTIONS_AUDIO', true) . '\',' . "\n" . "\t" . "\t" . 'play_again : \'' . JText::_('RSFP_PLAY_AGAIN', true) . '\',' . "\n" . "\t" . "\t" . 'cant_hear_this : \'' . JText::_('RSFP_CANT_HEAR_THIS', true) . '\',' . "\n" . "\t" . "\t" . 'visual_challenge : \'' . JText::_('RSFP_VISUAL_CHALLENGE', true) . '\',' . "\n" . "\t" . "\t" . 'audio_challenge : \'' . JText::_('RSFP_AUDIO_CHALLENGE', true) . '\',' . "\n" . "\t" . "\t" . 'refresh_btn : \'' . JText::_('RSFP_REFRESH_BTN', true) . '\',' . "\n" . "\t" . "\t" . 'help_btn : \'' . JText::_('RSFP_HELP_BTN', true) . '\',' . "\n" . "\t" . "\t" . 'incorrect_try_again : \'' . JText::_('RSFP_INCORRECT_TRY_AGAIN', true) . '\'' . "\n" . "\t" . '}' . "\n"; } $args['out'] .= '};' . "\n"; $args['out'] .= '</script>'; $args['out'] .= '<div id="recaptchaContainer' . $args['componentId'] . '">'; $args['out'] .= rsform_recaptcha_get_html($publickey, $error, $use_ssl); $args['out'] .= '</div>'; // clear the token on page refresh $session = JFactory::getSession(); $session->clear('com_rsform.recaptchaToken' . $args['formId']); } }
function getConfig($name = null) { $config = RSFormProHelper::readConfig(); if ($name != null) { if (isset($config->{$name})) { return $config->{$name}; } else { return false; } } else { return $config; } }