@@ -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 | } |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | $acces_admin = $_SESSION['acces_admin']; |
| 40 | 40 | |
| 41 | 41 | unset($_SESSION['err_ajout_utilisateur']); |
| 42 | - } |
|
| 43 | - else { |
|
| 42 | + } else { |
|
| 44 | 43 | $nom = null; |
| 45 | 44 | $prenom = null; |
| 46 | 45 | $pseudo = null; |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | $contenu_page = $_SESSION['contenu']; |
| 68 | 67 | |
| 69 | 68 | unset($_SESSION['err_modification_contenu']); |
| 70 | - } |
|
| 71 | - else if (($page == "gestion-contenus/modifier-contenu") || ($page == "gestion-contenus/inline")) { |
|
| 69 | + } else if (($page == "gestion-contenus/modifier-contenu") || ($page == "gestion-contenus/inline")) { |
|
| 72 | 70 | $id_page_courante = $_GET['id']; |
| 73 | 71 | |
| 74 | 72 | $contenu->getHeadPage($id_page_courante); |
@@ -85,8 +83,7 @@ discard block |
||
| 85 | 83 | if ($url == "") { |
| 86 | 84 | $url = "index"; |
| 87 | 85 | } |
| 88 | - } |
|
| 89 | - else { |
|
| 86 | + } else { |
|
| 90 | 87 | $balise_title = null; |
| 91 | 88 | $url = null; |
| 92 | 89 | $meta_description = null; |
@@ -124,8 +121,7 @@ discard block |
||
| 124 | 121 | $contenu_dynamique = $config->getContenusDynamique(); |
| 125 | 122 | $responsive = $config->getResponsive(); |
| 126 | 123 | $cache_config = $config->getCache(); |
| 127 | - } |
|
| 128 | - else { |
|
| 124 | + } else { |
|
| 129 | 125 | $config = new \core\Configuration(); |
| 130 | 126 | $nom_site = $config->getNomSite(); |
| 131 | 127 | $url_site = $config->getUrlSite(); |
@@ -161,8 +157,7 @@ discard block |
||
| 161 | 157 | $db_host_prod = $_SESSION["db_host_prod"]; |
| 162 | 158 | |
| 163 | 159 | unset($_SESSION['err_modification_configini']); |
| 164 | - } |
|
| 165 | - else { |
|
| 160 | + } else { |
|
| 166 | 161 | $developpement = $ini["developpment"]; |
| 167 | 162 | |
| 168 | 163 | $db_type_dev = $ini["dev"]["DB_TYPE"]; |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | $gestion_contenu = new \core\admin\contenus\GestionContenus(); |
| 3 | 3 | $droit_acces = new \core\admin\droitsacces\DroitAcces(); |
| 4 | 4 | |
| 5 | - if ((($droit_acces->getDroitAccesContenu("GESTION CONTENU PAGE", $_POST['id_page']) == true) && ($droit_acces->getModifContenu() != 0)) || ($droit_acces->getSuperAdmin() == 1)) { |
|
| 5 | + if ((($droit_acces->getDroitAccesContenu("GESTION CONTENU PAGE", $_POST['id_page']) == true) && ($droit_acces->getModifContenu() != 0)) || ($droit_acces->getSuperAdmin() == 1)) { |
|
| 6 | 6 | |
| 7 | 7 | $gestion_contenu->setModifierContenu($_GET['id_page'], $_GET['contenu']); |
| 8 | 8 | |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $_SESSION['acces_admin'] = $inscription->getAccesAdministration(); |
| 25 | 25 | //$id_liste_droit_acces = $_SESSION['id_liste_droit_acces']; |
| 26 | 26 | \core\HTML\flashmessage\FlashMessage::setFlash("<ul>".$inscription->getErreur()."</ul>"); |
| 27 | - } |
|
| 28 | - else { |
|
| 27 | + } else { |
|
| 29 | 28 | \core\HTML\flashmessage\FlashMessage::setFlash("L'utilisateur ".$inscription->getNom()." ".$inscription->getPrenom()."a bien été inscrit", "success"); |
| 30 | 29 | $inscription->setInscrireUtilisateur(); |
| 31 | 30 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | <button id="supprimer-page-contenu" type="button" class="submit-contenu supprimer-page supprimer open-popup" popup="supprimer-page" href="<?=ADMWEBROOT?>gestion-contenus/modifier-contenu?id=<?=$id_page_courante?>"><i class="fa fa-times"></i>Annuler</button> |
| 20 | 20 | |
| 21 | 21 | |
| 22 | -<?php if ($config->getResponsive() == 1){?> |
|
| 22 | +<?php if ($config->getResponsive() == 1) {?> |
|
| 23 | 23 | <link rel="stylesheet" type="text/css" href="<?=WEBROOT?>admin/views/template/css/foundation-inline.css"> |
| 24 | 24 | <?php }?> |
| 25 | 25 | <link rel="stylesheet" type="text/css" href="<?=TPLWEBROOT?>css/page.css"> |
@@ -35,9 +35,9 @@ discard block |
||
| 35 | 35 | <script> |
| 36 | 36 | CKEDITOR.disableAutoInline = true; |
| 37 | 37 | |
| 38 | - <?php for($i=0 ; $i<$bloc_editable ; $i++):?> |
|
| 38 | + <?php for ($i = 0; $i < $bloc_editable; $i++):?> |
|
| 39 | 39 | var editor<?=$i?> = CKEDITOR.inline("editor<?=$i?>", { customConfig: "<?=WEBROOT?>config/config_ckeditor.js" }); |
| 40 | 40 | CKFinder.setupCKEditor( editor<?=$i?>, "<?=LIBSWEBROOT?>ckfinder/" ); |
| 41 | - <?php endfor;?> |
|
| 41 | + <?php endfor; ?> |
|
| 42 | 42 | </script> |
| 43 | -<?php require_once(ROOT."admin/views/gestion-contenus/js/inline.php");?> |
|
| 44 | 43 | \ No newline at end of file |
| 44 | +<?php require_once(ROOT."admin/views/gestion-contenus/js/inline.php"); ?> |
|
| 45 | 45 | \ No newline at end of file |
@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | $meta_description = $_POST['meta_description']; |
| 11 | 11 | $titre_page = $_POST['titre_page']; |
| 12 | 12 | $parent = $_POST['parent_texte']; |
| 13 | - } |
|
| 14 | - else { |
|
| 13 | + } else { |
|
| 15 | 14 | $contenu_class->getHeadPage($_POST['id_page']); |
| 16 | 15 | $contenu_class->getContenuPage($_POST['id_page']); |
| 17 | 16 | |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | $balise_title = $_POST['balise_title']; |
| 20 | 19 | $url = $_POST['url']; |
| 21 | 20 | $meta_description = $_POST['meta_description']; |
| 22 | - } |
|
| 23 | - else { |
|
| 21 | + } else { |
|
| 24 | 22 | $balise_title = $contenu_class->getBaliseTitle(); |
| 25 | 23 | $url = $contenu_class->getUrl(); |
| 26 | 24 | $meta_description = $contenu_class->getMetaDescription(); |
@@ -29,8 +27,7 @@ discard block |
||
| 29 | 27 | if ($droit_acces->getModifNavigation() != 0) { |
| 30 | 28 | $titre_page = $_POST['titre_page']; |
| 31 | 29 | $parent = $_POST['parent_texte']; |
| 32 | - } |
|
| 33 | - else { |
|
| 30 | + } else { |
|
| 34 | 31 | $titre_page = $contenu_class->getTitre(); |
| 35 | 32 | $parent = $contenu_class->getParent(); |
| 36 | 33 | } |
@@ -41,8 +38,7 @@ discard block |
||
| 41 | 38 | if ((\core\App::getErreur() !== true) && ($gestion_contenu->getErreur() !== true)) { |
| 42 | 39 | \core\HTML\flashmessage\FlashMessage::setFlash("La page ".$_POST['titre_page']." a été mise à jour", "success"); |
| 43 | 40 | } |
| 44 | - } |
|
| 45 | - else { |
|
| 41 | + } else { |
|
| 46 | 42 | \core\HTML\flashmessage\FlashMessage::setFlash("Vous n'avez pas l'autorisation de modifier cette page !"); |
| 47 | 43 | } |
| 48 | 44 | |
@@ -24,8 +24,7 @@ |
||
| 24 | 24 | $_SESSION['acces_admin'] = $inscription->getAccesAdministration(); |
| 25 | 25 | //$id_liste_droit_acces = $_SESSION['id_liste_droit_acces']; |
| 26 | 26 | \core\HTML\flashmessage\FlashMessage::setFlash("<ul>".$inscription->getErreur()."</ul>"); |
| 27 | - } |
|
| 28 | - else { |
|
| 27 | + } else { |
|
| 29 | 28 | \core\HTML\flashmessage\FlashMessage::setFlash("L'utilisateur ".$inscription->getNom()." ".$inscription->getPrenom()."a bien été inscrit", "success"); |
| 30 | 29 | $inscription->setInscrireUtilisateur(); |
| 31 | 30 | } |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | if (isset($datas[$i][2])) { |
| 24 | 24 | $this->$function($datas[$i][1], $datas[$i][2]); |
| 25 | - } |
|
| 26 | - else { |
|
| 25 | + } else { |
|
| 27 | 26 | $this->$function($datas[$i][1]); |
| 28 | 27 | } |
| 29 | 28 | } |
@@ -56,8 +55,7 @@ discard block |
||
| 56 | 55 | protected function getTestRequired($value) { |
| 57 | 56 | if (($value == "") || ($value == null) || (strlen($value) == 0)) { |
| 58 | 57 | return false; |
| 59 | - } |
|
| 60 | - else { |
|
| 58 | + } else { |
|
| 61 | 59 | return true; |
| 62 | 60 | } |
| 63 | 61 | } |
@@ -70,8 +68,7 @@ discard block |
||
| 70 | 68 | protected function getTestLongueur($value, $longeur) { |
| 71 | 69 | if (strlen($value) > $longeur) { |
| 72 | 70 | return true; |
| 73 | - } |
|
| 74 | - else { |
|
| 71 | + } else { |
|
| 75 | 72 | return false; |
| 76 | 73 | } |
| 77 | 74 | } |
@@ -83,8 +80,7 @@ discard block |
||
| 83 | 80 | protected function getTestInt($value) { |
| 84 | 81 | if (is_numeric($value)) { |
| 85 | 82 | return true; |
| 86 | - } |
|
| 87 | - else { |
|
| 83 | + } else { |
|
| 88 | 84 | return false; |
| 89 | 85 | } |
| 90 | 86 | } |
@@ -102,12 +98,10 @@ discard block |
||
| 102 | 98 | if (($required != null) && ($this->getTestRequired($value) === false)) { |
| 103 | 99 | $this->erreur .= "<li>$erreur</li>"; |
| 104 | 100 | return false; |
| 105 | - } |
|
| 106 | - else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) { |
|
| 101 | + } else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) { |
|
| 107 | 102 | $this->erreur .= "<li>$erreur_long</li>"; |
| 108 | 103 | return false; |
| 109 | - } |
|
| 110 | - else { |
|
| 104 | + } else { |
|
| 111 | 105 | $this->$varaible = $value; |
| 112 | 106 | return true; |
| 113 | 107 | } |
@@ -155,8 +149,7 @@ discard block |
||
| 155 | 149 | protected function setVerifRetapeMdp($value) { |
| 156 | 150 | if ($this->mdp == $value) { |
| 157 | 151 | return true; |
| 158 | - } |
|
| 159 | - else { |
|
| 152 | + } else { |
|
| 160 | 153 | $this->erreur .= "<li>Les mots de passent ne correspondent pas</li>"; |
| 161 | 154 | $this->mdp = null; |
| 162 | 155 | return false; |
@@ -186,12 +179,10 @@ discard block |
||
| 186 | 179 | if (($required != null) && ($this->getTestRequired($value) === false)) { |
| 187 | 180 | $this->erreur .= "<li>Le champs E-mail ne peut pas être vide</li>"; |
| 188 | 181 | return false; |
| 189 | - } |
|
| 190 | - else if (!$validator->isValid($value)) { |
|
| 182 | + } else if (!$validator->isValid($value)) { |
|
| 191 | 183 | $this->erreur .= "<li>Le champs E-mail doit être une adresse E-mail valide</li>"; |
| 192 | 184 | return false; |
| 193 | - } |
|
| 194 | - else { |
|
| 185 | + } else { |
|
| 195 | 186 | $this->mail = $value; |
| 196 | 187 | return true; |
| 197 | 188 | } |
@@ -5,20 +5,20 @@ |
||
| 5 | 5 | use core\HTML\flashmessage\FlashMessage; |
| 6 | 6 | use core\Navigation; |
| 7 | 7 | |
| 8 | - class AdminNavigation extends Navigation{ |
|
| 8 | + class AdminNavigation extends Navigation { |
|
| 9 | 9 | |
| 10 | 10 | public function setOrdreNavigation($nav) { |
| 11 | 11 | $dbc = App::getDb(); |
| 12 | 12 | $count_nav = count($nav); |
| 13 | 13 | |
| 14 | - for ($i=0 ; $i<$count_nav ; $i++) { |
|
| 14 | + for ($i = 0; $i < $count_nav; $i++) { |
|
| 15 | 15 | $lien = explode(".", $nav[$i]); |
| 16 | 16 | |
| 17 | 17 | if ($lien[1] == "page") { |
| 18 | - $dbc->update("ordre", $i+1)->from("navigation")->where("ID_page", "=", $lien[0])->set(); |
|
| 18 | + $dbc->update("ordre", $i + 1)->from("navigation")->where("ID_page", "=", $lien[0])->set(); |
|
| 19 | 19 | } |
| 20 | 20 | else { |
| 21 | - $dbc->update("ordre", $i+1)->from("navigation")->where("ID_module", "=", $lien[0])->set(); |
|
| 21 | + $dbc->update("ordre", $i + 1)->from("navigation")->where("ID_module", "=", $lien[0])->set(); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
@@ -16,8 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | if ($lien[1] == "page") { |
| 18 | 18 | $dbc->update("ordre", $i+1)->from("navigation")->where("ID_page", "=", $lien[0])->set(); |
| 19 | - } |
|
| 20 | - else { |
|
| 19 | + } else { |
|
| 21 | 20 | $dbc->update("ordre", $i+1)->from("navigation")->where("ID_module", "=", $lien[0])->set(); |
| 22 | 21 | } |
| 23 | 22 | } |