"Australian Dollars", "CAD" => "Canadian Dollars", "EUR" => "Euros", "GBP" => "Pounds Sterling", "JPY" => "Yen", "USD" => "U.S. Dollars", "NZD" => "New Zealand Dollar", "CHF" => "Swiss Franc", "HKD" => "Hong Kong Dollar", "SGD" => "Singapore Dollar", "SEK" => "Swedish Krona", "DKK" => "Danish Krone", "PLN" => "Polish Zloty", "NOK" => "Norwegian Krone", "HUF" => "Hungarian Forint", "CZK" => "Czech Koruna", "ILS" => "Israeli Shekel", "MXN" => "Mexican Peso"); static $format= array( "AUD" => "$", "CAD" => "$", "EUR" => "€", "GBP" => "£", "JPY" => "¥", "USD" => "$", "NZD" => "$", "CHF" => "", "HKD" => "$", "SGD" => "$", "SEK" => "", "DKK" => "", "PLN" => "", "NOK" => "", "HUF" => "", "CZK" => "", "ILS" => "", "MXN" => ""); static function get_configure_form() { $form = new Forge("admin/configure", "", "post", array("id" => "gConfigureForm")); $group = $form->group("configure")->label(t("Configure Basket")); $group->input("email")->label(t("Offline Paying Email Address"))->id("gOrderEmailAddress"); $group->dropdown("currency") ->label(t("Currency")) ->options(self::$currencies); $group->checkbox("paypal")->label(t("Use Paypal"))->id("gPaypal"); $group->input("paypal_account")->label(t("Paypal E-Mail Address"))->id("gPaypalAddress"); $group->submit("")->value(t("Save")); return $form; } static function populateForm($form){ $form->configure->email->value(basket::getEmailAddress()); $form->configure->paypal->checked(basket::isPaypal()); $form->configure->paypal_account->value(basket::getPaypalAccount()); $form->configure->currency->selected(basket::getCurrency()); } static function extractForm($form){ $email = $form->configure->email->value; $isPaypal = $form->configure->paypal->value; $paypal_account = $form->configure->paypal_account->value; $currency = $form->configure->currency->selected; basket::setEmailAddress($email); basket::setPaypal($isPaypal); basket::setPaypalAccount($paypal_account); basket::setCurrency($currency); } static function getEmailAddress(){ return module::get_var("basket","email"); } static function isPaypal(){ return module::get_var("basket","paypal"); } static function getPaypalAccount(){ return module::get_var("basket","paypal_account"); } static function getCurrency(){ $cur = module::get_var("basket","currency"); if (!isset($cur)) { $cur = "USD"; } return $cur; } static function formatMoney($money){ return self::$format[self::getCurrency()].number_format($money,2); } static function setEmailAddress($email){ module::set_var("basket","email",$email); } static function setPaypal($paypal){ module::set_var("basket","paypal",$paypal); } static function setPaypalAccount($paypal_account){ module::set_var("basket","paypal_account",$paypal_account); } static function setCurrency($currency){ module::set_var("basket","currency",$currency); } static function generatePaypalForm($session_basket){ $form = "
"; return $form; } }