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(); }
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; }
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; }
/** * 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; }
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']; } }
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')); } }
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]; } }
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'); } } } }
/** * 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' => '', ), ); }
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"); } }
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'); }
/** * 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'); }
/** * 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'); }
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'); } }
/** * 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; }
public function __construct() { // load language for this method $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('export.method.' . strtolower($this->method_name)); $this->method_help = GetLang("MethodHelp"); $this->method_title = GetLang("MethodTitle"); }
/** * Set the settings for this panel. */ public function SetPanelSettings() { // How many tags do we have? $query = "\n\t\t\tSELECT COUNT(tagid) AS tagcount\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t"; $tagCount = $GLOBALS['ISC_CLASS_DB']->FetchOne($query); // How many products does the most popular tag contain? $query = "\n\t\t\tSELECT MAX(tagcount) AS popularcount, MIN(tagcount) AS leastcount\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t"; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $tagCounts = $GLOBALS['ISC_CLASS_DB']->Fetch($result); // Get a list of all of the tags $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]product_tags\n\t\t\tORDER BY tagname ASC\n\t\t"; $min = GetConfig('TagCloudMinSize'); $max = GetConfig('TagCloudMaxSize'); $GLOBALS['SNIPPETS']['TagList'] = ''; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($tag = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $weight = ceil($tag['tagcount'] / $tagCount * 100); if ($max > $min) { $fontSize = $weight / 100 * ($max - $min) + $min; } else { $fontSize = (100 - $weight) / 100 * ($max - $min) + $max; } $fontSize = (int) $fontSize; $GLOBALS['FontSize'] = $fontSize . '%'; $GLOBALS['TagName'] = isc_html_escape($tag['tagname']); $GLOBALS['TagLink'] = TagLink($tag['tagfriendlyname'], $tag['tagid']); $GLOBALS['TagProductCount'] = sprintf(GetLang('XProductsTaggedWith'), $tag['tagcount'], isc_html_escape($tag['tagname'])); $GLOBALS['SNIPPETS']['TagList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductTagCloudItem'); } }
/** * Get the form field description * * Static method will return an array with the form field name and description as the elements * * @access public * @return array The description array */ public static function getDetails() { return array( 'name' => GetLang('FormFieldMultiLineName'), 'desc' => GetLang('FormFieldMultiLineDesc'), 'img' => 'multitext.png', ); }
/** * Get the form field description * * Static method will return an array with the form field name and description as the elements * * @access public * @return array The description array */ public static function getDetails() { return array( 'name' => GetLang('FormFieldPasswordName'), 'desc' => GetLang('FormFieldPasswordDesc'), 'img' => 'passwordfield.png', ); }
/** * Run full sanity check on authenticity and input fields * * Method will run an authenticity and input fields check. Return false on any failure * * @access protected * @return bool true if all the checking is successful, FALSE if anything failured */ protected function check() { if ($this->checkInput() && $this->checkAuthenticity()) { return true; } $this->quickbooks->setAccountingSessionKey('LAST_ERROR', GetLang('QuickBooksGeneralErrorCheckFailed')); return false; }
/** * Get the form field description * * Static method will return an array with the form field name and description as the elements * * @access public * @return array The description array */ public static function getDetails() { return array( 'name' => GetLang('FormFieldSingleLineName'), 'desc' => GetLang('FormFieldSingleLineDesc'), 'img' => 'textfield.png', ); }
/** * Get the form field description * * Static method will return an array with the form field name and description as the elements * * @access public * @return array The description array */ public static function getDetails() { return array( 'name' => GetLang('FormFieldSelectOrTextName'), 'desc' => GetLang('FormFieldSelectOrTextDesc'), 'img' => 'picklist.png', ); }
/** * Show a listing of all of the available tags sorted by weight. */ public function ShowTagCloud() { $GLOBALS['HidePanels'][] = 'TagProducts'; $GLOBALS['BreadCrumbs'] = array(array('name' => GetLang('ProductTagCloud'), 'link' => TagLink())); $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . ' - ' . GetLang('ProductTagCloud')); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("tags"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
/** * Actually connect to the server and call the requested methods, parsing the result * You should never have to call this public function manually * * This is an override of the MCAPI callServer method to use ISC's network code. Since it's now using ISC, the error codes produced may not match MCAPI documents. * * @param string $method * @param array $params * @param int $timeout * @return string|bool resulting response body on success, or false on failure */ public function callServer($method, $params, $timeout = self::MCAPI_TIMEOUT) { $dc = "us1"; if (strstr($this->api_key,"-")){ list($key, $dc) = explode("-",$this->api_key,2); if (!$dc) $dc = "us1"; } $host = $dc.".".$this->apiUrl["host"]; $params["apikey"] = $this->api_key; $this->errorMessage = ""; $this->errorCode = ""; $url = 'http'; if ($this->secure) { $url .= 's'; } $url .= '://' . $host . $this->apiUrl['path'] . '?' . $this->apiUrl['query'] . '&method=' . $method; $requestOptions = new Interspire_Http_RequestOptions; $requestOptions->userAgent = 'MCAPI/' . $this->version . ' (BigCommerce)'; $response = PostToRemoteFileAndGetResponse($url, http_build_query($params), $timeout, $errno, $requestOptions); if (!$response) { $this->errorMessage = "Could not connect (" . $errno . ": " . GetLang('ISC_REMOTEFILE_ERROR_' . $errno) . ")"; $this->errorCode = $errno; Interspire_Event::trigger('Interspire_EmailIntegration_MailChimp/error', array( 'method' => $method, 'params' => $params, 'api' => $this, )); return false; } if (ini_get("magic_quotes_runtime")) { $response = stripslashes($response); } $serial = unserialize($response); if($response && $serial === false) { $response = array("error" => "Bad Response. Got This: " . $response, "code" => "-99"); } else { $response = $serial; } if(is_array($response) && isset($response["error"])) { $this->errorMessage = $response["error"]; $this->errorCode = $response["code"]; Interspire_Event::trigger('Interspire_EmailIntegration_MailChimp/error', array( 'method' => $method, 'params' => $params, 'api' => $this, )); return false; } return $response; }
function HandlePage() { // Send the 404 status headers header("HTTP/1.1 404 Not Found"); // Simply show the 404 page $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . " - " . GetLang('NotFound')); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("404"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
public function __Construct() { parent::__construct(); $this->setName('FREESHIPPINGWHENOVERX'); $this->displayName = GetLang($this->getName() . 'displayName'); $this->addJavascriptValidation('amount', 'int'); $this->addActionType('freeshipping'); $this->ruleType = 'Order'; }
private function ShowSystemInfo() { // Server Information $GLOBALS['ProductVersion'] = isc_html_escape(PRODUCT_VERSION); $GLOBALS['PHPVersion'] = isc_html_escape(phpversion()); $GLOBALS['MySQLVersion'] = isc_html_escape(mysql_get_server_info()); $GLOBALS['ServerSoftware'] = isc_html_escape($_SERVER['SERVER_SOFTWARE']); if (GetConfig('DisableSystemInfoEdition')) { $GLOBALS['HideEdition'] = 'display: none'; } else { if (isset($GLOBALS['ProductEditionUpgrade'])) { $GLOBALS['ProductEdition'] .= " (<a href='" . GetConfig('SystemInfoEditionUpgradeLink') . "' target='_blank'>Upgrade</a>)"; } } if (GDEnabled()) { $php_mods = parsePHPModules(); $GLOBALS['GDVersion'] = isc_html_escape($php_mods['gd']['GD Version']); } else { $GLOBALS['GDVersion'] = GetLang('GDMissing'); } if ((bool) ini_get('safe_mode') == true) { $GLOBALS['SafeMode'] = GetLang('Enabled'); } else { $GLOBALS['SafeMode'] = GetLang('Disabled'); } $GLOBALS['MultiByteFunctions'] = array(); if (function_exists("mb_strpos")) { $GLOBALS['MultiByteFunctions'][] = "Multibyte"; } if (function_exists("iconv_strpos")) { $GLOBALS['MultiByteFunctions'][] = "iconv"; } $GLOBALS['MultiByteFunctions'] = implode("<br />", $GLOBALS['MultiByteFunctions']); if (!$GLOBALS['MultiByteFunctions']) { $GLOBALS['MultiByteFunctions'] = GetLang('NotSupported'); } $GLOBALS['RemoteConnections'] = array(); if (function_exists("curl_init")) { $GLOBALS['RemoteConnections'][] = "CURL"; } if (!(bool) ini_get('safe_mode') && ini_get('allow_url_fopen')) { $GLOBALS['RemoteConnections'][] = GetLang('RemoteFOpen'); } $GLOBALS['RemoteConnections'] = implode("<br />", $GLOBALS['RemoteConnections']); if (!$GLOBALS['RemoteConnections']) { $GLOBALS['RemoteConnections'] = GetLang('NoneSupported'); } if (function_exists('pspell_suggest')) { $GLOBALS['PSpell'] = GetLang('Enabled'); } else { $GLOBALS['PSpell'] = GetLang('NotSupported'); } $GLOBALS['OperatingSystem'] = isc_html_escape(php_uname()); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("sysinfo"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
function ComplementaryImageView($productid) { //http://www.smartchamp.com/store/installimage.php $_prodimages = array(); $query = sprintf("SELECT pi.imageid, pi.imageprodid, pi.imageprodhash, pi.imagefile, pi.imageisthumb, ti.imagefile thumbfile, ti.imageisthumb isThumb FROM [|PREFIX|]product_images pi LEFT JOIN [|PREFIX|]product_images ti ON ti.imagesort = pi.imagesort AND ti.imageprodid = pi.imageprodid AND ti.imageisthumb='3' WHERE pi.imageprodid='%d' AND pi.imageisthumb='0' order by pi.imagesort asc", $productid); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { $_prodimages[] = $row; } $GLOBALS['ViewGallery'] = ''; $AdditionalView = ''; for ($y = 0; $y < count($_prodimages); $y++) { $ThumbImage = $GLOBALS['ImageDirectory'] . '/' . $_prodimages[$y]['thumbfile']; if (file_exists(ISC_BASE_PATH . "/" . $ThumbImage) && $_prodimages[$y]['thumbfile'] != '') { //file_exists($ThumbImage) && $ThumbImage = $GLOBALS['ShopPath'] . '/' . $GLOBALS['ImageDirectory'] . '/' . $_prodimages[$y]['thumbfile']; $ThumbImage = '<img id="Image' . $y . '" src="' . $ThumbImage . '" alt="">'; } else { if (file_exists(ISC_BASE_PATH . "/" . $GLOBALS['ImageDirectory'] . '/' . $_prodimages[$y]['imagefile'])) { $ThumbImage = ScaleImage($GLOBALS['ShopPath'] . "/" . $GLOBALS['ImageDirectory'] . '/' . $_prodimages[$y]['imagefile'], 70, 70, ISC_BASE_PATH . "/" . $GLOBALS['ImageDirectory'] . '/' . $_prodimages[$y]['imagefile']); } else { $ThumbImage = GetConfig('ShopPath') . '/templates/default/images/thumb_default.gif'; $ThumbImage = '<img id="Image' . $y . '" src="' . $ThumbImage . '" alt="">'; } } //$OnClick = "showProductImageNew('".GetConfig('ShopPath')."/productimage.php', ".$productid.", ".$y.");"; $OnClick = "showProductImageNew('" . GetConfig('ShopPath') . "/productimages/" . $productid . ".html'" . ", " . $productid . ", " . $y . ");"; $AdditionalView = '<div style="float:left;width:70px;height:70px;padding-right:2px;padding-left:2px"> <a onclick="' . $OnClick . '" href="#">' . $ThumbImage . '</a> </div>'; //<a onclick="'.$OnClick.'" href="#">'.$ThumbImage.'</a>; $GLOBALS['VideoJavascript'] = "showProductVideoNew('" . ProdVideoLink($productid) . "');"; $GLOBALS['AudioJavascript'] = "showProductVideoNew('" . ProdAudioLink($productid) . "');"; // Is there more than one video? If not, hide the "See videos" link Added by Simha if (GetNumVideos($productid) == 0 && GetNumAudios($productid) == 0) { $GLOBALS['VideosLink'] = "none"; } else { if (GetNumVideos($productid) > 0) { $var = "SeeVideos"; } else { $GLOBALS['SpecVideosLink'] = "none"; } if (GetNumAudios($productid) > 0) { $avar = "SeeAudios"; } else { $GLOBALS['SpecAudiosLink'] = "none"; } @($GLOBALS['SeeCompVideo'] = sprintf(GetLang($var), GetNumVideos($productid))); @($GLOBALS['SeeCompAudio'] = sprintf(GetLang($avar), GetNumAudios($productid))); } $GLOBALS['ViewGallery'] .= $AdditionalView; } //$output2 = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output2, $GLOBALS['SNIPPETS']); $CompImageView = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ImageView"); return $CompImageView; }
/** * printPage * * @return Void Doesn't return anything. */ public function printPage() { $user = GetUser(); $split_api = $this->GetApi('Splittest'); // for permission checks $subaction = $this->_getGetRequest('subaction', 'print'); $perpage = $this->_getGetRequest('PerPageDisplay', null); $jobids = $this->_getGETRequest('jobids', null); $listids = $this->_getGETRequest('split_statids', null); $jobids = explode(",", $jobids); $listids = explode(",", $listids); SendStudio_Functions::LoadLanguageFile('Stats'); if (!SplitTest_API::OwnsJobs($user->Get('userid'), $jobids) && !$user->Admin()) { FlashMessage(GetLang('NoAccess'), SS_FLASH_MSG_ERROR, $this->base_url); return; } // Get some setup parameters for the API $sortdetails = array('sort' => 'splitname', 'direction' => 'asc'); $page_number = 0; $perpage = 20; $displayAll = false; // just show a single splitest campaign send. If you want every campaign send for a split test set to true $dateFromat = self::getDateFormat(); $statitics = array(); $jobid = 0; for ($i = 0; $i < count($jobids); $i++) { $stats = array(); $stats_api = new Splittest_Stats_API(); $jobid = $jobids[$i]; $splitid = $listids[$i]; // get the array of stats data $stats = $stats_api->GetStats(array($splitid), $sortdetails, false, $page_number, $perpage, $displayAll, $jobid); foreach ($stats as $stats_id => $stats_details) { $stats[$stats_id]['splitname'] = htmlspecialchars($stats_details['splitname'], ENT_QUOTES, SENDSTUDIO_CHARSET); $stats[$stats_id]['campaign_names'] = htmlspecialchars($stats_details['campaign_names'], ENT_QUOTES, SENDSTUDIO_CHARSET); $stats[$stats_id]['list_names'] = htmlspecialchars($stats_details['list_names'], ENT_QUOTES, SENDSTUDIO_CHARSET); } // A Splittest can be sent multiple times hence we might have multiple campaign record sets here while (list($id, $data) = each($stats)) { $charts = $this->generateCharts($data['splitname'], $data['campaigns'], $subaction); foreach ($charts as $type => $data) { $stats[$id][$type] = $data; } } $statistics[] = $stats; } $template = GetTemplateSystem(dirname(__FILE__) . '/templates'); $template->Assign('DateFormat', $dateFromat); $template->Assign('statsData', $statistics); $template->Assign('subaction', $subaction); $options = $this->_getGETRequest('options', null); for ($i = 0; $i < count($options); $i++) { $template->Assign($options[$i], $options[$i]); } $template->ParseTemplate('Stats_Summary_Splittest'); }
public function SetCustomVars() { $this->_variables['intensedebatescript'] = array( "name" => GetLang('IntenseDebateCode'), "type" => "textarea", "help" => '', "default" => "", "required" => true ); }