Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 9c7119fdc29cf2bb306e8684d280cfe7ee78bd96
  • master par défaut
  • 1-baka-export
  • meson
  • assdraw
  • old-master
  • v3.2.2
  • v3.2.1
  • v3.2.0
  • v3.1.3
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.4
  • v3.0.3
  • v3.0.2
  • v3.0.1
  • v3.0.0
  • v2.1.3
  • v2.1.4
  • v2.1.5
  • v2.1.6
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.1.7
26 résultats

video_display.cpp

Blame
    • Thomas Goyne's avatar
      9c7119fd
      Redesign how project metadata is stored in the file · 9c7119fd
      Thomas Goyne a rédigé
      Remove it from the script info section and put it in its own section
      that isn't tracked by undo and make it not stringly typed. Removes the
      need for the gross hack where changes are slipped in just before saving
      to circumvent the undo system, cuts down on the uses of string literals
      to identify fields, and probably improves performance a little.
      9c7119fd
      Historique
      Redesign how project metadata is stored in the file
      Thomas Goyne a rédigé
      Remove it from the script info section and put it in its own section
      that isn't tracked by undo and make it not stringly typed. Removes the
      need for the gross hack where changes are slipped in just before saving
      to circumvent the undo system, cuts down on the uses of string literals
      to identify fields, and probably improves performance a little.
    JeuController.php 1,64 Kio
    <?php
    
    class JeuController extends Controller {
    	public function display() {
    		$slug = $this->route["params"]["slug"]; //cf. le commentaire dans ProfilController.php
    		$this->view->jeu = Jeu::getFromSlug($slug);
    		$this->view->display();
    	}
    
    	public function displayListe() {
    		$this->view->liste = Jeu::getList();
    		$this->view->display();
    	}
    
    	public function displayFormAdd() {
    		$this->view->display();
    	}
    
    	public function addRequest() {
    		if(!isset($_POST['nom']) || !isset($_POST['description'])) { // si l'une des données manque, erreur
    			//appeler une fonction d'erreur
    			echo "<h1>Erreur : variables absentes</h1>";
    			die();
    		}
    
            $data = $_POST;
            $data['slug_jeu'] = self::slugify($_POST['nom']);
    
            $result = Jeu::checkExists($data['slug_jeu']); // vérifie si le jeu n'est pas encore dans la BDD
    
            if($result == 0) { // connexion valide
                Jeu::addRequest($data['nom'], $data['description'], $data['slug_jeu'], 0);// on ajoute le jeu à la BDD avec
                header('Location:requestvalid'); // on redirige vers la  page OK
            }
            else {
                session_start(); // on démarre une session pour avoir accès aux variables superglobales de session
                $_SESSION["addRequestErrCode"] = $result; // on stocke le code d'erreur
                header('Location:../addjeu'); // on redirige vers la page de formulaire (il faut faire un retour dans le dossier parent pour que ça fonctionne)
            }
    
    		//$this->view->display();
    	}
    
        public function displayRequestValid() { // la fonction d'affichage de réussite
            $this->view->display(); // on affiche la page avec le message de réussite
        }
    }