diff options
| author | polo <ordipolo@gmx.fr> | 2025-11-01 17:54:22 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-11-01 17:54:22 +0100 |
| commit | 46d3c239a7ad2b00e86373f2fd0e829fdcba57f7 (patch) | |
| tree | 054d8e5d3c43bcfc587bb5308e6d2a444eec54bf | |
| parent | f33135c5d36d0e747d07773919ae0bc84cbceac1 (diff) | |
| download | cms-46d3c239a7ad2b00e86373f2fd0e829fdcba57f7.tar.gz cms-46d3c239a7ad2b00e86373f2fd0e829fdcba57f7.tar.bz2 cms-46d3c239a7ad2b00e86373f2fd0e829fdcba57f7.zip | |
utilisation des icônes SVG du dépôt twbs/bootstrap-icons pour les réseaux sociaux, amélioration du CSS
| -rw-r--r-- | .gitignore | 11 | ||||
| -rw-r--r-- | bin/install_tinymce_lang.php | 9 | ||||
| -rw-r--r-- | composer.json | 20 | ||||
| -rw-r--r-- | public/assets/facebook-nb.svg | 1 | ||||
| -rw-r--r-- | public/assets/facebook.svg | 37 | ||||
| -rw-r--r-- | public/assets/github-nb.svg | 1 | ||||
| -rw-r--r-- | public/assets/github.svg | 37 | ||||
| -rw-r--r-- | public/assets/instagram-nb.svg | 1 | ||||
| -rw-r--r-- | public/assets/instagram.svg | 37 | ||||
| -rw-r--r-- | public/assets/linkedin-nb.svg | 1 | ||||
| -rw-r--r-- | public/assets/linkedin.svg | 37 | ||||
| -rw-r--r-- | public/css/body.css | 2 | ||||
| -rw-r--r-- | public/css/head.css | 30 | ||||
| -rw-r--r-- | public/css/menu.css | 6 | ||||
| -rw-r--r-- | public/css/new_page.css | 7 | ||||
| -rw-r--r-- | public/js/main.js | 4 | ||||
| -rw-r--r-- | src/model/entities/NodeData.php | 2 | ||||
| -rw-r--r-- | src/view/AbstractBuilder.php | 17 | ||||
| -rw-r--r-- | src/view/HeadBuilder.php | 6 | ||||
| -rw-r--r-- | src/view/HeaderBuilder.php | 19 | ||||
| -rw-r--r-- | src/view/templates/header.php | 3 | ||||
| -rw-r--r-- | src/view/templates/new_page.php | 2 |
22 files changed, 91 insertions, 199 deletions
| @@ -1,8 +1,9 @@ | |||
| 1 | vendor/ | 1 | vendor/ |
| 2 | config/config.ini | 2 | config/config.ini |
| 3 | public/js/tinymce/ | 3 | public/js/tinymce |
| 4 | public/js/tinymce-langs/ | 4 | public/js/tinymce-langs |
| 5 | public/user_data/ | 5 | public/icons |
| 6 | public/images/ | 6 | public/user_data |
| 7 | public/images-mini/ | 7 | public/images |
| 8 | public/images-mini | ||
| 8 | composer.lock | 9 | composer.lock |
diff --git a/bin/install_tinymce_lang.php b/bin/install_tinymce_lang.php index 4950cc1..e76ec91 100644 --- a/bin/install_tinymce_lang.php +++ b/bin/install_tinymce_lang.php | |||
| @@ -2,7 +2,8 @@ | |||
| 2 | // bin/install_tinymce_lang.php | 2 | // bin/install_tinymce_lang.php |
| 3 | function installTinymceLang(string $lang = 'fr_FR'): void | 3 | function installTinymceLang(string $lang = 'fr_FR'): void |
| 4 | { | 4 | { |
| 5 | $dest = 'public/js/tinymce-langs/' . $lang . '.js'; | 5 | $path = 'public/js/tinymce-langs'; |
| 6 | $dest = $lang . '.js'; | ||
| 6 | $link = "https://cdn.jsdelivr.net/npm/tinymce-lang/langs/" . $lang . ".min.js"; | 7 | $link = "https://cdn.jsdelivr.net/npm/tinymce-lang/langs/" . $lang . ".min.js"; |
| 7 | 8 | ||
| 8 | $curl = curl_init($link); | 9 | $curl = curl_init($link); |
| @@ -10,8 +11,12 @@ function installTinymceLang(string $lang = 'fr_FR'): void | |||
| 10 | echo "Erreur : Impossible d'initialiser cURL.\n"; | 11 | echo "Erreur : Impossible d'initialiser cURL.\n"; |
| 11 | return; | 12 | return; |
| 12 | } | 13 | } |
| 14 | |||
| 15 | if(!is_dir($path)){ | ||
| 16 | mkdir($path, 0755, true); | ||
| 17 | } | ||
| 13 | 18 | ||
| 14 | $file = @fopen($dest, 'w+'); // @masque l'erreur pour la traiter soi-même | 19 | $file = @fopen($path . '/' . $dest, 'w+'); // @masque l'erreur pour la traiter soi-même |
| 15 | if(!$file){ // erreur écriture fichier | 20 | if(!$file){ // erreur écriture fichier |
| 16 | echo "Erreur : Impossible d'ouvrir le fichier $dest pour l'écriture.\n"; | 21 | echo "Erreur : Impossible d'ouvrir le fichier $dest pour l'écriture.\n"; |
| 17 | return; | 22 | return; |
diff --git a/composer.json b/composer.json index 5435c0e..a661963 100644 --- a/composer.json +++ b/composer.json | |||
| @@ -2,24 +2,26 @@ | |||
| 2 | "name": "ordipolo/cms", | 2 | "name": "ordipolo/cms", |
| 3 | "description": "CMS maison avec PHP, doctrine et tinMCE", | 3 | "description": "CMS maison avec PHP, doctrine et tinMCE", |
| 4 | "require": { | 4 | "require": { |
| 5 | "doctrine/dbal": "^4.2", | 5 | "doctrine/dbal": "^4.3", |
| 6 | "doctrine/orm": "^3.3", | 6 | "doctrine/orm": "^3.5", |
| 7 | "symfony/cache": "^7.2", | 7 | "symfony/cache": "^7.3", |
| 8 | "composer": "*", | 8 | "composer": "*", |
| 9 | "htmlawed/htmlawed": "^1.2", | 9 | "htmlawed/htmlawed": "^1.2", |
| 10 | "tinymce/tinymce": "^7.7", | 10 | "tinymce/tinymce": "^8.2", |
| 11 | "phpmailer/phpmailer": "^6.10", | 11 | "phpmailer/phpmailer": "^7.0", |
| 12 | "symfony/http-foundation": "^7.3" | 12 | "symfony/http-foundation": "^7.3", |
| 13 | "twbs/bootstrap-icons": "^1.13" | ||
| 13 | }, | 14 | }, |
| 14 | "scripts": { | 15 | "scripts": { |
| 15 | "post-install-cmd": [ | 16 | "post-install-cmd": [ |
| 16 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tinymce/tinymce public/js/tinymce", | 17 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tinymce/tinymce public/js/tinymce", |
| 17 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/install_tinymce_lang.php fr_FR" | 18 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/install_tinymce_lang.php fr_FR", |
| 18 | 19 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/twbs/bootstrap-icons/icons public/icons" | |
| 19 | ], | 20 | ], |
| 20 | "post-update-cmd": [ | 21 | "post-update-cmd": [ |
| 21 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tinymce/tinymce public/js/tinymce", | 22 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tinymce/tinymce public/js/tinymce", |
| 22 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/install_tinymce_lang.php fr_FR" | 23 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/install_tinymce_lang.php fr_FR", |
| 24 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/twbs/bootstrap-icons/icons public/icons" | ||
| 23 | ] | 25 | ] |
| 24 | }, | 26 | }, |
| 25 | "authors": [ | 27 | "authors": [ |
diff --git a/public/assets/facebook-nb.svg b/public/assets/facebook-nb.svg deleted file mode 100644 index 543537c..0000000 --- a/public/assets/facebook-nb.svg +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.001 2C6.47813 2 2.00098 6.47715 2.00098 12C2.00098 16.9913 5.65783 21.1283 10.4385 21.8785V14.8906H7.89941V12H10.4385V9.79688C10.4385 7.29063 11.9314 5.90625 14.2156 5.90625C15.3097 5.90625 16.4541 6.10156 16.4541 6.10156V8.5625H15.1931C13.9509 8.5625 13.5635 9.33334 13.5635 10.1242V12H16.3369L15.8936 14.8906H13.5635V21.8785C18.3441 21.1283 22.001 16.9913 22.001 12C22.001 6.47715 17.5238 2 12.001 2Z"></path></svg> \ No newline at end of file | ||
diff --git a/public/assets/facebook.svg b/public/assets/facebook.svg deleted file mode 100644 index d09d296..0000000 --- a/public/assets/facebook.svg +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | <svg | ||
| 3 | viewBox="0 0 24 24" | ||
| 4 | fill="currentColor" | ||
| 5 | version="1.1" | ||
| 6 | id="svg1" | ||
| 7 | sodipodi:docname="facebook.svg" | ||
| 8 | inkscape:version="1.4 (e7c3feb100, 2024-10-09)" | ||
| 9 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 11 | xmlns="http://www.w3.org/2000/svg" | ||
| 12 | xmlns:svg="http://www.w3.org/2000/svg"> | ||
| 13 | <defs | ||
| 14 | id="defs1" /> | ||
| 15 | <sodipodi:namedview | ||
| 16 | id="namedview1" | ||
| 17 | pagecolor="#ffffff" | ||
| 18 | bordercolor="#000000" | ||
| 19 | borderopacity="0.25" | ||
| 20 | inkscape:showpageshadow="2" | ||
| 21 | inkscape:pageopacity="0.0" | ||
| 22 | inkscape:pagecheckerboard="0" | ||
| 23 | inkscape:deskcolor="#d1d1d1" | ||
| 24 | inkscape:zoom="6.8333333" | ||
| 25 | inkscape:cx="12" | ||
| 26 | inkscape:cy="11.926829" | ||
| 27 | inkscape:window-width="1374" | ||
| 28 | inkscape:window-height="1032" | ||
| 29 | inkscape:window-x="542" | ||
| 30 | inkscape:window-y="0" | ||
| 31 | inkscape:window-maximized="1" | ||
| 32 | inkscape:current-layer="svg1" /> | ||
| 33 | <path | ||
| 34 | d="M12.001 2C6.47813 2 2.00098 6.47715 2.00098 12C2.00098 16.9913 5.65783 21.1283 10.4385 21.8785V14.8906H7.89941V12H10.4385V9.79688C10.4385 7.29063 11.9314 5.90625 14.2156 5.90625C15.3097 5.90625 16.4541 6.10156 16.4541 6.10156V8.5625H15.1931C13.9509 8.5625 13.5635 9.33334 13.5635 10.1242V12H16.3369L15.8936 14.8906H13.5635V21.8785C18.3441 21.1283 22.001 16.9913 22.001 12C22.001 6.47715 17.5238 2 12.001 2Z" | ||
| 35 | id="path1" | ||
| 36 | style="fill:#dd3333;fill-opacity:1;stroke:none;stroke-opacity:1" /> | ||
| 37 | </svg> | ||
diff --git a/public/assets/github-nb.svg b/public/assets/github-nb.svg deleted file mode 100644 index fdda08a..0000000 --- a/public/assets/github-nb.svg +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.001 2C6.47598 2 2.00098 6.475 2.00098 12C2.00098 16.425 4.86348 20.1625 8.83848 21.4875C9.33848 21.575 9.52598 21.275 9.52598 21.0125C9.52598 20.775 9.51348 19.9875 9.51348 19.15C7.00098 19.6125 6.35098 18.5375 6.15098 17.975C6.03848 17.6875 5.55098 16.8 5.12598 16.5625C4.77598 16.375 4.27598 15.9125 5.11348 15.9C5.90098 15.8875 6.46348 16.625 6.65098 16.925C7.55098 18.4375 8.98848 18.0125 9.56348 17.75C9.65098 17.1 9.91348 16.6625 10.201 16.4125C7.97598 16.1625 5.65098 15.3 5.65098 11.475C5.65098 10.3875 6.03848 9.4875 6.67598 8.7875C6.57598 8.5375 6.22598 7.5125 6.77598 6.1375C6.77598 6.1375 7.61348 5.875 9.52598 7.1625C10.326 6.9375 11.176 6.825 12.026 6.825C12.876 6.825 13.726 6.9375 14.526 7.1625C16.4385 5.8625 17.276 6.1375 17.276 6.1375C17.826 7.5125 17.476 8.5375 17.376 8.7875C18.0135 9.4875 18.401 10.375 18.401 11.475C18.401 15.3125 16.0635 16.1625 13.8385 16.4125C14.201 16.725 14.5135 17.325 14.5135 18.2625C14.5135 19.6 14.501 20.675 14.501 21.0125C14.501 21.275 14.6885 21.5875 15.1885 21.4875C19.259 20.1133 21.9999 16.2963 22.001 12C22.001 6.475 17.526 2 12.001 2Z"></path></svg> \ No newline at end of file | ||
diff --git a/public/assets/github.svg b/public/assets/github.svg deleted file mode 100644 index 69a8733..0000000 --- a/public/assets/github.svg +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | <svg | ||
| 3 | viewBox="0 0 24 24" | ||
| 4 | fill="currentColor" | ||
| 5 | version="1.1" | ||
| 6 | id="svg1" | ||
| 7 | sodipodi:docname="github.svg" | ||
| 8 | inkscape:version="1.4.1 (93de688d07, 2025-03-30)" | ||
| 9 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 11 | xmlns="http://www.w3.org/2000/svg" | ||
| 12 | xmlns:svg="http://www.w3.org/2000/svg"> | ||
| 13 | <defs | ||
| 14 | id="defs1" /> | ||
| 15 | <sodipodi:namedview | ||
| 16 | id="namedview1" | ||
| 17 | pagecolor="#ffffff" | ||
| 18 | bordercolor="#000000" | ||
| 19 | borderopacity="0.25" | ||
| 20 | inkscape:showpageshadow="2" | ||
| 21 | inkscape:pageopacity="0.0" | ||
| 22 | inkscape:pagecheckerboard="0" | ||
| 23 | inkscape:deskcolor="#d1d1d1" | ||
| 24 | inkscape:zoom="11.549411" | ||
| 25 | inkscape:cx="4.6755632" | ||
| 26 | inkscape:cy="5.324947" | ||
| 27 | inkscape:window-width="1399" | ||
| 28 | inkscape:window-height="1032" | ||
| 29 | inkscape:window-x="517" | ||
| 30 | inkscape:window-y="0" | ||
| 31 | inkscape:window-maximized="1" | ||
| 32 | inkscape:current-layer="svg1" /> | ||
| 33 | <path | ||
| 34 | style="fill:#dd3333;stroke:#dd3333;stroke-width:0.327249" | ||
| 35 | d="M 8.4852814,21.307718 C 7.955914,21.108949 6.9013636,20.552461 6.3671832,20.189993 5.6789926,19.723022 4.5113583,18.59261 3.9886125,17.887248 3.0826649,16.664815 2.3701942,14.947697 2.1595933,13.479147 2.0016653,12.377892 2.0955724,10.579173 2.3645735,9.5529082 3.3853776,5.6584436 6.5930714,2.7581765 10.537033,2.1637012 c 1.066368,-0.1607342 1.836609,-0.1617733 2.883925,-0.00389 2.083052,0.3140198 3.873467,1.188981 5.39679,2.6373669 4.102465,3.9006521 4.17868,10.2469419 0.171245,14.2594069 -1.101446,1.102828 -2.955529,2.231237 -3.867015,2.353493 -0.55147,0.07397 -0.575781,-0.0093 -0.575781,-1.972691 0,-1.792147 -0.08726,-2.364494 -0.423857,-2.780176 l -0.162507,-0.200687 0.777523,-0.15708 c 1.061175,-0.214384 1.782467,-0.559095 2.3976,-1.145834 0.893802,-0.852542 1.260079,-1.870144 1.262674,-3.507994 0.0018,-1.155649 -0.134211,-1.6724702 -0.640257,-2.4323411 -0.230454,-0.3460463 -0.30397,-0.5313214 -0.257672,-0.6493838 0.102813,-0.2621736 0.0741,-1.6893394 -0.04165,-2.0700528 l -0.105297,-0.346338 -0.515787,1.84e-4 c -0.428033,1.526e-4 -0.640999,0.061119 -1.251754,0.358346 C 15.18043,6.7030194 14.775814,6.9205461 14.686065,6.989423 14.543427,7.0988892 14.45623,7.0978007 13.993389,6.980773 13.254615,6.7939818 10.810849,6.7953318 10.06772,6.982943 9.5323043,7.1181146 9.5268032,7.1176101 9.2133081,6.9045846 8.6534451,6.5241479 7.7687298,6.1722058 7.2551882,6.1256395 6.7708068,6.0817174 6.7558534,6.0868789 6.6616746,6.3305022 6.4634945,6.8431577 6.3883536,7.6562797 6.4868767,8.2220414 6.581993,8.7682397 6.5818871,8.7687488 6.2796494,9.2178723 5.8365805,9.8762698 5.6276896,10.638357 5.6294962,11.589798 c 0.005,2.635183 1.2384114,4.232873 3.6350457,4.708641 0.4047826,0.08036 0.7519641,0.157069 0.7715141,0.170474 0.01955,0.01341 -0.02932,0.09605 -0.1086025,0.183656 -0.079282,0.0876 -0.2158076,0.370099 -0.3033907,0.627765 -0.1432863,0.421541 -0.1931333,0.47871 -0.4974888,0.570562 -1.0539106,0.318062 -1.6222978,0.05789 -2.6695591,-1.221956 -0.465256,-0.568585 -0.7730374,-0.739966 -1.3296005,-0.74036 -0.5987893,-4.24e-4 -0.7030483,0.192846 -0.2775657,0.514538 0.52731,0.398679 0.8514007,0.798691 1.170754,1.445012 0.3600775,0.728741 0.817606,1.172213 1.3684944,1.326452 0.2090694,0.05854 0.7280608,0.09106 1.1995571,0.07518 l 0.8310538,-0.028 0.039994,0.865845 c 0.047623,1.031015 -0.033692,1.290675 -0.4122232,1.316335 -0.1425333,0.0097 -0.3955219,-0.03364 -0.5621971,-0.09622 z" | ||
| 36 | id="path2" /> | ||
| 37 | </svg> | ||
diff --git a/public/assets/instagram-nb.svg b/public/assets/instagram-nb.svg deleted file mode 100644 index c51ee39..0000000 --- a/public/assets/instagram-nb.svg +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12.001 9C10.3436 9 9.00098 10.3431 9.00098 12C9.00098 13.6573 10.3441 15 12.001 15C13.6583 15 15.001 13.6569 15.001 12C15.001 10.3427 13.6579 9 12.001 9ZM12.001 7C14.7614 7 17.001 9.2371 17.001 12C17.001 14.7605 14.7639 17 12.001 17C9.24051 17 7.00098 14.7629 7.00098 12C7.00098 9.23953 9.23808 7 12.001 7ZM18.501 6.74915C18.501 7.43926 17.9402 7.99917 17.251 7.99917C16.5609 7.99917 16.001 7.4384 16.001 6.74915C16.001 6.0599 16.5617 5.5 17.251 5.5C17.9393 5.49913 18.501 6.0599 18.501 6.74915ZM12.001 4C9.5265 4 9.12318 4.00655 7.97227 4.0578C7.18815 4.09461 6.66253 4.20007 6.17416 4.38967C5.74016 4.55799 5.42709 4.75898 5.09352 5.09255C4.75867 5.4274 4.55804 5.73963 4.3904 6.17383C4.20036 6.66332 4.09493 7.18811 4.05878 7.97115C4.00703 9.0752 4.00098 9.46105 4.00098 12C4.00098 14.4745 4.00753 14.8778 4.05877 16.0286C4.0956 16.8124 4.2012 17.3388 4.39034 17.826C4.5591 18.2606 4.7605 18.5744 5.09246 18.9064C5.42863 19.2421 5.74179 19.4434 6.17187 19.6094C6.66619 19.8005 7.19148 19.9061 7.97212 19.9422C9.07618 19.9939 9.46203 20 12.001 20C14.4755 20 14.8788 19.9934 16.0296 19.9422C16.8117 19.9055 17.3385 19.7996 17.827 19.6106C18.2604 19.4423 18.5752 19.2402 18.9074 18.9085C19.2436 18.5718 19.4445 18.2594 19.6107 17.8283C19.8013 17.3358 19.9071 16.8098 19.9432 16.0289C19.9949 14.9248 20.001 14.5389 20.001 12C20.001 9.52552 19.9944 9.12221 19.9432 7.97137C19.9064 7.18906 19.8005 6.66149 19.6113 6.17318C19.4434 5.74038 19.2417 5.42635 18.9084 5.09255C18.573 4.75715 18.2616 4.55693 17.8271 4.38942C17.338 4.19954 16.8124 4.09396 16.0298 4.05781C14.9258 4.00605 14.5399 4 12.001 4ZM12.001 2C14.7176 2 15.0568 2.01 16.1235 2.06C17.1876 2.10917 17.9135 2.2775 18.551 2.525C19.2101 2.77917 19.7668 3.1225 20.3226 3.67833C20.8776 4.23417 21.221 4.7925 21.476 5.45C21.7226 6.08667 21.891 6.81333 21.941 7.8775C21.9885 8.94417 22.001 9.28333 22.001 12C22.001 14.7167 21.991 15.0558 21.941 16.1225C21.8918 17.1867 21.7226 17.9125 21.476 18.55C21.2218 19.2092 20.8776 19.7658 20.3226 20.3217C19.7668 20.8767 19.2076 21.22 18.551 21.475C17.9135 21.7217 17.1876 21.89 16.1235 21.94C15.0568 21.9875 14.7176 22 12.001 22C9.28431 22 8.94514 21.99 7.87848 21.94C6.81431 21.8908 6.08931 21.7217 5.45098 21.475C4.79264 21.2208 4.23514 20.8767 3.67931 20.3217C3.12348 19.7658 2.78098 19.2067 2.52598 18.55C2.27848 17.9125 2.11098 17.1867 2.06098 16.1225C2.01348 15.0558 2.00098 14.7167 2.00098 12C2.00098 9.28333 2.01098 8.94417 2.06098 7.8775C2.11014 6.8125 2.27848 6.0875 2.52598 5.45C2.78014 4.79167 3.12348 4.23417 3.67931 3.67833C4.23514 3.1225 4.79348 2.78 5.45098 2.525C6.08848 2.2775 6.81348 2.11 7.87848 2.06C8.94514 2.0125 9.28431 2 12.001 2Z"></path></svg> \ No newline at end of file | ||
diff --git a/public/assets/instagram.svg b/public/assets/instagram.svg deleted file mode 100644 index feb8ae8..0000000 --- a/public/assets/instagram.svg +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | <svg | ||
| 3 | viewBox="0 0 24 24" | ||
| 4 | fill="currentColor" | ||
| 5 | version="1.1" | ||
| 6 | id="svg1" | ||
| 7 | sodipodi:docname="instagram.svg" | ||
| 8 | inkscape:version="1.4 (e7c3feb100, 2024-10-09)" | ||
| 9 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 11 | xmlns="http://www.w3.org/2000/svg" | ||
| 12 | xmlns:svg="http://www.w3.org/2000/svg"> | ||
| 13 | <defs | ||
| 14 | id="defs1" /> | ||
| 15 | <sodipodi:namedview | ||
| 16 | id="namedview1" | ||
| 17 | pagecolor="#ffffff" | ||
| 18 | bordercolor="#000000" | ||
| 19 | borderopacity="0.25" | ||
| 20 | inkscape:showpageshadow="2" | ||
| 21 | inkscape:pageopacity="0.0" | ||
| 22 | inkscape:pagecheckerboard="0" | ||
| 23 | inkscape:deskcolor="#d1d1d1" | ||
| 24 | inkscape:zoom="20.166667" | ||
| 25 | inkscape:cx="12" | ||
| 26 | inkscape:cy="12.024793" | ||
| 27 | inkscape:window-width="1391" | ||
| 28 | inkscape:window-height="1032" | ||
| 29 | inkscape:window-x="525" | ||
| 30 | inkscape:window-y="0" | ||
| 31 | inkscape:window-maximized="1" | ||
| 32 | inkscape:current-layer="svg1" /> | ||
| 33 | <path | ||
| 34 | d="M12.001 9C10.3436 9 9.00098 10.3431 9.00098 12C9.00098 13.6573 10.3441 15 12.001 15C13.6583 15 15.001 13.6569 15.001 12C15.001 10.3427 13.6579 9 12.001 9ZM12.001 7C14.7614 7 17.001 9.2371 17.001 12C17.001 14.7605 14.7639 17 12.001 17C9.24051 17 7.00098 14.7629 7.00098 12C7.00098 9.23953 9.23808 7 12.001 7ZM18.501 6.74915C18.501 7.43926 17.9402 7.99917 17.251 7.99917C16.5609 7.99917 16.001 7.4384 16.001 6.74915C16.001 6.0599 16.5617 5.5 17.251 5.5C17.9393 5.49913 18.501 6.0599 18.501 6.74915ZM12.001 4C9.5265 4 9.12318 4.00655 7.97227 4.0578C7.18815 4.09461 6.66253 4.20007 6.17416 4.38967C5.74016 4.55799 5.42709 4.75898 5.09352 5.09255C4.75867 5.4274 4.55804 5.73963 4.3904 6.17383C4.20036 6.66332 4.09493 7.18811 4.05878 7.97115C4.00703 9.0752 4.00098 9.46105 4.00098 12C4.00098 14.4745 4.00753 14.8778 4.05877 16.0286C4.0956 16.8124 4.2012 17.3388 4.39034 17.826C4.5591 18.2606 4.7605 18.5744 5.09246 18.9064C5.42863 19.2421 5.74179 19.4434 6.17187 19.6094C6.66619 19.8005 7.19148 19.9061 7.97212 19.9422C9.07618 19.9939 9.46203 20 12.001 20C14.4755 20 14.8788 19.9934 16.0296 19.9422C16.8117 19.9055 17.3385 19.7996 17.827 19.6106C18.2604 19.4423 18.5752 19.2402 18.9074 18.9085C19.2436 18.5718 19.4445 18.2594 19.6107 17.8283C19.8013 17.3358 19.9071 16.8098 19.9432 16.0289C19.9949 14.9248 20.001 14.5389 20.001 12C20.001 9.52552 19.9944 9.12221 19.9432 7.97137C19.9064 7.18906 19.8005 6.66149 19.6113 6.17318C19.4434 5.74038 19.2417 5.42635 18.9084 5.09255C18.573 4.75715 18.2616 4.55693 17.8271 4.38942C17.338 4.19954 16.8124 4.09396 16.0298 4.05781C14.9258 4.00605 14.5399 4 12.001 4ZM12.001 2C14.7176 2 15.0568 2.01 16.1235 2.06C17.1876 2.10917 17.9135 2.2775 18.551 2.525C19.2101 2.77917 19.7668 3.1225 20.3226 3.67833C20.8776 4.23417 21.221 4.7925 21.476 5.45C21.7226 6.08667 21.891 6.81333 21.941 7.8775C21.9885 8.94417 22.001 9.28333 22.001 12C22.001 14.7167 21.991 15.0558 21.941 16.1225C21.8918 17.1867 21.7226 17.9125 21.476 18.55C21.2218 19.2092 20.8776 19.7658 20.3226 20.3217C19.7668 20.8767 19.2076 21.22 18.551 21.475C17.9135 21.7217 17.1876 21.89 16.1235 21.94C15.0568 21.9875 14.7176 22 12.001 22C9.28431 22 8.94514 21.99 7.87848 21.94C6.81431 21.8908 6.08931 21.7217 5.45098 21.475C4.79264 21.2208 4.23514 20.8767 3.67931 20.3217C3.12348 19.7658 2.78098 19.2067 2.52598 18.55C2.27848 17.9125 2.11098 17.1867 2.06098 16.1225C2.01348 15.0558 2.00098 14.7167 2.00098 12C2.00098 9.28333 2.01098 8.94417 2.06098 7.8775C2.11014 6.8125 2.27848 6.0875 2.52598 5.45C2.78014 4.79167 3.12348 4.23417 3.67931 3.67833C4.23514 3.1225 4.79348 2.78 5.45098 2.525C6.08848 2.2775 6.81348 2.11 7.87848 2.06C8.94514 2.0125 9.28431 2 12.001 2Z" | ||
| 35 | id="path1" | ||
| 36 | style="fill:#dd3333;fill-opacity:1" /> | ||
| 37 | </svg> | ||
diff --git a/public/assets/linkedin-nb.svg b/public/assets/linkedin-nb.svg deleted file mode 100644 index 42449fc..0000000 --- a/public/assets/linkedin-nb.svg +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18.3362 18.339H15.6707V14.1622C15.6707 13.1662 15.6505 11.8845 14.2817 11.8845C12.892 11.8845 12.6797 12.9683 12.6797 14.0887V18.339H10.0142V9.75H12.5747V10.9207H12.6092C12.967 10.2457 13.837 9.53325 15.1367 9.53325C17.8375 9.53325 18.337 11.3108 18.337 13.6245V18.339H18.3362ZM7.00373 8.57475C6.14573 8.57475 5.45648 7.88025 5.45648 7.026C5.45648 6.1725 6.14648 5.47875 7.00373 5.47875C7.85873 5.47875 8.55173 6.1725 8.55173 7.026C8.55173 7.88025 7.85798 8.57475 7.00373 8.57475ZM8.34023 18.339H5.66723V9.75H8.34023V18.339ZM19.6697 3H4.32923C3.59498 3 3.00098 3.5805 3.00098 4.29675V19.7033C3.00098 20.4202 3.59498 21 4.32923 21H19.6675C20.401 21 21.001 20.4202 21.001 19.7033V4.29675C21.001 3.5805 20.401 3 19.6675 3H19.6697Z"></path></svg> \ No newline at end of file | ||
diff --git a/public/assets/linkedin.svg b/public/assets/linkedin.svg deleted file mode 100644 index 0cb2381..0000000 --- a/public/assets/linkedin.svg +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | <svg | ||
| 3 | viewBox="0 0 24 24" | ||
| 4 | fill="currentColor" | ||
| 5 | version="1.1" | ||
| 6 | id="svg1" | ||
| 7 | sodipodi:docname="linkedin-nb.svg" | ||
| 8 | inkscape:version="1.4.1 (93de688d07, 2025-03-30)" | ||
| 9 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 11 | xmlns="http://www.w3.org/2000/svg" | ||
| 12 | xmlns:svg="http://www.w3.org/2000/svg"> | ||
| 13 | <defs | ||
| 14 | id="defs1" /> | ||
| 15 | <sodipodi:namedview | ||
| 16 | id="namedview1" | ||
| 17 | pagecolor="#ffffff" | ||
| 18 | bordercolor="#000000" | ||
| 19 | borderopacity="0.25" | ||
| 20 | inkscape:showpageshadow="2" | ||
| 21 | inkscape:pageopacity="0.0" | ||
| 22 | inkscape:pagecheckerboard="0" | ||
| 23 | inkscape:deskcolor="#d1d1d1" | ||
| 24 | inkscape:zoom="10.166667" | ||
| 25 | inkscape:cx="12" | ||
| 26 | inkscape:cy="12.04918" | ||
| 27 | inkscape:window-width="1916" | ||
| 28 | inkscape:window-height="1032" | ||
| 29 | inkscape:window-x="0" | ||
| 30 | inkscape:window-y="0" | ||
| 31 | inkscape:window-maximized="1" | ||
| 32 | inkscape:current-layer="svg1" /> | ||
| 33 | <path | ||
| 34 | style="fill:#dd3333;stroke:#dd3333;stroke-width:0.371757" | ||
| 35 | d="M 4.1311475,20.910086 C 3.6620652,20.794602 3.406594,20.62222 3.2469197,20.313445 3.1179756,20.064093 3.0983607,18.966433 3.0983607,12 c 0,-8.8532304 -0.03017,-8.4236524 0.616419,-8.7770236 C 4.0113978,3.0608698 4.5686607,3.0491803 12,3.0491803 c 7.431339,0 7.988603,0.011689 8.28522,0.1737961 0.174904,0.095588 0.396215,0.3168993 0.491803,0.4918033 C 20.93913,4.0113978 20.95082,4.5686607 20.95082,12 c 0,7.431339 -0.01169,7.988603 -0.173797,8.28522 -0.382317,0.699555 0.06784,0.663798 -8.580302,0.681556 -4.2737702,0.0088 -7.9032784,-0.01674 -8.0655735,-0.05669 z M 8.4098361,14.016393 V 9.6885246 H 7.0327869 5.6557377 v 4.3278684 4.327869 h 1.3770492 1.3770492 z m 4.3454209,1.647541 c 0.02932,-2.484375 0.04625,-2.705496 0.231696,-3.02459 0.281484,-0.48436 0.756161,-0.708704 1.399049,-0.661226 0.611966,0.04519 0.923145,0.28708 1.091282,0.848275 0.07244,0.241789 0.11288,1.297628 0.11288,2.947314 v 2.570555 h 1.383069 1.383068 l -0.0316,-3.270492 C 18.294872,11.985695 18.281225,11.774152 18.080026,11.281074 17.766715,10.513242 17.43091,10.130931 16.795899,9.8191095 16.288904,9.5701499 16.12636,9.5409836 15.245902,9.5409836 c -1.14142,0 -1.628041,0.1717844 -2.237705,0.7899424 l -0.368853,0.373992 V 10.196721 9.6885246 H 11.311475 9.9836066 v 4.3278684 4.327869 H 11.353618 12.72363 Z M 7.8206724,8.3852459 C 8.3791951,8.0051187 8.557377,7.6780083 8.557377,7.0327869 8.557377,6.3875655 8.3791951,6.0604551 7.8206724,5.6803279 7.182213,5.2457963 6.1194771,5.4518592 5.7004047,6.0914446 5.3325524,6.6528581 5.343805,7.486701 5.7261443,7.9988028 6.1804539,8.6073014 7.2141752,8.7980243 7.8206724,8.3852459 Z" | ||
| 36 | id="path2" /> | ||
| 37 | </svg> | ||
diff --git a/public/css/body.css b/public/css/body.css index 57afe92..1f6ef7e 100644 --- a/public/css/body.css +++ b/public/css/body.css | |||
| @@ -47,7 +47,7 @@ main | |||
| 47 | } | 47 | } |
| 48 | .hidden | 48 | .hidden |
| 49 | { | 49 | { |
| 50 | display: none; | 50 | display: none; /* attention, conflit si la même balise a déjà une règle display */ |
| 51 | } | 51 | } |
| 52 | section | 52 | section |
| 53 | { | 53 | { |
diff --git a/public/css/head.css b/public/css/head.css index 1844f93..1b805fe 100644 --- a/public/css/head.css +++ b/public/css/head.css | |||
| @@ -86,12 +86,34 @@ header a | |||
| 86 | display: flex; | 86 | display: flex; |
| 87 | gap: 4px; | 87 | gap: 4px; |
| 88 | flex-wrap: wrap; | 88 | flex-wrap: wrap; |
| 89 | margin: 4px; | ||
| 89 | } | 90 | } |
| 90 | #header_social_content a img | 91 | #header_social_content > div{ |
| 92 | margin: auto; | ||
| 93 | background-color: #ffffff7f; | ||
| 94 | } | ||
| 95 | #header_social_content a:hover | ||
| 96 | { | ||
| 97 | background-color: yellow; | ||
| 98 | } | ||
| 99 | #header_social_content > div, #header_social_content a:hover | ||
| 100 | { | ||
| 101 | border-radius: 10px; | ||
| 102 | } | ||
| 103 | #header_social_content a | ||
| 104 | { | ||
| 105 | padding: 2px; | ||
| 106 | display: inline-flex; /* flex pour que la taille de élément dépende de ses enfants, inline pour que <a> este inline */ | ||
| 107 | vertical-align: bottom; | ||
| 108 | } | ||
| 109 | #header_social_content a svg | ||
| 110 | { | ||
| 111 | width: 24px; | ||
| 112 | height: 24px; | ||
| 113 | } | ||
| 114 | .svg_fill_red | ||
| 91 | { | 115 | { |
| 92 | width: 28px; | 116 | fill: #dd3333; |
| 93 | background-color: #ffffffb3; | ||
| 94 | border-radius: 50%; | ||
| 95 | } | 117 | } |
| 96 | #header_social_content .action_icon | 118 | #header_social_content .action_icon |
| 97 | { | 119 | { |
diff --git a/public/css/menu.css b/public/css/menu.css index 0dfb840..aa8fde3 100644 --- a/public/css/menu.css +++ b/public/css/menu.css | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | /*-- page "Menu et chemins" uniquement --*/ | 1 | /*-- page "Menu et chemins" uniquement --*/ |
| 2 | 2 | ||
| 3 | .menu | 3 | /*.menu |
| 4 | { | 4 | {}*/ |
| 5 | padding: 0 20px; | ||
| 6 | } | ||
| 7 | .menu_edit_entry | 5 | .menu_edit_entry |
| 8 | { | 6 | { |
| 9 | margin-left: 29px; | 7 | margin-left: 29px; |
diff --git a/public/css/new_page.css b/public/css/new_page.css index 6d6fe43..80c7e1d 100644 --- a/public/css/new_page.css +++ b/public/css/new_page.css | |||
| @@ -1,8 +1,7 @@ | |||
| 1 | /*-- page "Nouvelle page" uniquement --*/ | 1 | /*-- page "Nouvelle page" uniquement --*/ |
| 2 | .new_page | 2 | |
| 3 | { | 3 | /*.new_page |
| 4 | padding: 0 15px; | 4 | {}*/ |
| 5 | } | ||
| 6 | .new_page .form_zone | 5 | .new_page .form_zone |
| 7 | { | 6 | { |
| 8 | background-color: white; | 7 | background-color: white; |
diff --git a/public/js/main.js b/public/js/main.js index 39a31f5..42bae70 100644 --- a/public/js/main.js +++ b/public/js/main.js | |||
| @@ -207,8 +207,8 @@ function checkSocialNetwork(id){ | |||
| 207 | method: 'POST', | 207 | method: 'POST', |
| 208 | onSuccess: (data) => { | 208 | onSuccess: (data) => { |
| 209 | checkbox.checked = data.checked; | 209 | checkbox.checked = data.checked; |
| 210 | document.getElementById(id + '_content').src = 'assets/' + id.split('_')[1] + (data.checked ? '': '-nb') + '.svg'; // assets/facebook.svg ou assets/facebook-nb.svg | 210 | document.getElementById(id + '_content').classList.toggle('svg_fill_red', data.checked); |
| 211 | toastNotify('Le logo "' + id.split('_')[1] + '" ' + (data.checked ? 'sera' : 'ne sera pas') + ' affiché aux visiteurs.'); | 211 | toastNotify('Le logo "' + id.split('_')[1] + '" ' + (data.checked ? 'sera' : 'ne sera pas') + ' affiché.'); |
| 212 | }, | 212 | }, |
| 213 | onFailure: (data) => { | 213 | onFailure: (data) => { |
| 214 | console.error(data.message || "Erreur serveur"); | 214 | console.error(data.message || "Erreur serveur"); |
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index b0aaef9..85cc0a6 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php | |||
| @@ -13,7 +13,7 @@ use Doctrine\Common\Collections\Collection; // interface | |||
| 13 | #[ORM\Table(name: TABLE_PREFIX . "node_data")] | 13 | #[ORM\Table(name: TABLE_PREFIX . "node_data")] |
| 14 | class NodeData | 14 | class NodeData |
| 15 | { | 15 | { |
| 16 | static array $social_networks = ['facebook', 'instagram', 'linkedin', 'github']; // à completer | 16 | static array $social_networks = ['facebook', 'instagram', 'whatsapp', 'snapchat', 'tiktok', 'linkedin', 'github']; // à completer |
| 17 | 17 | ||
| 18 | #[ORM\Id] | 18 | #[ORM\Id] |
| 19 | #[ORM\GeneratedValue] | 19 | #[ORM\GeneratedValue] |
diff --git a/src/view/AbstractBuilder.php b/src/view/AbstractBuilder.php index 3d315b1..b9a1d7f 100644 --- a/src/view/AbstractBuilder.php +++ b/src/view/AbstractBuilder.php | |||
| @@ -57,4 +57,21 @@ abstract class AbstractBuilder | |||
| 57 | { | 57 | { |
| 58 | $this->html .= $html; | 58 | $this->html .= $html; |
| 59 | } | 59 | } |
| 60 | |||
| 61 | protected function insertSVG(string $path, array $attributes = []): string | ||
| 62 | { | ||
| 63 | $svg = file_get_contents($path); | ||
| 64 | |||
| 65 | // modification des attributs | ||
| 66 | if(!empty($attributes)){ | ||
| 67 | $dom = new DOMDocument(); | ||
| 68 | $dom->loadXML($svg); | ||
| 69 | $svg_elem = $dom->documentElement; | ||
| 70 | foreach($attributes as $key => $value){ | ||
| 71 | $svg_elem->setAttribute($key, $value); | ||
| 72 | } | ||
| 73 | $svg = $dom->saveXML($svg_elem); | ||
| 74 | } | ||
| 75 | return $svg; | ||
| 76 | } | ||
| 60 | } \ No newline at end of file | 77 | } \ No newline at end of file |
diff --git a/src/view/HeadBuilder.php b/src/view/HeadBuilder.php index e3d620c..fa0f063 100644 --- a/src/view/HeadBuilder.php +++ b/src/view/HeadBuilder.php | |||
| @@ -18,14 +18,12 @@ class HeadBuilder extends AbstractBuilder | |||
| 18 | $page = Model::$page_path->getLast(); | 18 | $page = Model::$page_path->getLast(); |
| 19 | 19 | ||
| 20 | $css = ''; | 20 | $css = ''; |
| 21 | foreach($page->getCSS() as $name) | 21 | foreach($page->getCSS() as $name){ |
| 22 | { | ||
| 23 | $css .= '<link rel="stylesheet" href="' . self::versionedFileURL('css', $name) . '">' . "\n"; | 22 | $css .= '<link rel="stylesheet" href="' . self::versionedFileURL('css', $name) . '">' . "\n"; |
| 24 | } | 23 | } |
| 25 | 24 | ||
| 26 | $js = ''; | 25 | $js = ''; |
| 27 | foreach($page->getJS() as $name) | 26 | foreach($page->getJS() as $name){ |
| 28 | { | ||
| 29 | $js .= '<script src="' . self::versionedFileURL('js', $name) . '"></script>' . "\n"; | 27 | $js .= '<script src="' . self::versionedFileURL('js', $name) . '"></script>' . "\n"; |
| 30 | } | 28 | } |
| 31 | 29 | ||
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 | } |
diff --git a/src/view/templates/header.php b/src/view/templates/header.php index 4c39cfd..a2d472d 100644 --- a/src/view/templates/header.php +++ b/src/view/templates/header.php | |||
| @@ -35,7 +35,7 @@ | |||
| 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" style="flex-direction: <?= $header_social_flex_direction ?>;"> | 38 | <div id="header_social_content"> |
| 39 | <?= $social_networks ?> | 39 | <?= $social_networks ?> |
| 40 | </div> | 40 | </div> |
| 41 | </div> | 41 | </div> |
| @@ -44,6 +44,7 @@ | |||
| 44 | </div> | 44 | </div> |
| 45 | <?php if($_SESSION['admin']){ ?> | 45 | <?php if($_SESSION['admin']){ ?> |
| 46 | <script> | 46 | <script> |
| 47 | document.getElementById("head_favicon_content").src = window.Config.favicon; | ||
| 47 | let head_favicon = new InputFileFavicon('head_favicon'); | 48 | let head_favicon = new InputFileFavicon('head_favicon'); |
| 48 | let header_background = new InputFileHeaderBackground('header_background'); | 49 | let header_background = new InputFileHeaderBackground('header_background'); |
| 49 | let header_logo = new InputFile('header_logo'); | 50 | let header_logo = new InputFile('header_logo'); |
diff --git a/src/view/templates/new_page.php b/src/view/templates/new_page.php index 1756a78..7bf4c01 100644 --- a/src/view/templates/new_page.php +++ b/src/view/templates/new_page.php | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | <input type="hidden" name="new_page_hidden"> | 20 | <input type="hidden" name="new_page_hidden"> |
| 21 | <p> | 21 | <p> |
| 22 | <label class="label_textarea" for="page_description">Description qui apparaît sous le titre dans les moteurs de recherche</label> | 22 | <label class="label_textarea" for="page_description">Description qui apparaît sous le titre dans les moteurs de recherche</label> |
| 23 | <textarea id="page_description" name="page_description" cols="40" rows="3" placeholder="ex: nous faisons ceci et cela, etc"></textarea> | 23 | <textarea id="page_description" name="page_description" cols="35" rows="3" placeholder="ex: nous faisons ceci et cela, etc"></textarea> |
| 24 | </p> | 24 | </p> |
| 25 | <input type="submit" value="Créer la page"> | 25 | <input type="submit" value="Créer la page"> |
| 26 | </form> | 26 | </form> |
