[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 if (!isset($gCms)) exit; 3 4 $error = ''; 5 $newtemplate = ''; 6 if (isset($params['newtemplate'])) $newtemplate = $params['newtemplate']; 7 $content = ''; 8 if (isset($params['templatecontent'])) $content = $params['templatecontent']; 9 10 if (isset($params['cancel'])) 11 { 12 $this->Redirect($id, 'defaultadmin', $returnid); 13 } 14 else if (isset($params['submit'])) 15 { 16 if ($newtemplate == '') 17 { 18 $error = $this->Lang('notemplatename'); 19 } 20 else if ($content == '') 21 { 22 $error = $this->Lang('nocontent'); 23 } 24 else 25 { 26 if ($this->GetTemplate($newtemplate) == '') 27 { 28 $this->SetTemplate($newtemplate, $content); 29 $this->Redirect($id, 'defaultadmin', $returnid); 30 } 31 else 32 { 33 $themeObject = $gCms->variables['admintheme']; 34 $error = $themeObject->ShowErrors($this->Lang('templatenameexists')); 35 } 36 } 37 } 38 39 $this->smarty->assign_by_ref('errormsg', $error); 40 41 $this->smarty->assign('startform', $this->CreateFormStart($id, 'addtemplate', $returnid)); 42 $this->smarty->assign('endform', $this->CreateFormEnd()); 43 $this->smarty->assign('newtemplate', $this->Lang('newtemplate')); 44 $this->smarty->assign('inputname', $this->CreateInputText($id, 'newtemplate', $newtemplate, 20, 255)); 45 $this->smarty->assign('content', $this->Lang('templatecontent')); 46 $this->smarty->assign('inputcontent', $this->CreateTextArea(false, $id, $content, 'templatecontent')); 47 #$this->smarty->assign('hidden', $this->CreateInputHidden($id, 'tplname', $params['tplname'])); 48 $this->smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit'))); 49 $this->smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel'))); 50 51 echo $this->ProcessTemplate('edittemplate.tpl'); 52 53 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |