Пример #1
0
	public function ManageLayouts($MsgDesc = "", $MsgStatus = "", $template = "")
	{
		$output = '';

		if(isset($_REQUEST['forceTab'])) {
			$GLOBALS['ForceTab'] = (int)$_REQUEST['forceTab'];
		}

		$opener = new connect_remote();
		if ($opener->CanOpen()) {
			$GLOBALS['FopenSupport'] = true;
		} else {
			$GLOBALS['FopenSupport'] = false;
		}

		$GLOBALS['CurrentTemplateName']  = GetConfig('template');
		$GLOBALS['CurrentTemplateNameProper']  = ucfirst(GetConfig('template'));
		$GLOBALS['CurrentTemplateColor'] = GetConfig('SiteColor');
		$GLOBALS['StoreLogo'] = GetConfig('StoreLogo');
		$GLOBALS['siteName']  = GetConfig('StoreName');

		$this->LoadChooseTemplateTab();
		$this->LoadDownloadTemplates();
		$this->LoadLogoTab();

		if(file_exists(ISC_BASE_PATH . '/templates/'. GetConfig('template') . '/config.php')) {
			include(ISC_BASE_PATH . '/templates/'. GetConfig('template') . '/config.php');
			if(isset($GLOBALS['TPL_CFG']['GenerateLogo']) && $GLOBALS['TPL_CFG']['GenerateLogo'] === true) {
				$GLOBALS['CurrentTemplateHasLogoOption'] = 'true';
			}
			else {
				$GLOBALS['CurrentTemplateHasLogoOption'] = 'false';
			}
		}

		if(GetConfig('DisableTemplateDownloading')) {
			$GLOBALS['HideDownloadTab'] = 'none';
		}

		$GLOBALS['TemplateVersion'] = '1.0';
		if(isset($GLOBALS['TPL_CFG']['Version'])) {
			$GLOBALS['TemplateVersion'] = $GLOBALS['TPL_CFG']['Version'];
		}

		$GLOBALS['LayoutIntro'] = GetLang('TemplateIntro');

		$GLOBALS['DesignModeToken'] = isc_html_escape($_COOKIE['STORESUITE_CP_TOKEN']);

		$GLOBALS['Message'] = '';

		if ($MsgDesc != "") {
			$GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
		}

		$flashMessages = GetFlashMessages();
		if(is_array($flashMessages)) {
			foreach($flashMessages as $flashMessage) {
				$GLOBALS['Message'] .= MessageBox($flashMessage['message'], $flashMessage['type']);
			}
		}

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

		// Mark the design step as complete
		GetClass('ISC_ADMIN_ENGINE')->MarkGettingStartedComplete('design');

		if(!function_exists("gzdeflate")) {
			// No zlib - they can't download templates automatically
			$GLOBALS['HideDownloadMessage'] = "none";
			$GLOBALS['NoZLibMessage'] = MessageBox(GetLang('NoZLibInstalled'), MSG_ERROR);
		}
		else {
			// They have zlib - hide the zlib error message
			$GLOBALS['HideNoZLib'] = "none";
		}

		if(!$this->safeMode) {
			$GLOBALS['HideSafeModeMessage'] = 'display: none';
		}

		// Mobile template settings tab
		$validSettings = array(
			'enableMobileTemplate',
			'enableMobileTemplateDevices',
			'mobileTemplateLogo',
		);
		$mobileSettings = array();
		foreach($validSettings as $setting) {
			$mobileSettings[$setting] = getConfig($setting);
		}
		$this->template->assign('mobileSettings', $mobileSettings);

		require_once ISC_BASE_PATH.'/lib/templates/template.php';
		$phoneTemplateConfig = TEMPLATE::getTemplateConfiguration('__mobile');
		$this->template->assign('phoneLogoDimensions', array(
			'width' => $phoneTemplateConfig['LogoWidth'],
			'height' => $phoneTemplateConfig['LogoHeight']
		));

		// Gift certificates tab
		if(GetConfig('EnableGiftCertificates')) {
			$GLOBALS['GiftCertificateThemes'] = ISC_GIFTCERTIFICATE_THEME::findAll();
		}

		// Load the email templates
		$GLOBALS['EmailTemplatesGrid'] = $this->GetEmailTemplateRows();

		$GLOBALS['TemplatesOrderCustomURL'] = GetConfig('TemplatesOrderCustomURL');

		// Load a temporary editor to use for editing email templates
		$wysiwygOptions = array(
			'id' => 'temp_email_editor',
			'delayLoad' => true
		);
		$GLOBALS['TemporaryEditor'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions);

		$GLOBALS['Favicon'] = GetConfig('ShopPath') . '/' . GetConfig('ImageDirectory') . '/' . GetConfig('Favicon');

		$this->template->display('layout.manage.tpl');
	}
