diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-09 20:24:03 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-09 20:24:03 +0200 |
| commit | a0b94008b26ef20f1164e0c5302d5d11c313b1ad (patch) | |
| tree | 1cf474609d5320d84552ca50ffe5923d31311a0d | |
| parent | f0d1cd5d68579b462cf01a4a9f7d558a231bc072 (diff) | |
| download | cms-a0b94008b26ef20f1164e0c5302d5d11c313b1ad.tar.gz cms-a0b94008b26ef20f1164e0c5302d5d11c313b1ad.tar.bz2 cms-a0b94008b26ef20f1164e0c5302d5d11c313b1ad.zip | |
chemin de PHP alternatif (variable bash créée avec export) dans les scripts dans composer.json possible
| -rw-r--r-- | composer.json | 8 | ||||
| -rw-r--r-- | public/js/modif_page.js | 37 |
2 files changed, 4 insertions, 41 deletions
diff --git a/composer.json b/composer.json index 56882a9..8e8a6e8 100644 --- a/composer.json +++ b/composer.json | |||
| @@ -14,12 +14,12 @@ | |||
| 14 | }, | 14 | }, |
| 15 | "scripts": { | 15 | "scripts": { |
| 16 | "post-install-cmd": [ | 16 | "post-install-cmd": [ |
| 17 | "php 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", |
| 18 | "php bin/copy_directory.php vendor/tweeb/tinymce-i18n/langs public/js/tinymce-langs" | 18 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tweeb/tinymce-i18n/langs public/js/tinymce-langs" |
| 19 | ], | 19 | ], |
| 20 | "post-update-cmd": [ | 20 | "post-update-cmd": [ |
| 21 | "php bin/copy_directory.php vendor/tinymce/tinymce public/js/tinymce", | 21 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tinymce/tinymce public/js/tinymce", |
| 22 | "php bin/copy_directory.php vendor/tweeb/tinymce-i18n/langs public/js/tinymce-langs" | 22 | "PHP_PATH=${PHP_PATH:-php} && $PHP_PATH bin/copy_directory.php vendor/tweeb/tinymce-i18n/langs public/js/tinymce-langs" |
| 23 | ] | 23 | ] |
| 24 | }, | 24 | }, |
| 25 | "authors": [ | 25 | "authors": [ |
diff --git a/public/js/modif_page.js b/public/js/modif_page.js index aad53e9..5e7777c 100644 --- a/public/js/modif_page.js +++ b/public/js/modif_page.js | |||
| @@ -42,43 +42,6 @@ function changePageTitle(page_id){ | |||
| 42 | console.error('Erreur:', error); | 42 | console.error('Erreur:', error); |
| 43 | }); | 43 | }); |
| 44 | } | 44 | } |
| 45 | /*function changePageMenuPath(page_id){ | ||
| 46 | const page_name_path = document.getElementById("page_name_path"); | ||
| 47 | |||
| 48 | fetch('index.php?page_edit=page_menu_path', { | ||
| 49 | method: 'POST', | ||
| 50 | headers: { 'Content-Type': 'application/json' }, | ||
| 51 | body: JSON.stringify({page_menu_path: page_name_path.value, page_id: page_id}) | ||
| 52 | }) | ||
| 53 | .then(response => response.json()) | ||
| 54 | .then(data => { | ||
| 55 | if(data.success){ | ||
| 56 | // oh putaing... | ||
| 57 | let url = new URL(document.getElementById("m_" + page_id).parentElement.href); // url attrapée dans une balise <a> | ||
| 58 | let params = new URLSearchParams(url.search); // params à droite du ? | ||
| 59 | let path_array = params.get('page').split('/'); // chemin 'page' découpé dans un tableau | ||
| 60 | console.log(data.page_name_path); | ||
| 61 | path_array[path_array.length - 1] = data.page_name_path; // modif de la dernière case | ||
| 62 | params.set('page', path_array.join('/')); // réassemblage du chemin et MAJ de params | ||
| 63 | url.search = params.toString(); // MAJ de url | ||
| 64 | document.getElementById("m_" + page_id).parentElement.href = url.toString(); // MAJ de la balise <a> | ||
| 65 | |||
| 66 | // modifier l'URL sans rafraichir en touchant à l'historique | ||
| 67 | params.set('action', 'modif_page'); // on veut rester en mode "modif" | ||
| 68 | url.search = params.toString(); | ||
| 69 | history.pushState({}, '', url.toString()) | ||
| 70 | |||
| 71 | console.log("la nouveau chemin est: " + data.page_name_path); | ||
| 72 | toastNotify("la nouveau chemin est: " + data.page_name_path); | ||
| 73 | } | ||
| 74 | else{ | ||
| 75 | console.error("Erreur à la modification du chemin de la page dans l'URL."); | ||
| 76 | } | ||
| 77 | }) | ||
| 78 | .catch(error => { | ||
| 79 | console.error('Erreur:', error); | ||
| 80 | }); | ||
| 81 | }*/ | ||
| 82 | function changeDescription(page_id){ | 45 | function changeDescription(page_id){ |
| 83 | const textarea = document.getElementById("description_textarea"); | 46 | const textarea = document.getElementById("description_textarea"); |
| 84 | 47 | ||
