/**
  * init()
  *
  * Initialize the class.
  *
  * @since 1.0.0
  */
 function init()
 {
     // Register the admin screen.
     add_action('admin_menu', array(&$this, 'register_admin_screen'), 20);
     $shortname = 'colabs';
     $options_gateways = array();
     $currencies = colabs_get_currencies();
     foreach ($currencies as $key => $currency) {
         $options_currency[$key] = $currency['name'] . ' (' . $currency['symbol'] . ')';
     }
     $currency_symbol = colabs_get_currency_symbol(get_option('colabs_currency_code'));
     $options_gateways[] = array("name" => __('Payments General', 'colabsthemes'), "icon" => "general", "type" => "heading");
     $options_gateways[] = array("name" => __('Currency', 'colabsthemes'), "desc" => sprintf(__("This is the currency you want to collect payments in. It applies mainly to PayPal payments since other payment gateways accept more currencies. If your currency is not listed then PayPal currently does not support it. See the list of supported <a target='_new' href='%s'>PayPal currencies</a>.", 'colabsthemes'), 'https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside'), "id" => $shortname . "_currency_code", "options" => $options_currency, "type" => "select2");
     $options_gateways[] = array("name" => __("Symbol Position", "colabsthemes"), "desc" => __("Some currencies place the symbol on the right side vs the left. Select how you would like your currency symbol to be displayed.", "colabsthemes"), "id" => $shortname . "_currency_position", "std" => "left", "type" => "select2", "options" => array('left' => sprintf(__('Left of Currency (%s100)', 'colabsthemes'), $currency_symbol), 'left_space' => sprintf(__('Left of Currency with Space (%s 100)', 'colabsthemes'), $currency_symbol), 'right' => sprintf(__('Right of Currency (100%s)', 'colabsthemes'), $currency_symbol), 'right_space' => sprintf(__('Right of Currency with Space (100 %s)', 'colabsthemes'), $currency_symbol)));
     $this->default_options_gateways = $options_gateways;
 }
示例#2
0
function colabs_get_currency_symbol($currency_code = 'USD')
{
    if ($currency_code == '') {
        $currency_code = 'USD';
    }
    $currencies = colabs_get_currencies();
    $symbol = $currencies[$currency_code]['symbol'];
    return $symbol;
}