Пример #1
0
 public function __construct()
 {
     parent::__construct();
     $jversion = new JVersion();
     $this->config = RSFormProConfig::getInstance();
     $this->isJ30 = $jversion->isCompatible('3.0');
 }
Пример #2
0
 public function display($tpl = null)
 {
     $this->addToolbar();
     JFactory::getDocument()->addScript(JUri::root(true) . '/administrator/components/com_rsform/assets/js/restore.js');
     $this->sidebar = $this->get('Sidebar');
     $this->key = $this->get('Key');
     $this->overwrite = $this->get('Overwrite');
     $this->keepId = $this->get('KeepId');
     $this->config = RSFormProConfig::getInstance();
     parent::display($tpl);
 }
Пример #3
0
 public function display($tpl = null)
 {
     $this->addToolbar();
     // tabs
     $this->tabs = $this->get('RSTabs');
     // fields
     $this->form = $this->get('Form');
     $this->field = $this->get('RSFieldset');
     $this->sidebar = $this->get('SideBar');
     $this->tempDir = $this->get('TempDir');
     $this->writable = $this->get('isWritable');
     $this->forms = $this->get('forms');
     $this->config = RSFormProConfig::getInstance();
     JFactory::getDocument()->addScript(JUri::root(true) . '/administrator/components/com_rsform/assets/js/backup.js');
     if (!$this->writable) {
         JError::raiseWarning(500, JText::sprintf('RSFP_BACKUP_RESTORE_CANNOT_CONTINUE_WRITABLE_PERMISSIONS', '<strong>' . $this->escape($this->tempDir) . '</strong>'));
     }
     parent::display($tpl);
 }
Пример #4
0
 public function postflight($type, $parent)
 {
     if ($type == 'uninstall') {
         return true;
     }
     $source = $parent->getParent()->getPath('source');
     // need to update the old plugin?
     if ($this->migrate) {
         // it's a migration, we need to add the data to the PayPal Plugin
         $this->runSQL($source, 'install.sql', 'plg_paypal');
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         // find old forms
         $query->select($db->quoteName('FormId'))->from('#__rsform_components')->where($db->quoteName('ComponentTypeId') . ' IN (21, 22, 23)');
         $db->setQuery($query);
         $forms = $db->loadColumn();
         // add the PayPal component to the forms
         if ($forms = array_unique($forms)) {
             foreach ($forms as $formId) {
                 $this->addComponent($formId, 500);
             }
         }
         // migrate old configuration parameters
         $query = $db->getQuery(true);
         $query->select('*')->from('#__rsform_config')->where($db->quoteName('SettingName') . ' LIKE ' . $db->quote('paypal.%'));
         $db->setQuery($query);
         if ($results = $db->loadObjectList('SettingName')) {
             require_once JPATH_ADMINISTRATOR . '/components/com_rsform/helpers/config.php';
             $config = RSFormProConfig::getInstance();
             $config->set('payment.currency', $results['paypal.currency']->SettingValue);
             $config->set('payment.thousands', $results['paypal.thousands']->SettingValue);
             $config->set('payment.decimal', $results['paypal.decimal']->SettingValue);
             $config->set('payment.nodecimals', $results['paypal.nodecimals']->SettingValue);
         }
     }
     $this->enablePlugin('rsfppayment');
     $this->enablePlugin('rsfppaypal');
     $this->enablePlugin('rsfpofflinepayment');
 }
Пример #5
0
 public function getHash()
 {
     $version = new RSFormProVersion();
     return md5(RSFormProConfig::getInstance()->get('global.register.code') . $version->key);
 }
Пример #6
0
 public function getConfig()
 {
     return RSFormProConfig::getInstance();
 }
 public static function getConfig($name = null)
 {
     $config = RSFormProConfig::getInstance();
     if (is_null($name)) {
         return $config->getData();
     } else {
         return $config->get($name);
     }
 }