function initElements() { $this->addElement('text', 'site_title', array('size' => 40), array('help-id' => '#Site Title'))->setLabel(___('Site Title')); $this->addElement('static', null, null, array('help-id' => '#Root Url and License Key'))->setContent('<div><a href="' . Am_Controller::escape(REL_ROOT_URL) . '/admin-license" target="_top">' . ___('change') . '</a></div>')->setLabel(___('Root Url and License Keys')); $this->addText('flowplayer_license')->setLabel(___("FlowPlayer License Key\nyou may get your key in %smembers area%s", '<a href="http://www.amember.com/amember/member?flowplayer_key=1">', '</a>'))->addRule('regex', ___('Value must be alphanumeric'), '/^[a-zA-Z0-9]*$/'); $this->addElement('select', 'theme', null, array('help-id' => '#User Pages Theme'))->setLabel(___('User Pages Theme'))->loadOptions(Am_View::getThemes('user')); $this->addElement('select', 'admin_theme')->setLabel(___('Admin Pages Theme'))->loadOptions(Am_View::getThemes('admin')); /* if (!extension_loaded("curl")){ $el = $this->addElement('text', 'curl') ->setLabel(___('cURL executable file location', "you need it only if you are using payment processors<br /> like Authorize.Net or PayFlow Pro<br /> usually valid path is /usr/bin/curl or /usr/local/bin/curl")); $el->default = '/usr/bin/curl'; $el->addRule('callback2', 'error', array($this, 'validateCurl')); } */ $fs = $this->addElement('fieldset', '##02')->setLabel(___('Signup Form Configuration')); // $this->addElement('advcheckbox', 'generate_login') // ->setLabel(___('Generate Login', 'should aMember generate username for customer?')); $this->setDefault('login_min_length', 5); $this->setDefault('login_max_length', 16); $loginLen = $fs->addGroup()->setLabel(___('Username length')); $loginLen->addInteger('login_min_length')->setLabel('min'); $loginLen->addInteger('login_max_length')->setLabel('max'); $fs->addElement('advcheckbox', 'login_disallow_spaces')->setLabel(___('Do not allow spaces in username')); $fs->addElement('advcheckbox', 'login_dont_lowercase')->setLabel(___("Do not lowercase username\n" . "by default, aMember automatically lowercases entered username\n" . "here you can disable this function")); // $fs->addElement('advcheckbox', 'generate_pass') // ->setLabel(___('Generate Password', 'should aMember generate password for customer?')); // $this->setDefault('pass_min_length', 6); $this->setDefault('pass_max_length', 25); $passLen = $fs->addGroup()->setLabel(___('Password Length')); $passLen->addInteger('pass_min_length')->setLabel('min'); $passLen->addInteger('pass_max_length')->setLabel('max'); $fs = $this->addElement('fieldset', '##03')->setLabel(___('Miscellaneous')); $this->setDefault('admin.records-on-page', 10); $fs->addElement('text', 'admin.records-on-page')->setLabel(___('Records per page (for grids)')); $this->setDefault('currency', 'USD'); $currency = $fs->addElement('select', 'currency', array('size' => 1))->setLabel(___("Base Currency\n" . "base currency to be used for reports and affiliate commission.\n" . "It could not be changed if there are any invoices in database"))->loadOptions(Am_Currency::getFullList()); if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice")) { $currency->toggleFrozen(true); } }
function getSupportedCurrencies() { return array_keys(Am_Currency::getFullList()); }
function initElements() { $this->addElement('text', 'site_title', array('class' => 'el-wide'), array('help-id' => '#Setup.2FEdit_Site_Title'))->setLabel(___('Site Title')); $this->addElement('static', null, null, array('help-id' => '#Root_URL_and_License_Key'))->setContent('<a href="' . Am_Controller::escape(REL_ROOT_URL) . '/admin-license" target="_top" class="link">' . ___('change') . '</a>')->setLabel(___('Root Url and License Keys')); $players = array('Flowplayer' => 'Flowplayer'); if (file_exists(ROOT_DIR . '/application/default/views/public/js/jwplayer/jwplayer.js')) { $players['JWPlayer'] = 'JWPlayer'; } $this->addSelect('video_player')->setId('video-player')->setLabel(___('Video Player'))->loadOptions($players)->toggleFrozen(count($players) == 1 ? true : false); $this->setDefault('video_player', 'Flowplayer'); $this->addText('flowplayer_license')->setId('video-player-Flowplayer')->setLabel(___("FlowPlayer License Key\nyou may get your key in %smembers area%s", '<a href="http://www.amember.com/amember/member?flowplayer_key=1" class="link">', '</a>'))->addRule('regex', ___('Value must be alphanumeric'), '/^[a-zA-Z0-9]*$/'); $this->addText('jwplayer_license')->setId('video-player-JWPlayer')->setLabel(___("JWPlayer License Key")); $this->addScript()->setScript(<<<CUT \$(function(){ \$('#video-player').change(function(){ \$('#video-player-Flowplayer').closest('.row').toggle(\$(this).val() == 'Flowplayer'); \$('#video-player-JWPlayer').closest('.row').toggle(\$(this).val() == 'JWPlayer'); }).change(); }) CUT ); $this->addElement('select', 'theme', null, array('help-id' => '#Setup.2FEdit_User_Pages_Theme'))->setLabel(___('User Pages Theme'))->loadOptions(Am_View::getThemes('user')); $this->addElement('select', 'admin_theme', null, array('help-id' => '#Setup.2FEdit_Admin_Pages_Theme'))->setLabel(___('Admin Pages Theme'))->loadOptions(Am_View::getThemes('admin')); $tax_plugins = array('global-tax' => ___('Global Tax'), 'regional' => ___('Regional Tax'), 'vat' => ___('EU VAT'), 'vat2015' => ___('EU VAT (New Rules 2015)'), 'gst' => ___('GST (Inclusive Tax)')); foreach (Am_Di::getInstance()->plugins_tax->getAvailable() as $plugin) { if (!isset($tax_plugins[$plugin])) { $tax_plugins[$plugin] = ucwords(str_replace("-", ' ', $plugin)); } } $this->addSelect('plugins.tax', array('size' => 1))->setLabel(___('Tax'))->loadOptions(array('' => ___('No Tax')) + $tax_plugins); $fs = $this->addElement('fieldset', '##02')->setLabel(___('Signup Form Configuration')); // $this->addElement('advcheckbox', 'generate_login') // ->setLabel(___('Generate Login', 'should aMember generate username for customer?')); $this->setDefault('login_min_length', 5); $this->setDefault('login_max_length', 16); $loginLen = $fs->addGroup(null, null, array('help-id' => '#Setup.2FEdit_Username_Rules'))->setLabel(___('Username Length')); $loginLen->addInteger('login_min_length', array('size' => 3))->setLabel('min'); $loginLen->addStatic('')->setContent(' — '); $loginLen->addInteger('login_max_length', array('size' => 3))->setLabel('max'); $fs->addElement('advcheckbox', 'login_disallow_spaces', null, array('help-id' => '#Setup.2FEdit_Username_Rules'))->setLabel(___('Do not Allow Spaces in Username')); $fs->addElement('advcheckbox', 'login_dont_lowercase', null, array('help-id' => '#Setup.2FEdit_Username_Rules'))->setLabel(___("Do not Lowercase Username\n" . "by default, aMember automatically lowercases entered username\n" . "here you can disable this function")); // $fs->addElement('advcheckbox', 'generate_pass') // ->setLabel(___('Generate Password', 'should aMember generate password for customer?')); // $this->setDefault('pass_min_length', 6); $this->setDefault('pass_max_length', 25); $passLen = $fs->addGroup(null, null, array('help-id' => '#Setup.2FEdit_Password_Length'))->setLabel(___('Password Length')); $passLen->addInteger('pass_min_length', array('size' => 3))->setLabel('min'); $passLen->addStatic('')->setContent(' — '); $passLen->addInteger('pass_max_length', array('size' => 3))->setLabel('max'); $fs->addAdvCheckbox('require_strong_password')->setLabel(___("Require Strong Password\n" . 'password should contain at least 2 capital letters, 2 or more numbers and 2 or more special chars')); $fs = $this->addElement('fieldset', '##03')->setLabel(___('Miscellaneous')); $this->setDefault('admin.records-on-page', 10); $fs->addElement('text', 'admin.records-on-page')->setLabel(___('Records per Page (for grids)')); $fs->addAdvCheckbox('disable_rte')->setLabel(___('Disable Visual HTML Editor')); $this->setDefault('currency', 'USD'); $currency = $fs->addElement('select', 'currency', array('size' => 1, 'class' => 'am-combobox'), array('help-id' => '#Set_Up.2FEdit_Base_Currency'))->setLabel(___("Base Currency\n" . "base currency to be used for reports and affiliate commission.\n" . "It could not be changed if there are any invoices in database.\n" . "You can edit exchange rate %shere%s", '<a class="link" href="' . REL_ROOT_URL . '/admin-currency-exchange">', '</a>'))->loadOptions(Am_Currency::getFullList()); if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice")) { $currency->toggleFrozen(true); } $this->addSelect('404_page')->setLabel(___("Page Not Found (404)\n" . "%sthis page will be public and do not require any login/password%s\n" . 'you can create new pages %shere%s', '<strong>', '</strong>', '<a class="link" href="' . REL_ROOT_URL . '/default/admin-content/p/pages/index' . '">', '</a>'))->loadOptions(array('' => ___('Default Not Found Page')) + Am_Di::getInstance()->db->selectCol("SELECT page_id AS ?, title FROM ?_page", DBSIMPLE_ARRAY_KEY)); }