Пример #2
0
 /**
  * Check to make sure a template is the latest version
  *
  * @return void
  **/
 private function CheckTemplateVersion()
 {
     GetLib('class.remoteopener');
     $opener = new connect_remote();
     $tpl = GetClass('ISC_ADMIN_LAYOUT');
     $url = $tpl->BuildTemplateURL($GLOBALS['ISC_CFG']['TemplateVersionURL'], array("template" => GetConfig('template'), "version" => PRODUCT_VERSION_CODE));
     // Get a list of available templates
     $version = '';
     if ($opener->Open($url, $version)) {
         if (isc_strtolower(isc_substr($version, 0, 5)) != "error") {
             // success
             $tags[] = $this->MakeXMLTag('status', 1);
             if ($version === '') {
                 $verson = 0;
             }
             $tags[] = $this->MakeXMLTag('version', $version);
         } else {
             // there was a problem
             $tags[] = $this->MakeXMLTag('status', 0);
             $tags[] = $this->MakeXMLTag('message', $version);
         }
     } else {
         // there was a problem
         $tags[] = $this->MakeXMLTag('status', 0);
         $tags[] = $this->MakeXMLTag('message', 'Unable to open remote site for version checking');
     }
     $this->SendXMLHeader();
     $this->SendXMLResponse($tags);
     die;
 }
Пример #3
0
 public function ManageLayouts($MsgDesc = "", $MsgStatus = "", $template = "")
 {
     $output = '';
     if (isset($_REQUEST['ForceTab'])) {
         $GLOBALS['ForceTab'] = (int) $_REQUEST['ForceTab'];
     }
     if (isset($_REQUEST['forceTab'])) {
         $GLOBALS['ForceTab'] = (int) $_REQUEST['forceTab'];
     }
     $opener = new connect_remote();
     if ($opener->CanOpen()) {
         $GLOBALS['FopenSupport'] = true;
     } else {
         $GLOBALS['FopenSupport'] = false;
     }
     $GLOBALS['CurrentTemplateName'] = GetConfig('template');
     $GLOBALS['CurrentTemplateNameProper'] = ucfirst(GetConfig('template'));
     $GLOBALS['CurrentTemplateColor'] = GetConfig('SiteColor');
     $GLOBALS['StoreLogo'] = GetConfig('StoreLogo');
     $GLOBALS['siteName'] = GetConfig('StoreName');
     $this->LoadChooseTemplateTab();
     $this->LoadDownloadTemplates();
     $this->LoadLogoTab();
     if (file_exists(ISC_BASE_PATH . '/templates/' . GetConfig('template') . '/config.php')) {
         include ISC_BASE_PATH . '/templates/' . GetConfig('template') . '/config.php';
         if (isset($GLOBALS['TPL_CFG']['GenerateLogo']) && $GLOBALS['TPL_CFG']['GenerateLogo'] === true) {
             $GLOBALS['CurrentTemplateHasLogoOption'] = 'true';
         } else {
             $GLOBALS['CurrentTemplateHasLogoOption'] = 'false';
         }
     }
     if (GetConfig('DisableTemplateDownloading')) {
         $GLOBALS['HideDownloadTab'] = 'none';
     }
     $GLOBALS['TemplateVersion'] = '1.0';
     if (isset($GLOBALS['TPL_CFG']['Version'])) {
         $GLOBALS['TemplateVersion'] = $GLOBALS['TPL_CFG']['Version'];
     }
     $GLOBALS['LayoutIntro'] = GetLang('TemplateIntro');
     if (GetConfig('TemplatesOrderCustomURL') == '') {
         $GLOBALS['HideOrderCustomTemplate'] = "none";
     }
     if (GetConfig('DesignMode')) {
         $GLOBALS['DesignModeChecked'] = "checked";
     }
     if ($MsgDesc != "") {
         $GLOBALS['Message'] = MessageBox($MsgDesc, $MsgStatus);
     }
     $flashMessages = GetFlashMessages();
     if (is_array($flashMessages)) {
         $GLOBALS['Message'] = '';
         foreach ($flashMessages as $flashMessage) {
             $GLOBALS['Message'] .= MessageBox($flashMessage['message'], $flashMessage['type']);
         }
     }
     if (!function_exists("gzdeflate")) {
         // No zlib - they can't download templates automatically
         $GLOBALS['HideDownloadMessage'] = "none";
         $GLOBALS['NoZLibMessage'] = MessageBox(GetLang('NoZLibInstalled'), MSG_ERROR);
     } else {
         // They have zlib - hide the zlib error message
         $GLOBALS['HideNoZLib'] = "none";
     }
     if (!$this->safeMode) {
         $GLOBALS['HideSafeModeMessage'] = 'display: none';
     }
     // Load the email templates
     $GLOBALS['EmailTemplatesGrid'] = $this->_LoadEmailTemplates();
     $GLOBALS['TemplatesOrderCustomURL'] = GetConfig('TemplatesOrderCustomURL');
     // Load a temporary editor to use for editing email templates
     $wysiwygOptions = array('id' => 'temp_email_editor', 'delayLoad' => true);
     $GLOBALS['TemporaryEditor'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions);
     $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("layout.manage");
     $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate();
 }