protected function renderTemplatePHPPath($module, $action = "create", $switch = "default", $subTemplate = false) { $modulePath = ClsNaanalApplication::getAbsModulePath($module); $path = null; if (file_exists($modulePath . "{$action}/{$switch}.php")) { $path = $modulePath . "{$action}/"; } else { if (file_exists($modulePath . "{$action}.php")) { $path = $modulePath; } } if (isset(ClsConfig::$TEMPLATE_PHP_PATH) && !empty(ClsConfig::$TEMPLATE_PHP_PATH)) { if (file_exists(ClsConfig::$TEMPLATE_PHP_PATH . "{$module}/{$action}/{$switch}.php")) { $path = ClsConfig::$TEMPLATE_PHP_PATH . "{$module}/{$action}/"; } else { if (file_exists(ClsConfig::$TEMPLATE_PHP_PATH . "{$module}/{$action}.php")) { $path = ClsConfig::$TEMPLATE_PHP_PATH . "{$module}/"; } } } return $path; }
public static function loadClass($class) { static $arrClassPath = array(); if (!isset($arrClassPath[$class])) { $libpath = NAANAL_PATH_LIB; $naanalPath = AUIEO_FRAMEWORK_PATH; $module = false; $classPrefix = substr($class, 0, 3); if ($classPrefix == "Cls" && $class[3] == "W" && ctype_upper($class[4])) { $module = substr($class, 4); $module = strtolower($module); } else { if ($classPrefix == "Cls" && $class[3] == "U" && ctype_upper($class[4])) { $module = substr($class, 4); $module = strtolower($module); } else { if ($classPrefix == "Cls") { $module = substr($class, 3); $module = strtolower($module); } else { } } } if ($module) { $path = ClsNaanalApplication::getAbsModulePath($module); if ($path) { if (file_exists($path . $class . ".php")) { $arrClassPath[$class] = $path . $class . ".php"; } else { if (file_exists("wrapper/" . $class . ".php")) { $arrClassPath[$class] = "wrapper/" . $class . ".php"; } else { if (file_exists($class . ".php")) { $arrClassPath[$class] = $class . ".php"; } } } } else { } } } if (empty($arrClassPath[$class]) || !file_exists($arrClassPath[$class])) { //self::$arrError[]=array("error"=>"class ({$class}) does not exist"); return false; } include_once $arrClassPath[$class]; return true; }