diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-28 23:23:03 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-28 23:23:03 +0100 |
| commit | f653506421ee8e2c46c78e93d28ee2418a1d399d (patch) | |
| tree | 93f54c301538960f543ffdb5fafd387c83dec94a /src/view | |
| parent | cf8c9c1d380afbd8529a6da0afd55a9e3d8f1bf4 (diff) | |
| download | cms-f653506421ee8e2c46c78e93d28ee2418a1d399d.zip | |
modification liens réseaux sociaux, placeholder input text, correction erreurs CSS
Diffstat (limited to 'src/view')
| -rw-r--r-- | src/view/FooterBuilder.php | 6 | ||||
| -rw-r--r-- | src/view/HeaderBuilder.php | 43 | ||||
| -rw-r--r-- | src/view/templates/header.php | 12 |
3 files changed, 37 insertions, 24 deletions
diff --git a/src/view/FooterBuilder.php b/src/view/FooterBuilder.php index 277de4b..d810170 100644 --- a/src/view/FooterBuilder.php +++ b/src/view/FooterBuilder.php | |||
| @@ -30,15 +30,15 @@ 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 | $admin_footer_name = '<input type="text" id="footer_name_input" class="hidden" value="' . htmlspecialchars($name ?? '') . '" size="30"> | 33 | $admin_footer_name = '<input type="text" id="footer_name_input" class="hidden" value="' . htmlspecialchars($name ?? '') . '" placeholder="raison sociale" size="30"> |
| 34 | <img id="footer_name_open" class="action_icon" src="assets/edit.svg" onclick="footer_name.open()"> | 34 | <img id="footer_name_open" class="action_icon" src="assets/edit.svg" onclick="footer_name.open()"> |
| 35 | <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()"> |
| 36 | <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()">'; |
| 37 | $admin_footer_address = '<input type="text" id="footer_address_input" class="hidden" value="' . htmlspecialchars($address ?? '') . '" size="30"> | 37 | $admin_footer_address = '<input type="text" id="footer_address_input" class="hidden" value="' . htmlspecialchars($address ?? '') . '" placeholder="adresse" size="30"> |
| 38 | <img id="footer_address_open" class="action_icon" src="assets/edit.svg" onclick="footer_address.open()"> | 38 | <img id="footer_address_open" class="action_icon" src="assets/edit.svg" onclick="footer_address.open()"> |
| 39 | <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()"> |
| 40 | <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()">'; |
| 41 | $admin_footer_email = '<input type="text" id="footer_email_input" class="hidden" value="' . htmlspecialchars($email ?? '') . '" size="30"> | 41 | $admin_footer_email = '<input type="text" id="footer_email_input" class="hidden" value="' . htmlspecialchars($email ?? '') . '" placeholder="e-mail" size="30"> |
| 42 | <img id="footer_email_open" class="action_icon" src="assets/edit.svg" onclick="footer_email.open()"> | 42 | <img id="footer_email_open" class="action_icon" src="assets/edit.svg" onclick="footer_email.open()"> |
| 43 | <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()"> |
| 44 | <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()">'; |
diff --git a/src/view/HeaderBuilder.php b/src/view/HeaderBuilder.php index 4651418..4fbf941 100644 --- a/src/view/HeaderBuilder.php +++ b/src/view/HeaderBuilder.php | |||
| @@ -48,13 +48,6 @@ class HeaderBuilder extends AbstractBuilder | |||
| 48 | $header_background_name = $node_data->getAssetByRole('header_background')?->getFileName(); | 48 | $header_background_name = $node_data->getAssetByRole('header_background')?->getFileName(); |
| 49 | $header_background = $header_background_name ? Asset::USER_PATH . $header_background_name : ''; | 49 | $header_background = $header_background_name ? Asset::USER_PATH . $header_background_name : ''; |
| 50 | 50 | ||
| 51 | $keys = array_keys($social); | ||
| 52 | $social_networks = ''; | ||
| 53 | foreach($keys as $one_key){ | ||
| 54 | $social_networks .= '<a href="' . $social[$one_key] . '" target="_blank" rel="noopener noreferrer"> | ||
| 55 | <img src="assets/' . $one_key . '.svg" alt="' . $one_key . '_alt"></a>'; | ||
| 56 | } | ||
| 57 | |||
| 58 | // boutons mode admin | 51 | // boutons mode admin |
| 59 | if($_SESSION['admin']){ | 52 | if($_SESSION['admin']){ |
| 60 | // assets dans classe header_additional_inputs | 53 | // assets dans classe header_additional_inputs |
| @@ -74,29 +67,40 @@ class HeaderBuilder extends AbstractBuilder | |||
| 74 | <img id="header_logo_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_logo.submit()"> | 67 | <img id="header_logo_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_logo.submit()"> |
| 75 | <img id="header_logo_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_logo.cancel()">'; | 68 | <img id="header_logo_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_logo.cancel()">'; |
| 76 | // texte dans classe header_content | 69 | // texte dans classe header_content |
| 77 | $admin_header_title = '<input type="text" id="header_title_input" class="hidden" value="' . htmlspecialchars($title ?? '') . '" size="30"> | 70 | $admin_header_title = '<input type="text" id="header_title_input" class="hidden" value="' . htmlspecialchars($title ?? '') . '" placeholder="nom du site web" size="30"> |
| 78 | <img id="header_title_open" class="action_icon" src="assets/edit.svg" onclick="header_title.open()"> | 71 | <img id="header_title_open" class="action_icon" src="assets/edit.svg" onclick="header_title.open()"> |
| 79 | <img id="header_title_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_title.submit()"> | 72 | <img id="header_title_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_title.submit()"> |
| 80 | <img id="header_title_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_title.cancel()">'; | 73 | <img id="header_title_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_title.cancel()">'; |
| 81 | $admin_header_description = '<input type="text" id="header_description_input" class="hidden" value="' . htmlspecialchars($description ?? '') . '" size="30"> | 74 | $admin_header_description = '<input type="text" id="header_description_input" class="hidden" value="' . htmlspecialchars($description ?? '') . '" placeholder="sous-titre ou description" size="30"> |
| 82 | <img id="header_description_open" class="action_icon" src="assets/edit.svg" onclick="header_description.open()"> | 75 | <img id="header_description_open" class="action_icon" src="assets/edit.svg" onclick="header_description.open()"> |
| 83 | <img id="header_description_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_description.submit()"> | 76 | <img id="header_description_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_description.submit()"> |
| 84 | <img id="header_description_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_description.cancel()">'; | 77 | <img id="header_description_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_description.cancel()">'; |
| 85 | 78 | ||
| 86 | // icônes réseaux sociaux | 79 | // icônes réseaux sociaux |
| 87 | $social_networks_inputs = '<div id="header_social_input" class="hidden">'; | 80 | $header_social_flex_direction = 'column'; |
| 88 | foreach($keys as $one_key){ | 81 | $admin_social_networks = []; |
| 82 | foreach(array_keys($social) as $one_key){ | ||
| 83 | //<input type="file" id="header_' . $one_key . '_input" class="hidden" accept="image/svg+xml, image/png, image/jpeg, image/gif, image/webp, image/tiff"> | ||
| 84 | // sinon plutôt qu'on bouton nouveau réseau, utiliser le foreach avec HeadFootController::$social_networks pour tous les parcourir et placer des cases à cocher | ||
| 85 | // les icones seront ajoutées par mes soins | ||
| 86 | $admin_social_networks[$one_key] = '<input type="text" id="header_' . $one_key . '_input" class="hidden" value="' . $social[$one_key] . '" placeholder="nom du réseau social" size="30"> | ||
| 87 | <img id="header_' . $one_key . '_open" class="action_icon" src="assets/edit.svg" onclick="header_' . $one_key . '.open()"> | ||
| 88 | <img id="header_' . $one_key . '_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_' . $one_key . '.submit()"> | ||
| 89 | <img id="header_' . $one_key . '_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_' . $one_key . '.cancel()"> | ||
| 90 | <script>let header_' . $one_key . ' = new InputTextSocialNetwork(\'header_' . $one_key . '\');</script>'; | ||
| 91 | } | ||
| 92 | //$admin_social_new_network = '<div>nouveau réseau</div>'; | ||
| 93 | $admin_social_new_network = ''; | ||
| 94 | |||
| 95 | /*$social_networks_inputs = '<div id="header_social_input" class="hidden">'; | ||
| 96 | foreach(array_keys($social) as $one_key){ | ||
| 89 | $social_networks_inputs .= '<div> | 97 | $social_networks_inputs .= '<div> |
| 90 | <input type="text" placeholder="nom du réseau social"> | 98 | <input type="text" placeholder="nom du réseau social"> |
| 91 | <input type="text" placeholder="lien https://..."> | 99 | <input type="text" placeholder="lien https://..."> |
| 92 | <input type="file"> | 100 | <input type="file"> |
| 93 | </div>'; | 101 | </div>'; |
| 94 | } | 102 | } |
| 95 | $social_networks_inputs .= '</div>'; | 103 | $social_networks_inputs .= '</div>';*/ |
| 96 | /*$admin_social_networks = $social_networks_inputs . '<img id="header_social_open" class="action_icon" src="assets/edit.svg" onclick="header_social.open()"> | ||
| 97 | <div id="header_social_submit" class="hidden"></div> | ||
| 98 | <img id="header_social_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_social.cancel()">';*/ | ||
| 99 | $admin_social_networks = ''; | ||
| 100 | } | 104 | } |
| 101 | else{ | 105 | else{ |
| 102 | $admin_favicon = ''; | 106 | $admin_favicon = ''; |
| @@ -104,7 +108,12 @@ class HeaderBuilder extends AbstractBuilder | |||
| 104 | $admin_header_logo = ''; | 108 | $admin_header_logo = ''; |
| 105 | $admin_header_title = ''; | 109 | $admin_header_title = ''; |
| 106 | $admin_header_description = ''; | 110 | $admin_header_description = ''; |
| 107 | $admin_social_networks = ''; | 111 | $header_social_flex_direction = 'row'; |
| 112 | $admin_social_networks = []; | ||
| 113 | foreach(array_keys($social) as $one_key){ | ||
| 114 | $admin_social_networks[$one_key] = ''; | ||
| 115 | } | ||
| 116 | $admin_social_new_network = ''; | ||
| 108 | } | 117 | } |
| 109 | 118 | ||
| 110 | ob_start(); | 119 | ob_start(); |
diff --git a/src/view/templates/header.php b/src/view/templates/header.php index 9c74f9b..89cdd4b 100644 --- a/src/view/templates/header.php +++ b/src/view/templates/header.php | |||
| @@ -35,10 +35,15 @@ | |||
| 35 | </div> | 35 | </div> |
| 36 | <div class="header_right_col"> | 36 | <div class="header_right_col"> |
| 37 | <div id="header_social"> | 37 | <div id="header_social"> |
| 38 | <div id="header_social_content"> | 38 | <div id="header_social_content" style="flex-direction: <?= $header_social_flex_direction ?>;"> |
| 39 | <?= $social_networks ?> | 39 | <?php foreach(array_keys($social) as $one_key){ ?> |
| 40 | <div id="header_<?= $one_key ?>"> | ||
| 41 | <a href="<?= $social[$one_key] ?>" target="_blank" rel="noopener noreferrer"><img id="header_<?= $one_key ?>_content" src="assets/<?= $one_key ?>.svg" alt="<?= $one_key ?>_alt"></a> | ||
| 42 | <?= $admin_social_networks[$one_key] ?> | ||
| 43 | </div> | ||
| 44 | <?php } ?> | ||
| 45 | <?= $admin_social_new_network ?> | ||
| 40 | </div> | 46 | </div> |
| 41 | <?= $admin_social_networks ?> | ||
| 42 | </div> | 47 | </div> |
| 43 | <?= $breadcrumb ?? '' ?> | 48 | <?= $breadcrumb ?? '' ?> |
| 44 | </div> | 49 | </div> |
| @@ -50,7 +55,6 @@ | |||
| 50 | let header_logo = new InputFile('header_logo'); | 55 | let header_logo = new InputFile('header_logo'); |
| 51 | let header_title = new InputText('header_title'); | 56 | let header_title = new InputText('header_title'); |
| 52 | let header_description = new InputText('header_description'); | 57 | let header_description = new InputText('header_description'); |
| 53 | let header_social = new InputToggler('header_social'); | ||
| 54 | </script> | 58 | </script> |
| 55 | <?php } ?> | 59 | <?php } ?> |
| 56 | </header> \ No newline at end of file | 60 | </header> \ No newline at end of file |
