[ 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.importtemplate.php (source)

   1  <?php
   2  if (!isset($gCms)) exit;
   3  
   4  #$this->DeleteTemplate($params['tplname']);
   5  #$this->Redirect($id, 'defaultadmin', $returnid);
   6  
   7  $error = '';
   8  $newtemplate = '';
   9  if (isset($params['newtemplate'])) $newtemplate = $params['newtemplate'];
  10  
  11  if (isset($params['cancel']))
  12  {
  13      $this->Redirect($id, 'defaultadmin', $returnid);
  14  }
  15  else if (isset($params['submit']))
  16  {
  17      if ($newtemplate == '')
  18      {
  19          $error = $this->Lang('notemplatename');
  20      }
  21      else
  22      {
  23          if ($this->GetTemplate($newtemplate) == '')
  24          {
  25              @ob_start();
  26              @readfile(dirname(__FILE__) . '/templates/' . $params['tplname']);
  27              $contents = @ob_get_contents();
  28              @ob_clean();
  29              $this->SetTemplate($newtemplate, $contents);
  30              $this->Redirect($id, 'defaultadmin', $returnid);
  31          }
  32          else
  33          {
  34              $error = $this->Lang('templatenameexists');
  35          }
  36      }
  37  }
  38  
  39  $this->smarty->assign_by_ref('errormsg', $error);
  40  
  41  $this->smarty->assign('startform', $this->CreateFormStart($id, 'importtemplate', $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('hidden', $this->CreateInputHidden($id, 'tplname', $params['tplname']));
  46  $this->smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', lang('submit')));
  47  $this->smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', lang('cancel')));
  48  
  49  echo $this->ProcessTemplate('importtemplate.tpl');
  50  
  51  ?>


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