  |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
7 | 7 | | |
  |
8 | | - | Copyright (c) 2006 osCommerce |
| |
| 8 | + | Copyright (c) 2007 osCommerce |
|
9 | 9 | | |
| |
10 | 10 | | This program is free software; you can redistribute it and/or modify |
| |
11 | 11 | | it under the terms of the GNU General Public License v2 (1991) |
| |
12 | 12 | | as published by the Free Software Foundation. |
| |
13 | 13 | | */ |
| |
14 | 14 | | |
  |
| 15 | + | /** |
| |
| 16 | + | * The osC_Actions class loads action modules to execute specific tasks |
| |
| 17 | + | */ |
| |
| 18 | + | |
|
15 | 19 | | class osC_Actions { |
  |
16 | | - | function parse() { |
| |
17 | | - | if (isset($_GET['action']) && !empty($_GET['action'])) { |
| |
18 | | - | $_GET['action'] = basename($_GET['action']); |
|
19 | 20 | | |
  |
20 | | - | if (file_exists('includes/modules/actions/' . $_GET['action'] . '.php')) { |
| |
21 | | - | include('includes/modules/actions/' . $_GET['action'] . '.php'); |
| |
| 21 | + | /** |
| |
| 22 | + | * Loads the action module to execute |
| |
| 23 | + | * |
| |
| 24 | + | * @param string $module The name of the module to execute |
| |
| 25 | + | * @access public |
| |
| 26 | + | */ |
|
22 | 27 | | |
  |
23 | | - | call_user_func(array('osC_Actions_' . $_GET['action'], 'execute')); |
| |
24 | | - | } |
| |
| 28 | + | public static function parse($module) { |
| |
| 29 | + | $module = basename($module); |
| |
| 30 | + | |
| |
| 31 | + | if ( !empty($module) && file_exists('includes/modules/actions/' . $module . '.php') ) { |
| |
| 32 | + | include('includes/modules/actions/' . $module . '.php'); |
| |
| 33 | + | |
| |
| 34 | + | call_user_func(array('osC_Actions_' . $module, 'execute')); |
  |
25 | 35 | | } |
| |
26 | 36 | | } |
| |
27 | 37 | | } |