Login   Register  
PHP Classes
elePHPant
Icontem

File: framework/Controller_v4.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of sunish  >  RSPA  >  framework/Controller_v4.php  >  Download  
File: framework/Controller_v4.php
Role: Example script
Content type: text/plain
Description: Controller_v4.php
Class: RSPA
Process browser events on the server using AJAX
Author: By
Last change:
Date: 2006-07-20 10:57
Size: 2,888 bytes
 

Contents

Class file image Download
<?php
/**
*
*  Author : Sunish Kumar M.V
*
*  This is licenced under LGPL licence.

**/

require_once("rspaconf.inc.php");

    
$className $_REQUEST['__class'];
    
$methordName =  $_REQUEST['__methord'];

    
// Wenn Pfad übermittelt wurde
        
if (!empty($_REQUEST['__pfad'])){$X_Pfad base64_decode($_REQUEST['__pfad']);}else{$X_Pfad $RSPA['class_folder'];}
        if (
$_REQUEST['__include_file']){$_REQUEST['__include_file'] = base64_decode($_REQUEST['__include_file']);}

 include (
"../components/Form.class.php");

 
$filename $X_Pfad.$className.$RSPA['class_extension'];
 
 require_once(
$filename);

 
if ( 
class_exists($className) ){
    eval (
'$t = new ' $className '();');
    
$t->initialize();

    
// Eventuelle Parameter berücksichtigen
       
$parameter "";
       if(!empty(
$_REQUEST['__parameters'])){
          
$arg =  $_REQUEST['__parameters'];
              
$indx count($arg);
             
$ar1 array_fill($indx9'');
             
$arg array_merge($arg,$ar1);
             
          foreach (
$arg as $id => $value){
             if (
$value){
                if (
$parameter){$parameter .= "','" $value;}else{$parameter .= $value;}
             }
             }
         }

         eval (
'$t->' $methordName '(\'' $parameter '\');');


    if( (( isset(
$_REQUEST['__autocomplete']))?$_REQUEST['__autocomplete']:"") == "yes"){
        print(
$t->getAutoCompleteChoice());
        
    }
    else {
        
header('Content-type: text/xml');
        print(
$t->getXml());
    }
 }
 
//print "..." . $_REQUEST['__methord'] . "::::";
 /*
 if ( class_exists($_REQUEST['__class']) ){
    eval ("$t = new " . $_REQUEST['__class'] . "();");
    eval ("$t->initialize();");
    eval ("$t->" . $_REQUEST['__methord'] . "();");
    
    header('Content-type: text/xml');
    print($t->getXml());
 }else{
    print "Klasse bzw. Methode existiert nicht.";
 }
   */
 /*
 
 $class = new ReflectionClass($className);
 $inst = $class->newInstance();
 $method = new ReflectionMethod($className, "initialize");
 $method->invoke($inst);
 
 // $inst->initialize();
 

 $method = new ReflectionMethod($className, $methordName);

 if(! empty($_REQUEST['__parameters'])){
     
     if(method_exists($inst,"invokeArgs")){
         $arg =  $_REQUEST['__parameters'];
         $method->invokeArgs($inst,$arg);
     }
     else{
         //Invokes for max 10 parameters 
         
         $arg =  $_REQUEST['__parameters'];
         
         $indx = count($arg);
         $ar1 = array_fill($indx, 9, '');
         $arg = array_merge($arg,$ar1);
         $method->invoke($inst,$arg[0],$arg[1],$arg[2],$arg[3],$arg[4],$arg[5],$arg[6],$arg[7],$arg[8],$arg[9]);
     }
 }
 else {
     $method->invoke($inst);
 }
 
 if( (( isset($_REQUEST['__autocomplete']))?$_REQUEST['__autocomplete']:"") == "yes"){
     print($inst->getAutoCompleteChoice());
     
 }
 else{
     header('Content-type: text/xml');
     print($inst->getXml());
 }
 */
?>