summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgit-pc-greta <ordipolo@gmx.fr>2025-02-03 22:41:21 +0100
committergit-pc-greta <ordipolo@gmx.fr>2025-02-03 22:41:21 +0100
commit51a5391c96043829f7bbccda1262a51a8b8f93d8 (patch)
tree948d1ff5ad20fdeb8c2f11cb47a6700111d9385d /src
parent13f24b014d07ab3f28c7a8ede4f4bd6eaebbaad4 (diff)
downloadckeditor5-51a5391c96043829f7bbccda1262a51a8b8f93d8.zip
bouton supprimer
Diffstat (limited to 'src')
-rw-r--r--src/integration/ckeditor5/CKEditor.php5
-rw-r--r--src/integration/ckeditor5/view.php5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/integration/ckeditor5/CKEditor.php b/src/integration/ckeditor5/CKEditor.php
index e7ec181..c53f236 100644
--- a/src/integration/ckeditor5/CKEditor.php
+++ b/src/integration/ckeditor5/CKEditor.php
@@ -90,7 +90,8 @@ class CKEditor
90 public function displayArticle(string $id, string $texte): string 90 public function displayArticle(string $id, string $texte): string
91 { 91 {
92 $html = '<article>' . $texte . '</article> 92 $html = '<article>' . $texte . '</article>
93 <a href="index.php?page=' . $this->page . '&action=open_editor&id=' . $id . '"><button>ouvrir l\'éditeur</button></a>'; 93 <a href="index.php?page=' . $this->page . '&action=open_editor&id=' . $id . '"><button>Modifier</button></a>
94 <a href="index.php?page=' . $this->page . '&action=delete_article&id=' . $id . '"><button>Supprimer</button></a>';
94 return $html; 95 return $html;
95 } 96 }
96 97
@@ -104,6 +105,8 @@ class CKEditor
104 require self::INTEGRATION_PATH . 'view.php'; // html + JS 105 require self::INTEGRATION_PATH . 'view.php'; // html + JS
105 return $editeurHTML; 106 return $editeurHTML;
106 } 107 }
108
109 //public function deleteSideEffects(string $id){}
107 110
108 public function checkSubmitPOST(): string 111 public function checkSubmitPOST(): string
109 { 112 {
diff --git a/src/integration/ckeditor5/view.php b/src/integration/ckeditor5/view.php
index d80a830..57115d1 100644
--- a/src/integration/ckeditor5/view.php
+++ b/src/integration/ckeditor5/view.php
@@ -8,6 +8,8 @@ $submit_action = 'index.php?from=' . $this->page . '&action=submit_editor&id=' .
8$cancel_button = 'index.php?page=' . $this->page; 8$cancel_button = 'index.php?page=' . $this->page;
9//$cancel_button .= !empty($id) ? '&id=' . $id : ''; // à ajouter si on a besoin de revenir sur un article spécifique 9//$cancel_button .= !empty($id) ? '&id=' . $id : ''; // à ajouter si on a besoin de revenir sur un article spécifique
10 10
11$delete_button = $id != '' ? '<a href="index.php?page=' . $this->page . '&action=delete_article&id=' . $id . '"><input type="button" value="Supprimer"></a>' : '';
12
11$upload_ajax = 'index.php?action=upload_image_editor'; 13$upload_ajax = 'index.php?action=upload_image_editor';
12$upload_ajax .= !empty($id) ? '&id=' . $id : ''; 14$upload_ajax .= !empty($id) ? '&id=' . $id : '';
13 15
@@ -17,7 +19,8 @@ ob_start();
17 <form action="<?= $submit_action ?>" method="POST" enctype="multipart/form-data" > 19 <form action="<?= $submit_action ?>" method="POST" enctype="multipart/form-data" >
18 <textarea id="editor" name="contenu" ></textarea> 20 <textarea id="editor" name="contenu" ></textarea>
19 <input type="submit" value="Valider"> 21 <input type="submit" value="Valider">
20 <a href="<?= $cancel_button ?>" ><input type="button" value="Annuler"></a> 22 <a href="<?= $cancel_button ?>"><input type="button" value="Annuler"></a>
23<?= $delete_button ?>
21 <script type="importmap"> 24 <script type="importmap">
22 { 25 {
23 "imports": { 26 "imports": {