public function envoyer() { // Yeeeeeeeeeeeeeeeeeeeeeeha ! Et on envoie ! if ($this->type == "page") { echo Squelette::enrober($this); } else { if ($this->type == "sendfile") { Système_fichiers::envoyer_fichier_directement($this->sendfile_fichier); } else { if ($this->type == "sendprop") { Stockage::get_prop_sendfile($this->sendprop_chemin, $this->sendprop_prop); } else { if ($this->type == "raw") { header("Content-Type: " . $this->raw_mime); echo $this->raw_données; } else { if ($this->type == "redirect") { header("Location: " . $this->redirect_destination); /*echo "TODO : Redirection vers <a href=\"" . $this->redirect_destination . "\">" . $this->redirect_destination . "</a>";*/ } } } } } // TODO : else erreur }
public static function renomer($chemin, $nouveau_nom) { if ($chemin->dernier() == $nouveau_nom) { return true; } if (Permissions::vérifier_permission($chemin->parent(), "nouvelle_page") && Permissions::vérifier_permission($chemin, "supprimer")) { self::désactiver_réécriture($chemin); // TODO : récursivement ! self::activer_réécriture($chemin->renomer($nouveau_nom)); // TODO : récursivement ! return Système_fichiers::déplacer($chemin->get_fs_stockage(), $chemin->renomer($nouveau_nom)->get_fs_stockage()); } else { return false; } }