[ Index ]
 

Code source de CMS made simple 1.0.5

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

title

Body

[fermer]

/admin/ -> multistylesheet.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (wishy@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.sf.net
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  #
  19  #$Id$
  20  
  21  $CMS_ADMIN_PAGE=1;
  22  
  23  require_once ("../include.php");
  24  
  25  if (isset($_POST['cancel']))
  26      redirect('listcss.php');
  27  
  28  check_login();
  29  
  30  $action = '';
  31  if (isset($_POST['multiaction'])) $action = $_POST['multiaction'];
  32  
  33  global $gCms;
  34  $styleops =& $gCms->GetStylesheetOperations();
  35  
  36  $nodelist = array();
  37  
  38  if (isset($_POST['idlist']))
  39  {
  40      foreach (explode(':', $_POST['idlist']) as $id)
  41      {
  42          $stylesheet =& $styleops->LoadStylesheetByID($id);
  43          $nodelist[] =& $stylesheet;
  44      }
  45  }
  46  else
  47  {
  48      foreach ($_POST as $k=>$v)
  49      {
  50          if (startswith($k, 'multistylesheet-'))
  51          {
  52              $id = substr($k, strlen('multistylesheet-'));
  53              $stylesheet =& $styleops->LoadStylesheetByID($id);
  54              $nodelist[] =& $stylesheet; 
  55          }
  56      }
  57  }
  58  
  59  include_once ("header.php");
  60  
  61  if (count($nodelist) == 0)
  62  {
  63      redirect("listcss.php");
  64  }
  65  else
  66  {
  67      if ($action == 'delete')
  68      {
  69          ?>
  70          <div class="pagecontainer">
  71              <p class="pageheader"><?php echo lang('deletetemplate') ?></p><br />
  72          <?php
  73          $userid = get_userid();
  74          $access = check_permission($userid, 'Remove Stylesheets');
  75          if ($access)
  76          {
  77              echo '<form method="post" action="multistylesheet.php">' . "\n";
  78              $idlist = array();
  79              if (count($nodelist) > 0)
  80              {
  81                  echo '<p>'.lang('stylesheetstodelete').'</p><p>' . "\n";
  82                  foreach ($nodelist as $node)
  83                  {
  84                      echo $node->name . '<br />' . "\n";
  85                      $idlist[] = $node->id;
  86                  }
  87                  echo '</p>';
  88              }
  89  
  90              echo '<div class="pageoverflow">
  91                  <p class="pagetext">&nbsp;</p>
  92                  <p class="pageinput">';
  93  
  94              echo '<input type="hidden" name="multiaction" value="dodelete" /><input type="hidden" name="idlist" value="'.implode(':', $idlist).'" />' . "\n";
  95              ?>
  96                                  <?php if (count($nodelist) > 0) { ?><input type="submit" name="confirm" value="<?php echo lang('submit') ?>"  class="pagebutton" onmouseover="this.className='pagebuttonhover'" onmouseout="this.className='pagebutton'" /><?php } ?>
  97                                  <input type="submit" name="cancel" value="<?php echo lang('cancel') ?>" class="pagebutton" onmouseover="this.className='pagebuttonhover'" onmouseout="this.className='pagebutton'" />
  98                              </p>
  99                          </div>
 100                      </form>
 101                  </div>
 102              </div>
 103              <?php
 104          }
 105          else
 106          {
 107              redirect('listcss.php');
 108          }
 109      }
 110      else if ($action == 'dodelete')
 111      {
 112          $userid = get_userid();
 113          $access = check_permission($userid, 'Remove Stylesheets');
 114          if ($access)
 115          {
 116              foreach ($nodelist as $node)
 117              {
 118                  $id = $node->id;
 119                  $title = $node->name;
 120                  $node->Delete();
 121                  audit($id, $title, 'Deleted Stylesheet');
 122              }
 123          }
 124          redirect("listcss.php");
 125      }
 126      else
 127      {
 128          redirect("listcss.php");
 129      }
 130  }
 131  
 132  include_once ("footer.php");
 133  
 134  # vim:ts=4 sw=4 noet
 135  ?>


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