[5107] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * eGroupWare * |
---|
| 4 | * http://www.egroupware.org * |
---|
| 5 | * The file written by Mário César Kolling <mario.kolling@serpro.gov.br> * |
---|
| 6 | * -------------------------------------------- * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \**************************************************************************/ |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | /* |
---|
| 15 | * Não é necessário |
---|
| 16 | */ |
---|
| 17 | function mobileExecMethod($method, $functionparams = '_UNDEF_', $loglevel = 3, $classparams = '_UNDEF_'){ |
---|
| 18 | |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | function CreateObject($class, |
---|
| 22 | $p1='_UNDEF_',$p2='_UNDEF_',$p3='_UNDEF_',$p4='_UNDEF_', |
---|
| 23 | $p5='_UNDEF_',$p6='_UNDEF_',$p7='_UNDEF_',$p8='_UNDEF_', |
---|
| 24 | $p9='_UNDEF_',$p10='_UNDEF_',$p11='_UNDEF_',$p12='_UNDEF_', |
---|
| 25 | $p13='_UNDEF_',$p14='_UNDEF_',$p15='_UNDEF_',$p16='_UNDEF_') |
---|
| 26 | { |
---|
| 27 | global $phpgw_info, $phpgw; |
---|
| 28 | |
---|
| 29 | /* |
---|
| 30 | if(is_object(@$GLOBALS['phpgw']->log) && $class != 'phpgwapi.error' && $class != 'phpgwapi.errorlog') |
---|
| 31 | { |
---|
| 32 | $GLOBALS['phpgw']->log->write(array('text'=>'D-Debug, dbg: %1','p1'=>'This class was run: '.$class,'file'=>__FILE__,'line'=>__LINE__)); |
---|
| 33 | } |
---|
| 34 | */ |
---|
| 35 | |
---|
| 36 | /* error_reporting(0); */ |
---|
| 37 | list($appname,$classname) = explode('.', $class); |
---|
| 38 | $filename = PHPGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php'; |
---|
| 39 | $included_files = get_included_files(); |
---|
| 40 | |
---|
| 41 | if(!isset($included_files[$filename])) |
---|
| 42 | { |
---|
| 43 | if(@file_exists($filename)) |
---|
| 44 | { |
---|
| 45 | include_once($filename); |
---|
| 46 | $is_included = True; |
---|
| 47 | } |
---|
| 48 | else |
---|
| 49 | { |
---|
| 50 | $is_included = False; |
---|
| 51 | } |
---|
| 52 | } |
---|
| 53 | else |
---|
| 54 | { |
---|
| 55 | $is_included = True; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | if($is_included) |
---|
| 59 | { |
---|
| 60 | if($p1 == '_UNDEF_' && $p1 != 1) |
---|
| 61 | { |
---|
| 62 | $obj = new $classname; |
---|
| 63 | } |
---|
| 64 | else |
---|
| 65 | { |
---|
| 66 | $input = array($p1,$p2,$p3,$p4,$p5,$p6,$p7,$p8,$p9,$p10,$p11,$p12,$p13,$p14,$p15,$p16); |
---|
| 67 | $i = 1; |
---|
| 68 | $code = '$obj = new ' . $classname . '('; |
---|
| 69 | foreach($input as $test) |
---|
| 70 | { |
---|
| 71 | if(($test == '_UNDEF_' && $test != 1 ) || $i == 17) |
---|
| 72 | { |
---|
| 73 | break; |
---|
| 74 | } |
---|
| 75 | else |
---|
| 76 | { |
---|
| 77 | $code .= '$p' . $i . ','; |
---|
| 78 | } |
---|
| 79 | $i++; |
---|
| 80 | } |
---|
| 81 | $code = substr($code,0,-1) . ');'; |
---|
| 82 | eval($code); |
---|
| 83 | } |
---|
| 84 | /* error_reporting(E_ERROR | E_WARNING | E_PARSE); */ |
---|
| 85 | return $obj; |
---|
| 86 | } |
---|
| 87 | } |
---|
| 88 | |
---|
| 89 | ?> |
---|