public function export() { header("Content-Type: application/xml; charset=UTF-8"); $rss_date = self::displayDate($this->guessRSSDate()); $tVars = array('items' => $this->items, 'title_link' => $this->feedURL, 'feed_title' => $this->title, 'feed_description' => $this->descr, 'language' => GWF_Language::getCurrentISO(), 'image_url' => Common::getAbsoluteURL('/favicon.ico', false), 'image_link' => $this->webURL, 'image_width' => '32', 'image_height' => '32', 'pub_date' => $rss_date, 'build_date' => $rss_date); return GWF_Template::templatePHPMain('rss2.php', $tVars); }
public function displayPaysiteButton(GWF_Module $module, GWF_Order $order, GWF_Orderable $gdo, GWF_User $user) { $lang_iso = GWF_Language::getCurrentISO(); $action = self::RECEIVE_MONEY_URL; $hidden = GWF_Form::hidden('ap_purchasetype', 'item') . GWF_Form::hidden('ap_merchant', $this->cfgSeller()) . GWF_Form::hidden('ap_itemname', $gdo->getOrderItemName($module, $lang_iso)) . GWF_Form::hidden('ap_currency', $order->getOrderCurrency()) . GWF_Form::hidden('ap_returnurl', Common::getAbsoluteURL($gdo->getOrderSuccessURL($user), false)) . GWF_Form::hidden('ap_itemcode', $order->getOrderToken()) . GWF_Form::hidden('ap_quantity', $order->getOrderAmount()) . GWF_Form::hidden('ap_description', $gdo->getOrderDescr($module, $lang_iso)) . GWF_Form::hidden('ap_amount', $order->getOrderPriceTotal()) . GWF_Form::hidden('ap_cancelurl', Common::getAbsoluteURL($gdo->getOrderCancelURL($user), false)); // echo GWF_HTML::display($hidden); return Module_Payment::tinyform('pay_ap', 'img/' . GWF_ICON_SET . 'buy_ap.png', $action, $hidden); }
public function execute() { if (false === ($order = GWF_Order::getByToken(Common::getPostString('gwf_token')))) { return $this->module->error('err_order'); } if (!$order->isCreated()) { return $this->module->error('err_order'); } $gdo = $order->getOrderData(); $user = $order->getOrderUser(); # GWF_User::getStaticOrGuest(); /* The servername and serverport tells PayPal where the buyer should be directed back to after authorizing payment. In this case, its the local webserver that is running this script Using the servername and serverport, the return URL is the first portion of the URL that buyers will return to after authorizing payment */ /* The returnURL is the location where buyers return when a payment has been succesfully authorized. The cancelURL is the location buyers are sent to when they hit the cancel button during authorization of payment during the PayPal flow */ $successURL = urlencode($this->get2ndStepURL($order, $gdo)); $cancelURL = urlencode(Common::getAbsoluteURL($gdo->getOrderCancelURL($user), false)); $shipping = $gdo->needsShipping($user) ? '0' : '1'; /* Construct the parameter string that describes the PayPal payment the varialbes were set in the web form, and the resulting string is stored in $nvpstr */ $paymentAmount = $order->getOrderPriceTotal(2); $paymentType = "Sale"; $currencyCodeType = $order->getOrderCurrency(); $nvpstr = "&Amt={$paymentAmount}" . "&PAYMENTACTION={$paymentType}" . "&ReturnUrl={$successURL}" . "&CANCELURL={$cancelURL}" . "&CURRENCYCODE={$currencyCodeType}" . "&no_shipping={$shipping}" . "&LOCALECODE=" . strtoupper(GWF_Language::getCurrentISO()); // var_dump($nvpstr); /* Make the call to PayPal to set the Express Checkout token If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment. If an error occured, show the resulting errors */ $resArray = Paypal_Util::hash_call('SetExpressCheckout', $nvpstr); // var_dump($resArray); $ack = strtoupper($resArray["ACK"]); if ($ack == "SUCCESS") { // Redirect to paypal.com here $token = urldecode($resArray["TOKEN"]); if (false === $order->saveVar('order_xtoken', $token)) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)); } $payPalURL = PAYPAL_URL . $token; header("Location: " . $payPalURL); echo 'The browser should redirect you to: ' . $payPalURL . PHP_EOL; die; } else { return Paypal_Util::paypalError($resArray); } }
public static function getSwitchLangSelectDomain() { $langs = GWF_Language::getSupportedLanguages(); $data = array(); foreach ($langs as $lang) { $data[] = array($lang->displayName(), $lang->getISO()); } $current_iso = GWF_Language::getCurrentISO(); $domain = GWF_DOMAIN; $url = htmlspecialchars($_SERVER['REQUEST_URI']); $onchange = "window.location='http://'+this.value+'.{$domain}{$url}';"; return GWF_Select::display('switch_lang', $data, $current_iso, $onchange); }
private static function displayMenuLang(Module_PoolTool $module) { switch (GWF_Language::getCurrentISO()) { case 'de': $country = GWF_Country::getByTLD('gb'); $to = 'en'; break; case 'en': default: $country = GWF_Country::getByTLD('de'); $to = 'de'; break; } $href = sprintf('http://%s.%s%s', $to, GWF_DOMAIN, htmlspecialchars($_SERVER['REQUEST_URI'])); return sprintf('<a href="%s">%s</a>', $href, $country->displayFlag()); }
private function gTranslate() { if (false === ($post = $this->module->getCurrentPost())) { return $this->module->error('err_post'); } if (false === ($thread = $post->getThread())) { return $this->module->error('err_post'); } if (false === $thread->hasPermission(GWF_Session::getUser())) { return $this->module->error('err_post_perm'); } $text = $post->displayTitle() . PHP_EOL . PHP_EOL . $post->displayMessage(); $text = preg_replace('/<[^>]+>/', '', $text); $text = str_replace('|', '-', $text); $text = urlencode($text); $browser_lang = GWF_Language::getCurrentISO(); $url = 'http://translate.google.com/translate_t#auto|' . $browser_lang . '|' . $text; header('Location: ' . $url); }
public static function getBrowserISO() { return GWF_Language::getCurrentISO(); }
/** * Return a human readable duration. * Example: 666 returns 11 minutes 6 seconds. * @param $duration in seconds. * @param $nUnits how many units to display max. * @return string */ public static function humanDuration($duration, $nUnits = 2) { return self::humanDurationISO(GWF_Language::getCurrentISO(), $duration, $nUnits); }
public function execute() { return GWF_Language::getCurrentISO(); }
<?php SSYHTML::$menuID = SSY_MENU_NEWS; echo SSYHTML::getBoxTitled($tLang->lang('title'), Module_Assessystem::getInstance()->lang('news_info')); if (count($tVars['news']) === 0) { $tVars['news'] = array(array('news_id' => '0', 'news_date' => '', 'user_name' => '', 'newst_title' => $tLang->lang('title_no_news'), 'newst_message' => $tLang->lang('msg_no_news'))); } ?> <span class="t" style=""> <span class="ssy800v_R ssy_st_out3"><span class="ssy_small_softbox"> <?php echo sprintf('<a href="%snewsletter/subscribe">%s</a>', GWF_WEB_ROOT, $tLang->lang('btn_sign')); echo '<span class="b" style="height: 20px;"></span>'; $iso = GWF_Language::getCurrentISO(); foreach ($tVars['titles'] as $id => $d) { $newsid = $d[0]; $title = $d[1]; $catid = 0; $cat = 'FOO'; // $title = $d[0]; $etitle = Common::urlencodeSEO($title); // $catid = $d[1]; // $cat = 'foo'; // $cat = $d[2];#($catid === 0) ? GWF_HTML::lang('no_category') : $d[2]; // $cat = Common::urlencodeSEO($cat); // $newsid = (int)$d[3]; $url = sprintf(GWF_WEB_ROOT . 'news/%s/%s/%s/%s/%s#newsid_%d', $iso, $catid, $cat, $newsid, $etitle, $newsid); echo sprintf('<a href="%s">%s</a>', $url, GWF_HTML::display($title)); } ?> </span>
private function getTranslated($translate) { if ($translate === false) { return ''; } $text = $this->pm->displayMessage(); if (false !== ($back = GWF_GTranslate::translate($text, 'auto', GWF_Language::getCurrentISO()))) { return $back; } return ''; }
public static function getHTMLHead() { $tVars = array('page_title' => self::displayPageTitle(), 'language' => GWF_Language::getCurrentISO(), 'meta' => self::displayMeta(), 'js' => self::displayJavascripts(), 'head_links' => self::displayLink()); # Errors and messages from GWF_Error GWF_Error::displayAll(); return GWF_Doctype::getDoctype(GWF_DEFAULT_DOCTYPE) . GWF_Template::templateMain('html_head.tpl', $tVars) . PHP_EOL; }
private function getPageMenu() { $iso = GWF_Language::getCurrentISO(); $href = sprintf(GWF_WEB_ROOT . 'news/%s/%d/%s/page-%%PAGE%%', $iso, $this->catid, urlencode($this->catTitle)); return GWF_PageMenu::display($this->page, $this->nPages, $href); }
public static function insertOrder(GWF_Module $module, GWF_Orderable $gdo, GWF_PaymentModule $paysite, GWF_User $user, $price_total, $cartid = 0) { $token = self::generateToken(); $order = new self(array('order_cartid' => $cartid, 'order_uid' => $user->getID(), 'order_token' => $token, 'order_xtoken' => '', 'order_date_paid' => '00000000000000', 'order_date_ordered' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'order_price' => $gdo->getOrderPrice($user), 'order_price_total' => $price_total, 'order_currency' => Module_Payment::getShopCurrencyS(), 'order_amount' => 1, 'order_email' => '', 'order_site' => $paysite->getSiteNameToken(), 'order_title' => $gdo->getOrderItemName($module, GWF_Language::getCurrentISO()), 'order_title_admin' => $gdo->getOrderItemName($module, GWF_LANG_ADMIN), 'order_descr' => $gdo->getOrderDescr($module, GWF_Language::getCurrentISO()), 'order_descr_admin' => $gdo->getOrderDescr($module, GWF_LANG_ADMIN), 'order_status' => self::CREATED, 'order_data' => serialize($gdo), 'order_module' => $gdo->getOrderModuleName())); if (false === $order->insert()) { return false; } return $order; }
public function displayName() { return $this->displayNameISO(GWF_Language::getCurrentISO()); }