/**
  * Verify currency strings return properly
  */
 public function test_currency_string()
 {
     $string = APP_Currencies::get_currency_string('USD');
     $this->assertEquals('US Dollars ($)', $string);
     $string_array = APP_Currencies::get_currency_string_array();
     $this->assertInternalType('array', $string_array);
     $this->assertContains($string, $string_array);
 }
 /**
  * Creates the tabs for the page
  * @return void
  */
 protected function init_tabs()
 {
     $this->tabs->add('general', __('General', APP_TD));
     $this->tab_sections['general']['regional'] = array('title' => __('Regional', APP_TD), 'fields' => array(array('title' => __('Currency', APP_TD), 'type' => 'select', 'name' => 'currency_code', 'values' => APP_Currencies::get_currency_string_array()), array('title' => __('Identifier', APP_TD), 'type' => 'radio', 'name' => 'currency_identifier', 'values' => array('symbol' => sprintf(__('Symbol (%s)', APP_TD), '{symbol}'), 'code' => sprintf(__('Code (%s)', APP_TD), '{code}'))), array('title' => __('Position', APP_TD), 'type' => 'radio', 'name' => 'currency_position', 'values' => array('left' => '{symbol}1.00', 'left_space' => '{symbol} 1.00', 'right' => '1.00{symbol}', 'right_space' => '1.00 {symbol}')), array('title' => __('Thousands Separator', APP_TD), 'type' => 'text', 'name' => 'thousands_separator', 'tip' => __('This sets the thousand separator of displayed prices.', APP_TD), 'extra' => array('style' => 'width: 50px'), 'default' => ','), array('title' => __('Decimal Separator', APP_TD), 'type' => 'text', 'name' => 'decimal_separator', 'tip' => __('This sets the decimal separator of displayed prices.', APP_TD), 'extra' => array('style' => 'width: 50px'), 'default' => '.'), array('title' => __('Tax Charge', APP_TD), 'type' => 'text', 'name' => 'tax_charge', 'desc' => __('%', APP_TD), 'extra' => array('style' => 'width: 50px'), 'default' => 0)));
     $this->tab_sections['general']['gateways'] = array('title' => __('Installed Gateways', APP_TD), 'fields' => array());
     $gateways = APP_Gateway_Registry::get_gateways();
     foreach ($gateways as $gateway) {
         $this->tab_sections['general']['gateways']['fields'][] = $this->load_gateway_tabs($gateway);
     }
     add_action('admin_notices', array($this, 'disabled_gateway_warning'));
 }
Exemple #3
0
 /**
  * Creates the tabs for the page
  * @return void
  */
 protected function init_tabs()
 {
     $this->tabs->add('general', __('General', APP_TD));
     $this->tab_sections['general']['regional'] = array('title' => __('Regional', APP_TD), 'desc' => __('The following options affect how prices are displayed on your website.', APP_TD), 'fields' => array(array('title' => __('Currency', APP_TD), 'type' => 'select', 'name' => 'currency_code', 'values' => APP_Currencies::get_currency_string_array()), array('title' => __('Identifier', APP_TD), 'type' => 'select', 'name' => 'currency_identifier', 'values' => array('symbol' => sprintf(__('Symbol (%s)', APP_TD), '{symbol}'), 'code' => sprintf(__('Code (%s)', APP_TD), '{code}'))), array('title' => __('Position', APP_TD), 'type' => 'select', 'name' => 'currency_position', 'values' => array('left' => 'Left ({symbol}1.00)', 'right' => 'Right (1.00{symbol})', 'left_space' => 'Left with space ({symbol} 1.00)', 'right_space' => 'Right with space (1.00 {symbol})')), array('title' => __('Thousand Separator', APP_TD), 'type' => 'text', 'name' => 'thousands_separator', 'tip' => __('The thousand separator of displayed prices.', APP_TD), 'extra' => array('class' => 'small-text'), 'default' => ','), array('title' => __('Decimal Separator', APP_TD), 'type' => 'text', 'name' => 'decimal_separator', 'tip' => __('The decimal separator of displayed prices.', APP_TD), 'extra' => array('class' => 'small-text'), 'default' => '.')));
     $this->tab_sections['general']['tax'] = array('title' => __('Tax', APP_TD), 'desc' => __('The following options affect how taxes are applied to all purchases.', APP_TD), 'fields' => array(array('title' => __('Rate', APP_TD), 'type' => 'text', 'name' => 'tax_charge', 'desc' => __('%', APP_TD), 'tip' => __('Set to zero to disable taxes.', APP_TD), 'extra' => array('class' => 'small-text'), 'default' => 0)));
     $this->tab_sections['general']['gateways'] = array('title' => __('Installed Gateways', APP_TD), 'fields' => array());
     $gateways = APP_Gateway_Registry::get_gateways();
     foreach ($gateways as $gateway) {
         $this->tab_sections['general']['gateways']['fields'][] = $this->load_gateway_tabs($gateway);
     }
     add_action('admin_notices', array($this, 'disabled_gateway_warning'));
 }