Example #1
0
		private function ManageSettings($messages=array())
		{
			if(!gzte11(ISC_HUGEPRINT)) {
				$GLOBALS['HideVendorOptions'] = 'display: none';
			}

			$GLOBALS['Message'] = GetFlashMessageBoxes();

			// Get the getting started box if we need to
			$GLOBALS['GettingStartedStep'] = '';
			if(empty($GLOBALS['Message']) && (isset($_GET['wizard']) && $_GET['wizard']==1) && !in_array('settings', GetConfig('GettingStartedCompleted')) && !GetConfig('DisableGettingStarted')) {
				$GLOBALS['GettingStartedTitle'] = GetLang('ConfigureStoreSettings');
				$GLOBALS['GettingStartedContent'] = GetLang('ConfigureStoreSettingsDesc');
				$GLOBALS['GettingStartedStep'] = $this->template->render('Snippets/GettingStartedModal.html');
			}

			if (GetConfig('UseWYSIWYG')) {
				$GLOBALS['IsWYSIWYGEnabled'] = 'checked="checked"';
			}

			if (GetConfig('ShowThumbsInControlPanel')) {
				$GLOBALS['IsProductThumbnailsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('DesignMode')) {
				$GLOBALS['IsDesignMode'] = 'checked="checked"';
			}

			if (GetConfig('ForceControlPanelSSL')) {
				$GLOBALS['IsControlPanelSSLEnabled'] = 'checked="checked"';
			}

			if (GetConfig('DownForMaintenance')) {
				$GLOBALS['IsDownForMaintenance'] = 'checked="checked"';
			}

			$GLOBALS["CharacterSet"] = GetConfig('CharacterSet');

			if(in_array(GetConfig('CharacterSet'), $this->validCharacterSets)) {
				$selectedCharset = GetConfig('CharacterSet');
				$selectedCharset = isc_strtolower($selectedCharset);
				$selectedCharset = str_replace(array("-", "_"), "", $selectedCharset);
				$GLOBALS["CharacterSet_Selected_" . $selectedCharset] = 'selected="selected"';
			} else {
				$GLOBALS["CharacterSet_Selected_utf8"] = 'selected="selected"';
			}

			/*
			if (GetConfig('UseSSL')) {
				$GLOBALS['IsSSLEnabled'] = 'checked="checked"';
			}
			*/
			switch (GetConfig('UseSSL')) {
				case SSL_NORMAL:
					$SSLOption = "UseNormalSSL";
					break;
				case SSL_SHARED:
					$SSLOption = "UseSharedSSL";
					break;
				case SSL_SUBDOMAIN:
					$SSLOption = "UseSubdomainSSL";
					break;
				default:
					$SSLOption = "NoSSL";
			}

			$GLOBALS[$SSLOption . 'Checked'] = 'checked="checked"';

			if(GetConfig('AllowPurchasing')) {
				$GLOBALS['IsPurchasingEnabled'] = 'checked="checked"';
			}

			switch(GetConfig('WeightMeasurement')) {
				case 'LBS':
					$GLOBALS['IsPounds'] = 'selected="selected"';
					break;
				case 'Ounces':
					$GLOBALS['IsOunces'] = 'selected="selected"';
					break;
				case 'KGS':
					$GLOBALS['IsKilos'] = 'selected="selected"';
					break;
				case 'Grams':
					$GLOBALS['IsGrams'] = 'selected="selected"';
					break;
				case 'Tonnes':
					$GLOBLAS['IsTonnes'] = 'selected="selected"';
			}

			if (GetConfig('LengthMeasurement') == "Inches") {
				$GLOBALS['IsInches'] = 'selected="selected"';
			} else {
				$GLOBALS['IsCentimeters'] = 'selected="selected"';
			}

			$GLOBALS['ShippingFactoringDimensionDepthSelected'] = '';
			$GLOBALS['ShippingFactoringDimensionHeightSelected'] = '';
			$GLOBALS['ShippingFactoringDimensionWidthSelected'] = '';

			switch (GetConfig('ShippingFactoringDimension')) {
				case 'height':
					$GLOBALS['ShippingFactoringDimensionHeightSelected'] = 'selected="selected"';
					break;
				case 'width':
					$GLOBALS['ShippingFactoringDimensionWidthSelected'] = 'selected="selected"';
					break;
				case 'depth':
				default:
					$GLOBALS['ShippingFactoringDimensionDepthSelected'] = 'selected="selected"';
					break;
			}

			if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
				$GLOBALS['IsDropdown'] = 'selected="selected"';
			} else {
				$GLOBALS['IsTextbox'] = 'selected="selected"';
			}

			// Product breadcrumbs dropdown
			$GLOBALS['ProductBreadcrumbs'] = GetConfig('ProductBreadcrumbs');
			$GLOBALS['ProductBreadcrumbOptions'] = array(
				"showall" => GetLang('ShowAll'),
				"showone" => GetLang('ShowOneOnly'),
				"shownone" => GetLang('DontShow'),
			);

			if (GetConfig('FastCartAction') == 'popup') {
				$GLOBALS['IsShowPopWindow'] = 'selected="selected"';
			} else {
				$GLOBALS['IsShowCartPage'] = 'selected="selected"';
			}

			if (GetConfig('TagCloudsEnabled')) {
				$GLOBALS['IsTagCloudsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('BulkDiscountEnabled')) {
				$GLOBALS['IsBulkDiscountEnabled'] = 'checked="checked"';
			}

			if (GetConfig('EnableProductTabs')) {
				$GLOBALS['IsProductTabsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('ShowAddToCartQtyBox')) {
				$GLOBALS['IsShownAddToCartQtyBox'] = 'checked="checked"';
			}

			if (GetConfig('CaptchaEnabled')) {
				$GLOBALS['IsCaptchaEnabled'] = 'checked="checked"';
			}

			if(GetConfig('StoreDSTCorrection')) {
				$GLOBALS['IsDSTCorrectionEnabled'] = "checked=\"checked\"";
			}

			if (GetConfig('ShowCartSuggestions')) {
				$GLOBALS['IsShowCartSuggestions'] = 'checked="checked"';
			}

			if (GetConfig('ShowThumbsInCart')) {
				$GLOBALS['IsShowThumbsInCart'] = 'checked="checked"';
			}

			if (GetConfig('TagCloudsEnabled')) {
				$GLOBALS['IsTagCloudsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('ShowAddToCartQtyBox')) {
				$GLOBALS['IsShownAddToCartQtyBox'] = 'checked="checked"';
			}

			if (GetConfig('AutoApproveReviews')) {
				$GLOBALS['IsAutoApproveReviews'] = 'checked="checked"';
			}

			if (GetConfig('SearchSuggest')) {
				$GLOBALS['IsSearchSuggest'] = 'checked="checked"';
			}

			if (GetConfig('QuickSearch')) {
				$GLOBALS['IsQuickSearch'] = 'checked="checked"';
			}

			if (GetConfig('ShowInventory')) {
				$GLOBALS['IsShowInventory'] = 'checked="checked"';
			}

			if (GetConfig('ShowPreOrderInventory')) {
				$GLOBALS['IsShowPreOrderInventory'] = 'checked="checked"';
			}

			// Bulk Discount Settings
			if (GetConfig('BulkDiscountEnabled')) {
				$GLOBALS['IsBulkDiscountEnabled'] = 'checked="checked"';
			}

			if (GetConfig('EnableProductTabs')) {
				$GLOBALS['IsProductTabsEnabled'] = 'checked="checked"';
			}

			// RSS Settings
			if (GetConfig('RSSNewProducts')) {
				$GLOBALS['IsRSSNewProductsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('RSSPopularProducts')) {
				$GLOBALS['IsRSSPopularProductsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('RSSFeaturedProducts')) {
				$GLOBALS['IsRSSFeaturedProductsEnabled'] = 'checked="checked"';
			}

			if (GetConfig('RSSCategories')) {
				$GLOBALS['IsRSSCategoriesEnabled'] = 'checked="checked"';
			}

			if (GetConfig('RSSProductSearches')) {
				$GLOBALS['IsRSSProductSearchesEnabled'] = 'checked="checked"';
			}

			if (GetConfig('RSSLatestBlogEntries')) {
				$GLOBALS['IsRSSLatestBlogEntriesEnabled'] = 'checked="checked"';
			}

			if (GetConfig('RSSSyndicationIcons')) {
				$GLOBALS['IsRSSSyndicationIconsEnabled'] = 'checked="checked"';
			}

			if(GetConfig('EnableCustomersAlsoViewed')) {
				$GLOBALS['IsCustomersAlsoViewedEnabled'] = 'checked="checked"';
			}

			// Product Images
			if (GetConfig('ProductImagesTinyThumbnailsEnabled')) {
				$GLOBALS['IsProductImagesTinyThumbnailsEnabled'] = 'checked="checked"';
			}

			if(GetConfig('ProductImagesImageZoomEnabled')) {
				$GLOBALS['IsProductImagesImageZoomEnabled'] = 'checked="checked"';
			}

			if((int)GetConfig('ProductImagesStorewideThumbnail_width') < 1) {
				$GLOBALS['ISC_CFG']['ProductImagesStorewideThumbnail_width'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_THUMBNAIL;
			}

			if((int)GetConfig('ProductImagesStorewideThumbnail_height') < 1) {
				$GLOBALS['ISC_CFG']['ProductImagesStorewideThumbnail_height'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_THUMBNAIL;
			}

			if((int)GetConfig('ProductImagesProductPageImage_width') < 1) {
				$GLOBALS['ISC_CFG']['ProductImagesProductPageImage_width'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_STANDARD;
			}

			if((int)GetConfig('ProductImagesProductPageImage_height') < 1) {
				$GLOBALS['ISC_CFG']['ProductImagesProductPageImage_height'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_STANDARD;
			}

			if((int)GetConfig('ProductImagesGalleryThumbnail_width') < 1) {
				$GLOBALS['ISC_CFG']['ProductImagesGalleryThumbnail_width'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_TINY;
			}

			if((int)GetConfig('ProductImagesGalleryThumbnail_height') < 1) {
				$GLOBALS['ISC_CFG']['ProductImagesGalleryThumbnail_height'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_TINY;
			}

			// Backup Settings
			if (GetConfig('BackupsLocal')) {
				$GLOBALS['IsBackupsLocalEnabled'] = 'checked="checked"';
			}

			if (GetConfig('BackupsRemoteFTP')) {
				$GLOBALS['IsBackupsRemoteFTPEnabled'] = 'checked="checked"';
			}

			if (GetConfig('BackupsAutomatic')) {
				$GLOBALS['IsBackupsAutomaticEnabled'] = 'checked="checked"';
			}

			if (GetConfig('HTTPSSLVerifyPeer')) {
				$GLOBALS['IsHTTPSSLVerifyPeerEnabled'] = 'checked="checked"';
			}

			if (strpos(strtolower(PHP_OS), 'win') === 0) {
				$binary = 'php.exe';
				$path_to_php = Which($binary);
			} else {
				// Check if there is a separate PHP 5 binary first
				foreach(array('php5', 'php') as $phpBin) {
					$path_to_php = Which($phpBin);
					if($path_to_php !== '') {
						break;
					}
				}
			}

			if ($path_to_php === '' && strpos(strtolower(PHP_OS), 'win') === 0) {
				$path_to_php = 'php.exe';
			} elseif ($path_to_php === '') {
				$path_to_php = 'php';
			}

			$GLOBALS['BackupsAutomaticPath'] = $path_to_php.' -f ' . realpath(ISC_BASE_PATH . "/admin")."/cron-backup.php";

			if (GetConfig('BackupsAutomaticMethod') == "ftp") {
				$GLOBALS['IsBackupsAutomaticMethodFTP'] = 'selected="selected"';
			} else {
				$GLOBALS['IsBackupsAutomaticMethodLocal'] = 'selected="selected"';
			}

			if (GetConfig('BackupsAutomaticDatabase')) {
				$GLOBALS['IsBackupsAutomaticDatabaseEnabled'] = 'checked="checked"';
			}

			if (GetConfig('BackupsAutomaticImages')) {
				$GLOBALS['IsBackupsAutomaticImagesEnabled'] = 'checked="checked"';
			}

			if (GetConfig('BackupsAutomaticDownloads')) {
				$GLOBALS['IsBackupsAutomaticDownloadsEnabled'] = 'checked="checked"';
			}

			$GLOBALS['LanguageOptions'] = $this->GetLanguageOptions(GetConfig('Language'));

			if (!function_exists('ftp_connect')) {
				$GLOBALS['FTPBackupsHide'] = "none";
			}

			$GLOBALS['TimeZoneOptions'] = $this->GetTimeZoneOptions(GetConfig('StoreTimeZone'));

			$query = sprintf("select version() as version");
			$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
			$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
			$GLOBALS['dbVersion'] = $row['version'];

			// Logging Settings
			if (GetConfig('SystemLogging')) {
				$GLOBALS['IsSystemLoggingEnabled'] = "checked=\"checked\"";
			}

			if(GetConfig('DebugMode')) {
				$GLOBALS['IsDebugModeEnabled'] = "checked=\"checked\"";
			}

			if (GetConfig('SystemLogTypes')) {
				$types = explode(",", GetConfig('SystemLogTypes'));
				if (in_array('general', $types)) {
					$GLOBALS['IsGeneralLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('payment', $types)) {
					$GLOBALS['IsPaymentLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('shipping', $types)) {
					$GLOBALS['IsShippingLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('notification', $types)) {
					$GLOBALS['IsNotificationLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('sql', $types)) {
					$GLOBALS['IsSQLLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('php', $types)) {
					$GLOBALS['IsPHPLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('accounting', $types)) {
					$GLOBALS['IsAccountingLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('emailintegration', $types)) {
					$GLOBALS['IsEmailIntegrationLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('ebay', $types)) {
					$GLOBALS['IsEbayLoggingEnabled'] = "selected=\"selected\"";
				}
				if (in_array('shoppingcomparison', $types)) {
					$GLOBALS['IsShoppingComparisonLoggingEnabled'] = "selected=\"selected\"";
				}
			}

			if (GetConfig('SystemLogSeverity')) {
				$severities = explode(",", GetConfig('SystemLogSeverity'));
				if (in_array('errors', $severities)) {
					$GLOBALS['IsLoggingSeverityErrors'] = "selected=\"selected\"";
				}
				if (in_array('warnings', $severities)) {
					$GLOBALS['IsLoggingSeverityWarnings'] = "selected=\"selected\"";
				}
				if (in_array('notices', $severities)) {
					$GLOBALS['IsLoggingSeverityNotices'] = "selected=\"selected\"";
				}
				if (in_array('success', $severities)) {
					$GLOBALS['IsLoggingSeveritySuccesses'] = "selected=\"selected\"";
				}
				if (in_array('debug', $severities)) {
					$GLOBALS['IsLoggingSeverityDebug'] = "selected=\"selected\"";
				}
			}


			if (GetConfig('EnableSEOUrls') == 2) {
				$GLOBALS['IsEnableSEOUrlsAuto'] = "selected=\"selected\"";
			}
			else if (GetConfig('EnableSEOUrls') == 1) {
				$GLOBALS['IsEnableSEOUrlsEnabled'] = "selected=\"selected\"";
			}
			else {
				$GLOBALS['IsEnableSEOUrlsDisabled'] = "selected=\"selected\"";
			}

			if (!gzte11(ISC_MEDIUMPRINT)) {
				$GLOBALS['HideBackupSettings'] = "none";
			}

			if (GetConfig('AdministratorLogging')) {
				$GLOBALS['IsAdministratorLoggingEnabled'] = "checked=\"checked\"";
			}

			if(GetConfig('HidePHPErrors')) {
				$GLOBALS['IsHidePHPErrorsEnabled'] = "checked=\"checked\"";
			}

			if(GetConfig('EnableWishlist')) {
				$GLOBALS['IsWishlistEnabled'] = "checked=\"checked\"";
			}

			if(GetConfig('EnableAccountCreation')) {
				$GLOBALS['IsEnableAccountCreation'] = "checked=\"checked\"";
			}

			if (!getProductReviewsEnabled()) {
				 $GLOBALS['HideIfReviewsDisabled'] = 'display: none;';
			}

			if(GetConfig('EnableProductComparisons')) {
				$GLOBALS['IsEnableProductComparisons'] = "checked=\"checked\"";
			}

			// Product display settings
			if(GetConfig('ShowProductPrice')) {
				$GLOBALS['IsProductPriceShown'] = 'CHECKED';
			}

			if(GetConfig('ShowProductSKU')) {
				$GLOBALS['IsProductSKUShown'] = 'CHECKED';
			}

			if(GetConfig('ShowProductWeight')) {
				$GLOBALS['IsProductWeightShown'] = 'CHECKED';
			}

			if(GetConfig('ShowProductBrand')) {
				$GLOBALS['IsProductBrandShown'] = 'CHECKED';
			}

			if(GetConfig('ShowProductShipping')) {
				$GLOBALS['IsProductShippingShown'] = 'CHECKED';
			}

			if(GetConfig('ShowProductRating')) {
				$GLOBALS['IsProductRatingShown'] = 'CHECKED';
			}

			if(GetConfig('ShowAddToCartLink')) {
				$GLOBALS['IsAddToCartLinkShown'] = 'CHECKED';
			}

			if (GetConfig('ShowAddThisLink')) {
				$GLOBALS['IsAddThisLinkShown'] = 'checked="checked"';
			}

			if(GetConfig('LowInventoryNotificationAddress') != '') {
				$GLOBALS['LowInventoryEmailsEnabledCheck'] = "checked=\"checked\"";
			}
			else {
				$GLOBALS['HideLowInventoryNotification'] = "none";
			}

			if(GetConfig('ForwardInvoiceEmails') != '') {
				$GLOBALS['ForwardInvoiceEmailsCheck'] = "checked=\"checked\"";
			}
			else {
				$GLOBALS['HideForwardInvoiceEmails'] = 'none';
			}

			if(GetConfig('MailUseSMTP')) {
				$GLOBALS['HideMailSMTPSettings'] = '';
				$GLOBALS['MailUseSMTPChecked'] = "checked=\"checked\"";
			}
			else {
				$GLOBALS['HideMailSMTPSettings'] = 'none';
				$GLOBALS['MailUsePHPChecked'] = "checked=\"checked\"";
			}

			if (GetConfig('ProductImageMode') == "lightbox") {
				$GLOBALS['ProductImageModeLightbox'] = 'selected="selected"';
			} else {
				$GLOBALS['ProductImageModePopup'] = 'selected="selected"';
			}

			if (GetConfig('CategoryDisplayMode') == "grid") {
				$GLOBALS['CategoryDisplayModeGrid'] = 'selected="selected"';
			}
			else {
				$GLOBALS['CategoryDisplayModeList'] = 'selected="selected"';
			}

			if (GetConfig('CategoryDefaultImage') !== '') {
				$GLOBALS['CatImageDefaultSettingMessage'] = sprintf(GetLang('CatImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('CategoryDefaultImage'), GetConfig('CategoryDefaultImage'));
			} else {
				$GLOBALS['CatImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), $GLOBALS['IMG_PATH'].'/CategoryDefault.gif', $GLOBALS['IMG_PATH'].'CategoryDefault.gif');
			}

			if (GetConfig('BrandDefaultImage') !== '') {
				$GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('BrandDefaultImage'), GetConfig('BrandDefaultImage'));
			} else {
				$GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), $GLOBALS['IMG_PATH'].'/BrandDefault.gif', $GLOBALS['IMG_PATH'].'/BrandDefault.gif');
			}

			$GLOBALS['HideCurrentDefaultProductImage'] = 'display: none';
			switch(GetConfig('DefaultProductImage')) {
				case 'template':
					$GLOBALS['DefaultProductImageTemplateChecked'] = 'checked="checked"';
					break;
				case '':
					$GLOBALS['DefaultProductImageNoneChecked'] = 'checked="checked"';
					break;
				default:
					$GLOBALS['DefaultProductImageCustomChecked'] = 'checked="checked"';
					$GLOBALS['HideCurrentDefaultProductImage'] = '';
					$GLOBALS['DefaultProductImage'] = GetConfig('DefaultProductImage');
			}

			if (GetConfig('CategoryListingMode') == 'children') {
				$GLOBALS['CategoryListModeChildren'] = "checked=\"checked\"";
			}
			else if (GetConfig('CategoryListingMode') == 'emptychildren') {
				$GLOBALS['CategoryListModeEmptyChildren'] = "checked=\"checked\"";
			}
			else {
				$GLOBALS['CategoryListModeSingle'] = "checked=\"checked\"";
			}

			// check if the images need to be resized automatically
			$GLOBALS['RunImageResize'] = '0';
			if(isset($_SESSION['RunImageResize']) && $_SESSION['RunImageResize'] == 'yes') {
				$GLOBALS['RunImageResize'] = '1';
				unset($_SESSION['RunImageResize']);
			}

			// Get a list of the customer groups
			$query = 'SELECT * FROM [|PREFIX|]customer_groups ORDER BY groupname ASC';
			$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
			$GLOBALS['CustomerGroupOptions'] = '';
			while($group = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				if(GetConfig('GuestCustomerGroup') == $group['customergroupid']) {
					$sel = 'selected="selected"';
				}
				else {
					$sel = '';
				}
				$GLOBALS['CustomerGroupOptions'] .= "<option value=\"".$group['customergroupid']."\" ".$sel.">".isc_html_escape($group['groupname'])."</option>";
			}

			// Workout the HTTPS URL
			$GLOBALS['CompleteStorePath'] = fix_url($_SERVER['PHP_SELF']);
			$GLOBALS['HTTPSUrl'] = str_replace("http://", "https://", isc_strtolower($GLOBALS['ShopPath']));

			$GLOBALS['HideVendorSettings'] = 'display: none';
			if(gzte11(ISC_HUGEPRINT)) {
				$GLOBALS['HideVendorSettings'] = '';
			}

			if(GetConfig('VendorLogoSize')) {
				$logoDimensions = explode('x', GetConfig('VendorLogoSize'));
				$GLOBALS['VendorLogoSizeW'] = (int)$logoDimensions[0];
				$GLOBALS['VendorLogoSizeH'] = (int)$logoDimensions[1];
				$GLOBALS['HideVendorLogoUploading'] = '';
				$GLOBALS['VendorLogoUploadingChecked'] = 'checked="checked"';
			}
			else {
				$GLOBALS['HideVendorLogoUploading'] = 'display: none';
			}

			if(GetConfig('VendorPhotoSize')) {
				$photoDimensions = explode('x', GetConfig('VendorPhotoSize'));
				$GLOBALS['VendorPhotoSizeW'] = (int)$photoDimensions[0];
				$GLOBALS['VendorPhotoSizeH'] = (int)$photoDimensions[1];
				$GLOBALS['HideVendorPhotoUploading'] = '';
				$GLOBALS['VendorPhotoUploadingChecked'] = 'checked="checked"';
			}
			else {
				$GLOBALS['HideVendorPhotoUploading'] = 'display: none';
			}

			foreach ($this->all_vars as $var) {
				if (is_string(GetConfig($var)) || is_numeric(GetConfig($var))) {
					$GLOBALS[$var] = isc_html_escape(GetConfig($var));
				}
			}

			// the current value of auto_increment for the orders table
			$GLOBALS['StartingOrderNumber'] = ResetStartingOrderNumber();

			if(GetConfig('DisableDatabaseDetailFields')) {
				$GLOBALS['dbType'] = '';
				$GLOBALS['dbServer'] = '';
				$GLOBALS['dbUser'] = '';
				$GLOBALS['dbPass'] = '';
				$GLOBALS['dbDatabase'] = '';
				$GLOBALS['tablePrefix'] = '';
				$GLOBALS['HideDatabaseDetails'] = 'display: none';
			}

			if(GetConfig('DisableLicenseKeyField')) {
				$GLOBALS['serverStamp'] = 'N/A';
				$GLOBALS['HideLicenseKey'] = 'display: none';
			}

			if(GetConfig('DisablePathFields')) {
				$GLOBALS['HidePathFields'] = 'display: none';
			}

			if(GetConfig('DisableStoreUrlField')) {
				$GLOBALS['HideStoreUrlField'] = 'display: none';
			}

			if(GetConfig('DisableLoggingSettingsTab')) {
				$GLOBALS['HideLoggingSettingsTab'] = 'display: none';
			}

			if(GetConfig('DisableProxyFields')) {
				$GLOBALS['HideProxyFields'] = 'display: none';
			}

			if(GetConfig('DisableBackupSettings')) {
				$GLOBALS['HideBackupSettings'] = 'none';
			}


			// Advance Search settings\
			$GLOBALS['SearchDefaultProductSortOptions'] = getAdvanceSearchSortOptions("product");
			$GLOBALS['SearchDefaultContentSortOptions'] = getAdvanceSearchSortOptions("content");

			$GLOBALS['SearchProductDisplayModeOptions'] = '';

			foreach (array('grid', 'list') as $type) {
				$GLOBALS['SearchProductDisplayModeOptions'] .= '<option value="' . $type . '"';

				if (GetConfig('SearchProductDisplayMode') == $type) {
					$GLOBALS['SearchProductDisplayModeOptions'] .= ' selected';
				}

				$GLOBALS['SearchProductDisplayModeOptions'] .= '>' . GetLang('SearchProductDisplayMode' . ucfirst($type)) . '</option>';
			}

			$GLOBALS['SearchResultsPerPageOptions'] = '';

			foreach (array('5', '10', '20', '50', '100') as $perpage) {
				$GLOBALS['SearchResultsPerPageOptions'] .= '<option value="' . $perpage . '"';

				if (GetConfig('SearchResultsPerPage') == $perpage) {
					$GLOBALS['SearchResultsPerPageOptions'] .= ' selected';
				}

				$GLOBALS['SearchResultsPerPageOptions'] .= '>' . $perpage . '</option>';
			}

			$GLOBALS['SearchOptimisationOptions'] = '';

			foreach (array('fulltext', 'like', 'both') as $mode) {
				$GLOBALS['SearchOptimisationOptions'] .= '<option value="' . $mode . '"';

				if (GetConfig('SearchOptimisation') == $mode) {
					$GLOBALS['SearchOptimisationOptions'] .= ' selected';
				}

				$GLOBALS['SearchOptimisationOptions'] .= '>' . GetLang('SearchOptimisation' . ucfirst(isc_strtolower($mode))) . '</option>';
			}

			$GLOBALS["AbandonOrderLifetimeOptions"] = "";

			foreach (array(1, 7, 14, 21, 30, 60, 90, 120, 150, 180) as $lifetimeType) {
				$GLOBALS["AbandonOrderLifetimeOptions"] .= "<option value=\"" . $lifetimeType . "\"";

				if ((int)GetConfig("AbandonOrderLifetime") == $lifetimeType) {
					$GLOBALS["AbandonOrderLifetimeOptions"] .= " selected=\"selected\"";
				}

				$GLOBALS["AbandonOrderLifetimeOptions"] .= ">" . GetLang("AbandonOrderLifetimeOption" . $lifetimeType . "Days") . "</option>\n";
			}

			$GLOBALS['ShopPath'] = GetConfig('ShopPathNormal');

			// get the maintenance message
			$GLOBALS['DownForMaintenanceMessage'] = Store_DownForMaintenance::getDownForMaintenanceMessage();

			switch (GetConfig('RedirectWWW')) {
				case REDIRECT_TO_WWW:
					$redirectOption = 'RedirectToWWW';
					break;
				case REDIRECT_TO_NO_WWW:
					$redirectOption = 'RedirectToNoWWW';
					break;
				default:
					$redirectOption = 'RedirectNoPreference';
			}

			$GLOBALS[$redirectOption . 'Selected'] = 'selected="selected"';
			$GLOBALS['ShowPCISettings'] = !GetConfig('HidePCISettings');

			$GLOBALS['FacebookLikeButtonEnabled'] = GetConfig('FacebookLikeButtonEnabled');
			$GLOBALS['FacebookLikeButtonStyle' . GetConfig('FacebookLikeButtonStyle')] = 'selected="selected"';
			$GLOBALS['FacebookLikeButtonPosition' . GetConfig('FacebookLikeButtonPosition')] = 'selected="selected"';
			$GLOBALS['FacebookLikeButtonVerb' . GetConfig('FacebookLikeButtonVerb')] = 'selected="selected"';
			$GLOBALS['FacebookLikeButtonShowFacesEnabled'] = GetConfig('FacebookLikeButtonShowFaces');

			if (!isset($GLOBALS['TPL_CFG']['EnableFlyoutMenuSupport']) || !$GLOBALS['TPL_CFG']['EnableFlyoutMenuSupport']) {
				// force selection if template does not support flyout
				$GLOBALS['CategoryListStyle'] = 'static';
			}

			$this->template->display('settings.manage.tpl');
		}
Example #2
0
	if(!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->IsLoggedIn() || !$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_See_Store_During_Maintenance)) {
		define('MAINTENANCE_IS_ADMIN', false);
		Store_DownForMaintenance::showDownForMaintenance();
		die();
	}

	define('MAINTENANCE_IS_ADMIN', true);

	if(isset($_GET['showStore']) && $_GET['showStore'] == 'yes') {
		$_SESSION['AdminShowStore'] = true;
	} elseif (isset($_GET['showStore']) && $_GET['showStore'] == 'no') {
		$_SESSION['AdminShowStore'] = false;
	}

	if(!isset($_SESSION['AdminShowStore']) || (isset($_SESSION['AdminShowStore'])  && $_SESSION['AdminShowStore'] === false)) {
		Store_DownForMaintenance::showDownForMaintenance();
		die();
	}

	$GLOBALS['MaintenanceNotice'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("MaintenanceNotice");
}

$GLOBALS['ISC_CLASS_VISITOR'] = GetClass('ISC_VISITOR');

if(isset($GLOBALS['ShowStoreUnavailable'])) {
	$GLOBALS['ErrorMessage'] = GetLang('StoreUnavailable');
	$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("error");
	$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
	exit;
}