diff options
author | git-pc-greta <ordipolo@gmx.fr> | 2025-01-18 00:47:30 +0100 |
---|---|---|
committer | git-pc-greta <ordipolo@gmx.fr> | 2025-01-18 00:47:30 +0100 |
commit | 718107e8efbcb42d6b263999a3d9f6c4f02f26e5 (patch) | |
tree | 138fcfc1e9d60f13cdd81de6af080230722a36b0 | |
parent | bbf50ae1ffa5b1b3b71f0e57d658d9beaaa50de0 (diff) | |
download | ckeditor5-718107e8efbcb42d6b263999a3d9f6c4f02f26e5.zip |
jointure (sorte de symlink) sur windows
-rw-r--r-- | index.php | 8 | ||||
-rw-r--r-- | src/integration/ckeditor5/config.php | 4 | ||||
-rw-r--r-- | src/integration/ckeditor5/create.php | 2 | ||||
-rw-r--r-- | src/integration/ckeditor5/init.php | 14 |
4 files changed, 19 insertions, 9 deletions
@@ -2,19 +2,19 @@ | |||
2 | // index.php | 2 | // index.php |
3 | 3 | ||
4 | require 'src/integration/ckeditor5/config.php'; | 4 | require 'src/integration/ckeditor5/config.php'; |
5 | require $ckeditor_integration_path . 'init.php'; | 5 | require $ckeditor_integration . 'init.php'; |
6 | makeTranslationSymLink(); | 6 | makeTranslationSymLink(); |
7 | 7 | ||
8 | 8 | ||
9 | // routage | 9 | // routage |
10 | 10 | ||
11 | // upload images AJAX | 11 | // upload images AJAX |
12 | require $ckeditor_integration_path . 'image_upload.php'; | 12 | require $ckeditor_integration . 'image_upload.php'; |
13 | 13 | ||
14 | // submit normal | 14 | // submit normal |
15 | if(isset($_GET['action']) && $_GET['action'] === 'submit') // HTML envoyé par l'éditeur | 15 | if(isset($_GET['action']) && $_GET['action'] === 'submit') // HTML envoyé par l'éditeur |
16 | { | 16 | { |
17 | require $ckeditor_integration_path . 'clean_html.php'; | 17 | require $ckeditor_integration . 'clean_html.php'; |
18 | $html_from_editor = getAndCleanEditorOutput(); // manipule $_POST['contenu']; | 18 | $html_from_editor = getAndCleanEditorOutput(); // manipule $_POST['contenu']; |
19 | 19 | ||
20 | // enregistrement des données | 20 | // enregistrement des données |
@@ -28,7 +28,7 @@ if(isset($_GET['action']) && $_GET['action'] === 'submit') // HTML envoyé par l | |||
28 | // ouvrir l'éditeur | 28 | // ouvrir l'éditeur |
29 | elseif(isset($_GET['page']) && $_GET['page'] === 'editor') | 29 | elseif(isset($_GET['page']) && $_GET['page'] === 'editor') |
30 | { | 30 | { |
31 | require $ckeditor_integration_path . 'create.php'; | 31 | require $ckeditor_integration . 'create.php'; |
32 | } | 32 | } |
33 | else // $previous_page, affichage sans l'article | 33 | else // $previous_page, affichage sans l'article |
34 | { | 34 | { |
diff --git a/src/integration/ckeditor5/config.php b/src/integration/ckeditor5/config.php index 822884f..e185e8e 100644 --- a/src/integration/ckeditor5/config.php +++ b/src/integration/ckeditor5/config.php | |||
@@ -1,8 +1,8 @@ | |||
1 | <?php | 1 | <?php |
2 | // src/integration/ckeditor5/config.php | 2 | // src/integration/ckeditor5/config.php |
3 | 3 | ||
4 | $ckeditor_integration_path = 'src/integration/ckeditor5/'; | 4 | $ckeditor_integration = 'src/integration/ckeditor5/'; |
5 | $css_hors_editeur = '<link rel="stylesheet" href="' . $ckeditor_integration_path . 'article_hors_editeur.css" />'; | 5 | $css_hors_editeur = '<link rel="stylesheet" href="' . $ckeditor_integration . 'article_hors_editeur.css" />'; |
6 | 6 | ||
7 | $server_root = $_SERVER['SERVER_NAME'] . '/ckeditor5/'; | 7 | $server_root = $_SERVER['SERVER_NAME'] . '/ckeditor5/'; |
8 | // pour l'importmap: j'ai modifié la version "installation avec CDN de la doc pour utiliser les fichiers locaux | 8 | // pour l'importmap: j'ai modifié la version "installation avec CDN de la doc pour utiliser les fichiers locaux |
diff --git a/src/integration/ckeditor5/create.php b/src/integration/ckeditor5/create.php index 863c420..cf7242c 100644 --- a/src/integration/ckeditor5/create.php +++ b/src/integration/ckeditor5/create.php | |||
@@ -14,5 +14,5 @@ elseif($storage === 'files') | |||
14 | } | 14 | } |
15 | 15 | ||
16 | // vue | 16 | // vue |
17 | require $ckeditor_integration_path . 'view.php'; // html + JS | 17 | require $ckeditor_integration . 'view.php'; // html + JS |
18 | $contenu = $editeurHTML; | 18 | $contenu = $editeurHTML; |
diff --git a/src/integration/ckeditor5/init.php b/src/integration/ckeditor5/init.php index 4d77cba..30e5fb9 100644 --- a/src/integration/ckeditor5/init.php +++ b/src/integration/ckeditor5/init.php | |||
@@ -6,8 +6,18 @@ function makeTranslationSymLink(): void | |||
6 | { | 6 | { |
7 | $target = '../translations'; | 7 | $target = '../translations'; |
8 | $link = 'node_modules/ckeditor5/dist/browser/translations'; | 8 | $link = 'node_modules/ckeditor5/dist/browser/translations'; |
9 | if (!file_exists($link)) | 9 | |
10 | if(!file_exists($link)) | ||
10 | { | 11 | { |
11 | symlink($target, $link); | 12 | if(PHP_OS === 'Linux') |
13 | { | ||
14 | symlink($target, $link); | ||
15 | } | ||
16 | elseif(PHP_OS === 'WINNT') | ||
17 | { | ||
18 | // on peut créer une jointure sans droit d'admin | ||
19 | $target = 'node_modules\ckeditor5\dist\translations'; | ||
20 | exec('mklink /J ' . str_replace('/', '\\', $link) . ' ' . $target); | ||
21 | } | ||
12 | } | 22 | } |
13 | } | 23 | } |