示例#1
0
 public function getRedirectParams($description = null)
 {
     $transaction = $this->getTransaction();
     // NOOOO.. THE UGLY HACKING
     $return = Config::get('site_root') . 'presale/transaction:complete';
     $method = $transaction->shipment_method;
     if ($method == 'presale-remainder') {
         $return = Config::get('site_root') . 'presale/transaction:confirm_complete';
     }
     return array('cmd' => '_xclick', 'business' => Config::get('shopPaypalAccount'), 'notify_url' => Config::get('site_root') . $this->returnRoute . 'paypal' . $this->getMethod() . '.html', 'bn' => Config::get('ident') . '_BuyNow_WPS_' . strtoupper(Lang::getInstance()->getShortLang()), 'amount' => $transaction->payment_amount, 'item_name' => issetor($description, Config::get('sitename') . ': ' . String::makePlural($transaction->shipment_itemsqty, 'item')), 'quantity' => 1, 'address_ override' => 1, 'address1' => $transaction->shipment_address, 'zip' => $transaction->shipment_zipcode, 'city' => $transaction->shipment_city, 'state' => $transaction->shipment_region, 'country' => $transaction->shipment_country, 'email' => $transaction->email, 'first_name' => $transaction->name, 'currency_code' => Config::get('currencyCode'), 'custom' => $transaction->secret, 'no_shipping' => 1, 'no_note' => 1, 'return' => $return, 'rm' => 1);
 }
示例#2
0
文件: Ini.php 项目: nabble/ajde-core
 public function get($ident, $module = null)
 {
     $module = $this->getModule($module);
     $lang = Lang::getInstance()->getLang();
     $iniFilename = LANG_DIR . $lang . DIRECTORY_SEPARATOR . $module . '.ini';
     if (is_file($iniFilename)) {
         $book = parse_ini_file($iniFilename);
         if (array_key_exists($ident, $book)) {
             return $book[$ident];
         }
     }
     return $ident;
 }
示例#3
0
 public function __construct($route)
 {
     $this->_originalRoute = $route;
     // See if first part is language code (i.e. first part is exactly
     // two characters in length)
     if (strlen($route) === 2 || substr($route, 2, 1) === '/') {
         $shortLang = substr($route, 0, 2);
         $langInstance = Lang::getInstance();
         if ($lang = $langInstance->getAvailableLang($shortLang)) {
             $this->set("lang", $lang);
             $route = substr($route, 3);
             // set global lang
             $langInstance->setGlobalLang($lang);
         }
     }
     Dispatcher::trigger($this, 'onAfterLangSet');
     if (!$route) {
         $route = Config::get('homepageRoute');
     }
     // Check for route aliases
     $aliases = Config::get("aliases");
     if (array_key_exists($route, $aliases)) {
         $this->_route = $aliases[$route];
     } else {
         $this->_route = $route;
     }
     Dispatcher::trigger($this, 'onAfterRouteSet');
     // Get route parts
     $routeParts = $this->_extractRouteParts();
     if (empty($routeParts)) {
         $exception = new Routing(sprintf("Invalid route: %s", $route), 90021);
         Ajde::routingError($exception);
     }
     $defaultParts = Config::get('defaultRouteParts');
     $parts = array_merge($defaultParts, $routeParts);
     foreach ($parts as $part => $value) {
         $this->set($part, $value);
     }
 }
示例#4
0
文件: I18n.php 项目: nabble/ajde-core
 public function getAvailableTranslations()
 {
     $lang = Lang::getInstance();
     $langs = $lang->getAvailableNiceNames();
     $model = $this->_crud->getModel();
     /* @var $model Ajde_Lang_Proxy_Model */
     $translations = $model->getTranslations();
     $translatedLangs = array();
     foreach ($translations as $model) {
         /* @var $model Ajde_Lang_Proxy_Model */
         $modelLanguage = $model->getLanguage();
         if (!empty($modelLanguage)) {
             $translatedLangs[$modelLanguage] = $model;
         }
     }
     foreach ($langs as $key => &$name) {
         $name = array('name' => $name);
         if (array_key_exists($key, $translatedLangs)) {
             $name['model'] = $translatedLangs[$key];
         }
     }
     return $langs;
 }
示例#5
0
 protected function _load($sql, $values, $populate = true)
 {
     $return = parent::_load($sql, $values, $populate);
     if (Lang::getInstance()->autoTranslateModels() && $return) {
         // get translation
         $lang = Lang::getInstance();
         if ($translation = $this->getTranslated($lang->getLang())) {
             /* @var $translation Ajde_Lang_Proxy_Model */
             $this->reset();
             $this->loadFromValues($translation->values());
         }
     }
     return $return;
 }