diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-26 22:48:49 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-26 22:48:49 +0100 |
| commit | 959527bb712fcd05351d8b4b52ff17786baad454 (patch) | |
| tree | 459f66a07e443a971930e5aa3bce257c33079f20 | |
| parent | e73ea91a5999dc2cbadc00dfda18c839ef1a158b (diff) | |
| download | cms-959527bb712fcd05351d8b4b52ff17786baad454.zip | |
modification du nom et plus seulement de l'URL des entrées "URL" du menu, header/footer: renommage de classes et input absents du HTML sans être adminHEADmain
| -rw-r--r-- | public/css/head.css | 22 | ||||
| -rw-r--r-- | public/css/menu.css | 12 | ||||
| -rw-r--r-- | public/js/Input.js (renamed from public/js/InputFile.js) | 50 | ||||
| -rw-r--r-- | public/js/InputText.js | 48 | ||||
| -rw-r--r-- | public/js/menu.js | 78 | ||||
| -rw-r--r-- | src/controller/MenuAndPathsController.php | 19 | ||||
| -rw-r--r-- | src/model/Model.php | 3 | ||||
| -rw-r--r-- | src/router.php | 4 | ||||
| -rw-r--r-- | src/view/FooterBuilder.php | 20 | ||||
| -rw-r--r-- | src/view/HeadBuilder.php | 3 | ||||
| -rw-r--r-- | src/view/HeaderBuilder.php | 33 | ||||
| -rw-r--r-- | src/view/MenuBuilder.php | 26 | ||||
| -rw-r--r-- | src/view/templates/footer.php | 20 | ||||
| -rw-r--r-- | src/view/templates/header.php | 30 |
14 files changed, 146 insertions, 222 deletions
diff --git a/public/css/head.css b/public/css/head.css index 4206044..dab81a8 100644 --- a/public/css/head.css +++ b/public/css/head.css | |||
| @@ -49,7 +49,7 @@ header | |||
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | .site_title | 52 | .header_center_col |
| 53 | { | 53 | { |
| 54 | background-color: #ffffff7f; | 54 | background-color: #ffffff7f; |
| 55 | border-radius: 10px; | 55 | border-radius: 10px; |
| @@ -81,25 +81,15 @@ header a | |||
| 81 | color: unset; /* ne plus hériter */ | 81 | color: unset; /* ne plus hériter */ |
| 82 | text-decoration: none; | 82 | text-decoration: none; |
| 83 | } | 83 | } |
| 84 | .editing_zone > div | ||
| 85 | { | ||
| 86 | /*display: inline;*/ /* à l'ancienne */ | ||
| 87 | } | ||
| 88 | /*.header_right_col | 84 | /*.header_right_col |
| 89 | {}*/ | 85 | {}*/ |
| 90 | .social | 86 | #header_social img |
| 91 | { | ||
| 92 | /*align-self: end;*/ | ||
| 93 | /*padding: 4px;*/ | ||
| 94 | } | ||
| 95 | .social a img | ||
| 96 | { | 87 | { |
| 97 | width: 25px; | 88 | width: 28px; |
| 98 | background-color: #ffffffb3; | 89 | background-color: rgba(255, 255, 255, 0.7); |
| 99 | border-radius: 50%; | 90 | border-radius: 50%; |
| 100 | } | 91 | } |
| 101 | 92 | #header_social img:hover | |
| 102 | .social img:hover | ||
| 103 | { | 93 | { |
| 104 | background-color: yellow; | 94 | background-color: yellow; |
| 105 | } | 95 | } \ No newline at end of file |
diff --git a/public/css/menu.css b/public/css/menu.css index ac77d50..0dfb840 100644 --- a/public/css/menu.css +++ b/public/css/menu.css | |||
| @@ -58,7 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | .menu button | 59 | .menu button |
| 60 | { | 60 | { |
| 61 | margin: 5px; | 61 | margin: 4px 0; |
| 62 | } | 62 | } |
| 63 | .menu_entry_checkbox | 63 | .menu_entry_checkbox |
| 64 | { | 64 | { |
| @@ -109,15 +109,11 @@ | |||
| 109 | flex-wrap: wrap; | 109 | flex-wrap: wrap; |
| 110 | align-items: center; | 110 | align-items: center; |
| 111 | } | 111 | } |
| 112 | .menu .url | 112 | .menu .url_content input |
| 113 | { | ||
| 114 | text-wrap: nowrap; | ||
| 115 | } | ||
| 116 | .menu .url input[type=url] | ||
| 117 | { | 113 | { |
| 118 | width: 50%; | 114 | width: 50%; |
| 119 | } | 115 | } |
| 120 | 116 | ||
| 121 | @media screen and (min-width: 80rem) { | 117 | /*@media screen and (min-width: 80rem) { |
| 122 | i{} | 118 | i{} |
| 123 | } \ No newline at end of file | 119 | }*/ \ No newline at end of file |
diff --git a/public/js/InputFile.js b/public/js/Input.js index e676037..0b6912b 100644 --- a/public/js/InputFile.js +++ b/public/js/Input.js | |||
| @@ -1,27 +1,36 @@ | |||
| 1 | // étendre une classe parente avec InputFile? | 1 | class Input{ |
| 2 | class InputFile{ | ||
| 3 | constructor(name){ | 2 | constructor(name){ |
| 4 | this.name = name; | 3 | this.name = name; |
| 4 | /*const name_array = name.split('_'); | ||
| 5 | this.node = name_array[0]; | ||
| 6 | this.what = name_array[1];*/ | ||
| 5 | this.parent = document.getElementById(name); | 7 | this.parent = document.getElementById(name); |
| 6 | } | 8 | } |
| 7 | open(){ | 9 | open(){ |
| 8 | this.parent.querySelector('#' + this.name + '_img').classList.add('hidden'); | 10 | this.parent.querySelector('#' + this.name + '_content').classList.add('hidden'); |
| 9 | this.parent.querySelector('#' + this.name + '_input').classList.remove('hidden'); | 11 | this.parent.querySelector('#' + this.name + '_input').classList.remove('hidden'); |
| 10 | this.parent.querySelector('#' + this.name + '_open').classList.add('hidden'); | 12 | this.parent.querySelector('#' + this.name + '_open').classList.add('hidden'); |
| 11 | this.parent.querySelector('#' + this.name + '_submit').classList.remove('hidden'); | 13 | this.parent.querySelector('#' + this.name + '_submit').classList.remove('hidden'); |
| 12 | this.parent.querySelector('#' + this.name + '_cancel').classList.remove('hidden'); | 14 | this.parent.querySelector('#' + this.name + '_cancel').classList.remove('hidden'); |
| 13 | } | 15 | } |
| 14 | close(){ | 16 | close(){ |
| 15 | this.parent.querySelector('#' + this.name + '_img').classList.remove('hidden'); | 17 | this.parent.querySelector('#' + this.name + '_content').classList.remove('hidden'); |
| 16 | this.parent.querySelector('#' + this.name + '_input').classList.add('hidden'); | 18 | this.parent.querySelector('#' + this.name + '_input').classList.add('hidden'); |
| 17 | this.parent.querySelector('#' + this.name + '_open').classList.remove('hidden'); | 19 | this.parent.querySelector('#' + this.name + '_open').classList.remove('hidden'); |
| 18 | this.parent.querySelector('#' + this.name + '_submit').classList.add('hidden'); | 20 | this.parent.querySelector('#' + this.name + '_submit').classList.add('hidden'); |
| 19 | this.parent.querySelector('#' + this.name + '_cancel').classList.add('hidden'); | 21 | this.parent.querySelector('#' + this.name + '_cancel').classList.add('hidden'); |
| 20 | } | 22 | } |
| 23 | cancel(){ | ||
| 24 | this.close(); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | class InputFile extends Input{ | ||
| 21 | submit(){ | 29 | submit(){ |
| 22 | const file = this.parent.querySelector('#' + this.name + '_input').files[0]; | 30 | const file = this.parent.querySelector('#' + this.name + '_input').files[0]; |
| 23 | if(!file){ | 31 | if(!file){ |
| 24 | console.error("Erreur: aucun fichier sélectionné."); | 32 | console.error("Erreur: aucun fichier sélectionné."); |
| 33 | toastNotify("Erreur: aucun fichier sélectionné."); | ||
| 25 | return; | 34 | return; |
| 26 | } | 35 | } |
| 27 | const form_data = new FormData(); | 36 | const form_data = new FormData(); |
| @@ -34,9 +43,7 @@ class InputFile{ | |||
| 34 | .then(response => response.json()) | 43 | .then(response => response.json()) |
| 35 | .then(data => { | 44 | .then(data => { |
| 36 | if(data.success){ | 45 | if(data.success){ |
| 37 | this.parent.querySelector('#' + this.name + '_img').src = data.location; | 46 | // cas particuliers |
| 38 | |||
| 39 | // cas particulier | ||
| 40 | if(this.name === 'head_favicon'){ | 47 | if(this.name === 'head_favicon'){ |
| 41 | const link = document.querySelector('link[rel="icon"]'); | 48 | const link = document.querySelector('link[rel="icon"]'); |
| 42 | link.type = data.mime_type; | 49 | link.type = data.mime_type; |
| @@ -46,6 +53,7 @@ class InputFile{ | |||
| 46 | document.querySelector('header').style.backgroundImage = "url('" + data.location + "')"; | 53 | document.querySelector('header').style.backgroundImage = "url('" + data.location + "')"; |
| 47 | } | 54 | } |
| 48 | 55 | ||
| 56 | this.parent.querySelector('#' + this.name + '_content').src = data.location; | ||
| 49 | this.close(); | 57 | this.close(); |
| 50 | } | 58 | } |
| 51 | else{ | 59 | else{ |
| @@ -56,7 +64,33 @@ class InputFile{ | |||
| 56 | console.error('Erreur:', error); | 64 | console.error('Erreur:', error); |
| 57 | }); | 65 | }); |
| 58 | } | 66 | } |
| 59 | cancel(){ | 67 | } |
| 68 | |||
| 69 | class InputText extends Input{ | ||
| 70 | submit(){ | ||
| 71 | const new_text = this.parent.querySelector('#' + this.name + '_input').value; | ||
| 72 | |||
| 73 | fetch('index.php?head_foot_text=' + this.name, { | ||
| 74 | method: 'POST', | ||
| 75 | headers: { 'Content-Type': 'application/json' }, | ||
| 76 | body: JSON.stringify({new_text: new_text}) | ||
| 77 | }) | ||
| 78 | .then(response => response.json()) | ||
| 79 | .then(data => { | ||
| 80 | if(data.success){ | ||
| 81 | this.parent.querySelector('#' + this.name + '_content').innerHTML = new_text; | ||
| 82 | this.close(); | ||
| 83 | } | ||
| 84 | else{ | ||
| 85 | console.error("Erreur: le serveur n'a pas enregistré le nouveau texte."); | ||
| 86 | } | ||
| 87 | }) | ||
| 88 | .catch(error => { | ||
| 89 | console.error('Erreur:', error); | ||
| 90 | }); | ||
| 91 | } | ||
| 92 | cancel(){ // surcharge | ||
| 93 | this.parent.querySelector('#' + this.name + '_input').value = this.parent.querySelector('#' + this.name + '_content').innerHTML; | ||
| 60 | this.close(); | 94 | this.close(); |
| 61 | } | 95 | } |
| 62 | } \ No newline at end of file | 96 | } \ No newline at end of file |
diff --git a/public/js/InputText.js b/public/js/InputText.js deleted file mode 100644 index 79f0398..0000000 --- a/public/js/InputText.js +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | // s'en servir dans menu et chemin | ||
| 2 | // étendre un classe parente avec InputText? | ||
| 3 | class InputText{ | ||
| 4 | constructor(name){ | ||
| 5 | this.name = name; | ||
| 6 | this.parent = document.getElementById(name); | ||
| 7 | } | ||
| 8 | open(){ | ||
| 9 | this.parent.querySelector('#' + this.name + '_span').classList.add('hidden'); | ||
| 10 | this.parent.querySelector('#' + this.name + '_input').classList.remove('hidden'); | ||
| 11 | this.parent.querySelector('#' + this.name + '_open').classList.add('hidden'); | ||
| 12 | this.parent.querySelector('#' + this.name + '_submit').classList.remove('hidden'); | ||
| 13 | this.parent.querySelector('#' + this.name + '_cancel').classList.remove('hidden'); | ||
| 14 | } | ||
| 15 | close(){ | ||
| 16 | this.parent.querySelector('#' + this.name + '_span').classList.remove('hidden'); | ||
| 17 | this.parent.querySelector('#' + this.name + '_input').classList.add('hidden'); | ||
| 18 | this.parent.querySelector('#' + this.name + '_open').classList.remove('hidden'); | ||
| 19 | this.parent.querySelector('#' + this.name + '_submit').classList.add('hidden'); | ||
| 20 | this.parent.querySelector('#' + this.name + '_cancel').classList.add('hidden'); | ||
| 21 | } | ||
| 22 | submit(){ | ||
| 23 | const new_text = this.parent.querySelector('#' + this.name + '_input').value; | ||
| 24 | |||
| 25 | fetch('index.php?head_foot_text=' + this.name, { | ||
| 26 | method: 'POST', | ||
| 27 | headers: { 'Content-Type': 'application/json' }, | ||
| 28 | body: JSON.stringify({new_text: new_text}) | ||
| 29 | }) | ||
| 30 | .then(response => response.json()) | ||
| 31 | .then(data => { | ||
| 32 | if(data.success){ | ||
| 33 | this.parent.querySelector('#' + this.name + '_span').innerHTML = new_text; | ||
| 34 | this.close(); | ||
| 35 | } | ||
| 36 | else{ | ||
| 37 | console.error("Erreur: le serveur n'a pas enregistré le nouveau texte."); | ||
| 38 | } | ||
| 39 | }) | ||
| 40 | .catch(error => { | ||
| 41 | console.error('Erreur:', error); | ||
| 42 | }); | ||
| 43 | } | ||
| 44 | cancel(){ | ||
| 45 | this.parent.querySelector('#' + this.name + '_input').value = this.parent.querySelector('#' + this.name + '_span').innerHTML; | ||
| 46 | this.close(); | ||
| 47 | } | ||
| 48 | } \ No newline at end of file | ||
diff --git a/public/js/menu.js b/public/js/menu.js index ef58c42..5e02387 100644 --- a/public/js/menu.js +++ b/public/js/menu.js | |||
| @@ -147,22 +147,27 @@ function checkMenuEntry(page_id){ | |||
| 147 | }); | 147 | }); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | // seul la modification des URL est possible pour l'instant, les noms des entrées de menu attendront | 150 | function editUrl(page_id, selector){ |
| 151 | function editUrlEntry(page_id){ | ||
| 152 | const parent_div = document.getElementById(page_id); | 151 | const parent_div = document.getElementById(page_id); |
| 153 | const url_input = parent_div.querySelector('.url').querySelector('input').value; | 152 | const input_data = parent_div.querySelector('.' + selector).querySelector('input').value; |
| 154 | 153 | ||
| 155 | fetch('index.php?menu_edit=edit_url_entry', { | 154 | fetch('index.php?menu_edit=url_edit', { |
| 156 | method: 'POST', | 155 | method: 'POST', |
| 157 | headers: { | 156 | headers: { |
| 158 | 'Content-Type': 'application/json' | 157 | 'Content-Type': 'application/json' |
| 159 | }, | 158 | }, |
| 160 | body: JSON.stringify({ id: page_id, url_input: url_input }) | 159 | body: JSON.stringify({ id: page_id, field: selector, input_data: input_data }) |
| 161 | }) | 160 | }) |
| 162 | .then(response => response.json()) | 161 | .then(response => response.json()) |
| 163 | .then(data => { | 162 | .then(data => { |
| 164 | if(data.success){ | 163 | if(data.success){ |
| 165 | findParentByTagName(document.getElementById('m_' + page_id), 'a').href = data.url_input; // MAJ menu | 164 | // MAJ menu |
| 165 | if(selector === 'url_name'){ | ||
| 166 | document.getElementById('m_' + page_id).innerHTML = data.url_data; | ||
| 167 | } | ||
| 168 | else if(selector === 'url_content'){ | ||
| 169 | findParentByTagName(document.getElementById('m_' + page_id), 'a').href = data.url_data; | ||
| 170 | } | ||
| 166 | toastNotify("Nouvelle adresse enregistrée avec succès") | 171 | toastNotify("Nouvelle adresse enregistrée avec succès") |
| 167 | } | 172 | } |
| 168 | else{ | 173 | else{ |
| @@ -173,63 +178,4 @@ function editUrlEntry(page_id){ | |||
| 173 | .catch(error => { | 178 | .catch(error => { |
| 174 | console.error('Erreur:', error); | 179 | console.error('Erreur:', error); |
| 175 | }); | 180 | }); |
| 176 | } | 181 | } \ No newline at end of file |
| 177 | |||
| 178 | |||
| 179 | |||
| 180 | // code à recycler pour pouvoir modifier le nom de l'entrée de menu correspondant aux liens | ||
| 181 | /*function editUrlEntry(page_id){ | ||
| 182 | const parent_div = document.getElementById(page_id); | ||
| 183 | parent_div.querySelector('i').classList.add('hidden'); | ||
| 184 | parent_div.querySelector('.url').querySelector('input').classList.remove('hidden'); | ||
| 185 | parent_div.querySelector('#edit-i' + page_id).classList.add('hidden'); | ||
| 186 | parent_div.querySelector('#delete-i' + page_id).querySelector('input[type=image]').classList.add('hidden'); | ||
| 187 | parent_div.querySelector('#cancel-i' + page_id).querySelector('button').classList.remove('hidden'); | ||
| 188 | parent_div.querySelector('#submit-i' + page_id).querySelector('input[type=submit]').classList.remove('hidden'); | ||
| 189 | } | ||
| 190 | function cancelUrlEntry(page_id){ | ||
| 191 | const parent_div = document.getElementById(page_id); | ||
| 192 | parent_div.querySelector('.url').querySelector('input').value = parent_div.querySelector('i').textContent; // textContent (contrairement à innerHTML) ne transforme pas les & en entités HTML | ||
| 193 | closeUrlEntry(page_id, parent_div); | ||
| 194 | } | ||
| 195 | function submitUrlEntry(page_id){ | ||
| 196 | const parent_div = document.getElementById(page_id); | ||
| 197 | const url_input = parent_div.querySelector('.url').querySelector('input').value; | ||
| 198 | |||
| 199 | fetch('index.php?menu_edit=edit_url_entry', { | ||
| 200 | method: 'POST', | ||
| 201 | headers: { | ||
| 202 | 'Content-Type': 'application/json' | ||
| 203 | }, | ||
| 204 | body: JSON.stringify({ id: page_id, url_input: url_input }) | ||
| 205 | }) | ||
| 206 | .then(response => response.json()) | ||
| 207 | .then(data => { | ||
| 208 | if(data.success){ | ||
| 209 | parent_div.querySelector('i').innerHTML = data.url_input; // MAJ <i> | ||
| 210 | findParentByTagName(document.getElementById('m_' + page_id), 'a').href = data.url_input; // MAJ menu | ||
| 211 | closeUrlEntry(page_id, parent_div); | ||
| 212 | } | ||
| 213 | else{ | ||
| 214 | toastNotify("Erreur rencontrée par le serveur, changements non pris en compte"); | ||
| 215 | console.error("Erreur rencontrée par le serveur, changements non pris en compte"); | ||
| 216 | } | ||
| 217 | }) | ||
| 218 | .catch(error => { | ||
| 219 | console.error('Erreur:', error); | ||
| 220 | }); | ||
| 221 | } | ||
| 222 | function closeUrlEntry(page_id, parent_div){ | ||
| 223 | parent_div.querySelector('i').classList.remove('hidden'); | ||
| 224 | parent_div.querySelector('.url').querySelector('input').classList.add('hidden'); | ||
| 225 | parent_div.querySelector('#edit-i' + page_id).classList.remove('hidden'); | ||
| 226 | parent_div.querySelector('#delete-i' + page_id).querySelector('input[type=image]').classList.remove('hidden'); | ||
| 227 | parent_div.querySelector('#cancel-i' + page_id).querySelector('button').classList.add('hidden'); | ||
| 228 | parent_div.querySelector('#submit-i' + page_id).querySelector('input[type=submit]').classList.add('hidden'); | ||
| 229 | }*/ | ||
| 230 | |||
| 231 | /*function deleteUrlEntry(page_id){ | ||
| 232 | const selected_div = document.getElementById(page_id); | ||
| 233 | console.log(selected_div.id); | ||
| 234 | }*/ | ||
| 235 | |||
diff --git a/src/controller/MenuAndPathsController.php b/src/controller/MenuAndPathsController.php index a32b210..6bb098f 100644 --- a/src/controller/MenuAndPathsController.php +++ b/src/controller/MenuAndPathsController.php | |||
| @@ -42,21 +42,30 @@ class MenuAndPathsController | |||
| 42 | die; | 42 | die; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | static public function editUrlEntry(EntityManager $entityManager, array $json): void | 45 | // on pourrait utiliser FormValidation ici |
| 46 | static public function editUrl(EntityManager $entityManager, array $json): void | ||
| 46 | { | 47 | { |
| 47 | $url_input = trim($json['url_input']); // faire htmlspecialchars à l'affichage | 48 | $url_data = trim($json['input_data']); // garder htmlspecialchars pour l'affichage |
| 48 | $page = $entityManager->find('App\Entity\Page', $json['id']); | 49 | $page = $entityManager->find('App\Entity\Page', $json['id']); |
| 49 | 50 | ||
| 50 | if(!$page){ | 51 | if(!$page){ |
| 51 | echo json_encode(['success' => false, 'message' => "id invalide"]); | 52 | echo json_encode(['success' => false, 'message' => "id invalide"]); |
| 52 | } | 53 | } |
| 53 | elseif(!filter_var($url_input, FILTER_VALIDATE_URL) || !str_starts_with($url_input, 'http')){ | 54 | elseif(!in_array($json['field'], ['url_name', 'url_content'])){ |
| 55 | echo json_encode(['success' => false, 'message' => "champ invalide"]); | ||
| 56 | } | ||
| 57 | elseif($json['field'] === 'url_content' && (!filter_var($url_data, FILTER_VALIDATE_URL) || !str_starts_with($url_data, 'http'))){ | ||
| 54 | echo json_encode(['success' => false, 'message' => "la chaîne envoyée n'est pas une URL valide"]); | 58 | echo json_encode(['success' => false, 'message' => "la chaîne envoyée n'est pas une URL valide"]); |
| 55 | } | 59 | } |
| 56 | else{ | 60 | else{ |
| 57 | $page->setEndOfPath($url_input); | 61 | if($json['field'] === 'url_name'){ |
| 62 | $page->setPageName($url_data); | ||
| 63 | } | ||
| 64 | elseif($json['field'] === 'url_content'){ | ||
| 65 | $page->setEndOfPath($url_data); | ||
| 66 | } | ||
| 58 | $entityManager->flush(); | 67 | $entityManager->flush(); |
| 59 | echo json_encode(['success' => true, 'url_input' => $url_input]); | 68 | echo json_encode(['success' => true, 'url_data' => $url_data]); |
| 60 | } | 69 | } |
| 61 | die; | 70 | die; |
| 62 | } | 71 | } |
diff --git a/src/model/Model.php b/src/model/Model.php index 68c4c08..eeba8b2 100644 --- a/src/model/Model.php +++ b/src/model/Model.php | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | <?php | 1 | <?php |
| 2 | // src/model/Model.php | 2 | // src/model/Model.php |
| 3 | // | ||
| 4 | // à l'occaz, faire des classes métiers: NodeModel = celle-ci | ||
| 5 | // puis PageModel, puis éventuellement UserModel, EmailModel (le calendrier a déjà EventDTO) | ||
| 3 | 6 | ||
| 4 | declare(strict_types=1); | 7 | declare(strict_types=1); |
| 5 | 8 | ||
diff --git a/src/router.php b/src/router.php index cfb1dec..ebe645f 100644 --- a/src/router.php +++ b/src/router.php | |||
| @@ -166,8 +166,8 @@ elseif($request->getMethod() === 'POST'){ | |||
| 166 | elseif($_GET['menu_edit'] === 'display_in_menu' && isset($json['id']) && isset($json['checked'])){ | 166 | elseif($_GET['menu_edit'] === 'display_in_menu' && isset($json['id']) && isset($json['checked'])){ |
| 167 | MenuAndPathsController::displayInMenu($entityManager, $json); | 167 | MenuAndPathsController::displayInMenu($entityManager, $json); |
| 168 | } | 168 | } |
| 169 | elseif($_GET['menu_edit'] === 'edit_url_entry' && isset($json['id']) && isset($json['url_input'])){ | 169 | elseif($_GET['menu_edit'] === 'url_edit' && isset($json['id']) && isset($json['field']) && isset($json['input_data'])){ |
| 170 | MenuAndPathsController::editUrlEntry($entityManager, $json); | 170 | MenuAndPathsController::editUrl($entityManager, $json); |
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | 173 | ||
diff --git a/src/view/FooterBuilder.php b/src/view/FooterBuilder.php index fcb78e0..277de4b 100644 --- a/src/view/FooterBuilder.php +++ b/src/view/FooterBuilder.php | |||
| @@ -30,17 +30,21 @@ class FooterBuilder extends AbstractBuilder | |||
| 30 | if($_SESSION['admin']) | 30 | if($_SESSION['admin']) |
| 31 | { | 31 | { |
| 32 | // données du footer | 32 | // données du footer |
| 33 | $buttons_footer_name = '<img id="footer_name_open" class="action_icon" src="assets/edit.svg" onclick="footer_name.open()"> | 33 | $admin_footer_name = '<input type="text" id="footer_name_input" class="hidden" value="' . htmlspecialchars($name ?? '') . '" size="30"> |
| 34 | <img id="footer_name_open" class="action_icon" src="assets/edit.svg" onclick="footer_name.open()"> | ||
| 34 | <img id="footer_name_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_name.submit()"> | 35 | <img id="footer_name_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_name.submit()"> |
| 35 | <img id="footer_name_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_name.cancel()">'; | 36 | <img id="footer_name_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_name.cancel()">'; |
| 36 | $buttons_footer_address = '<img id="footer_address_open" class="action_icon" src="assets/edit.svg" onclick="footer_address.open()"> | 37 | $admin_footer_address = '<input type="text" id="footer_address_input" class="hidden" value="' . htmlspecialchars($address ?? '') . '" size="30"> |
| 38 | <img id="footer_address_open" class="action_icon" src="assets/edit.svg" onclick="footer_address.open()"> | ||
| 37 | <img id="footer_address_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_address.submit()"> | 39 | <img id="footer_address_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_address.submit()"> |
| 38 | <img id="footer_address_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_address.cancel()">'; | 40 | <img id="footer_address_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_address.cancel()">'; |
| 39 | $buttons_footer_email = '<img id="footer_email_open" class="action_icon" src="assets/edit.svg" onclick="footer_email.open()"> | 41 | $admin_footer_email = '<input type="text" id="footer_email_input" class="hidden" value="' . htmlspecialchars($email ?? '') . '" size="30"> |
| 42 | <img id="footer_email_open" class="action_icon" src="assets/edit.svg" onclick="footer_email.open()"> | ||
| 40 | <img id="footer_email_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_email.submit()"> | 43 | <img id="footer_email_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_email.submit()"> |
| 41 | <img id="footer_email_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_email.cancel()">'; | 44 | <img id="footer_email_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_email.cancel()">'; |
| 42 | 45 | ||
| 43 | $buttons_footer_logo = '<img id="footer_logo_open" class="action_icon" src="assets/edit.svg" onclick="footer_logo.open()"> | 46 | $admin_footer_logo = '<input type="file" id="footer_logo_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> |
| 47 | <img id="footer_logo_open" class="action_icon" src="assets/edit.svg" onclick="footer_logo.open()"> | ||
| 44 | <img id="footer_logo_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_logo.submit()"> | 48 | <img id="footer_logo_submit" class="action_icon hidden" src="assets/save.svg" onclick="footer_logo.submit()"> |
| 45 | <img id="footer_logo_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_logo.cancel()">'; | 49 | <img id="footer_logo_cancel" class="action_icon hidden" src="assets/close.svg" onclick="footer_logo.cancel()">'; |
| 46 | 50 | ||
| @@ -81,10 +85,10 @@ class FooterBuilder extends AbstractBuilder | |||
| 81 | } | 85 | } |
| 82 | $zone_admin = '<button><a href="' . $url . '">Mode admin</a></button>'; | 86 | $zone_admin = '<button><a href="' . $url . '">Mode admin</a></button>'; |
| 83 | 87 | ||
| 84 | $buttons_footer_name = ''; | 88 | $admin_footer_name = ''; |
| 85 | $buttons_footer_address = ''; | 89 | $admin_footer_address = ''; |
| 86 | $buttons_footer_email = ''; | 90 | $admin_footer_email = ''; |
| 87 | $buttons_footer_logo = ''; | 91 | $admin_footer_logo = ''; |
| 88 | } | 92 | } |
| 89 | 93 | ||
| 90 | ob_start(); | 94 | ob_start(); |
diff --git a/src/view/HeadBuilder.php b/src/view/HeadBuilder.php index fd7f751..3eba9a2 100644 --- a/src/view/HeadBuilder.php +++ b/src/view/HeadBuilder.php | |||
| @@ -36,8 +36,7 @@ class HeadBuilder extends AbstractBuilder | |||
| 36 | 36 | ||
| 37 | if($_SESSION['admin']){ | 37 | if($_SESSION['admin']){ |
| 38 | // édition éléments sur toutes les pages (header, footer et favicon) | 38 | // édition éléments sur toutes les pages (header, footer et favicon) |
| 39 | $js .= '<script src="' . self::versionedFileURL('js', 'InputText') . '"></script>' . "\n"; | 39 | $js .= '<script src="' . self::versionedFileURL('js', 'Input') . '"></script>' . "\n"; |
| 40 | $js .= '<script src="' . self::versionedFileURL('js', 'InputFile') . '"></script>' . "\n"; | ||
| 41 | 40 | ||
| 42 | // tinymce, nécéssite un script de copie dans composer.json | 41 | // tinymce, nécéssite un script de copie dans composer.json |
| 43 | $css .= '<link rel="stylesheet" href="' . self::versionedFileURL('css', 'tinymce') . '">' . "\n"; | 42 | $css .= '<link rel="stylesheet" href="' . self::versionedFileURL('css', 'tinymce') . '">' . "\n"; |
diff --git a/src/view/HeaderBuilder.php b/src/view/HeaderBuilder.php index 1c82368..ae9a888 100644 --- a/src/view/HeaderBuilder.php +++ b/src/view/HeaderBuilder.php | |||
| @@ -57,37 +57,42 @@ class HeaderBuilder extends AbstractBuilder | |||
| 57 | if($_SESSION['admin']){ | 57 | if($_SESSION['admin']){ |
| 58 | // assets dans classe editing_zone | 58 | // assets dans classe editing_zone |
| 59 | $editing_zone_margin = '5px'; | 59 | $editing_zone_margin = '5px'; |
| 60 | $buttons_favicon = '<button id="head_favicon_open" onclick="head_favicon.open()"><img id="head_favicon_img" class="action_icon"> Favicon</button> | 60 | $admin_favicon = '<input type="file" id="head_favicon_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff, image/x-icon, image/bmp"> |
| 61 | <script>document.getElementById(\'head_favicon_img\').src = window.Config.favicon;</script> | 61 | <button id="head_favicon_open" onclick="head_favicon.open()"><img id="head_favicon_content" class="action_icon"> Favicon</button> |
| 62 | <script>document.getElementById(\'head_favicon_content\').src = window.Config.favicon;</script> | ||
| 62 | <img id="head_favicon_submit" class="action_icon hidden" src="assets/save.svg" onclick="head_favicon.submit()"> | 63 | <img id="head_favicon_submit" class="action_icon hidden" src="assets/save.svg" onclick="head_favicon.submit()"> |
| 63 | <img id="head_favicon_cancel" class="action_icon hidden" src="assets/close.svg" onclick="head_favicon.cancel()">'; | 64 | <img id="head_favicon_cancel" class="action_icon hidden" src="assets/close.svg" onclick="head_favicon.cancel()">'; |
| 64 | $buttons_background = '<button id="header_background_open" onclick="header_background.open()"><img id="header_background_img" class="background_button" src="' . $header_background . '"> Image de fond</button> | 65 | $admin_background = '<input type="file" id="header_background_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> |
| 66 | <button id="header_background_open" onclick="header_background.open()"><img id="header_background_content" class="background_button" src="' . $header_background . '"> Image de fond</button> | ||
| 65 | <img id="header_background_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_background.submit()"> | 67 | <img id="header_background_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_background.submit()"> |
| 66 | <img id="header_background_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_background.cancel()">'; | 68 | <img id="header_background_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_background.cancel()">'; |
| 67 | 69 | ||
| 68 | // asset dans classe header_content | 70 | // asset dans classe header_content |
| 69 | $buttons_header_logo = '<img id="header_logo_open" class="action_icon" src="assets/edit.svg" onclick="header_logo.open()"> | 71 | $admin_header_logo = '<input type="file" id="header_logo_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> |
| 72 | <img id="header_logo_open" class="action_icon" src="assets/edit.svg" onclick="header_logo.open()"> | ||
| 70 | <img id="header_logo_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_logo.submit()"> | 73 | <img id="header_logo_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_logo.submit()"> |
| 71 | <img id="header_logo_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_logo.cancel()">'; | 74 | <img id="header_logo_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_logo.cancel()">'; |
| 72 | // texte dans classe header_content | 75 | // texte dans classe header_content |
| 73 | $buttons_header_title = '<img id="header_title_open" class="action_icon" src="assets/edit.svg" onclick="header_title.open()"> | 76 | $admin_header_title = '<input type="text" id="header_title_input" class="hidden" value="' . htmlspecialchars($title ?? '') . '" size="30"> |
| 77 | <img id="header_title_open" class="action_icon" src="assets/edit.svg" onclick="header_title.open()"> | ||
| 74 | <img id="header_title_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_title.submit()"> | 78 | <img id="header_title_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_title.submit()"> |
| 75 | <img id="header_title_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_title.cancel()">'; | 79 | <img id="header_title_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_title.cancel()">'; |
| 76 | $buttons_header_description = '<img id="header_description_open" class="action_icon" src="assets/edit.svg" onclick="header_description.open()"> | 80 | $admin_header_description = '<input type="text" id="header_description_input" class="hidden" value="' . htmlspecialchars($description ?? '') . '" size="30"> |
| 81 | <img id="header_description_open" class="action_icon" src="assets/edit.svg" onclick="header_description.open()"> | ||
| 77 | <img id="header_description_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_description.submit()"> | 82 | <img id="header_description_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_description.submit()"> |
| 78 | <img id="header_description_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_description.cancel()">'; | 83 | <img id="header_description_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_description.cancel()">'; |
| 79 | 84 | ||
| 80 | //$buttons_social_networks = '<img class="action_icon" src="assets/edit.svg" onclick="editSocialNetworks()">'; | 85 | // icônes réseaux sociaux |
| 81 | $buttons_social_networks = ''; | 86 | $admin_social_networks = ''; |
| 82 | } | 87 | } |
| 83 | else{ | 88 | else{ |
| 84 | $editing_zone_margin = '0'; | 89 | $editing_zone_margin = '0'; |
| 85 | $buttons_favicon = ''; | 90 | $admin_favicon = ''; |
| 86 | $buttons_background = ''; | 91 | $admin_background = ''; |
| 87 | $buttons_header_logo = ''; | 92 | $admin_header_logo = ''; |
| 88 | $buttons_header_title = ''; | 93 | $admin_header_title = ''; |
| 89 | $buttons_header_description = ''; | 94 | $admin_header_description = ''; |
| 90 | $buttons_social_networks = ''; | 95 | $admin_social_networks = ''; |
| 91 | } | 96 | } |
| 92 | 97 | ||
| 93 | ob_start(); | 98 | ob_start(); |
diff --git a/src/view/MenuBuilder.php b/src/view/MenuBuilder.php index 12298cf..8e8b9a9 100644 --- a/src/view/MenuBuilder.php +++ b/src/view/MenuBuilder.php | |||
| @@ -55,32 +55,26 @@ class MenuBuilder extends AbstractBuilder | |||
| 55 | <img class="move_entry_icon" onclick="switchMenuPositions(' . $entry->getId() . ', \'down\')" src="assets/arrow-down.svg"> | 55 | <img class="move_entry_icon" onclick="switchMenuPositions(' . $entry->getId() . ', \'down\')" src="assets/arrow-down.svg"> |
| 56 | <span class="menu_entry_checkbox"> | 56 | <span class="menu_entry_checkbox"> |
| 57 | <input type="checkbox" ' . $checked . ' onclick="checkMenuEntry(' . $entry->getId() . ')"> | 57 | <input type="checkbox" ' . $checked . ' onclick="checkMenuEntry(' . $entry->getId() . ')"> |
| 58 | </span> | 58 | </span>'; |
| 59 | <button>' . $entry->getPageName() . '</button>'; | ||
| 60 | 59 | ||
| 61 | // seul la modification des URL est possible pour l'instant, les noms des entrées de menu attendront | 60 | // entrées URL: bouton poubelle + nom du lien + adresse |
| 62 | if(str_starts_with($entry->getEndOfPath(), 'http')){ | 61 | if(str_starts_with($entry->getEndOfPath(), 'http')){ |
| 63 | $this->html .= '<form style="display: inline;" id="delete-i' . $entry->getId() . '" method="post" action="' . new URL(['from' => 'menu_chemins']) . '"> | 62 | $this->html .= '<form style="display: inline;" id="delete-i' . $entry->getId() . '" method="post" action="' . new URL(['from' => 'menu_chemins']) . '"> |
| 64 | <input type="hidden" name="delete" value="' . $entry->getId() . '"> | 63 | <input type="hidden" name="delete" value="' . $entry->getId() . '"> |
| 65 | <input type="image" class="move_entry_icon" src="assets/delete-bin.svg" alt="delete link button" onclick="return confirm(\'Voulez-vous vraiment supprimer cette entrée?\');"> | 64 | <input type="image" class="move_entry_icon" src="assets/delete-bin.svg" alt="delete link button" onclick="return confirm(\'Voulez-vous vraiment supprimer cette entrée?\');"> |
| 66 | </form> | 65 | </form> |
| 67 | <span class="url"> | 66 | <span class="url_name"> |
| 67 | <button class="url_name"><input type="" value="' . htmlspecialchars($entry->getPageName()) . '"></button> | ||
| 68 | <img class="move_entry_icon" src="assets/save.svg" onclick="editUrl(' . $entry->getId() . ', \'url_name\')"> | ||
| 69 | </span> | ||
| 70 | <span class="url_content"> | ||
| 68 | <input type="url" value="' . htmlspecialchars($entry->getEndOfPath()) . '"> | 71 | <input type="url" value="' . htmlspecialchars($entry->getEndOfPath()) . '"> |
| 69 | <img class="move_entry_icon" src="assets/save.svg" onclick="editUrlEntry(' . $entry->getId() . ')"> | 72 | <img class="move_entry_icon" src="assets/save.svg" onclick="editUrl(' . $entry->getId() . ', \'url_content\')"> |
| 70 | </span>'; | 73 | </span>'; |
| 71 | |||
| 72 | // code à recycler pour pouvoir modifier le nom de l'entrée de menu correspondant aux liens | ||
| 73 | /*$this->html .= '<span id="cancel-i' . $entry->getId() . '"> | ||
| 74 | <input type="hidden" name="cancel" value="' . $entry->getId() . '"> | ||
| 75 | <button class="hidden" onclick="cancelUrlEntry(' . $entry->getId() . ')">Annuler</button> | ||
| 76 | </span> | ||
| 77 | <span id="submit-i' . $entry->getId() . '"> | ||
| 78 | <input type="hidden" name="submit" value="' . $entry->getId() . '"> | ||
| 79 | <input type="submit" class="hidden" onclick="submitUrlEntry(' . $entry->getId() . ')"> | ||
| 80 | </span>';*/ | ||
| 81 | } | 74 | } |
| 82 | else{ | 75 | else{ |
| 83 | $this->html .= '<i class="path">' . $entry->getPagePath() . '</i>'; | 76 | $this->html .= '<button>' . $entry->getPageName() . '</button> |
| 77 | <i class="path">' . $entry->getPagePath() . '</i>'; | ||
| 84 | } | 78 | } |
| 85 | 79 | ||
| 86 | if(count($entry->getChildren()) > 0){ | 80 | if(count($entry->getChildren()) > 0){ |
diff --git a/src/view/templates/footer.php b/src/view/templates/footer.php index 4db38ae..dc1c6cb 100644 --- a/src/view/templates/footer.php +++ b/src/view/templates/footer.php | |||
| @@ -4,25 +4,21 @@ | |||
| 4 | <div class="data"> | 4 | <div class="data"> |
| 5 | <div class="contact"> | 5 | <div class="contact"> |
| 6 | <div id="footer_name"> | 6 | <div id="footer_name"> |
| 7 | <span id="footer_name_span"><?= htmlspecialchars($name ?? '') ?></span> | 7 | <span id="footer_name_content"><?= htmlspecialchars($name ?? '') ?></span> |
| 8 | <input type="text" id="footer_name_input" class="hidden" value="<?= htmlspecialchars($name ?? '') ?>" size="30"> | 8 | <?= $admin_footer_name ?> |
| 9 | <?= $buttons_footer_name ?> | ||
| 10 | </div> | 9 | </div> |
| 11 | <div id="footer_address"> | 10 | <div id="footer_address"> |
| 12 | <span id="footer_address_span"><?= htmlspecialchars($address ?? '') ?></span> | 11 | <span id="footer_address_content"><?= htmlspecialchars($address ?? '') ?></span> |
| 13 | <input type="text" id="footer_address_input" class="hidden" value="<?= htmlspecialchars($address ?? '') ?>" size="30"> | 12 | <?= $admin_footer_address ?> |
| 14 | <?= $buttons_footer_address ?> | ||
| 15 | </div> | 13 | </div> |
| 16 | <div id="footer_email"> | 14 | <div id="footer_email"> |
| 17 | <a href="mailto:<?= $email ?>"><span id="footer_email_span"><?= htmlspecialchars($email ?? '') ?></span></a> | 15 | <a id="footer_email_content" href="mailto:<?= $email ?>"><?= htmlspecialchars($email ?? '') ?></a> |
| 18 | <input type="text" id="footer_email_input" class="hidden" value="<?= htmlspecialchars($email ?? '') ?>" size="30"> | 16 | <?= $admin_footer_email ?> |
| 19 | <?= $buttons_footer_email ?> | ||
| 20 | </div> | 17 | </div> |
| 21 | </div> | 18 | </div> |
| 22 | <div id="footer_logo"> | 19 | <div id="footer_logo"> |
| 23 | <a href="<?= new URL ?>"><img id="footer_logo_img" src="<?= $footer_logo ?? '' ?>" alt="logo_alt"></a> | 20 | <a id="footer_logo_content" href="<?= new URL ?>"><img src="<?= $footer_logo ?? '' ?>" alt="logo_alt"></a> |
| 24 | <input type="file" id="footer_logo_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> | 21 | <?= $admin_footer_logo ?> |
| 25 | <?= $buttons_footer_logo ?> | ||
| 26 | </div> | 22 | </div> |
| 27 | <?php if($_SESSION['admin']){ ?> | 23 | <?php if($_SESSION['admin']){ ?> |
| 28 | <script> | 24 | <script> |
diff --git a/src/view/templates/header.php b/src/view/templates/header.php index ac8af7f..4d3b323 100644 --- a/src/view/templates/header.php +++ b/src/view/templates/header.php | |||
| @@ -5,43 +5,38 @@ | |||
| 5 | <div id="nav_zone"> | 5 | <div id="nav_zone"> |
| 6 | <?= $nav ?> | 6 | <?= $nav ?> |
| 7 | </div> | 7 | </div> |
| 8 | <div class="editing_zone"> | 8 | <div> |
| 9 | <div id="head_favicon" style="margin: <?= $editing_zone_margin ?>;"> | 9 | <div id="head_favicon" style="margin: <?= $editing_zone_margin ?>;"> |
| 10 | <input type="file" id="head_favicon_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff, image/x-icon, image/bmp"> | 10 | <?= $admin_favicon ?> |
| 11 | <?= $buttons_favicon ?> | ||
| 12 | </div> | 11 | </div> |
| 13 | <div id="header_background"> | 12 | <div id="header_background"> |
| 14 | <input type="file" id="header_background_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> | 13 | <?= $admin_background ?> |
| 15 | <?= $buttons_background ?> | ||
| 16 | </div> | 14 | </div> |
| 17 | </div> | 15 | </div> |
| 18 | <div class="header_content"> | 16 | <div class="header_content"> |
| 19 | <div class="header_left_col"> | 17 | <div class="header_left_col"> |
| 20 | <div id="header_logo"> | 18 | <div id="header_logo"> |
| 21 | <a href="<?= new URL ?>"><img id="header_logo_img" src="<?= $header_logo ?? '' ?>" alt="header_logo"></a> | 19 | <a id="header_logo_content" href="<?= new URL ?>"><img src="<?= $header_logo ?? '' ?>" alt="header_logo"></a> |
| 22 | <input type="file" id="header_logo_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> | 20 | <?= $admin_header_logo ?> |
| 23 | <?= $buttons_header_logo ?> | ||
| 24 | </div> | 21 | </div> |
| 25 | </div> | 22 | </div> |
| 26 | <div class="nav_button"> | 23 | <div class="nav_button"> |
| 27 | <button>MENU</button> | 24 | <button>MENU</button> |
| 28 | </div> | 25 | </div> |
| 29 | <div class="site_title"> | 26 | <div class="header_center_col"> |
| 30 | <h1 id="header_title"> | 27 | <h1 id="header_title"> |
| 31 | <a href="<?= new URL ?>"><span id="header_title_span"><?= htmlspecialchars($title ?? '') ?></span></a> | 28 | <a id="header_title_content" href="<?= new URL ?>"><?= htmlspecialchars($title ?? '') ?></a></span> |
| 32 | <input type="text" id="header_title_input" class="hidden" value="<?= htmlspecialchars($title ?? '') ?>" size="30"> | 29 | <?= $admin_header_title ?> |
| 33 | <?= $buttons_header_title ?> | ||
| 34 | </h1> | 30 | </h1> |
| 35 | <h2 id="header_description"> | 31 | <h2 id="header_description"> |
| 36 | <span id="header_description_span"><?= htmlspecialchars($description ?? '') ?></span> | 32 | <span id="header_description_content"><?= htmlspecialchars($description ?? '') ?></span> |
| 37 | <input type="text" id="header_description_input" class="hidden" value="<?= htmlspecialchars($description ?? '') ?>" size="30"> | 33 | <?= $admin_header_description ?> |
| 38 | <?= $buttons_header_description ?> | ||
| 39 | </h2> | 34 | </h2> |
| 40 | </div> | 35 | </div> |
| 41 | <div class="header_right_col"> | 36 | <div class="header_right_col"> |
| 42 | <div class="social"> | 37 | <div id="header_social"> |
| 43 | <?= $social_networks ?> | 38 | <?= $social_networks ?> |
| 44 | <?= $buttons_social_networks ?> | 39 | <?= $admin_social_networks ?> |
| 45 | </div> | 40 | </div> |
| 46 | <?= $breadcrumb ?? '' ?> | 41 | <?= $breadcrumb ?? '' ?> |
| 47 | </div> | 42 | </div> |
| @@ -53,6 +48,7 @@ | |||
| 53 | let header_logo = new InputFile('header_logo'); | 48 | let header_logo = new InputFile('header_logo'); |
| 54 | let header_title = new InputText('header_title'); | 49 | let header_title = new InputText('header_title'); |
| 55 | let header_description = new InputText('header_description'); | 50 | let header_description = new InputText('header_description'); |
| 51 | let header_social = new InputFile('header_social'); | ||
| 56 | </script> | 52 | </script> |
| 57 | <?php } ?> | 53 | <?php } ?> |
| 58 | </header> \ No newline at end of file | 54 | </header> \ No newline at end of file |
