[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_module/mod_glossary/ -> backend.default.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  // ----------------------------------------------------------------
  24  // obligate check for phpwcms constants
  25  if (!defined('PHPWCMS_ROOT')) {
  26     die("You Cannot Access This Script Directly, Have a Nice Day.");
  27  }
  28  // ----------------------------------------------------------------
  29  
  30  
  31  /*
  32   * module glossary
  33   * ===============
  34   *
  35   * some defaults for modules: $phpwcms['modules'][$module]
  36   * store all related in here and holds some default values
  37   * ['path'], ['type'], ['name']
  38   * language values are store in $BL['modules'][$module] 
  39   * as defined in lang/en.lang.php
  40   * but maybe to keep default language file more lightweight
  41   * you can use own language definitions starting within this file
  42   *
  43   */
  44   
  45  // first check if neccessary db exists
  46  if(isset($phpwcms['modules'][$module]['path']) && file_exists($phpwcms['modules'][$module]['path'].'setup/setup.php')) {
  47  
  48      include_once($phpwcms['modules'][$module]['path'].'setup/setup.php');
  49  
  50  } elseif(isset($phpwcms['modules'][$module]['path'])) {
  51  
  52      // module default stuff
  53      
  54      // put translation back to have easier access to it - use it as relation
  55      $BLM = & $BL['modules'][$module];
  56      define('GLOSSARY_HREF', 'phpwcms.php?do=modules&amp;module='.$module);
  57      $glossary = array();
  58  
  59  
  60      if(isset($_GET['edit'])) {
  61      
  62          // handle posts and read data
  63          include_once($phpwcms['modules'][$module]['path'].'inc/processing.inc.php');
  64      
  65          // edit form
  66          include_once($phpwcms['modules'][$module]['path'].'backend.editform.php');
  67          
  68      } elseif(isset($_GET['verify'])) {
  69      
  70          // active/inactive
  71          $sql  = 'UPDATE '.DB_PREPEND.'phpwcms_glossary SET ';
  72          $sql .= "glossary_status=".(intval($_GET['verify']) ? 1 : 0)." ";
  73          $sql .= "WHERE glossary_id=".intval($_GET['editid']);
  74          @_dbQuery($sql, 'UPDATE');
  75          headerRedirect(decode_entities(GLOSSARY_HREF));
  76      
  77      } elseif(isset($_GET['delete'])) {
  78      
  79          // delete
  80          $sql  = 'UPDATE '.DB_PREPEND.'phpwcms_glossary SET ';
  81          $sql .= "glossary_status=9 WHERE glossary_id=".intval($_GET['delete']);
  82          @_dbQuery($sql, 'UPDATE');        
  83          headerRedirect(decode_entities(GLOSSARY_HREF));
  84      
  85      } else {
  86      
  87          // listing
  88          include_once($phpwcms['modules'][$module]['path'].'backend.listing.php');
  89          
  90      }
  91      
  92  }
  93  
  94  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7