Changeset 5134 for trunk/expressoMail1_2/controller.php
- Timestamp:
- 11/03/11 13:24:28 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/controller.php
r1738 r5134 8 8 } 9 9 require_once '../header.session.inc.php'; 10 require_once '../API/class.servicelocator.php'; 10 11 11 12 // Explode action from cExecuteForm function … … 16 17 $array_files = array(); 17 18 for($idx = 1; $idx <= $count_files; $idx++) { 18 if( $_FILES['file_'.$idx] && !$_FILES['file_'.$idx]['error'])19 if(array_key_exists('file_'.$idx , $_FILES) && $_FILES['file_'.$idx] && !$_FILES['file_'.$idx]['error']) 19 20 $array_files[] = $_FILES['file_'.$idx]; 20 21 } 21 22 $_POST['FILES'] = $array_files; 22 23 } 23 list($app,$class,$method) = explode('.',@$_POST['_action']); 24 $get_p = explode('.',@$_POST['_action']); 25 24 26 $cExecuteFormReturn = true; 25 27 } 26 28 // Explode action from cExecute function 27 else if($_GET['action']) 28 list($app,$class,$method) = explode('.',@$_GET['action']); 29 else if(array_key_exists('action', $_GET)) 30 $get_p = explode('.',@$_GET['action']); 31 32 29 33 // NO ACTION 30 34 else … … 32 36 33 37 // Load dinamically class file. 34 if($ app== '$this')35 $filename = 'inc/class.'.$ class.'.inc.php';38 if($get_p[0] == '$this') 39 $filename = 'inc/class.'.$get_p[1].'.inc.php'; 36 40 else 37 $filename = '../'.$ app.'/inc/class.'.$class.'.inc.php';41 $filename = '../'.$get_p[0].'/inc/class.'.$get_p[1].'.inc.php'; 38 42 39 43 include_once($filename); 40 44 41 45 // Create new Object (class loaded). 42 $obj = new $ class;46 $obj = new $get_p[1]; 43 47 44 48 // Prepare parameters for execution. … … 60 64 // if params is not empty, then class method with parameters. 61 65 if($params) 62 $result = $obj -> $ method($params);66 $result = $obj -> $get_p[2]($params); 63 67 else 64 $result = $obj -> $ method();68 $result = $obj -> $get_p[2](); 65 69 66 70 // Return result serialized. 67 71 68 72 69 if(!$cExecuteFormReturn) 73 if(!$cExecuteFormReturn /*&& (!$_REQUEST['isPost'])*/ ) 74 if(array_key_exists(3,$get_p)) 75 echo $result; 76 else 70 77 echo serialize($result); 71 78 else
Note: See TracChangeset
for help on using the changeset viewer.