original_string: public function Index($Module, $AppFolder = '', $DeliveryType = '') {
        if (!$DeliveryType)
           $this->DeliveryType(DELIVERY_TYPE_VIEW);
        
        $ModuleClassExists = class_exists($Module);
  
        if ($ModuleClassExists) {
           // Make sure that the class implements Gdn_IModule
           $ReflectionClass = new ReflectionClass($Module);
           if ($ReflectionClass->implementsInterface("Gdn_IModule")) {
              // Set the proper application folder on this controller so that things render properly.
              if ($AppFolder) {
                 $this->ApplicationFolder = $AppFolder;
              } else {
                 $Filename = str_replace('\\', '/', substr($ReflectionClass->getFileName(), strlen(PATH_ROOT)));
                 // Figure our the application folder for the module.
                 $Parts = explode('/', trim($Filename, '/'));
                 if ($Parts[0] == 'applications') {
                    $this->ApplicationFolder = $Parts[1];
                 }
              }
  
  
              $ModuleInstance = new $Module($this);
              $ModuleInstance->Visible = TRUE;
              
              $WhiteList = array('Limit', 'Help');
              foreach ($this->Request->Get() as $Key => $Value) {
                 if (in_array($Key, $WhiteList)) {
                    $ModuleInstance->$Key = $Value;
                 }
              }
              
              $this->SetData('_Module', $ModuleInstance);
              $this->Render('Index', FALSE, 'dashboard');
              return;
           }
        }
        throw NotFoundException($Module);
     }
code: public function Index($Module, $AppFolder = '', $DeliveryType = '') {
        if (!$DeliveryType)
           $this->DeliveryType(DELIVERY_TYPE_VIEW);
        
        $ModuleClassExists = class_exists($Module);
  
        if ($ModuleClassExists) {
           // Make sure that the class implements Gdn_IModule
           $ReflectionClass = new ReflectionClass($Module);
           if ($ReflectionClass->implementsInterface("Gdn_IModule")) {
              // Set the proper application folder on this controller so that things render properly.
              if ($AppFolder) {
                 $this->ApplicationFolder = $AppFolder;
              } else {
                 $Filename = str_replace('\\', '/', substr($ReflectionClass->getFileName(), strlen(PATH_ROOT)));
                 // Figure our the application folder for the module.
                 $Parts = explode('/', trim($Filename, '/'));
                 if ($Parts[0] == 'applications') {
                    $this->ApplicationFolder = $Parts[1];
                 }
              }
  
  
              $ModuleInstance = new $Module($this);
              $ModuleInstance->Visible = TRUE;
              
              $WhiteList = array('Limit', 'Help');
              foreach ($this->Request->Get() as $Key => $Value) {
                 if (in_array($Key, $WhiteList)) {
                    $ModuleInstance->$Key = $Value;
                 }
              }
              
              $this->SetData('_Module', $ModuleInstance);
              $this->Render('Index', FALSE, 'dashboard');
              return;
           }
        }
        throw NotFoundException($Module);
     }
code_tokens: public function Index ( $ Module , $ AppFolder = '' , $ DeliveryType = '' ) { if ( ! $ DeliveryType ) $ this -> DeliveryType ( DELIVERY_TYPE_VIEW ) ; $ ModuleClassExists = class_exists ( $ Module ) ; if ( $ ModuleClassExists ) { // Make sure that the class implements Gdn_IModule $ ReflectionClass = new ReflectionClass ( $ Module ) ; if ( $ ReflectionClass -> implementsInterface ( "Gdn_IModule" ) ) { // Set the proper application folder on this controller so that things render properly. if ( $ AppFolder ) { $ this -> ApplicationFolder = $ AppFolder ; } else { $ Filename = str_replace ( '\\' , '/' , substr ( $ ReflectionClass -> getFileName ( ) , strlen ( PATH_ROOT ) ) ) ; // Figure our the application folder for the module. $ Parts = explode ( '/' , trim ( $ Filename , '/' ) ) ; if ( $ Parts [ 0 ] == 'applications' ) { $ this -> ApplicationFolder = $ Parts [ 1 ] ; } } $ ModuleInstance = new $ Module ( $ this ) ; $ ModuleInstance -> Visible = TRUE ; $ WhiteList = array ( 'Limit' , 'Help' ) ; foreach ( $ this -> Request -> Get ( ) as $ Key => $ Value ) { if ( in_array ( $ Key , $ WhiteList ) ) { $ ModuleInstance -> $ Key = $ Value ; } } $ this -> SetData ( '_Module' , $ ModuleInstance ) ; $ this -> Render ( 'Index' , FALSE , 'dashboard' ) ; return ; } } throw NotFoundException ( $ Module ) ; }
docstring: Creates and renders an instance of a module.
docstring_tokens: Creates and renders an instance of a module .