芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/clients/canaldegap.fr_old/modules/TruetypeText/action.addstyle.php
CheckPermission( 'Use TruetypeText' ) ) exit; if (isset($params['cancel'])) $this->Redirect($id, 'defaultadmin', $returnid); include_once cms_join_path(dirname(__FILE__),'class.style.php'); $stylename = (isset($params['stylename']) ? $params['stylename'] : ''); if (isset($params['submit'])) { $TTTsl = new TTTstylelist(); if ($stylename == '') echo $this->showerrors($this->lang('error_emptyname')); elseif (is_numeric($stylename)) echo $this->showerrors($this->lang('error_nameisnumeric')); elseif ($TTTsl->getstyle($stylename) !== false) echo $this->showerrors($this->lang('error_namealreadyexists')); else { $fonts = $this->getFonts(); $TTTstyle = new TTTstyle($stylename); $TTTstyle->addTextElement($fonts[0]); if ($TTTstyle->savedbnew()) $this->Redirect($id, 'editstyle', $returnid, array('styleid' => $TTTstyle->id, 'module_message'=>$this->lang('stylesaved'))); else echo $this->showerrors($this->lang('error_unabletosavestyle')); } } $this->smarty->assign('nametext', $this->Lang('name')); $this->smarty->assign('nameinput', $this->CreateInputText($id, 'stylename', $stylename, 30, 255)); $this->smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit'))); $this->smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel'))); echo $this->CreateFormStart($id, 'addstyle', $returnid); echo $this->ProcessTemplate('name.tpl'); echo $this->CreateFormEnd(); ?>