function _addTemplateCode($templateName)
 {
     $ts = new TemplateSetStorage();
     // make sure that the template is valid
     $templateSandbox = new TemplateSandbox();
     $valid = $templateSandbox->checkTemplateFolder($templateName, $ts->getBaseTemplateFolder());
     if ($valid < 0) {
         $this->_errorMessage = $this->_locale->pr('error_installing_template', $templateName) . ': ' . $this->_checkTemplateSandboxResult($valid) . '<br/>';
         $result = false;
     } else {
         // otherwise, we can add it without problems
         $ts->addTemplate($templateName);
         $this->_successMessage = $this->_locale->pr('template_installed_ok', $templateName) . '<br/>';
         $result = true;
     }
     $this->setCommonData();
     return $result;
 }
 /**
  * @private
  */
 function _addTemplateCode($templateName)
 {
     $config =& Config::getConfig();
     $templateFolder = $config->getValue("template_folder");
     $ts = new TemplateSetStorage();
     $this->_view = new AdminBlogTemplateSetsListView($this->_blogInfo);
     // make sure that the template is valid
     $templateSandbox = new TemplateSandbox();
     $valid = $templateSandbox->checkTemplateFolder($templateName, $ts->getBlogBaseTemplateFolder($this->_blogInfo->getId()));
     if ($valid < 0) {
         $this->_errorMessage = $this->_locale->pr('error_installing_template', $templateName) . ': ' . AdminAddTemplateAction::_checkTemplateSandboxResult($valid) . '<br/>';
         $result = false;
     } else {
         // otherwise, we can add it without problems
         $ts->addTemplate($templateName, $this->_blogInfo->getId());
         $this->_successMessage = $this->_locale->pr("template_installed_ok", $templateName);
         $result = true;
     }
     $this->setCommonData();
     return $result;
 }