@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | foreach ($query as $obj) { |
| 22 | 22 | $params = $obj->mdp_params; |
| 23 | 23 | } |
| 24 | - } |
|
| 25 | - else { |
|
| 24 | + } else { |
|
| 26 | 25 | $params = self::$params; |
| 27 | 26 | } |
| 28 | 27 | |
@@ -74,8 +73,7 @@ discard block |
||
| 74 | 73 | |
| 75 | 74 | if ($id_identite != null) { |
| 76 | 75 | self::setSaveParams("$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20), $id_identite); |
| 77 | - } |
|
| 78 | - else { |
|
| 76 | + } else { |
|
| 79 | 77 | self::$params = "$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20); |
| 80 | 78 | } |
| 81 | 79 | |
@@ -76,8 +76,7 @@ |
||
| 76 | 76 | |
| 77 | 77 | if ($id_page != 0) { |
| 78 | 78 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE ID_page=".$id_page); |
| 79 | - } |
|
| 80 | - else { |
|
| 79 | + } else { |
|
| 81 | 80 | $query = $dbc->query("SELECT balise_title, meta_description, ID_page FROM page WHERE url LIKE '$url'"); |
| 82 | 81 | } |
| 83 | 82 | |
@@ -268,6 +268,10 @@ |
||
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | + /** |
|
| 272 | + * @param string $id |
|
| 273 | + * @param integer $affiche |
|
| 274 | + */ |
|
| 271 | 275 | private function setAjoutLienNavigation($id, $value_id, $affiche) { |
| 272 | 276 | if ($affiche !== null) { |
| 273 | 277 | $nav = new Navigation(); |
@@ -31,7 +31,9 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $query = $dbc->query("SELECT titre FROM page WHERE ID_page=".$parent); |
| 33 | 33 | if ((is_array($query)) && (count($query) > 0)) { |
| 34 | - foreach ($query as $obj) $this->parent_texte = $obj->titre; |
|
| 34 | + foreach ($query as $obj) { |
|
| 35 | + $this->parent_texte = $obj->titre; |
|
| 36 | + } |
|
| 35 | 37 | } |
| 36 | 38 | |
| 37 | 39 | return $this->parent_texte; |
@@ -137,13 +139,11 @@ discard block |
||
| 137 | 139 | $dbc->prepare("INSERT INTO page (titre, contenu, url, meta_description, balise_title, ordre, parent, affiche) VALUES (:titre, :contenu, :url, :meta_description, :balise_title, :ordre, :parent, :affiche)", $value); |
| 138 | 140 | $this->id_page = $dbc->lastInsertId(); |
| 139 | 141 | $this->setAjoutLienNavigation("ID_page", $this->id_page , 1); |
| 140 | - } |
|
| 141 | - else { |
|
| 142 | + } else { |
|
| 142 | 143 | FlashMessage::setFlash("Impossible de créer cette page, veuillez réeseyer dans un moment. Si le problème persiste contactez votre administrateur."); |
| 143 | 144 | $this->erreur = true; |
| 144 | 145 | } |
| 145 | - } |
|
| 146 | - else { |
|
| 146 | + } else { |
|
| 147 | 147 | $this->setErreurContenus($balise_title, $url, $meta_description, $titre_page, $parent, $contenu, $err_balise_title, $err_url, $err_meta_description, $err_titre_page); |
| 148 | 148 | } |
| 149 | 149 | } |
@@ -207,8 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | $dbc->prepare("UPDATE page SET titre=:titre_page, contenu=:contenu, url=:url, meta_description=:meta_description, balise_title=:balise_title, parent=:parent, affiche=:affiche WHERE ID_page=:id_page", $value); |
| 209 | 209 | $this->setModifierLienNavigation("ID_page", $id_page, $this->getParentId($parent), $affiche); |
| 210 | - } |
|
| 211 | - else { |
|
| 210 | + } else { |
|
| 212 | 211 | $this->setErreurContenus($balise_title, $url, $meta_description, $titre_page, $parent, $contenu, $err_balise_title, $err_url, $err_meta_description, $err_titre_page); |
| 213 | 212 | } |
| 214 | 213 | } |
@@ -251,8 +250,7 @@ discard block |
||
| 251 | 250 | FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); |
| 252 | 251 | $this->erreur = true; |
| 253 | 252 | } |
| 254 | - } |
|
| 255 | - else { |
|
| 253 | + } else { |
|
| 256 | 254 | FlashMessage::setFlash("Impossible de supprimer cette page, veuillez contacter votre administrateur pour corriger ce problème"); |
| 257 | 255 | $this->erreur = true; |
| 258 | 256 | } |
@@ -269,8 +267,7 @@ discard block |
||
| 269 | 267 | if ($parent != "") { |
| 270 | 268 | $nav = new Navigation(); |
| 271 | 269 | $nav->setSupprimerLien($id, $id_page); |
| 272 | - } |
|
| 273 | - else if (($affiche == 1) && ($parent == "")) { |
|
| 270 | + } else if (($affiche == 1) && ($parent == "")) { |
|
| 274 | 271 | $this->setAjoutLienNavigation($id, $id_page, $affiche); |
| 275 | 272 | } |
| 276 | 273 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function getBlocEditable($id_page_courante) { |
| 41 | - $dbc= App::getDb(); |
|
| 41 | + $dbc = App::getDb(); |
|
| 42 | 42 | $bloc_editable = 0; |
| 43 | 43 | |
| 44 | 44 | $query = $dbc->select("bloc_editable")->from("page")->where("ID_page", "=", $id_page_courante)->get(); |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | if($no_module === null) { |
| 16 | 16 | $query = $dbc->select()->from("navigation")->orderBy("ordre")->get(); |
| 17 | - } |
|
| 18 | - else { |
|
| 17 | + } else { |
|
| 19 | 18 | $query = $dbc->select()->from("navigation")->where("ID_page", " IS NOT ", "NULL")->orderBy("ordre")->get(); |
| 20 | 19 | } |
| 21 | 20 | |
@@ -23,8 +22,7 @@ discard block |
||
| 23 | 22 | foreach ($query as $obj) { |
| 24 | 23 | if ($obj->ID_page === null) { |
| 25 | 24 | $navigation[] = $this->getLienNavigationModule($obj->ID_module); |
| 26 | - } |
|
| 27 | - else { |
|
| 25 | + } else { |
|
| 28 | 26 | $navigation[] = $this->getLienNavigationPage($obj->ID_page); |
| 29 | 27 | } |
| 30 | 28 | $last_ordre = $obj->ordre; |
@@ -130,8 +130,7 @@ discard block |
||
| 130 | 130 | foreach ($query as $obj) { |
| 131 | 131 | if ($obj->activer == 1) { |
| 132 | 132 | return true; |
| 133 | - } |
|
| 134 | - else { |
|
| 133 | + } else { |
|
| 135 | 134 | return false; |
| 136 | 135 | } |
| 137 | 136 | } |
@@ -183,8 +182,7 @@ discard block |
||
| 183 | 182 | |
| 184 | 183 | if ($activer == 1) { |
| 185 | 184 | $nav->setAjoutLien("ID_module", self::getUrlToId($url)); |
| 186 | - } |
|
| 187 | - else { |
|
| 185 | + } else { |
|
| 188 | 186 | $nav->setSupprimerLien("ID_module", self::getUrlToId($url)); |
| 189 | 187 | } |
| 190 | 188 | } |
@@ -36,12 +36,10 @@ discard block |
||
| 36 | 36 | if ($this->getTestInt($value) === true) { |
| 37 | 37 | $this->acces_administration = $value; |
| 38 | 38 | return true; |
| 39 | - } |
|
| 40 | - else if ($this->getTestInt($value) === false) { |
|
| 39 | + } else if ($this->getTestInt($value) === false) { |
|
| 41 | 40 | $this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>"; |
| 42 | 41 | return false; |
| 43 | - } |
|
| 44 | - else { |
|
| 42 | + } else { |
|
| 45 | 43 | return true; |
| 46 | 44 | } |
| 47 | 45 | |
@@ -59,12 +57,10 @@ discard block |
||
| 59 | 57 | if ($this->getTestInt($value) === true) { |
| 60 | 58 | $this->id_liste_droit_acces = $value; |
| 61 | 59 | return true; |
| 62 | - } |
|
| 63 | - else if ($this->getTestInt($value) === false) { |
|
| 60 | + } else if ($this->getTestInt($value) === false) { |
|
| 64 | 61 | $this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>"; |
| 65 | 62 | return false; |
| 66 | - } |
|
| 67 | - else { |
|
| 63 | + } else { |
|
| 68 | 64 | return true; |
| 69 | 65 | } |
| 70 | 66 | |
@@ -66,8 +66,7 @@ discard block |
||
| 66 | 66 | $this->reload_cache = $obj->reload_cache; |
| 67 | 67 | $this->no_cache = $obj->no_cache; |
| 68 | 68 | } |
| 69 | - } |
|
| 70 | - else { |
|
| 69 | + } else { |
|
| 71 | 70 | $value = [ |
| 72 | 71 | "nom_fichier" => $this->page, |
| 73 | 72 | "reload_cache" => 0 |
@@ -108,16 +107,14 @@ discard block |
||
| 108 | 107 | require_once($this->chemin_cache); |
| 109 | 108 | |
| 110 | 109 | return true; |
| 111 | - } |
|
| 112 | - else { |
|
| 110 | + } else { |
|
| 113 | 111 | if ($this->no_cache == null) { |
| 114 | 112 | ob_start(); |
| 115 | 113 | } |
| 116 | 114 | |
| 117 | 115 | return false; |
| 118 | 116 | } |
| 119 | - } |
|
| 120 | - else { |
|
| 117 | + } else { |
|
| 121 | 118 | return false; |
| 122 | 119 | } |
| 123 | 120 | } |
@@ -55,8 +55,7 @@ discard block |
||
| 55 | 55 | if ($query) { |
| 56 | 56 | $obj = $query->fetchAll(PDO::FETCH_OBJ); |
| 57 | 57 | return $obj; |
| 58 | - } |
|
| 59 | - else { |
|
| 58 | + } else { |
|
| 60 | 59 | FlashMessage::setFlash("Une erreur est survenue en executant cette requette : ".$req); |
| 61 | 60 | } |
| 62 | 61 | } |
@@ -84,8 +83,7 @@ discard block |
||
| 84 | 83 | public function rechercherEgalite($table, $champ, $value, $id_table = null, $id = null) { |
| 85 | 84 | if ($id == null) { |
| 86 | 85 | $query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'"); |
| 87 | - } |
|
| 88 | - else { |
|
| 86 | + } else { |
|
| 89 | 87 | $query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value' AND $id_table != $id"); |
| 90 | 88 | } |
| 91 | 89 | |
@@ -94,9 +92,10 @@ discard block |
||
| 94 | 92 | $nb = $obj["nb"]; |
| 95 | 93 | } |
| 96 | 94 | |
| 97 | - if ((isset($nb)) && ($nb != 0)) return true; |
|
| 98 | - } |
|
| 99 | - else { |
|
| 95 | + if ((isset($nb)) && ($nb != 0)) { |
|
| 96 | + return true; |
|
| 97 | + } |
|
| 98 | + } else { |
|
| 100 | 99 | return false; |
| 101 | 100 | } |
| 102 | 101 | } |
@@ -113,8 +112,7 @@ discard block |
||
| 113 | 112 | |
| 114 | 113 | if ($query->rowCount() > 0) { |
| 115 | 114 | return true; |
| 116 | - } |
|
| 117 | - else { |
|
| 115 | + } else { |
|
| 118 | 116 | return false; |
| 119 | 117 | } |
| 120 | 118 | } |
@@ -21,8 +21,12 @@ discard block |
||
| 21 | 21 | //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
| 22 | 22 | public function __construct() { |
| 23 | 23 | //On test si dossier temporaire + modules a la racines existes bien sinon on les crées |
| 24 | - if (!file_exists(ROOT."temp")) mkdir(ROOT."temp"); |
|
| 25 | - if (!file_exists(ROOT."modules")) mkdir(ROOT."modules"); |
|
| 24 | + if (!file_exists(ROOT."temp")) { |
|
| 25 | + mkdir(ROOT."temp"); |
|
| 26 | + } |
|
| 27 | + if (!file_exists(ROOT."modules")) { |
|
| 28 | + mkdir(ROOT."modules"); |
|
| 29 | + } |
|
| 26 | 30 | } |
| 27 | 31 | //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
| 28 | 32 | |
@@ -95,8 +99,7 @@ discard block |
||
| 95 | 99 | } |
| 96 | 100 | |
| 97 | 101 | FlashMessage::setFlash("Votre module a bien été ajouté au site.", "success"); |
| 98 | - } |
|
| 99 | - else { |
|
| 102 | + } else { |
|
| 100 | 103 | FlashMessage::setFlash("Le module n'a pas pu être correctement téléchargé et installé, veuillez réesseyer dans un instant"); |
| 101 | 104 | } |
| 102 | 105 | } |
@@ -131,8 +134,7 @@ discard block |
||
| 131 | 134 | |
| 132 | 135 | FlashMessage::setFlash("Votre module a bien été mis à jour", "success"); |
| 133 | 136 | } |
| 134 | - } |
|
| 135 | - else { |
|
| 137 | + } else { |
|
| 136 | 138 | FlashMessage::setFlash("Impossible de télécharger la mise à jour, veuillez réesseyer dans un instant"); |
| 137 | 139 | } |
| 138 | 140 | } |
@@ -144,8 +146,7 @@ discard block |
||
| 144 | 146 | private function setSupprimerArchiveTemp() { |
| 145 | 147 | if (unlink(TEMPROOT.$this->nom_fichier) == true) { |
| 146 | 148 | return true; |
| 147 | - } |
|
| 148 | - else { |
|
| 149 | + } else { |
|
| 149 | 150 | return false; |
| 150 | 151 | } |
| 151 | 152 | } |
@@ -190,7 +191,11 @@ discard block |
||
| 190 | 191 | $objects = scandir($url); |
| 191 | 192 | foreach ($objects as $object) { |
| 192 | 193 | if ($object != "." && $object != "..") { |
| 193 | - if (filetype($url."/".$object) == "dir") $this->supprimerDossier($url."/".$object); else unlink($url."/".$object); |
|
| 194 | + if (filetype($url."/".$object) == "dir") { |
|
| 195 | + $this->supprimerDossier($url."/".$object); |
|
| 196 | + } else { |
|
| 197 | + unlink($url."/".$object); |
|
| 198 | + } |
|
| 194 | 199 | } |
| 195 | 200 | } |
| 196 | 201 | reset($objects); |