Beispiel #1
0
 public function edit()
 {
     global $aecConfig;
     // See whether we have a duplication
     if ($aecConfig->RowDuplicationCheck()) {
         // Clean out duplication and reload settings
         $aecConfig->CleanDuplicatedRows();
         $aecConfig = new aecConfig();
     }
     $lists = array();
     $currency_code_list = AECToolbox::aecCurrencyField(true, true, true);
     $lists['currency_code_general'] = JHTML::_('select.genericlist', $currency_code_list, 'currency_code_general', 'size="10"', 'value', 'text', !empty($aecConfig->cfg['currency_code_general']) ? $aecConfig->cfg['currency_code_general'] : '');
     $available_plans = SubscriptionPlanHandler::getActivePlanList(true, false);
     if (!isset($aecConfig->cfg['entry_plan'])) {
         $aecConfig->cfg['entry_plan'] = 0;
     }
     $lists['entry_plan'] = JHTML::_('select.genericlist', $available_plans, 'entry_plan', 'size="' . min(10, count($available_plans) + 2) . '"', 'value', 'text', $aecConfig->cfg['entry_plan']);
     $gtree = xJACLhandler::getGroupTree(array(28, 29, 30));
     if (!isset($aecConfig->cfg['checkout_as_gift_access'])) {
         $aecConfig->cfg['checkout_as_gift_access'] = 0;
     }
     // Create GID related Lists
     $lists['checkout_as_gift_access'] = JHTML::_('select.genericlist', $gtree, 'checkout_as_gift_access', 'size="6"', 'value', 'text', $aecConfig->cfg['checkout_as_gift_access']);
     $tab_data = array();
     $params = array();
     $params[] = array('page-head', JText::_('General Configuration'));
     $params[] = array('section', 'access');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_ACCESS'));
     $params['require_subscription'] = array('toggle', 0);
     $params['adminaccess'] = array('toggle', 0);
     $params['manageraccess'] = array('toggle', 0);
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_PROCESSORS'));
     $params['gwlist'] = array('list', 0);
     $params['standard_currency'] = array('list_currency', 0);
     $params[] = array('section-end');
     $params[] = array('page-head', JText::_('Registration Flow'));
     $params[] = array('section', 'plans');
     $params['plans_first'] = array('toggle', 0);
     $params['integrate_registration'] = array('toggle', 0);
     $params['skip_confirmation'] = array('toggle', 0);
     $params[] = array('section-end');
     $params[] = array('section', 'plans');
     $params[] = array('section-head', JText::_('Plan List'));
     $params['root_group'] = array('list', 0);
     $params[] = array('section-end');
     $params[] = array('section', 'cart');
     $params[] = array('section-head', 'Shopping Cart');
     $params['enable_shoppingcart'] = array('toggle', '');
     $params['additem_stayonpage'] = array('toggle', '');
     $params[] = array('section-end');
     $params[] = array('section', 'checkout');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_CHECKOUT'));
     $params['checkout_coupons'] = array('toggle', 0);
     $params['user_checkout_prefill'] = array('inputD', 0);
     $rewriteswitches = array('cms', 'user', 'expiration', 'subscription');
     $params = AECToolbox::rewriteEngineInfo($rewriteswitches, $params);
     $params[] = array('section-end');
     $params[] = array('page-head', JText::_('Inner workings'));
     $params[] = array('section', 'heartbeat');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_SYSTEM'));
     $params['heartbeat_cycle'] = array('inputA', 0);
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_EMAIL'));
     $params['noemails'] = array('toggle', 0);
     $params['noemails_adminoverride'] = array('toggle', 0);
     $params['nojoomlaregemails'] = array('toggle', 0);
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_DEBUG'));
     $params['curl_default'] = array('toggle', 0);
     $params['simpleurls'] = array('toggle', 0);
     $params['debug_processor_notifications'] = array('toggle', 0);
     $params['error_notification_level'] = array('list', 0);
     $params['email_notification_level'] = array('list', 0);
     $params[] = array('section-end');
     @end($params);
     $tab_data[] = array(JText::_('CFG_TAB1_TITLE'), key($params), '<h2>' . JText::_('CFG_TAB1_SUBTITLE') . '</h2>');
     $params[] = array('page-head', JText::_('CFG_TAB_CUSTOMIZATION_TITLE'));
     $params[] = array('section', 'customredirect');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_CREDIRECT'));
     $params['customintro'] = array('inputC', '');
     $params['customintro_userid'] = array('toggle', '');
     $params['customintro_always'] = array('toggle', '');
     $params[] = array('section-end');
     $params[] = array('section', 'invoice-number');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_FORMAT_INUM'));
     $params['invoicenum_doformat'] = array('toggle', '');
     $params['invoicenum_formatting'] = array('inputD', '');
     $rewriteswitches = array('cms', 'user', 'expiration', 'subscription', 'plan', 'invoice');
     $params = AECToolbox::rewriteEngineInfo($rewriteswitches, $params);
     $params[] = array('section-end');
     $params[] = array('section', 'captcha');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_CAPTCHA'));
     $params['use_recaptcha'] = array('toggle', '');
     $params['recaptcha_privatekey'] = array('inputC', '');
     $params['recaptcha_publickey'] = array('inputC', '');
     $params[] = array('section-end');
     $params[] = array('section', 'proxy');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_PROXY'));
     $params['use_proxy'] = array('toggle', '');
     $params['proxy'] = array('inputC', '');
     $params['proxy_port'] = array('inputC', '');
     $params['proxy_username'] = array('inputC', '');
     $params['proxy_password'] = array('inputC', '');
     $params['gethostbyaddr'] = array('toggle', '');
     $params[] = array('section-end');
     $params[] = array('section', 'date');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_FORMAT_DATE'));
     $params['display_date_backend'] = array('inputC', '%a, %d %b %Y %T %Z');
     $params['display_date_frontend'] = array('inputC', '%a, %d %b %Y %T %Z');
     $params['setlocale_date'] = array('inputD', '');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_FORMAT_PRICE'));
     $params['amount_currency_symbol'] = array('toggle', 0);
     $params['amount_currency_symbolfirst'] = array('toggle', 0);
     $params['amount_use_comma'] = array('toggle', 0);
     $params[] = array('section-end');
     $params[] = array('section', 'itemid');
     $params[] = array('section-head', JText::_('CFG_CUSTOMIZATION_SUB_ITEMID'));
     $itemidlist = array('cart' => array('view' => 'cart', 'params' => false), 'checkout' => array('view' => 'checkout', 'params' => false), 'confirmation' => array('view' => 'confirmation', 'params' => false), 'subscribe' => array('view' => 'subscribe', 'params' => false), 'exception' => array('view' => 'exception', 'params' => false), 'thanks' => array('view' => 'thanks', 'params' => false), 'expired' => array('view' => 'expired', 'params' => false), 'hold' => array('view' => 'hold', 'params' => false), 'notallowed' => array('view' => 'notallowed', 'params' => false), 'pending' => array('view' => 'pending', 'params' => false), 'subscriptiondetails' => array('view' => 'subscriptiondetails', 'params' => false), 'subscriptiondetails_invoices' => array('view' => 'subscriptiondetails', 'params' => 'sub=invoices'), 'subscriptiondetails_details' => array('view' => 'subscriptiondetails', 'params' => 'sub=details'));
     foreach ($itemidlist as $param => $xparams) {
         $params['itemid_' . $param] = array('inputA', '');
     }
     $params['itemid_cb'] = array('inputA', '');
     $params['itemid_joomlauser'] = array('inputA', '');
     $params[] = array('section-end');
     @end($params);
     $tab_data[] = array(JText::_('CFG_TAB_CUSTOMIZATION_TITLE'), key($params), '<h2>' . JText::_('CFG_TAB_CUSTOMIZATION_SUBTITLE') . '</h2>');
     $params[] = array('page-head', JText::_('CFG_TAB_EXPERT_SUBTITLE'));
     $params[] = array('section', 'system');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_SYSTEM'));
     $params['alertlevel2'] = array('inputA', 0);
     $params['alertlevel1'] = array('inputA', 0);
     $params['expiration_cushion'] = array('inputA', 0);
     $params['invoice_cushion'] = array('inputA', 0);
     $params['invoice_spawn_new'] = array('toggle', 0);
     $params['heartbeat_cycle_backend'] = array('inputA', 0);
     $params['allow_frontend_heartbeat'] = array('toggle', 0);
     $params['disable_regular_heartbeat'] = array('toggle', 0);
     $params['custom_heartbeat_securehash'] = array('inputC', '');
     $params['countries_available'] = array('list_country_full', 0);
     $params['countries_top'] = array('list_country_full', 0);
     $params[] = array('section-end');
     $params[] = array('section', 'api');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_API'));
     $params['apiapplist'] = array('inputD', '');
     $params[] = array('section-end');
     $params[] = array('section', 'registration');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_REGFLOW'));
     $params['show_fixeddecision'] = array('toggle', 0);
     $params['temp_auth_exp'] = array('inputC', '');
     $params['intro_expired'] = array('toggle', 0);
     $params['skip_registration'] = array('toggle', 0);
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_CONFIRMATION'));
     $params['confirmation_coupons'] = array('toggle', 0);
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_CHECKOUT'));
     $params['checkoutform_jsvalidation'] = array('toggle', '');
     $params['checkout_coupons'] = array('toggle', 1);
     $params['checkout_as_gift'] = array('toggle', '');
     $params['checkout_as_gift_access'] = array('list', defined('JPATH_MANIFESTS') ? 2 : 18);
     $params['confirm_as_gift'] = array('toggle', '');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_PLANS'));
     $params['root_group_rw'] = array('inputD', 0);
     $params['entry_plan'] = array('list', 0);
     $params['per_plan_mis'] = array('toggle', 0);
     $params[] = array('section-end');
     $params[] = array('section', 'security');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_SECURITY'));
     $params['ssl_signup'] = array('toggle', 0);
     $params['ssl_profile'] = array('toggle', 0);
     $params['override_reqssl'] = array('toggle', 0);
     $params['altsslurl'] = array('inputC', '');
     $params['ssl_verifypeer'] = array('toggle', 0);
     $params['ssl_verifyhost'] = array('inputC', '');
     $params['ssl_cainfo'] = array('inputC', '');
     $params['ssl_capath'] = array('inputC', '');
     $params['allow_invoice_unpublished_item'] = array('toggle', 0);
     $params[] = array('section-end');
     $params[] = array('section', 'debug');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_DEBUG'));
     $params['bypassintegration'] = array('inputC', '');
     $params['breakon_mi_error'] = array('toggle', 0);
     $params['email_default_admins'] = array('toggle', 1);
     $params['email_extra_admins'] = array('inputD', '');
     $params[] = array('section-end');
     $params[] = array('section', 'uninstall');
     $params[] = array('section-head', JText::_('CFG_GENERAL_SUB_UNINSTALL'));
     $params['delete_tables'] = array('toggle', 0);
     $params['delete_tables_sure'] = array('toggle', 0);
     $params[] = array('section-end');
     @end($params);
     $tab_data[] = array(JText::_('CFG_TAB_EXPERT_TITLE'), key($params), '<h2>' . JText::_('CFG_TAB_EXPERT_SUBTITLE') . '</h2>');
     $error_reporting_notices[] = JHTML::_('select.option', 512, JText::_('AEC_NOTICE_NUMBER_512'));
     $error_reporting_notices[] = JHTML::_('select.option', 128, JText::_('AEC_NOTICE_NUMBER_128'));
     $error_reporting_notices[] = JHTML::_('select.option', 32, JText::_('AEC_NOTICE_NUMBER_32'));
     $error_reporting_notices[] = JHTML::_('select.option', 8, JText::_('AEC_NOTICE_NUMBER_8'));
     $error_reporting_notices[] = JHTML::_('select.option', 2, JText::_('AEC_NOTICE_NUMBER_2'));
     $lists['error_notification_level'] = JHTML::_('select.genericlist', $error_reporting_notices, 'error_notification_level', 'size="5"', 'value', 'text', $aecConfig->cfg['error_notification_level']);
     $lists['email_notification_level'] = JHTML::_('select.genericlist', $error_reporting_notices, 'email_notification_level', 'size="5"', 'value', 'text', $aecConfig->cfg['email_notification_level']);
     // Display Processor descriptions?
     if (!empty($aecConfig->cfg['gwlist'])) {
         $desc_list = $aecConfig->cfg['gwlist'];
     } else {
         $desc_list = array();
     }
     $lists['gwlist'] = PaymentProcessorHandler::getProcessorSelectList(true, $desc_list);
     $grouplist = ItemGroupHandler::getTree();
     $glist = array();
     foreach ($grouplist as $glisti) {
         if (defined('JPATH_MANIFESTS')) {
             $glist[] = JHTML::_('select.option', $glisti[0], str_replace('&nbsp;', ' ', $glisti[1]));
         } else {
             $glist[] = JHTML::_('select.option', $glisti[0], $glisti[1]);
         }
     }
     $lists['root_group'] = JHTML::_('select.genericlist', $glist, 'root_group', 'size="' . min(6, count($glist) + 1) . '"', 'value', 'text', $aecConfig->cfg['root_group']);
     foreach ($itemidlist as $idk => $idkp) {
         if (empty($aecConfig->cfg['itemid_' . $idk])) {
             $query = 'SELECT `id`' . ' FROM #__menu' . ' WHERE ( LOWER( `link` ) = \'index.php?option=com_acctexp&view=' . $idkp['view'] . '\'' . ' OR LOWER( `link` ) LIKE \'%' . 'layout=' . $idkp['view'] . '%\' )' . ' AND published = \'1\'';
             $this->db->setQuery($query);
             $mid = 0;
             if (empty($idkp['params'])) {
                 $mid = $this->db->loadResult();
             } else {
                 $mids = xJ::getDBArray($this->db);
                 if (!empty($mids)) {
                     $query = 'SELECT `id`' . ' FROM #__menu' . ' WHERE `id` IN (' . implode(',', $mids) . ')' . ' AND `params` LIKE \'%' . $idkp['params'] . '%\'' . ' AND published = \'1\'';
                     $this->db->setQuery($query);
                     $mid = $this->db->loadResult();
                 }
             }
             if ($mid) {
                 $aecConfig->cfg['itemid_' . $idk] = $mid;
             }
         }
     }
     if (!empty($aecConfig->cfg['apiapplist'])) {
         $string = "";
         foreach ($aecConfig->cfg['apiapplist'] as $app => $key) {
             $string .= $app . "=" . $key . "\n";
         }
         $aecConfig->cfg['apiapplist'] = $string;
     } else {
         $aecConfig->cfg['apiapplist'] = "";
     }
     $settings = new aecSettings('cfg', 'general');
     $settings->fullSettingsArray($params, $aecConfig->cfg, $lists);
     // Call HTML Class
     $aecHTML = new aecHTML($settings->settings, $settings->lists);
     if (!empty($customparamsarray)) {
         $aecHTML->customparams = $customparamsarray;
     }
     HTML_AcctExp::Settings($aecHTML, $params, $tab_data);
 }