diff options
Diffstat (limited to 'src/view/HeaderBuilder.php')
| -rw-r--r-- | src/view/HeaderBuilder.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/view/HeaderBuilder.php b/src/view/HeaderBuilder.php index 1339659..266aab8 100644 --- a/src/view/HeaderBuilder.php +++ b/src/view/HeaderBuilder.php | |||
| @@ -11,6 +11,7 @@ class HeaderBuilder extends AbstractBuilder | |||
| 11 | { | 11 | { |
| 12 | private ?Node $nav = null; | 12 | private ?Node $nav = null; |
| 13 | private ?Node $breadcrumb = null; | 13 | private ?Node $breadcrumb = null; |
| 14 | const ICON_PATH = 'icons/'; | ||
| 14 | 15 | ||
| 15 | public function __construct(Node $node) | 16 | public function __construct(Node $node) |
| 16 | { | 17 | { |
| @@ -55,7 +56,6 @@ class HeaderBuilder extends AbstractBuilder | |||
| 55 | // assets dans classe header_additional_inputs | 56 | // assets dans classe header_additional_inputs |
| 56 | $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"> | 57 | $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"> |
| 57 | <button id="head_favicon_open" onclick="head_favicon.open()"><img id="head_favicon_content" class="action_icon"> Favicon</button> | 58 | <button id="head_favicon_open" onclick="head_favicon.open()"><img id="head_favicon_content" class="action_icon"> Favicon</button> |
| 58 | <script>document.getElementById("head_favicon_content").src = window.Config.favicon;</script> | ||
| 59 | <img id="head_favicon_submit" class="action_icon hidden" src="assets/save.svg" onclick="head_favicon.submit()"> | 59 | <img id="head_favicon_submit" class="action_icon hidden" src="assets/save.svg" onclick="head_favicon.submit()"> |
| 60 | <img id="head_favicon_cancel" class="action_icon hidden" src="assets/close.svg" onclick="head_favicon.cancel()">'; | 60 | <img id="head_favicon_cancel" class="action_icon hidden" src="assets/close.svg" onclick="head_favicon.cancel()">'; |
| 61 | $admin_background = '<input type="file" id="header_background_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> | 61 | $admin_background = '<input type="file" id="header_background_input" class="hidden" accept="image/png, image/jpeg, image/gif, image/webp, image/tiff"> |
| @@ -80,7 +80,6 @@ class HeaderBuilder extends AbstractBuilder | |||
| 80 | <img id="header_description_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_description.cancel()">'; | 80 | <img id="header_description_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_description.cancel()">'; |
| 81 | 81 | ||
| 82 | // icônes réseaux sociaux | 82 | // icônes réseaux sociaux |
| 83 | $header_social_flex_direction = 'column'; | ||
| 84 | // boucle sur la liste complète de réseaux sociaux | 83 | // boucle sur la liste complète de réseaux sociaux |
| 85 | foreach(NodeData::$social_networks as $network){ | 84 | foreach(NodeData::$social_networks as $network){ |
| 86 | $checked = (isset($social_show[$network]) && $social_show[$network]) ? 'checked' : ''; | 85 | $checked = (isset($social_show[$network]) && $social_show[$network]) ? 'checked' : ''; |
| @@ -88,15 +87,16 @@ class HeaderBuilder extends AbstractBuilder | |||
| 88 | 87 | ||
| 89 | $social_networks .= '<div id="header_' . $network . '"> | 88 | $social_networks .= '<div id="header_' . $network . '"> |
| 90 | <input type="checkbox" onclick="checkSocialNetwork(\'header_' . $network . '\')" ' . $checked . '> | 89 | <input type="checkbox" onclick="checkSocialNetwork(\'header_' . $network . '\')" ' . $checked . '> |
| 91 | <a ' . $href . ' target="_blank" rel="noopener noreferrer"> | 90 | <a ' . $href . ' target="_blank" rel="noopener noreferrer">' |
| 92 | <img id="header_' . $network . '_content" src="assets/' . $network . ($checked ? '' : '-nb') . '.svg" alt="'. $network . '_alt"> | 91 | . $this->insertSVG(self::ICON_PATH . $network . '.svg', ['id' => 'header_' . $network . '_content', 'class' => ($checked ? 'svg_fill_red' : '')]) |
| 93 | </a> | 92 | . '</a> |
| 94 | <input type="text" id="header_' . $network . '_input" class="hidden" value="' . ($social[$network] ?? "") . '" placeholder="nom du réseau social" size="30"> | 93 | <input type="text" id="header_' . $network . '_input" class="hidden" value="' . ($social[$network] ?? "") . '" placeholder="lien http://..." size="30"> |
| 95 | <img id="header_' . $network . '_open" class="action_icon" src="assets/edit.svg" onclick="header_' . $network . '.open()"> | 94 | <img id="header_' . $network . '_open" class="action_icon" src="assets/edit.svg" onclick="header_' . $network . '.open()"> |
| 96 | <img id="header_' . $network . '_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_' . $network . '.submit()"> | 95 | <img id="header_' . $network . '_submit" class="action_icon hidden" src="assets/save.svg" onclick="header_' . $network . '.submit()"> |
| 97 | <img id="header_' . $network . '_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_' . $network . '.cancel()"> | 96 | <img id="header_' . $network . '_cancel" class="action_icon hidden" src="assets/close.svg" onclick="header_' . $network . '.cancel()"> |
| 98 | <script>let header_' . $network . ' = new InputTextSocialNetwork(\'header_' . $network . '\');</script> | 97 | <script>let header_' . $network . ' = new InputTextSocialNetwork(\'header_' . $network . '\', {\'has_content\': false});</script> |
| 99 | </div>'; | 98 | </div>'; |
| 99 | // {'has_content': false} => InputToggle ne gèrera pas cette balise | ||
| 100 | } | 100 | } |
| 101 | } | 101 | } |
| 102 | else{ | 102 | else{ |
| @@ -106,14 +106,15 @@ class HeaderBuilder extends AbstractBuilder | |||
| 106 | $admin_header_title = ''; | 106 | $admin_header_title = ''; |
| 107 | $admin_header_description = ''; | 107 | $admin_header_description = ''; |
| 108 | 108 | ||
| 109 | $header_social_flex_direction = 'row'; | ||
| 110 | if(isset($social_show)){ | 109 | if(isset($social_show)){ |
| 111 | // boucle sur les réseaux sociaux "activés" | 110 | // boucle sur les réseaux sociaux "activés" |
| 112 | foreach(array_keys($social_show) as $network){ | 111 | foreach(array_keys($social_show) as $network){ |
| 113 | if($social_show[$network]){ | 112 | if($social_show[$network]){ |
| 114 | $href = (isset($social[$network]) && $social[$network] !== '') ? 'href="' . $social[$network] . '"' : ''; | 113 | $href = (isset($social[$network]) && $social[$network] !== '') ? 'href="' . $social[$network] . '"' : ''; |
| 115 | $social_networks .= '<div id="header_' . $network . '"> | 114 | $social_networks .= '<div id="header_' . $network . '"> |
| 116 | <a ' . $href . ' target="_blank" rel="noopener noreferrer"><img id="header_' . $network . '_content" src="assets/' . $network . '.svg" alt="'. $network . '_alt"></a> | 115 | <a ' . $href . ' target="_blank" rel="noopener noreferrer">' |
| 116 | . $this->insertSVG(self::ICON_PATH . $network . '.svg', ['id' => 'header_' . $network . '_content','class' => 'svg_fill_red']) | ||
| 117 | . '</a> | ||
| 117 | </div>'; | 118 | </div>'; |
| 118 | } | 119 | } |
| 119 | } | 120 | } |
