[ Index ]

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

title

Body

[close]

/include/inc_module/mod_shop/ -> 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 ads/banner managament
  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']) && is_file($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      $plugin = array();
  54      define('MODULE_HREF', 'phpwcms.php?do=modules&amp;module='.$module);
  55      include_once($phpwcms['modules'][$module]['path'].'inc/shop.functions.inc.php');
  56      
  57      // put translation back to have easier access to it - use it as relation
  58      $BLM = & $BL['modules'][$module];
  59      
  60      // load special backend CSS
  61      $BE['HEADER']['module.shop.css'] = '    <link href="'.$phpwcms['modules'][$module]['dir'].'template/css/module.shop.css" rel="stylesheet" type="text/css" />';
  62  
  63  
  64      
  65      $controller    = empty($_GET['controller']) ? 'order' : strtolower($_GET['controller']);
  66      
  67      if(isset($_GET['edit'])) {
  68          $action    = 'edit';
  69      } elseif(isset($_GET['status'])) {
  70          $action    = 'status';
  71      } elseif(isset($_GET['delete'])) {
  72          $action    = 'delete';
  73      } elseif(isset($_GET['show'])) {
  74          $action    = 'show';
  75      } else {
  76          $action        = '';
  77      }
  78          
  79      switch($controller) {
  80      
  81          case 'prod':    $controller    = 'products';
  82                          break;
  83          
  84          case 'cat':        $controller    = 'categories';
  85                          break;
  86          
  87          case 'pref':    $controller    = 'preferences';
  88                          $action        = 'edit';
  89                          break;
  90          
  91          case 'order':    $controller    = 'orders';
  92                          break;
  93  
  94          case 'default':    $controller    = 'default';
  95                          break;
  96  
  97          default:        $controller    = 'orders';
  98                          
  99                          // some defaults - unset session vars
 100                          unset($_SESSION['detail_page'], $_SESSION['list_active'], $_SESSION['list_inactive'], $_SESSION['filter']);        
 101  
 102      }
 103  
 104      // processing
 105      if( $action ) {
 106          include_once($phpwcms['modules'][$module]['path'].'inc/processing.' . $controller . '.inc.php');
 107      }
 108      
 109      // header
 110      include_once($phpwcms['modules'][$module]['path'].'inc/tabs.inc.php');
 111      
 112      // listing
 113      if($action) {
 114          include_once($phpwcms['modules'][$module]['path'].'inc/'.$action.'.' . $controller . '.inc.php');
 115      } else {
 116          include_once($phpwcms['modules'][$module]['path'].'inc/listing.' . $controller . '.inc.php');
 117      }
 118      
 119  }
 120  
 121  ?>


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