[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/MenuManager/ -> action.edittemplate.php (source)

   1  <?php
   2  if (!isset($gCms)) exit;
   3  
   4  $error = '';
   5  $tplname = '';
   6  if (isset($params['tplname'])) $tplname = $params['tplname'];
   7  $newtemplate = '';
   8  if (isset($params['newtemplate'])) $newtemplate = $params['newtemplate'];
   9  $content = '';
  10  if (isset($params['templatecontent'])) $content = $params['templatecontent'];
  11  
  12  if (isset($params['cancel']))
  13  {
  14      $this->Redirect($id, 'defaultadmin', $returnid);
  15  }
  16  else if (isset($params['submit']) || isset($params['apply']))
  17  {
  18      if ($newtemplate == '')
  19      {
  20          $error = $this->Lang('notemplatename');
  21      }
  22      else if ($content == '')
  23      {
  24          $error = $this->Lang('nocontent');
  25      }
  26      else
  27      {
  28          if ($newtemplate != $tplname && $this->GetTemplate($newtemplate) != '')
  29          {
  30              $error = $this->Lang('templateexists');
  31          }
  32          else
  33          {
  34              if ($newtemplate != $tplname)
  35              {
  36                  $this->DeleteTemplate($tplname);
  37              }
  38              $this->SetTemplate($newtemplate, $content);
  39              if (isset($params['submit']))
  40                  $this->Redirect($id, 'defaultadmin', $returnid);
  41          }
  42      }
  43  }
  44  else
  45  {
  46      if ($newtemplate == '')
  47      {
  48          $newtemplate = $tplname;
  49      }
  50      $blah = $this->GetTemplate($newtemplate);
  51      if ($blah != '')
  52      {
  53          $content = $blah;
  54      }
  55  }
  56  
  57  $this->smarty->assign_by_ref('errormsg', $error);
  58  
  59  $this->smarty->assign('startform', $this->CreateFormStart($id, 'edittemplate', $returnid));
  60  $this->smarty->assign('endform', $this->CreateFormEnd());
  61  $this->smarty->assign('newtemplate', $this->Lang('newtemplate'));
  62  $this->smarty->assign('inputname', $this->CreateInputText($id, 'newtemplate', $newtemplate, 20, 255));
  63  $this->smarty->assign('content', $this->Lang('templatecontent'));
  64  $this->smarty->assign('inputcontent', $this->CreateTextArea(false, $id, $content, 'templatecontent'));
  65  $this->smarty->assign('hidden', $this->CreateInputHidden($id, 'tplname', $params['tplname']));
  66  $this->smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit')));
  67  $this->smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel')));
  68  $this->smarty->assign('apply', $this->CreateInputSubmit($id, 'apply', lang('apply')));
  69  
  70  echo $this->ProcessTemplate('edittemplate.tpl');
  71  
  72  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7