[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

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

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2012 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')) die("You Cannot Access This Script Directly, Have a Nice Day.");
  26  // ----------------------------------------------------------------
  27  
  28  
  29  /*
  30   * Module/Plug-in Feed to Article import
  31   * =====================================
  32   *
  33   * some defaults for modules: $phpwcms['modules'][$module]
  34   * store all related in here and holds some default values
  35   * ['path'], ['type'], ['name']
  36   * language values are store in $BL['modules'][$module] 
  37   * as defined in lang/en.lang.php
  38   * but maybe to keep default language file more lightweight
  39   * you can use own language definitions starting within this file
  40   *
  41   */
  42  
  43  // first check if neccessary db exists
  44  if(isset($phpwcms['modules'][$module]['path'])) {
  45  
  46      // module default stuff
  47      
  48      // put translation back to have easier access to it - use it as relation
  49      $BLM =& $BL['modules'][$module];
  50      define('MODULE_HREF', 'phpwcms.php?do=modules&amp;module='.$module);
  51      define('MODULE_HREF_DECODE', PHPWCMS_URL . 'phpwcms.php?do=modules&module='.$module);
  52      define('MODULE_KEY', 'feedimport');
  53  
  54      require_once($phpwcms['modules'][$module]['path'].'inc/functions.inc.php');
  55  
  56      if(isset($_GET['edit'])) {
  57          
  58          include_once (PHPWCMS_ROOT.'/include/inc_lib/article.functions.inc.php'); //load article funtions
  59      
  60          // handle posts and read data
  61          include_once($phpwcms['modules'][$module]['path'].'inc/processing.inc.php');
  62      
  63          // edit form
  64          include_once($phpwcms['modules'][$module]['path'].'backend.editform.php');
  65          
  66      } elseif(isset($_GET['active']) && !empty($_GET['editid'])) {
  67      
  68          // active/inactive
  69          $data = array(
  70              'cnt_changed'    => now(),
  71              'cnt_status'    => empty($_GET['active']) ? 0 : 1
  72          );
  73          _dbUpdate('phpwcms_content', $data, 'cnt_id='.intval($_GET['editid']).' AND cnt_module='._dbEscape(MODULE_KEY));
  74          headerRedirect(MODULE_HREF_DECODE);
  75      
  76      } elseif(!empty($_GET['delete'])) {
  77      
  78          // delete
  79          $data = array(
  80              'cnt_changed'    => now(),
  81              'cnt_status'    => 9
  82          );
  83          _dbUpdate('phpwcms_content', $data, 'cnt_id='.intval($_GET['delete']).' AND cnt_module='._dbEscape(MODULE_KEY));
  84          headerRedirect(MODULE_HREF_DECODE);
  85      
  86      } else {
  87      
  88          // listing
  89          include_once($phpwcms['modules'][$module]['path'].'backend.listing.php');
  90          
  91      }
  92      
  93  }
  94  
  95  ?>


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1