/** * @see Form::save() */ public function save() { AbstractForm::save(); // create template pack if (count($this->templatePacks) == 0) { $this->templatePackID = TemplatePackEditor::create($this->templatePackName, $this->templatePackFolderName); // get available template packs $this->templatePacks = TemplatePackEditor::getTemplatePacks(); } // save template if ($this->copy) { $this->template = TemplateEditor::create($this->tplName, $this->source, $this->templatePackID, $this->template->packageID); } else { $this->template->update($this->tplName, $this->source, $this->templatePackID); } $this->templateID = $this->template->templateID; // reset cache WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.templates-*.php'); $this->saved(); $this->copy = 0; WCF::getTPL()->assign('success', true); }
/** * @see Form::save() */ public function save() { parent::save(); // save template $this->template = TemplateEditor::create($this->tplName, $this->source, $this->templatePackID); // reset cache WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.templates-*.php'); // reset values $this->tplName = $this->source = ''; $this->templatePackID = 0; $this->saved(); WCF::getTPL()->assign('success', true); }