[ Index ]

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

title

Body

[close]

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


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