当前位置: 首页>>代码示例>>PHP>>正文


PHP GetLang函数代码示例

本文整理汇总了PHP中GetLang函数的典型用法代码示例。如果您正苦于以下问题:PHP GetLang函数的具体用法?PHP GetLang怎么用?PHP GetLang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetLang函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Subscribe

		public function Subscribe()
		{
			if(!isset($_POST['check'])) {
				$GLOBALS['SubscriptionHeading'] = GetLang('Oops');
				$GLOBALS['Class'] = "ErrorMessage";
				$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSpammerVerification');
			}
			else if(isset($_POST['nl_first_name']) && isset($_POST['nl_email'])) {

				$first_name = $_POST['nl_first_name'];
				$email = $_POST['nl_email'];

				if (!is_email_address($email)) {
					$GLOBALS['SubscriptionHeading'] = GetLang('NewsletterSubscription');
					$GLOBALS['Class'] = "ErrorMessage";
					$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterEnterValidEmail');
				} else {
					$subscription = new Interspire_EmailIntegration_Subscription_Newsletter($email, $first_name);
					$results = $subscription->routeSubscription();

					$success = false;
					$existed = false;

					foreach ($results as /** @var Interspire_EmailIntegration_SubscriberActionResult */$result) {
						// message sent to visitor is 'ok' if even one subscription worked; other failures will be logged internally & emailed to store owner
						// this is a little counter-intuitive when multiple modules are enabled but it's the best compromise I think short of sending info about every module back to the visitor, who shouldn't be concered with such detail
						if ($result->pending) {
							$success = true;
						} else {
							if ($result->success) {
								$success = true;
							}
							if ($result->existed) {
								$existed = true;
							}
						}
					}

					if ($success) {
						if ($existed) {
							// most APIs will simply update existing details, rather than error - but this mimmicks the existing behaviour of ISC if the API can let us know the subscriber existed
							$GLOBALS['SubscriptionHeading'] = GetLang('Oops');
							$GLOBALS['Class'] = "ErrorMessage";
							$GLOBALS['SubscriptionMessage'] = sprintf(GetLang('NewsletterAlreadySubscribed'), $email); // legacy sprintf
						} else {
							$GLOBALS['SubscriptionHeading'] = GetLang('NewsletterThanksForSubscribing');
							$GLOBALS['Class'] = "";
							$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSubscribedSuccessfully') . sprintf(" <a href='%s'>%s.</a>", $GLOBALS['ShopPath'], GetLang('Continue'));
						}
					} else {
						$GLOBALS['SubscriptionHeading'] = GetLang('Oops');
						$GLOBALS['Class'] = "ErrorMessage";
						$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSubscribeError');
					}
				}
			}
			$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(sprintf("%s - %s", GetConfig('StoreName'), GetLang('NewsletterSubscription')));
			$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("newsletter_subscribe");
			$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:60,代码来源:class.subscribe.php

示例2: SetPanelSettings

	public function SetPanelSettings()
	{
		$output = "";

		// If product ratings aren't enabled then we don't even need to load anything here
		if(!getProductReviewsEnabled()) {
			$this->DontDisplay = true;
			return;
		}

		$categorySql = $GLOBALS['ISC_CLASS_CATEGORY']->GetCategoryAssociationSQL(false);
		$query = $this->getProductQuery('prodratingtotal > 0 AND '.$categorySql, 'p.prodratingtotal DESC', 5);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
		if($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
			$GLOBALS['AlternateClass'] = '';
			while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				$this->setProductGlobals($row);
				$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProducts");
			}

			// Showing the syndication option?
			if(GetConfig('RSSPopularProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
				$GLOBALS['ISC_LANG']['CategoryPopularProductsFeed'] = sprintf(GetLang('CategoryPopularProductsFeed'), isc_html_escape($GLOBALS['CatName']));
				$GLOBALS['SNIPPETS']['SideCategoryPopularProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProductsFeed");
			}
		}
		else {
			$GLOBALS['HideSideCategoryPopularProductsPanel'] = "none";
			$this->DontDisplay = true;
		}

		$GLOBALS['SNIPPETS']['SideCategoryPopularProducts'] = $output;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:33,代码来源:SideCategoryPopularProducts.php

示例3: SetPanelSettings

	public function SetPanelSettings()
	{
		$output = "";
		$categorySql = $GLOBALS['ISC_CLASS_CATEGORY']->GetCategoryAssociationSQL(false);

		$query = $this->getProductQuery($categorySql, 'p.productid DESC', 5);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		if($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
			if(!GetConfig('ShowProductRating')) {
				$GLOBALS['HideProductRating'] = "display: none";
			}

			$GLOBALS['AlternateClass'] = '';
			while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				$this->setProductGlobals($row);
				$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryNewProducts");
			}

			// Showing the syndication option?
			if(GetConfig('RSSNewProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
				$GLOBALS['ISC_LANG']['CategoryNewProductsFeed'] = sprintf(GetLang('CategoryNewProductsFeed'), $GLOBALS['CatName']);
				$GLOBALS['SNIPPETS']['SideCategoryNewProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryNewProductsFeed");
			}
		}
		else {
			$GLOBALS['HideSideCategoryNewProductsPanel'] = "none";
			$this->DontDisplay = true;
		}

		$GLOBALS['SNIPPETS']['SideNewProducts'] = $output;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:32,代码来源:SideCategoryNewProducts.php

示例4: ExportOrders

 /**
  * An additional action that's called by this module when the above form is submitted.
  */
 public function ExportOrders()
 {
     // Load up the orders class
     $GLOBALS['ISC_CLASS_ADMIN_ORDERS'] = GetClass('ISC_ADMIN_ORDERS');
     // Get the value of the order status setting
     if ($this->GetValue('orderstatus') == 'shipped') {
         $_GET['orderStatus'] = 2;
     }
     $numOrders = 0;
     $ordersResult = $GLOBALS['ISC_CLASS_ADMIN_ORDERS']->_GetOrderList(0, 'orderid', 'desc', $numOrders, true);
     if ($numOrders == 0) {
         $GLOBALS['ISC_CLASS_ADMIN_ORDERS']->ManageOrders(GetLang('NoOrders'));
         return;
     }
     require_once ISC_BASE_PATH . '/lib/class.xml.php';
     $xml = new ISC_XML_PARSER();
     $tags = array();
     while ($order = $GLOBALS['ISC_CLASS_DB']->Fetch($ordersResult)) {
         $orderTags = array();
         $orderTags[] = $xml->MakeXMLTag('amount', number_format($order['ordtotalamount'], 2));
         $orderTags[] = $xml->MakeXMLTag('customer', $order['ordbillfirstname'] . ' ' . $order['ordbilllastname'], true);
         $orderTags[] = $xml->MakeXMLTag('date', CDate($order['orddate']), true);
         $attributes = array('orderid' => $order['orderid']);
         $tags[] = $xml->MakeXMLTag('order', implode('', $orderTags), false, $attributes);
     }
     @ob_end_clean();
     $xml->SendXMLHeader();
     $xml->SendXMLResponse($tags);
     exit;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:33,代码来源:addon.orderxml.php

示例5: initializeAdmin

	public function initializeAdmin()
	{
		$quantity = 1;

		if (isset($GLOBAL['var_orders'])) {
			$quantity = $GLOBAL['var_orders'];
		}

		// If we're using a cart quantity drop down, load that
		if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
			$GLOBALS['SelectId'] = "orders";
			$GLOBALS['Qty0'] = Interspire_Template::getInstance('admin')->render('Snippets/DiscountItemQtySelect.html');
		// Otherwise, load the textbox
		} else {
			$GLOBALS['SelectId'] = "orders";
			$GLOBALS['Qty0'] = Interspire_Template::getInstance('admin')->render('Snippets/DiscountItemQtyText.html');
		}

		if (!isset($GLOBALS['var_ps'])) {
			$GLOBALS['var_ps'] = GetLang('ChooseAProduct');
		}

		$currency = GetDefaultCurrency();
		if ($currency['currencystringposition'] == "LEFT") {
			$GLOBALS['CurrencyLeft'] = $currency['currencystring'];
		}
		else {
			$GLOBALS['CurrencyRight'] =  $currency['currencystring'];
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:module.xoffforrepeatcustomers.php

示例6: SetPanelSettings

 function SetPanelSettings()
 {
     if (GetConfig('RSSNewProducts') == 0) {
         $GLOBALS['ShowNewProductsFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicateNewProductsIntro'] = sprintf(GetLang('SyndicateNewProductsIntro'), GetConfig('RSSItemsLimit'), $GLOBALS['StoreName']);
         $GLOBALS['ISC_LANG']['SyndicateNewProductsRSS'] = sprintf(GetLang('SyndicateNewProductsRSS'), GetConfig('RSSItemsLimit'));
         $GLOBALS['ISC_LANG']['SyndicateNewProductsAtom'] = sprintf(GetLang('SyndicateNewProductsAtom'), GetConfig('RSSItemsLimit'));
     }
     if (GetConfig('RSSPopularProducts') == 0) {
         $GLOBALS['ShowPopularProductsFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicatePopularProductsIntro'] = sprintf(GetLang('SyndicatePopularProductsIntro'), GetConfig('RSSItemsLimit'), $GLOBALS['StoreName']);
         $GLOBALS['ISC_LANG']['SyndicatePopularProductsRSS'] = sprintf(GetLang('SyndicatePopularProductsRSS'), GetConfig('RSSItemsLimit'));
         $GLOBALS['ISC_LANG']['SyndicatePopularProductsAtom'] = sprintf(GetLang('SyndicatePopularProductsAtom'), GetConfig('RSSItemsLimit'));
     }
     if (GetConfig('RSSProductSearches') == 0) {
         $GLOBALS['ShowSearchFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicateSearchesIntro2'] = sprintf(GetLang('SyndicateSearchesIntro2'), $GLOBALS['StoreName']);
     }
     if (GetConfig('RSSLatestBlogEntries') == 0) {
         $GLOBALS['ShowNewsFeed'] = "none";
     } else {
         $GLOBALS['ISC_LANG']['SyndicateNewsIntro'] = sprintf(GetLang('SyndicateNewsIntro'), GetConfig('RSSItemsLimit'), $GLOBALS['StoreName']);
         $GLOBALS['ISC_LANG']['SyndicateNewsRSS'] = sprintf(GetLang('SyndicateNewsRSS'), GetConfig('RSSItemsLimit'));
         $GLOBALS['ISC_LANG']['SyndicateNewsAtom'] = sprintf(GetLang('SyndicateNewsAtom'), GetConfig('RSSItemsLimit'));
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:29,代码来源:Syndicate.php

示例7: FetchExchangeRate

		public function FetchExchangeRate($fromCode, $toCode)
		{
			// Can make a SOAP request but a REST (POST or GET) request is quicker
			// The fields to post
			$postFields = "FromCurrency=" . urlencode(strtoupper($fromCode)) . "&ToCurrency=" . urlencode(strtoupper($toCode));

			$rtn = PostToRemoteFileAndGetResponse($this->GetTargetURL(), $postFields);

			// If we have failed then there is nothing really useful you can tell the client other than this service is temporarly unavailable
			if (!$rtn) {
				$this->SetError(GetLang("CurrencyProviderRequestUnavailable"));
				return false;
			}

			// Now we parse the return XML. Its not a big XML result and we only need one value out of it so we don't need anything heavy to read it.
			// If the parsing failed or if we didn't receive a value then we wern't given a valid XML due to the code(s) being incorrect
			$xml = @simplexml_load_string($rtn);
			if(!is_object($xml)) {
				$this->SetError(GetLang("CurrencyProviderRequestInvalidCode"));
				return false;
			}

			if (empty($xml)) {
				return (double)$xml;
			} else {
				return (double)$xml[0];
			}
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:28,代码来源:module.webservicex.php

示例8: SetPanelSettings

 public function SetPanelSettings()
 {
     if ($GLOBALS['ISC_CLASS_PRODUCT']->IsPurchasingAllowed()) {
         if (!GetConfig('ShowProductShipping')) {
             $GLOBALS['HideShipping'] = 'none';
         } else {
             if ($GLOBALS['ISC_CLASS_PRODUCT']->GetProductType() == PT_PHYSICAL) {
                 if ($GLOBALS['ISC_CLASS_PRODUCT']->GetFixedShippingCost() != 0) {
                     // Is there a fixed shipping cost?
                     $GLOBALS['ShippingPrice'] = sprintf("%s %s", CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_PRODUCT']->GetFixedShippingCost()), GetLang('FixedShippingCost'));
                 } else {
                     if ($GLOBALS['ISC_CLASS_PRODUCT']->HasFreeShipping()) {
                         // Does this product have free shipping?
                         $GLOBALS['ShippingPrice'] = GetLang('FreeShipping');
                     } else {
                         // Shipping calculated at checkout
                         $GLOBALS['ShippingPrice'] = GetLang('CalculatedAtCheckout');
                     }
                 }
             } else {
                 $GLOBALS['ShippingPrice'] = GetLang('CalculatedAtCheckout');
             }
         }
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:25,代码来源:ShippingInfo.php

示例9: SetCustomVars

		/**
		* Custom variables for the shipping module. Custom variables are stored in the following format:
		* array(variable_id, variable_name, variable_type, help_text, default_value, required, [variable_options], [multi_select], [multi_select_height])
		* variable_type types are: text,number,password,radio,dropdown
		* variable_options is used when the variable type is radio or dropdown and is a name/value array.
		*/
		public function SetCustomVars()
		{

			$this->_variables = array (
				'defaultcost' => array (
					"name" => GetLang('DefaultShippingCost'),
					"type" => "textbox",
					"help" => GetLang('DefaultShippingCostHelp'),
					"default" => "",
					"required" => false,
					"size" => 7,
					'format' => 'price',
				),
				'placeholder' => array (
					'name' => 'Weight Ranges',
					'type' => 'custom',
					'callback' => 'BuildForm',
					'default' => '',
					'required' => false,
					'help' => '',
					'javascript' => '',
				),
			);

		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:module.byweight.php

示例10: SetPanelSettings

 public function SetPanelSettings()
 {
     $GLOBALS['SNIPPETS']['ShippingAddressList'] = "";
     $GLOBALS['ShippingAddressRow'] = "";
     $count = 0;
     $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');
     // Get a list of all shipping addresses for this customer and out them as radio buttons
     $shipping_addresses = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerShippingAddresses();
     foreach ($shipping_addresses as $address) {
         $GLOBALS['ShippingAddressId'] = (int) $address['shipid'];
         $GLOBALS['ShipFullName'] = isc_html_escape($address['shipfirstname'] . ' ' . $address['shiplastname']);
         $GLOBALS['ShipCompany'] = '';
         if ($address['shipcompany']) {
             $GLOBALS['ShipCompany'] = isc_html_escape($address['shipcompany']) . '<br />';
         }
         $GLOBALS['ShipAddressLine1'] = isc_html_escape($address['shipaddress1']);
         if ($address['shipaddress2'] != "") {
             $GLOBALS['ShipAddressLine2'] = isc_html_escape($address['shipaddress2']);
         } else {
             $GLOBALS['ShipAddressLine2'] = '';
         }
         $GLOBALS['ShipSuburb'] = isc_html_escape($address['shipcity']);
         $GLOBALS['ShipState'] = isc_html_escape($address['shipstate']);
         $GLOBALS['ShipZip'] = isc_html_escape($address['shipzip']);
         $GLOBALS['ShipCountry'] = isc_html_escape($address['shipcountry']);
         if ($address['shipphone'] != "") {
             $GLOBALS['ShipPhone'] = isc_html_escape(sprintf("%s: %s", GetLang('Phone'), $address['shipphone']));
         } else {
             $GLOBALS['ShipPhone'] = "";
         }
         $GLOBALS['SNIPPETS']['ShippingAddressList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CheckoutShippingAddressItemOffer");
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:33,代码来源:ChooseBillingAddressOffer.php

示例11: GetPropertiesSheet

		public function GetPropertiesSheet($tab_id)
		{
			parent::PreparePropertiesSheet($tab_id, 'ShipperId', 'NotificationJavaScript', 'notification_selected');

			$query = sprintf("select count(variableid) as is_setup from [|PREFIX|]module_vars where modulename='%s' and variablename='is_setup' and variableval='1'", $GLOBALS['ISC_CLASS_DB']->Quote($this->GetId()));
			$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
			$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);

			// Add the test notification link
			if($this->_showtestlink) {
				if($row['is_setup'] > 0) {
					$GLOBALS['PropertyBox'] = sprintf("<a href='javascript:void(0)' onclick='openwin(\"index.php?ToDo=testNotificationMethodSettings&module=%s\", \"%s\", 500, %s)'>%s</a>", $this->GetId(), $this->GetId(), $this->getheight(), GetLang('TestNotificationMethod'));
				}
				else {
					$GLOBALS['PropertyBox'] = sprintf("<a href='javascript:void(0)' onclick='alert(\"%s\")'>%s</a>", GetLang('NotificationProviderNotSetup'), GetLang('TestNotificationMethod'));
				}

				$help_id = rand(1000,100000);
				$GLOBALS['PropertyName'] = "";
				$GLOBALS['Required'] = "";
				$GLOBALS['PanelBottom'] = "PanelBottom";
				$GLOBALS['HelpTip'] = sprintf("<img onmouseout=\"HideHelp('d%d')\" onmouseover=\"ShowHelp('d%d', '%s', '%s')\" src=\"images/help.gif\" width=\"24\" height=\"16\" border=\"0\"><div style=\"display:none\" id=\"d%d\"></div>", $help_id, $help_id, GetLang('TestNotificationMethod'), GetLang('TestNotificationProviderHelp'), $help_id);

				$GLOBALS['Properties'] .= Interspire_Template::getInstance('admin')->render('module.property.tpl');
			}

			return Interspire_Template::getInstance('admin')->render('module.propertysheet.tpl');
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:28,代码来源:class.notification.php

示例12: showOptionsPage

    /**
     * showOptionsPage
     * Displays the print option page.
     *
     * @return Void Does not return anything.
     */
    function showOptionsPage()
    {
        $statstype = $this->_getGETRequest('statstype', null);
        if ($statstype == null) {
            return false;
            exit;
        }
        $path = $this->_getGETRequest('path', '');
        SendStudio_Functions::LoadLanguageFile('stats');
        $stats_api = $this->GetApi('Splittest_Stats');
        $bg_color = 'white';
        $print_options = '<input type="hidden" name="statstype" value="' . htmlentities($statstype, ENT_QUOTES, SENDSTUDIO_CHARSET) . '" />';
        switch ($statstype) {
            case 'splittest':
                $splitStatIds = $this->_getGETRequest('statids', null);
                $jobIds = $this->_getGETRequest('jobids', null);
                $splitStatIds = SplitTest_API::FilterIntSet($splitStatIds);
                $jobIds = SplitTest_API::FilterIntSet($jobIds);
                $print_options .= '<input type="hidden" name="split_statids" value="' . implode(',', $splitStatIds) . '" />';
                $print_options .= '<input type="hidden" name="jobids" value="' . implode(',', $jobIds) . '" />';
                $options = array('snapshot' => GetLang('Addon_splittest_Menu_ViewStats'), 'open' => GetLang('Addon_splittest_open_summary'), 'click' => GetLang('Addon_splittest_linkclick_summary'), 'bounce' => GetLang('Addon_splittest_bounce_summary'), 'unsubscribe' => GetLang('Addon_splittest_unsubscribe_summary'));
                foreach ($options as $key => $val) {
                    $bg_color = $bg_color == 'white' ? '#EDECEC' : 'white';
                    $print_options .= '<div style="background-color: ' . $bg_color . '; padding: 5px; margin-bottom: 5px;">';
                    $print_options .= '<input id="print_' . $key . '" type="checkbox" name="options[]" value="' . $key . '" checked="checked" style="margin:0;"/>
						<label for="print_' . $key . '">' . $val . '</label>' . "\n";
                    $print_options .= '</div>' . "\n";
                }
                break;
        }
        $this->template_system->assign('path', $path);
        $this->template_system->Assign('title', GetLang('Addon_splittest_PrintSplitTestStatistics'));
        $this->template_system->Assign('print_options', $print_options);
        $this->template_system->ParseTemplate('print_stats_options');
    }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:41,代码来源:print_stats_options.php

示例13: Init

	/**
	* Initialises this method for exporting
	*
	* @param ISC_ADMIN_EXPORTOPTIONS The options to export with
	*/
	public function Init(ISC_ADMIN_EXPORTOPTIONS $options)
	{
		$filetype = $options->getFileType();

		// initialise the file type
		$filetype->Init($this, $options->getTemplateId(), $options->getWhere(), $options->getHaving());

		// set the type name
		$details = $filetype->GetTypeDetails();
		$name = $details['name'];
		if (substr($name, -1, 1) == "s") {
			$name = substr($name, 0, -1);
		}
		$this->type_name = $name;

		$this->filetype = $filetype;

		// load settings for this method
		$settings = $this->GetSettings($options->getTemplateId());
		foreach ($settings as $var => $setting) {
			$this->settings[$var] = $setting['value'];
		}

		$this->className = 'exporttemplate';
		$this->exportName = $details['title'];
		$GLOBALS['ExportName'] = $details['title'];
		$GLOBALS['ExportGenerate'] = GetLang('AjaxExportLink', array('title' => isc_strtolower($details['title']), 'type' => $this->method_name));
		$GLOBALS['ExportIntro'] = GetLang('AjaxExportIntro');
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:34,代码来源:class.exportmethod.php

示例14: SetPanelSettings

 public function SetPanelSettings()
 {
     // Setup the cart values
     $total = $count = 0;
     $GLOBALS['SNIPPETS']['SideCartItems'] = '';
     if (!isset($_SESSION['CART']['ITEMS']) || empty($_SESSION['CART']['ITEMS'])) {
         $this->DontDisplay = true;
         return;
     }
     if (isset($_SESSION['CART']['ITEMS'])) {
         foreach ($_SESSION['CART']['ITEMS'] as $item) {
             $total += $item['product_price'] * $item['quantity'];
             $count += $item['quantity'];
             if (!isset($item['type']) || $item['type'] != "giftcertificate") {
                 $GLOBALS['ProductName'] = "<a href=\"" . ProdLink($item['product_name']) . "\">" . isc_html_escape($item['product_name']) . "</a>";
             } else {
                 $GLOBALS['ProductName'] = isc_html_escape($item['product_name']);
             }
             // Is this product a variation?
             $GLOBALS['ProductOptions'] = '';
             if (isset($item['options']) && !empty($item['options'])) {
                 $GLOBALS['ProductOptions'] .= "<br /><small>(";
                 $comma = '';
                 foreach ($item['options'] as $name => $value) {
                     if (!trim($name) || !trim($value)) {
                         continue;
                     }
                     $GLOBALS['ProductOptions'] .= $comma . isc_html_escape($name) . ": " . isc_html_escape($value);
                     $comma = ', ';
                 }
                 $GLOBALS['ProductOptions'] .= ")</small>";
             }
             $GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($item['product_price'] * $item['quantity']);
             $GLOBALS['ProductQuantity'] = $item['quantity'];
             $GLOBALS['SNIPPETS']['SideCartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCartItem");
         }
     }
     if ($count == 1) {
         $GLOBALS['SideCartItemCount'] = GetLang('SideCartYouHave1Item');
     } else {
         $GLOBALS['SideCartItemCount'] = sprintf(GetLang('SideCartYouHaveXItems'), $count);
     }
     $GLOBALS['ISC_LANG']['SideCartTotalCost'] = sprintf(GetLang('SideCartTotalCost'), CurrencyConvertFormatPrice($total));
     // Go through all the checkout modules looking for one with a GetSidePanelCheckoutButton function defined
     $GLOBALS['AdditionalCheckoutButtons'] = '';
     $HideCheckout = false;
     foreach (GetAvailableModules('checkout', true, true) as $module) {
         if (method_exists($module['object'], 'GetSidePanelCheckoutButton')) {
             $GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetSidePanelCheckoutButton();
         }
         if ($module['object']->disableNonCartCheckoutButtons) {
             $HideCheckout = true;
         }
     }
     if ($HideCheckout) {
         $GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = '';
     } else {
         $GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SideCartContentsCheckoutLink');
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:60,代码来源:SideCartContents.php

示例15: runValidation

	/**
	 * Run validation on the server side
	 *
	 * Method will run the validation on the server side (will not run the JS function type) and return
	 * the result
	 *
	 * @access public
	 * @param string &$errmsg The error message if the validation fails
	 * @return bool TRUE if the validation was successful, FALSE if it failed
	 */
	public function runValidation(&$errmsg)
	{
		if (!parent::runValidation($errmsg)) {
			return false;
		}

		$value = $this->getValue();

		if ($value == '') {
			return true;
		}

		if (!is_numeric($value)) {
			$errmsg = sprintf(GetLang('CustomFieldsValidationNumbersOnly'), $this->label);
			return false;
		}

		if ($this->extraInfo['limitfrom'] !== '' && (int)$value < (int)$this->extraInfo['limitfrom']) {
			$errmsg = sprintf(GetLang('CustomFieldsValidationNumbersToLow'), $this->label, $this->extraInfo['limitfrom']);
			return false;
		}

		if ($this->extraInfo['limitto'] !== '' && (int)$value > (int)$this->extraInfo['limitto']) {
			$errmsg = sprintf(GetLang('CustomFieldsValidationNumbersToHigh'), $this->label, $this->extraInfo['limitto']);
			return false;
		}

		return true;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:39,代码来源:formfield.numberonly.php


注:本文中的GetLang函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。