Ejemplo n.º 1
0
 function SetTemplate($name)
 {
     // Make sure requested template exists
     $requestedTemplate = 'templates/' . $name . '.php';
     if (Filesystem::FileExistsInIncludePath($requestedTemplate)) {
         $this->templateFile = $requestedTemplate;
     } else {
         return false;
     }
 }
Ejemplo n.º 2
0
 function SetLayout($name)
 {
     // Make sure requested layout exists
     $requestedLayout = 'layouts/' . $name . '.php';
     if (Filesystem::FileExistsInIncludePath($requestedLayout)) {
         $this->templateFile = $requestedLayout;
     } else {
         return false;
     }
 }
Ejemplo n.º 3
0
 function GetNewModule($name, $item = '', $hasParent = false)
 {
     global $_JAM;
     if (!$_JAM->availableModules[$name]) {
         trigger_error("Couldn't create new module because '" . $name . "' module does not exist", E_USER_ERROR);
     }
     $className = ucfirst($name) . 'Module';
     $classPath = 'modules/' . $name . '/' . $className . '.php';
     if (Filesystem::FileExistsInIncludePath($classPath)) {
         // There is a custom module class; load it and create new instance
         require_once $classPath;
         $module = new $className($name, $item);
     } else {
         // There is no custom module class; use plain Module class
         $module = new Module($name, $item);
     }
     // Don't run FinishSetup() if module has parent; will run later in NestModule
     // FIXME: Kludgy.
     if (!$hasParent) {
         $module->FinishSetup();
     }
     return $module;
 }