Ignore:
Timestamp:
11/03/11 13:24:28 (12 years ago)
Author:
wmerlotto
Message:

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus, do modulo ExpressoMail?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/controller.php

    r1738 r5134  
    88} 
    99require_once '../header.session.inc.php'; 
     10require_once '../API/class.servicelocator.php'; 
    1011 
    1112        //      Explode action from cExecuteForm function 
     
    1617                        $array_files = array();                  
    1718                        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']) 
    1920                                        $array_files[] = $_FILES['file_'.$idx];                                           
    2021                        } 
    2122                        $_POST['FILES'] = $array_files; 
    2223                }                                
    23                 list($app,$class,$method) = explode('.',@$_POST['_action']); 
     24                $get_p = explode('.',@$_POST['_action']); 
     25 
    2426                $cExecuteFormReturn = true; 
    2527        } 
    2628        //      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 
    2933        // NO ACTION 
    3034        else 
     
    3236         
    3337        // 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'; 
    3640        else 
    37                 $filename = '../'.$app.'/inc/class.'.$class.'.inc.php'; 
     41                $filename = '../'.$get_p[0].'/inc/class.'.$get_p[1].'.inc.php'; 
    3842                 
    3943        include_once($filename);         
    4044         
    4145        // Create new Object  (class loaded).    
    42         $obj = new $class; 
     46        $obj = new $get_p[1]; 
    4347         
    4448        // Prepare parameters for execution.     
     
    6064        // if params is not empty, then class method with parameters.    
    6165        if($params) 
    62                 $result = $obj -> $method($params); 
     66                $result = $obj -> $get_p[2]($params); 
    6367        else             
    64                 $result = $obj -> $method(); 
     68                $result = $obj -> $get_p[2](); 
    6569                 
    6670        // Return result serialized.     
    6771         
    6872 
    69         if(!$cExecuteFormReturn) 
     73        if(!$cExecuteFormReturn /*&& (!$_REQUEST['isPost'])*/ ) 
     74                if(array_key_exists(3,$get_p)) 
     75                        echo $result; 
     76                else 
    7077                echo serialize($result); 
    7178        else 
Note: See TracChangeset for help on using the changeset viewer.