Exemple #1
0
 /**
  * Entry point, to get page file to include, given page name
  * and optionnal ajax block requested
  *
  * @param string $name
  * @param string $ajaxBlock
  * @return string
  */
 public static function getPageFile($name, $ajaxBlock = null)
 {
     if (Z::$pageName) {
         return Z::returnError("Error : currently processing page " . Z::$pageName . ". Can't process page {$name}");
     }
     Z::$pageName = $name;
     if ($ajaxBlock) {
         if (in_array($ajaxBlock, Z::$blocks)) {
             Z::$ajaxBlock = $ajaxBlock;
         } else {
             return Z::returnError('<p>Le bloc <abbr>AJAX</abbr> « ' . $ajaxBlock . ' » n’est pas autorisé. </p>');
         }
         return Z::findInPath("z-ajax" . Z::$ext);
     }
     return Z::findInPath("-html" . Z::$ext);
 }