static function getLists($params_values, $restrictions_values)
 {
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $gtree = xJACLhandler::getGroupTree(array(28, 29, 30));
     // Create GID related Lists
     $lists['gid'] = JHTML::_('select.genericlist', $gtree, 'gid', 'size="6"', 'value', 'text', arrayValueDefault($params_values, 'gid', defined('JPATH_MANIFESTS') ? 2 : 18));
     $lists['mingid'] = JHTML::_('select.genericlist', $gtree, 'mingid', 'size="6"', 'value', 'text', arrayValueDefault($restrictions_values, 'mingid', defined('JPATH_MANIFESTS') ? 2 : 18));
     $lists['fixgid'] = JHTML::_('select.genericlist', $gtree, 'fixgid', 'size="6"', 'value', 'text', arrayValueDefault($restrictions_values, 'fixgid', defined('JPATH_MANIFESTS') ? 3 : 19));
     $lists['maxgid'] = JHTML::_('select.genericlist', $gtree, 'maxgid', 'size="6"', 'value', 'text', arrayValueDefault($restrictions_values, 'maxgid', defined('JPATH_MANIFESTS') ? 4 : 21));
     $available_plans = array();
     // Fetch Payment Plans
     $query = 'SELECT `id` AS value, `name` AS text' . ' FROM #__acctexp_plans';
     $db->setQuery($query);
     $plans = $db->loadObjectList();
     if (empty($plans)) {
         $plans = array();
     } else {
         $all_plans = $available_plans;
     }
     $planrest = array('previousplan_req', 'currentplan_req', 'overallplan_req', 'used_plan_min', 'used_plan_max', 'previousplan_req_excluded', 'currentplan_req_excluded', 'overallplan_req_excluded');
     foreach ($planrest as $name) {
         $lists[$name] = JHTML::_('select.genericlist', $plans, $name . '[]', 'size="1" multiple="multiple"', 'value', 'text', arrayValueDefault($restrictions_values, $name, 0));
     }
     $available_groups = array();
     // Fetch Item Groups
     $query = 'SELECT `id` AS value, `name` AS text' . ' FROM #__acctexp_itemgroups';
     $db->setQuery($query);
     $groups = $db->loadObjectList();
     if (empty($groups)) {
         $groups = array();
     }
     $grouprest = array('previousgroup_req', 'currentgroup_req', 'overallgroup_req', 'used_group_min', 'used_group_max', 'previousgroup_req_excluded', 'currentgroup_req_excluded', 'overallgroup_req_excluded');
     foreach ($grouprest as $name) {
         $lists[$name] = JHTML::_('select.genericlist', $groups, $name . '[]', 'size="1" multiple="multiple"', 'value', 'text', arrayValueDefault($restrictions_values, $name, 0));
     }
     return $lists;
 }
Example #2
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);
 }
Example #3
0
File: acl.php Project: Ibrahim1/aec
 public function Settings()
 {
     $settings = array();
     $rewriteswitches = array('cms', 'user', 'expiration', 'subscription', 'plan', 'invoice');
     if (defined('JPATH_MANIFESTS')) {
         $settings['set_gid'] = array('toggle');
         $settings['gid'] = array('list');
         $settings['gid_rw'] = array('inputD');
         $settings['set_removegid'] = array('toggle');
         $settings['removegid'] = array('list');
         $settings['removegid_rw'] = array('inputD');
         $settings['aectab_exp'] = array('tab', 'Expiration Action', 'Expiration Action');
         $settings['set_gid_exp'] = array('toggle');
         $settings['gid_exp'] = array('list');
         $settings['gid_rw_exp'] = array('inputD');
         $settings['set_removegid_exp'] = array('toggle');
         $settings['removegid_exp'] = array('list');
         $settings = AECToolbox::rewriteEngineInfo($rewriteswitches, $settings);
         $settings['aectab_preexp'] = array('tab', 'Pre-Expiration Action', 'Pre-Expiration Action');
         $settings['set_gid_pre_exp'] = array('toggle');
         $settings['gid_pre_exp'] = array('list');
         $settings['gid_rw_pre_exp'] = array('inputD');
         $settings['set_removegid_pre_exp'] = array('toggle');
         $settings['removegid_pre_exp'] = array('list');
         $settings['removegid_rw_pre_exp'] = array('inputD');
         $settings = AECToolbox::rewriteEngineInfo($rewriteswitches, $settings);
     } else {
         $settings['jaclpluspro'] = array('toggle');
         $settings['delete_subgroups'] = array('toggle');
         $settings['set_gid'] = array('toggle');
         $settings['gid'] = array('list');
         $settings['gid_rw'] = array('inputD');
         $settings['sub_set_gid'] = array('toggle');
         $settings['sub_gid_del'] = array('list');
         $settings['sub_gid'] = array('list');
         $settings['aectab_exp'] = array('tab', 'Expiration Action', 'Expiration Action');
         $settings['set_gid_exp'] = array('toggle');
         $settings['gid_exp'] = array('list');
         $settings['gid_rw_exp'] = array('inputD');
         $settings['sub_set_gid_exp'] = array('toggle');
         $settings['sub_gid_exp_del'] = array('list');
         $settings['sub_gid_exp'] = array('list');
         $settings['aectab_preexp'] = array('tab', 'Pre-Expiration Action', 'Pre-Expiration Action');
         $settings['set_gid_pre_exp'] = array('toggle');
         $settings['gid_pre_exp'] = array('list');
         $settings['gid_rw_pre_exp'] = array('inputD');
         $settings['sub_set_gid_pre_exp'] = array('toggle');
         $settings['sub_gid_pre_exp_del'] = array('list');
         $settings['sub_gid_pre_exp'] = array('list');
     }
     $gtree = xJACLhandler::getGroupTree(array(28, 29, 30));
     $gidlists = array('gid', 'gid_exp', 'gid_pre_exp', 'removegid', 'removegid_exp', 'removegid_pre_exp');
     foreach ($gidlists as $name) {
         if (defined('JPATH_MANIFESTS')) {
             $selected = array();
         } else {
             $selected = 18;
         }
         if (!empty($this->settings[$name])) {
             if (is_array($this->settings[$name])) {
                 foreach ($this->settings[$name] as $value) {
                     $selected[] = (object) array('value' => $value);
                 }
             } else {
                 $selected = $this->settings[$name];
             }
         }
         if (defined('JPATH_MANIFESTS')) {
             $settings['lists'][$name] = JHTML::_('select.genericlist', $gtree, $name . '[]', 'size="6" multiple="multiple"', 'value', 'text', $selected);
         } else {
             $settings['lists'][$name] = JHTML::_('select.genericlist', $gtree, $name, 'size="6"', 'value', 'text', $selected);
         }
     }
     $subgroups = array('sub_gid_del', 'sub_gid', 'sub_gid_exp_del', 'sub_gid_exp', 'sub_gid_pre_exp_del', 'sub_gid_pre_exp');
     foreach ($subgroups as $groupname) {
         $selected = array();
         if (!empty($this->settings[$groupname])) {
             foreach ($this->settings[$groupname] as $value) {
                 $selected[] = (object) array('value' => $value);
             }
         }
         $settings['lists'][$groupname] = JHTML::_('select.genericlist', $gtree, $groupname . '[]', 'size="6" multiple="multiple"', 'value', 'text', $selected);
     }
     return $settings;
 }