@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | if (isset($_GET['page'])) { |
31 | 31 | $titre_page = "Administration du site"; |
32 | 32 | $description_page = "Administration du site"; |
33 | - } |
|
34 | - else { |
|
33 | + } else { |
|
35 | 34 | $titre_page = "Administration du site"; |
36 | 35 | $description_page = "Administration du site"; |
37 | 36 | } |
@@ -61,25 +60,21 @@ discard block |
||
61 | 60 | //si c'est un controleur de base on va cerhcer dans core/admin |
62 | 61 | if ($core !== false) { |
63 | 62 | require_once(ROOT.$lien.".php"); |
64 | - } |
|
65 | - else if ($module !== false) { |
|
63 | + } else if ($module !== false) { |
|
66 | 64 | $explode = explode("/", $lien, 3); |
67 | 65 | |
68 | 66 | require_once(ROOT.$explode[0]."/".$explode[1]."/admin/controller/".$explode[2].".php"); |
69 | - } |
|
70 | - else { |
|
67 | + } else { |
|
71 | 68 | require_once("admin/controller/".$lien.".php"); |
72 | 69 | } |
73 | 70 | } |
74 | 71 | //pour la page de login |
75 | 72 | else if ($page == "login") { |
76 | 73 | require("admin/views/template/login_admin.php"); |
77 | - } |
|
78 | - else { |
|
74 | + } else { |
|
79 | 75 | if (!isset($_SESSION["idlogin".CLEF_SITE])) { |
80 | 76 | Connexion::setConnexion(1, WEBROOT."administrator/login"); |
81 | - } |
|
82 | - else { |
|
77 | + } else { |
|
83 | 78 | if (\core\functions\ChaineCaractere::FindInString($page, "modules/") == true) { |
84 | 79 | //utilisé pour initialiser les modules |
85 | 80 | $page_module = $page; |
@@ -94,8 +89,7 @@ discard block |
||
94 | 89 | if (($droit_acces->getDroitAccesPage("gestion-comptes/index") == false) && ($page == "gestion-comptes")) { |
95 | 90 | FlashMessage::setFlash("L'accès à cette page n'est pas activé, veuillez contacter votre administrateur pour y avoir accès"); |
96 | 91 | header("location:".WEBROOT."administrator"); |
97 | - } |
|
98 | - else if (($droit_acces->getDroitAccesPage("gestion-droits-acces/index") == false) && ($page == "gestion-droits-acces")) { |
|
92 | + } else if (($droit_acces->getDroitAccesPage("gestion-droits-acces/index") == false) && ($page == "gestion-droits-acces")) { |
|
99 | 93 | FlashMessage::setFlash("L'accès à cette page n'est pas activé, veuillez contacter votre administrateur pour y avoir accès"); |
100 | 94 | header("location:".WEBROOT."administrator"); |
101 | 95 | } |
@@ -103,8 +97,7 @@ discard block |
||
103 | 97 | if ($droit_acces->getDroitAccesPage($page) == false) { |
104 | 98 | FlashMessage::setFlash("Vous n'avez pas les droits pour accéder à cette page, contacter votre gérant pour y avoir accès"); |
105 | 99 | header("location:".WEBROOT."administrator"); |
106 | - } |
|
107 | - else { |
|
100 | + } else { |
|
108 | 101 | $cache = new \core\Cache($page, 1); |
109 | 102 | $admin = new Admin($_SESSION["idlogin".CLEF_SITE]); |
110 | 103 | |
@@ -116,14 +109,12 @@ discard block |
||
116 | 109 | } |
117 | 110 | } |
118 | 111 | } |
119 | - } |
|
120 | - else { |
|
112 | + } else { |
|
121 | 113 | Connexion::setConnexion(1, WEBROOT."administrator/login"); |
122 | 114 | |
123 | 115 | if (!isset($_SESSION["idlogin".CLEF_SITE])) { |
124 | 116 | Connexion::setConnexion(1, WEBROOT."administrator/login"); |
125 | - } |
|
126 | - else { |
|
117 | + } else { |
|
127 | 118 | $page = "index"; |
128 | 119 | $admin = new Admin($_SESSION["idlogin".CLEF_SITE]); |
129 | 120 | require(ROOT."admin/controller/initialise_all.php"); |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | $contenu->getContenuPage(); |
40 | 40 | $contenu_page = $contenu->getContenu(); |
41 | - } |
|
42 | - else { |
|
41 | + } else { |
|
43 | 42 | $contenu->getHeadPage(1); |
44 | 43 | $titre_page = $contenu->getBaliseTitle(); |
45 | 44 | $description_page = $contenu->getMetaDescription(); |
@@ -75,17 +74,14 @@ discard block |
||
75 | 74 | //si c'est un controleur de base on va cerhcer dans core/admin |
76 | 75 | if ($core !== false) { |
77 | 76 | require_once(ROOT.$lien.".php"); |
78 | - } |
|
79 | - else if ($module !== false) { |
|
77 | + } else if ($module !== false) { |
|
80 | 78 | $explode = explode("/", $lien, 3); |
81 | 79 | |
82 | 80 | require_once(ROOT.$explode[0]."/".$explode[1]."/app/controller/".$explode[2].".php"); |
83 | - } |
|
84 | - else { |
|
81 | + } else { |
|
85 | 82 | require_once("app/controller/".$lien.".php"); |
86 | 83 | } |
87 | - } |
|
88 | - else { |
|
84 | + } else { |
|
89 | 85 | $cache = new \core\Cache($page); |
90 | 86 | |
91 | 87 | $router_module = new RouterModule(); |
@@ -95,8 +91,7 @@ discard block |
||
95 | 91 | if ($router_module->getController() != "") { |
96 | 92 | require_once(MODULEROOT.$router_module->getController()); |
97 | 93 | } |
98 | - } |
|
99 | - else { |
|
94 | + } else { |
|
100 | 95 | $explode = explode("/", $page); |
101 | 96 | $page = "app/views/".end($explode); |
102 | 97 | |
@@ -111,8 +106,7 @@ discard block |
||
111 | 106 | } |
112 | 107 | $cache->setEnd(); |
113 | 108 | } |
114 | - } |
|
115 | - else { |
|
109 | + } else { |
|
116 | 110 | $page = "app/views/index"; |
117 | 111 | require("app/controller/initialise_all.php"); |
118 | 112 | require("app/views/template/principal.php"); |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | //$id_liste_droit_acces = $_SESSION['id_liste_droit_acces']; |
48 | 48 | |
49 | 49 | unset($_SESSION['err_ajout_utilisateur']); |
50 | - } |
|
51 | - else { |
|
50 | + } else { |
|
52 | 51 | $nom = null; |
53 | 52 | $prenom = null; |
54 | 53 | $pseudo = null; |
@@ -75,8 +74,7 @@ discard block |
||
75 | 74 | $contenu_page = $_SESSION['contenu']; |
76 | 75 | |
77 | 76 | unset($_SESSION['err_modification_contenu']); |
78 | - } |
|
79 | - else if ($page == "gestion-contenus/modifier-contenu") { |
|
77 | + } else if ($page == "gestion-contenus/modifier-contenu") { |
|
80 | 78 | $id_page_courante = $_GET['id']; |
81 | 79 | |
82 | 80 | $contenu->getHeadPage($id_page_courante); |
@@ -89,8 +87,7 @@ discard block |
||
89 | 87 | $parent_courant = $contenu->getParent(); |
90 | 88 | $texte_parent_courant = $gestion_contenu->getParentTexte($parent_courant); |
91 | 89 | $contenu_page = $contenu->getContenu(); |
92 | - } |
|
93 | - else { |
|
90 | + } else { |
|
94 | 91 | $balise_title = null; |
95 | 92 | $url = null; |
96 | 93 | $meta_description = null; |
@@ -131,8 +128,7 @@ discard block |
||
131 | 128 | $contenu_dynamique = $config->getContenusDynamique(); |
132 | 129 | $responsive = $config->getResponsive(); |
133 | 130 | $cache_config = $config->getCache(); |
134 | - } |
|
135 | - else { |
|
131 | + } else { |
|
136 | 132 | $config = new \core\Configuration(); |
137 | 133 | $nom_site = $config->getNomSite(); |
138 | 134 | $url_site = $config->getUrlSite(); |
@@ -156,8 +152,7 @@ discard block |
||
156 | 152 | |
157 | 153 | if (isset($_SESSION['err_modification_configini'])) { |
158 | 154 | |
159 | - } |
|
160 | - else { |
|
155 | + } else { |
|
161 | 156 | $developpement = $ini["developpment"]; |
162 | 157 | |
163 | 158 | $db_type_dev = $ini["dev"]["DB_TYPE"]; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <nav class="nav-page"> |
2 | 2 | <div class="inner"> |
3 | 3 | <ul> |
4 | - <?php for ($i=0 ; $i<count($id_page) ; $i++): ?> |
|
4 | + <?php for ($i = 0; $i < count($id_page); $i++): ?> |
|
5 | 5 | <?php if ($parent[$i] == 0): ?> |
6 | 6 | <li><a href="<?=ADMWEBROOT?>gestion-contenus/modifier-contenu?id=<?=$id_page[$i]?>"><?=$titre[$i]?></a> |
7 | 7 | <ul> |
8 | - <?php for ($j=0 ; $j<count($id_page) ; $j++): ?> |
|
8 | + <?php for ($j = 0; $j < count($id_page); $j++): ?> |
|
9 | 9 | <?php if ($parent[$j] == $id_page[$i]): ?> |
10 | 10 | <li><a href="<?=ADMWEBROOT?>gestion-contenus/modifier-contenu?id=<?=$id_page[$j]?>"><?=$titre[$j]?></a></li> |
11 | - <?php endif;?> |
|
12 | - <?php endfor;?> |
|
11 | + <?php endif; ?> |
|
12 | + <?php endfor; ?> |
|
13 | 13 | </ul> |
14 | 14 | </li> |
15 | - <?php endif;?> |
|
16 | - <?php endfor;?> |
|
15 | + <?php endif; ?> |
|
16 | + <?php endfor; ?> |
|
17 | 17 | </ul> |
18 | 18 | </div> |
19 | 19 | </nav> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | <td> |
48 | 48 | <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) == true) { ?> |
49 | 49 | <a class="open-popup" popup="popup-delete-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/supprimer?id_module=<?=$gestion_module_page_syst->getIdModule()[$i]?>">Supprimer</a> |
50 | - <?php }else{ ?> |
|
50 | + <?php } else{ ?> |
|
51 | 51 | <a class="installer-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/installer?url=<?=$gestion_module_page_syst->getUrlTelechargement()[$i]?>">Installer</a> |
52 | 52 | <?php }?> |
53 | 53 | </td> |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | <td> |
91 | 91 | <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page->getNom()[$i]) == true) { ?> |
92 | 92 | <a class="supprimer open-popup" popup="popup-delete-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/supprimer?id_module=<?=$gestion_module_page->getIdModule()[$i]?>">Supprimer</a> |
93 | - <?php }else{ ?> |
|
93 | + <?php } else{ ?> |
|
94 | 94 | <a href="<?=ADMWEBROOT?>controller/core/modules/installation/installer?url=<?=$gestion_module_page->getUrlTelechargement()[$i]?>">Installer</a> |
95 | 95 | <?php }?> |
96 | 96 | </td> |
@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | <script src="<?=LIBSWEBROOT?>checkbox/js/anim.js"></script> |
8 | 8 | <link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>popup/css/style.css"> |
9 | 9 | <script src="<?=LIBSWEBROOT?>popup/js/popup.js"></script> |
10 | -<?php require_once(ROOT."admin/views/configuration/js/configuration.php");?> |
|
11 | -<?php require_once('header.php');?> |
|
10 | +<?php require_once(ROOT."admin/views/configuration/js/configuration.php"); ?> |
|
11 | +<?php require_once('header.php'); ?> |
|
12 | 12 | |
13 | 13 | <div class="inner"> |
14 | - <?php require_once(LIBSROOT."barre_chargement/index.php");?> |
|
14 | + <?php require_once(LIBSROOT."barre_chargement/index.php"); ?> |
|
15 | 15 | <div class="contenu modifier-contenu"> |
16 | 16 | <h2>Ajouter un module</h2> |
17 | 17 | <form action="<?=ADMWEBROOT?>controller/core/modules/installation/installer" method="get" id="form-install"> |
@@ -36,23 +36,23 @@ discard block |
||
36 | 36 | </tr> |
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | - <?php for ($i=0 ; $i<count($gestion_module_page_syst->getIdModule()) ; $i++):?> |
|
39 | + <?php for ($i = 0; $i < count($gestion_module_page_syst->getIdModule()); $i++):?> |
|
40 | 40 | <tr> |
41 | 41 | <td><?=$gestion_module_page_syst->getNom()[$i]?></td> |
42 | 42 | <td> |
43 | 43 | <label for="<?=$gestion_module_page_syst->getUrl()[$i]?>" class="checkbox-perso switched"> |
44 | - <input type="checkbox" class="test-check" id="<?=$gestion_module_page_syst->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true): ?>checked<?php endif;?> <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === false):?>disabled<?php endif;?>> |
|
44 | + <input type="checkbox" class="test-check" id="<?=$gestion_module_page_syst->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true): ?>checked<?php endif; ?> <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === false):?>disabled<?php endif; ?>> |
|
45 | 45 | </label> |
46 | 46 | </td> |
47 | 47 | <td> |
48 | 48 | <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === true) { ?> |
49 | 49 | <a class="open-popup" popup="popup-delete-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/supprimer?id_module=<?=$gestion_module_page_syst->getIdModule()[$i]?>">Supprimer</a> |
50 | - <?php }else{ ?> |
|
50 | + <?php } else { ?> |
|
51 | 51 | <a class="installer-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/installer?url=<?=$gestion_module_page_syst->getUrlTelechargement()[$i]?>">Installer</a> |
52 | 52 | <?php }?> |
53 | 53 | </td> |
54 | 54 | <td> |
55 | - <?php if ((\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === true) && (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true)){ ?> |
|
55 | + <?php if ((\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === true) && (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true)) { ?> |
|
56 | 56 | <?php if (\core\modules\GestionModule::getModuleAJour($gestion_module_page_syst->getNom()[$i]) != 1) { ?> |
57 | 57 | <a href="<?=ADMWEBROOT?>controller/core/modules/installation/update?id_module=<?=$gestion_module_page_syst->getIdModule()[$i]?>" class="open-popup" popup="popup-update-module">Mettre à jour</a> |
58 | 58 | <?php } else {?> |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | <?php }?> |
64 | 64 | </td> |
65 | 65 | </tr> |
66 | - <?php endfor;?> |
|
66 | + <?php endfor; ?> |
|
67 | 67 | </tbody> |
68 | 68 | </table> |
69 | 69 | </div> |
@@ -79,23 +79,23 @@ discard block |
||
79 | 79 | </tr> |
80 | 80 | </thead> |
81 | 81 | <tbody> |
82 | - <?php for ($i=0 ; $i<count($gestion_module_page->getIdModule()) ; $i++):?> |
|
82 | + <?php for ($i = 0; $i < count($gestion_module_page->getIdModule()); $i++):?> |
|
83 | 83 | <tr> |
84 | 84 | <td><?=$gestion_module_page->getNom()[$i]?></td> |
85 | 85 | <td> |
86 | 86 | <label for="<?=$gestion_module_page->getUrl()[$i]?>" class="checkbox-perso switched"> |
87 | - <input type="checkbox" class="test-check" id="<?=$gestion_module_page->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page->getNom()[$i]) === true): ?>checked<?php endif;?>> |
|
87 | + <input type="checkbox" class="test-check" id="<?=$gestion_module_page->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page->getNom()[$i]) === true): ?>checked<?php endif; ?>> |
|
88 | 88 | </label> |
89 | 89 | </td> |
90 | 90 | <td> |
91 | 91 | <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page->getNom()[$i]) === true) { ?> |
92 | 92 | <a class="supprimer open-popup" popup="popup-delete-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/supprimer?id_module=<?=$gestion_module_page->getIdModule()[$i]?>">Supprimer</a> |
93 | - <?php }else{ ?> |
|
93 | + <?php } else { ?> |
|
94 | 94 | <a href="<?=ADMWEBROOT?>controller/core/modules/installation/installer?url=<?=$gestion_module_page->getUrlTelechargement()[$i]?>">Installer</a> |
95 | 95 | <?php }?> |
96 | 96 | </td> |
97 | 97 | </tr> |
98 | - <?php endfor;?> |
|
98 | + <?php endfor; ?> |
|
99 | 99 | </tbody> |
100 | 100 | </table> |
101 | 101 | </div> |
@@ -22,11 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | if ($type == "error") { |
24 | 24 | $icone = "<i class='fa fa-close'></i>"; |
25 | - } |
|
26 | - else if ($type == "success") { |
|
25 | + } else if ($type == "success") { |
|
27 | 26 | $icone = "<i class='fa fa-check'></i>"; |
28 | - } |
|
29 | - else { |
|
27 | + } else { |
|
30 | 28 | $icone = "<i class='fa fa-info'></i>"; |
31 | 29 | } |
32 | 30 | |
@@ -55,16 +53,14 @@ discard block |
||
55 | 53 | if (strstr($_SERVER['SCRIPT_NAME'], "index.php")) { |
56 | 54 | //definit le chemin sachant que l'on part de index.php |
57 | 55 | $chemin = str_replace("\\", "/", str_replace("index.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/"); |
58 | - } |
|
59 | - else { |
|
56 | + } else { |
|
60 | 57 | //definit le chemin sachant que l'on part de admin.php |
61 | 58 | $chemin = str_replace("\\", "/", str_replace("admin.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/"); |
62 | 59 | } |
63 | 60 | |
64 | 61 | |
65 | 62 | require("view/index.php"); |
66 | - } |
|
67 | - else { |
|
63 | + } else { |
|
68 | 64 | echo("$icone $type : $message"); |
69 | 65 | } |
70 | 66 | unset($_SESSION['flash']); |
@@ -43,13 +43,13 @@ |
||
43 | 43 | //-------------------------- GETTER ----------------------------------------------------------------------------// |
44 | 44 | |
45 | 45 | public function getOldImage() { |
46 | - return $this->old_image; |
|
46 | + return $this->old_image; |
|
47 | 47 | } |
48 | 48 | public function getCheminImage() { |
49 | - return $this->chemin_image; |
|
49 | + return $this->chemin_image; |
|
50 | 50 | } |
51 | 51 | public function getErreur() { |
52 | - return $this->erreur; |
|
52 | + return $this->erreur; |
|
53 | 53 | } |
54 | 54 | public function getNomImage() { |
55 | 55 | return $this->nom_image; |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | $explode = explode("/", $this->chemin_image); |
59 | 59 | $this->image = end($explode); |
60 | 60 | return $this->image; |
61 | - } |
|
62 | - else { |
|
61 | + } else { |
|
63 | 62 | $this->erreur = "Impossible de trouver votre image, vuellez réessayer dans un instant"; |
64 | 63 | return false; |
65 | 64 | } |
@@ -89,8 +88,7 @@ discard block |
||
89 | 88 | $this->erreur = "Vous devez obligatoirement ajouter une image"; |
90 | 89 | return false; |
91 | 90 | } |
92 | - } |
|
93 | - else { |
|
91 | + } else { |
|
94 | 92 | //test si il y a deja une img |
95 | 93 | if ($old_image_req != null) { |
96 | 94 | $query = $dbc->query($old_image_req); |
@@ -108,12 +106,10 @@ discard block |
||
108 | 106 | if (!in_array(substr($image, -3), $this->autorized_extention)) { |
109 | 107 | $this->erreur = "Votre image ne comporte pas l'extension jpg, png, jpeg, gif, JPG, PNG, JPEG, GIF"; |
110 | 108 | return false; |
111 | - } |
|
112 | - else if (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max)) { |
|
109 | + } else if (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max)) { |
|
113 | 110 | $this->erreur = "Problème dans les dimensions ou taille de l'image."; |
114 | 111 | return false; |
115 | - } |
|
116 | - else { |
|
112 | + } else { |
|
117 | 113 | $uniqid = uniqid(); |
118 | 114 | |
119 | 115 | if (move_uploaded_file($_FILES[$name]['tmp_name'], $this->dossier_image."/".$uniqid.substr($image, -4))) { |
@@ -128,8 +124,7 @@ discard block |
||
128 | 124 | } |
129 | 125 | |
130 | 126 | return true; |
131 | - } |
|
132 | - else { |
|
127 | + } else { |
|
133 | 128 | $this->erreur = "Impossible d'envoyer votre image sur le serveur, veuillez réessayer dans une instant, si l'erreur se reproduit, contactez votre administrateur"; |
134 | 129 | } |
135 | 130 | } |
@@ -155,8 +150,7 @@ discard block |
||
155 | 150 | $resize->saveImage($this->dossier_image."/".$img_resize, 100); |
156 | 151 | |
157 | 152 | $this->nom_image = $img_resize; |
158 | - } |
|
159 | - else { |
|
153 | + } else { |
|
160 | 154 | $this->nom_image = null; |
161 | 155 | } |
162 | 156 | |
@@ -181,8 +175,7 @@ discard block |
||
181 | 175 | unlink($this->dossier_image."/".end($old_image)); |
182 | 176 | return true; |
183 | 177 | } |
184 | - } |
|
185 | - else if ($nom_image !== null) { |
|
178 | + } else if ($nom_image !== null) { |
|
186 | 179 | |
187 | 180 | if (is_array($nom_image)) { |
188 | 181 | $count = count($nom_image); |
@@ -191,27 +184,22 @@ discard block |
||
191 | 184 | |
192 | 185 | if (unlink($chemin_img)) { |
193 | 186 | $success = true; |
194 | - } |
|
195 | - else { |
|
187 | + } else { |
|
196 | 188 | if (unlink($this->chemin_image)) { |
197 | 189 | $success = true; |
198 | - } |
|
199 | - else { |
|
190 | + } else { |
|
200 | 191 | $this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site"; |
201 | 192 | $success = false; |
202 | 193 | } |
203 | 194 | } |
204 | 195 | } |
205 | - } |
|
206 | - else { |
|
196 | + } else { |
|
207 | 197 | if (unlink($this->dossier_image."/".$nom_image)) { |
208 | 198 | $success = true; |
209 | - } |
|
210 | - else { |
|
199 | + } else { |
|
211 | 200 | if (unlink($this->chemin_image)) { |
212 | 201 | $success = true; |
213 | - } |
|
214 | - else { |
|
202 | + } else { |
|
215 | 203 | $this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site"; |
216 | 204 | $success = false; |
217 | 205 | } |
@@ -219,8 +207,7 @@ discard block |
||
219 | 207 | } |
220 | 208 | |
221 | 209 | return $success; |
222 | - } |
|
223 | - else { |
|
210 | + } else { |
|
224 | 211 | $this->erreur = "Impossible de supprimer cette image"; |
225 | 212 | return false; |
226 | 213 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | { |
22 | 22 | // *** Class variables |
23 | 23 | private $image; |
24 | - private $width; |
|
25 | - private $height; |
|
24 | + private $width; |
|
25 | + private $height; |
|
26 | 26 | private $imageResized; |
27 | 27 | |
28 | 28 | function __construct($fileName) |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | // *** Open up the file |
31 | 31 | $this->image = $this->openImage($fileName); |
32 | 32 | |
33 | - // *** Get width and height |
|
34 | - $this->width = imagesx($this->image); |
|
35 | - $this->height = imagesy($this->image); |
|
33 | + // *** Get width and height |
|
34 | + $this->width = imagesx($this->image); |
|
35 | + $this->height = imagesy($this->image); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | ## -------------------------------------------------------- |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | public function saveImage($savePath, $imageQuality="100") |
207 | 207 | { |
208 | 208 | // *** Get extension |
209 | - $extension = strrchr($savePath, '.'); |
|
210 | - $extension = strtolower($extension); |
|
209 | + $extension = strrchr($savePath, '.'); |
|
210 | + $extension = strtolower($extension); |
|
211 | 211 | |
212 | 212 | switch($extension) |
213 | 213 | { |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | private function crop($optimalWidth, $optimalHeight, $newWidth, $newHeight) |
196 | 196 | { |
197 | 197 | // *** Find center - this will be used for the crop |
198 | - $cropStartX = ( $optimalWidth / 2) - ( $newWidth /2 ); |
|
199 | - $cropStartY = ( $optimalHeight/ 2) - ( $newHeight/2 ); |
|
198 | + $cropStartX = ($optimalWidth / 2) - ($newWidth / 2); |
|
199 | + $cropStartY = ($optimalHeight / 2) - ($newHeight / 2); |
|
200 | 200 | |
201 | 201 | $crop = $this->imageResized; |
202 | 202 | |
203 | 203 | // *** Now crop from center to exact requested size |
204 | - $this->imageResized = imagecreatetruecolor($newWidth , $newHeight); |
|
205 | - imagecopyresampled($this->imageResized, $crop , 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight , $newWidth, $newHeight); |
|
204 | + $this->imageResized = imagecreatetruecolor($newWidth, $newHeight); |
|
205 | + imagecopyresampled($this->imageResized, $crop, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | ## -------------------------------------------------------- |
@@ -210,13 +210,13 @@ discard block |
||
210 | 210 | * @param string $savePath |
211 | 211 | * @param string $imageQuality |
212 | 212 | */ |
213 | - public function saveImage($savePath, $imageQuality="100") |
|
213 | + public function saveImage($savePath, $imageQuality = "100") |
|
214 | 214 | { |
215 | 215 | // *** Get extension |
216 | 216 | $extension = strrchr($savePath, '.'); |
217 | 217 | $extension = strtolower($extension); |
218 | 218 | |
219 | - switch($extension) |
|
219 | + switch ($extension) |
|
220 | 220 | { |
221 | 221 | case '.jpg': |
222 | 222 | case '.jpeg': |
@@ -139,19 +139,19 @@ |
||
139 | 139 | |
140 | 140 | private function getSizeByAuto($newWidth, $newHeight) |
141 | 141 | { |
142 | - if ($this->height < $this->width) |
|
143 | - // *** Image to be resized is wider (landscape) |
|
142 | + if ($this->height < $this->width) { |
|
143 | + // *** Image to be resized is wider (landscape) |
|
144 | 144 | { |
145 | 145 | $optimalWidth = $newWidth; |
146 | - $optimalHeight = $this->getSizeByFixedWidth($newWidth); |
|
147 | 146 | } |
148 | - elseif ($this->height > $this->width) |
|
149 | - // *** Image to be resized is taller (portrait) |
|
147 | + $optimalHeight = $this->getSizeByFixedWidth($newWidth); |
|
148 | + } elseif ($this->height > $this->width) { |
|
149 | + // *** Image to be resized is taller (portrait) |
|
150 | 150 | { |
151 | 151 | $optimalWidth = $this->getSizeByFixedHeight($newHeight); |
152 | - $optimalHeight = $newHeight; |
|
153 | 152 | } |
154 | - else |
|
153 | + $optimalHeight = $newHeight; |
|
154 | + } else |
|
155 | 155 | // *** Image to be resizerd is a square |
156 | 156 | { |
157 | 157 | if ($newHeight < $newWidth) { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | - namespace core\admin\droitsacces; |
|
2 | + namespace core\admin\droitsacces; |
|
3 | 3 | |
4 | - use core\App; |
|
4 | + use core\App; |
|
5 | 5 | |
6 | 6 | class GestionDroitAcces extends DroitAcces { |
7 | 7 | //pour les droit_acces standard |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | - //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
27 | + //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
28 | 28 | public function __construct($id_liste_droit_acces=null) { |
29 | 29 | $dbc = App::getDb(); |
30 | 30 | |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | $this->id_liste_droit_acces = $id_liste_droit_acces; |
65 | 65 | } |
66 | 66 | } |
67 | - //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
67 | + //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------// |
|
68 | 68 | |
69 | 69 | |
70 | 70 | |
71 | - //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
71 | + //-------------------------- GETTER ----------------------------------------------------------------------------// |
|
72 | 72 | //pour les droit_acces standard |
73 | 73 | public function getIdListeDroitAcces() { |
74 | 74 | return $this->id_liste_droit_acces; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return $this->pseudo; |
109 | 109 | } |
110 | 110 | public function getNbUser(){ |
111 | - return $this->nb_user; |
|
111 | + return $this->nb_user; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @param $id_liste_droit_acces |
117 | 117 | */ |
118 | 118 | public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){ |
119 | - $dbc = \core\App::getDb(); |
|
119 | + $dbc = \core\App::getDb(); |
|
120 | 120 | |
121 | 121 | if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
122 | 122 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param $id_liste_droit_acces |
161 | 161 | */ |
162 | 162 | public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){ |
163 | - $dbc = \core\App::getDb(); |
|
163 | + $dbc = \core\App::getDb(); |
|
164 | 164 | |
165 | 165 | if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
166 | 166 | |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | $this->setListeDroitAccesDetailPage($id_page, $titre_page); |
180 | 180 | } |
181 | 181 | } |
182 | - //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
182 | + //-------------------------- FIN GETTER ----------------------------------------------------------------------------// |
|
183 | 183 | |
184 | 184 | |
185 | 185 | |
186 | - //-------------------------- SETTER ----------------------------------------------------------------------------// |
|
186 | + //-------------------------- SETTER ----------------------------------------------------------------------------// |
|
187 | 187 | private function setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user){ |
188 | 188 | $this->id_liste_droit_acces = $id_liste_droit_acces; |
189 | 189 | $this->nom_liste = $nom_liste; |
@@ -205,4 +205,4 @@ discard block |
||
205 | 205 | $this->prenom = $prenom; |
206 | 206 | } |
207 | 207 | //-------------------------- FIN SETTER ----------------------------------------------------------------------------// |
208 | - } |
|
209 | 208 | \ No newline at end of file |
209 | + } |
|
210 | 210 | \ No newline at end of file |
@@ -59,8 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $this->setListeDroitAcces($id_liste_droit_acces, $nom_liste, $nb_droit_acces, $nb_droit_acces_page, $nb_user); |
61 | 61 | } |
62 | - } |
|
63 | - else { |
|
62 | + } else { |
|
64 | 63 | $this->id_liste_droit_acces = $id_liste_droit_acces; |
65 | 64 | } |
66 | 65 | } |
@@ -118,7 +117,9 @@ discard block |
||
118 | 117 | public function getListeDroitAccesDetailDroit($id_liste_droit_acces=null){ |
119 | 118 | $dbc = \core\App::getDb(); |
120 | 119 | |
121 | - if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
120 | + if ($id_liste_droit_acces == null) { |
|
121 | + $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
122 | + } |
|
122 | 123 | |
123 | 124 | $query = $dbc->query("SELECT * FROM droit_acces, liaison_liste_droit WHERE |
124 | 125 | droit_acces.ID_droit_acces = liaison_liste_droit.ID_droit_acces AND |
@@ -139,7 +140,9 @@ discard block |
||
139 | 140 | public function getListeDroitAccesDetailUser($id_liste_droit_acces=null) { |
140 | 141 | $dbc = \core\App::getDb(); |
141 | 142 | |
142 | - if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
143 | + if ($id_liste_droit_acces == null) { |
|
144 | + $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
145 | + } |
|
143 | 146 | |
144 | 147 | //récupératin des utilisateurs qui sont dans cette liste |
145 | 148 | $query = $dbc->query("SELECT * FROM identite WHERE liste_droit=".$id_liste_droit_acces); |
@@ -162,7 +165,9 @@ discard block |
||
162 | 165 | public function getListeDroitAccesDetailPage($id_liste_droit_acces=null){ |
163 | 166 | $dbc = \core\App::getDb(); |
164 | 167 | |
165 | - if ($id_liste_droit_acces == null) $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
168 | + if ($id_liste_droit_acces == null) { |
|
169 | + $id_liste_droit_acces = $this->id_liste_droit_acces; |
|
170 | + } |
|
166 | 171 | |
167 | 172 | //récupération des droits d'acces pour les pages |
168 | 173 | $query = $dbc->query("SELECT * FROM liste_droit_acces, droit_acces_page, page WHERE |