[ Index ]
 

Code source de CMS made simple 1.0.5

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

title

Body

[fermer]

/admin/ -> deletehtmlblob.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: deletehtmlblob.php 3763 2007-01-19 10:58:34Z wishy $
  20  
  21  $CMS_ADMIN_PAGE=1;
  22  
  23  require_once ("../include.php");
  24  //require_once("../lib/classes/class.htmlblob.inc.php");
  25  require_once ("../lib/classes/class.template.inc.php");
  26  
  27  check_login();
  28  
  29  $group_id = -1;
  30  if (isset($_GET["htmlblob_id"]))
  31  {
  32      $htmlblob_id = $_GET["htmlblob_id"];
  33      $htmlblob_name = "";
  34      $userid = get_userid();
  35      $access = check_permission($userid, 'Remove Global Content Blocks');
  36  
  37      if ($access)
  38      {
  39          $result = false;
  40          
  41          global $gCms;
  42          $gcbops =& $gCms->GetGlobalContentOperations();
  43          $templateops =& $gCms->GetTemplateOperations();
  44  
  45          $blobobj = $gcbops->LoadHtmlBlobByID($htmlblob_id);
  46          $htmlblob_name = $blobobj->name;
  47  
  48          if ($blobobj)
  49          {
  50              #Perform the deletehtmlblob_pre callback
  51              foreach($gCms->modules as $key=>$value)
  52              {
  53                  if ($gCms->modules[$key]['installed'] == true &&
  54                      $gCms->modules[$key]['active'] == true)
  55                  {
  56                      $gCms->modules[$key]['object']->DeleteHtmlBlobPre($blobobj);
  57                  }
  58              }
  59              
  60              Events::SendEvent('Core', 'DeleteGlobalContentPre', array('global_content' => &$blobobj));
  61  
  62              $result = $blobobj->Delete();
  63          }
  64  
  65          if ($result == true)
  66          {
  67              #Perform the deletehtmlblob_post callback
  68              foreach($gCms->modules as $key=>$value)
  69              {
  70                  if ($gCms->modules[$key]['installed'] == true &&
  71                      $gCms->modules[$key]['active'] == true)
  72                  {
  73                      $gCms->modules[$key]['object']->DeleteHtmlBlobPost($blobobj);
  74                  }
  75              }
  76              
  77              Events::SendEvent('Core', 'DeleteGlobalContentPost', array('global_content' => &$blobobj));
  78  
  79              audit($htmlblob_id, $htmlblob_name, 'Deleted Html Blob');
  80          }
  81      }
  82  }
  83  
  84  redirect("listhtmlblobs.php");
  85  
  86  # vim:ts=4 sw=4 noet
  87  ?>


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