www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

admin-index.php (936B)


      1 <?php
      2 
      3 class AdminIndex {
      4 	public static function action($chemin, $action, $paramètres) {
      5 		if (isset($paramètres["vue"])) {
      6 			return self::vue($chemin, $paramètres["vue"]);
      7 		} else {
      8 			return self::vue($chemin);
      9 		}
     10 	}
     11 	
     12 	public static function vue($chemin, $vue = "normal") {
     13 		if ($vue == "normal") {
     14 			$ret = '';
     15 			$ret .= '<h2>Administration</h2>';
     16 			$ret .= '<ul>';
     17 			foreach (Stockage::liste_enfants($chemin) as $k) {
     18 				if (Stockage::get_prop($k, "inclure_administration") == "oui") {
     19 					$ret .= '<li>';
     20 					$ret .= '<a href="' . $k->get_url() . '">'; // TODO : escape l'url !
     21 					$ret .= Stockage::get_prop($k, "titre");
     22 					$ret .= '</a>';
     23 					$ret .= '</li>';
     24 				}
     25 			}
     26 			$ret .= '</ul>';
     27 			return new Page($ret, Stockage::get_prop($chemin, "nom_site"));
     28 		}
     29 		return new Page('',''); // TODO : devrait renvoyer une page d'erreur !
     30 	}
     31 }
     32 
     33 Modules::enregister_module("AdminIndex", "admin-index", "vue");
     34 
     35 ?>