Exemplo n.º 1
0
 /**
  * Finds class given the template name.
  */
 private function findClass()
 {
     if (!$this->ajaxMode) {
         $classFilename = PathManager::screenClass($this->screenTemplate);
         if (file_exists($classFilename)) {
             $this->screenClassPath = $classFilename;
             $tmp1 = explode('/', $this->screenTemplate);
             $size = sizeof($tmp1);
             $this->screenClassName = $tmp1[$size - 1];
         } else {
             $tmppath = PathManager::screenClassDir();
             ## generate list of possible classes:
             $template = $this->screenTemplate;
             $path44 = explode('/', $template);
             for ($i = sizeof($path44) - 1; $i >= 0; $i--) {
                 $tmppath2 = "";
                 for ($k = 0; $k < $i; $k++) {
                     $tmppath2 .= $path44[$k] . "/";
                 }
                 $tmppath2 .= "DefaultScreen.php";
                 $classFiles[] = $tmppath2;
             }
             foreach ($classFiles as $classFile) {
                 if (file_exists($tmppath . $classFile)) {
                     $this->screenClassPath = $tmppath . $classFile;
                     $this->screenClassName = "DefaultScreen";
                     break;
                 }
             }
         }
     } else {
         $ttt = ModuleHelpers::findModuleClass($this->moduleTemplate);
         $this->moduleClassName = $ttt[0];
         $this->moduleClassPath = $ttt[1];
     }
 }