public function initContent()
 {
     parent::initContent();
     theme_check_memory_limit(true);
     if (Tools::getIsset('invalid_urls')) {
         // base and server urls have to start with the same symbols
         $this->errors[] = $this->l(sprintf('An error has occurred. The Themler start URL %s does not match Shop Domain or SSL Domain %s. This may be due to one of the following reasons: 1. server protocol does not match (HTTP/HTTPS) 2. www prefix is missing in one of the links', $this->_serverUrl . $_SERVER['REQUEST_URI'], $this->_baseUrl));
     }
     if (Tools::getIsset('invalid_php_version')) {
         $this->errors[] = $this->l(sprintf('Unable to open theme. Your server is running php version %s but Themler requires %s or higher. Please upgrade PHP version to continue.', $this->_php_version, $this->_required_php_version));
     }
     if (Tools::getIsset('no_project')) {
         $this->errors[] = $this->l(sprintf('The theme `%s` cannot be opened because /project/project.json file is missing or corrupted.', $this->_getThemeName()));
     }
     if ($this->ajax) {
         try {
             $themeName = $this->_getThemeName();
             $this->_checkPermissions($themeName);
             moveInnerPreview($themeName);
             $data = $this->_getThemlerData($themeName);
             echo $this->_buildPage($themeName);
         } catch (PermissionsException $e) {
             die(buildErrorsPage($e->getMessage()));
         }
     } else {
         $edit = Tools::getValue('edit', '');
         if (!empty($edit)) {
             $title = $this->l('Slider settings');
             $this->content .= $this->renderThemeSettingsForm();
         } else {
             $title = $this->l('List of Themes');
             $this->content .= $this->_formRendererHelper->renderThemesListForm($this->getThemesInfo());
         }
         $this->context->smarty->assign(array('content' => $this->content, 'title' => $title));
     }
 }
 /**
  * Returns theme to Billion Themler
  */
 public function getTheme($userThemeName, $includeThemler)
 {
     ProviderLog::start('getTheme');
     moveInnerPreview($this->_themeName);
     $archive = generateArchive($this->_themeName, $userThemeName, $includeThemler);
     ProviderLog::end('getTheme');
     if (is_array($archive) && array_key_exists('content', $archive)) {
         return $archive['content'];
     }
     trigger_error('Archive is incorrect: "' . $archive . '"', E_USER_ERROR);
 }