From cca7530631103d22d0edaa396ed6f7970b1d3674 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 1 Jun 2023 20:08:11 +0200 Subject: [PATCH] news profil --- core/module/user/user.php | 18 +++- .../user/view/profilAdd/profilAdd.js.php | 8 ++ core/module/user/view/profilAdd/profilAdd.php | 100 ++++++++++++------ .../user/view/profilEdit/profilEdit.js.php | 8 ++ .../user/view/profilEdit/profilEdit.php | 40 ++++++- 5 files changed, 136 insertions(+), 38 deletions(-) diff --git a/core/module/user/user.php b/core/module/user/user.php index 1dcbe5ee..d3faf9ca 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -588,9 +588,16 @@ class user extends common 'option' => $this->getInput('profilEditBlogOption', helper::FILTER_BOOLEAN), 'comment' => $this->getInput('profilEditBlogComment', helper::FILTER_BOOLEAN), 'commentApprouve' => $this->getInput('profilEditBlogCommentApprouve', helper::FILTER_BOOLEAN), - 'commentdelete' => $this->getInput('profilEditBlogCommentDelete', helper::FILTER_BOOLEAN), + 'commentDelete' => $this->getInput('profilEditBlogCommentDelete', helper::FILTER_BOOLEAN), 'commentDeleteAll' => $this->getInput('profilEditBlogCommentDeleteAll', helper::FILTER_BOOLEAN), ], + 'news' => [ + 'add' => $this->getInput('profilEditNewsAdd', helper::FILTER_BOOLEAN), + 'edit' => $this->getInput('profilEditNewsEdit', helper::FILTER_BOOLEAN), + 'delete' => $this->getInput('profilEditNewsDElete', helper::FILTER_BOOLEAN), + 'config' => $this->getInput('profilEditNewsConfig', helper::FILTER_BOOLEAN), + 'option' => $this->getInput('profilEditNewsOption', helper::FILTER_BOOLEAN), + ], ] ]); @@ -673,9 +680,16 @@ class user extends common 'option' => $this->getInput('profilAddBlogOption', helper::FILTER_BOOLEAN), 'comment' => $this->getInput('profilAddBlogComment', helper::FILTER_BOOLEAN), 'commentApprouve' => $this->getInput('profilAddBlogCommentApprouve', helper::FILTER_BOOLEAN), - 'commentdelete' => $this->getInput('profilAddBlogCommentDelete', helper::FILTER_BOOLEAN), + 'commentDelete' => $this->getInput('profilAddBlogCommentDelete', helper::FILTER_BOOLEAN), 'commentDeleteAll' => $this->getInput('profilAddBlogCommentDeleteAll', helper::FILTER_BOOLEAN), ], + 'news' => [ + 'add' => $this->getInput('profilAddNewsAdd', helper::FILTER_BOOLEAN), + 'edit' => $this->getInput('profilAddNewsEdit', helper::FILTER_BOOLEAN), + 'delete' => $this->getInput('profilAddNewsDElete', helper::FILTER_BOOLEAN), + 'config' => $this->getInput('profilAddNewsConfig', helper::FILTER_BOOLEAN), + 'option' => $this->getInput('profilAddNewsOption', helper::FILTER_BOOLEAN), + ], ] ]); // Valeurs en sortie diff --git a/core/module/user/view/profilAdd/profilAdd.js.php b/core/module/user/view/profilAdd/profilAdd.js.php index a2844afb..538c6e17 100644 --- a/core/module/user/view/profilAdd/profilAdd.js.php +++ b/core/module/user/view/profilAdd/profilAdd.js.php @@ -36,4 +36,12 @@ $(document).ready(function () { } }); + $("#profilAddPageEdit").change(function () { + if (!$(this).prop("checked")) { + $(".containerModule").prop("disabled", true); + } else { + $(".containerModule").prop("disabled", false); + } + }); + }); diff --git a/core/module/user/view/profilAdd/profilAdd.php b/core/module/user/view/profilAdd/profilAdd.php index 7123e71a..0eb59356 100644 --- a/core/module/user/view/profilAdd/profilAdd.php +++ b/core/module/user/view/profilAdd/profilAdd.php @@ -78,44 +78,75 @@ -
-
-
-

- -

-
-
- +
+
+
+
+

+ +

+
+
+ +
+
+ +
+
+ +
+
+ +
-
- +
+ +
+ +
+
+ +
+
+ +
-
- -
-
- +
+
+ +
+
+ +
-
- -
- +
+
+
+
+
+

+ +

+
+
+ +
+
+ +
+
+ +
-
- -
-
- -
-
-
-
- -
-
- +
+
+ +
+
+ +
+
@@ -198,7 +229,7 @@
'filemanager']); ?>
-
+
'filemanager']); ?> @@ -216,5 +247,4 @@
- \ No newline at end of file diff --git a/core/module/user/view/profilEdit/profilEdit.js.php b/core/module/user/view/profilEdit/profilEdit.js.php index f1abf0af..39d9510d 100644 --- a/core/module/user/view/profilEdit/profilEdit.js.php +++ b/core/module/user/view/profilEdit/profilEdit.js.php @@ -26,4 +26,12 @@ $(document).ready(function () { $(".filemanager").prop("disabled", false); } }); + + $("#profilEditPageEdit").change(function () { + if (!$(this).prop("checked")) { + $(".containerModule").prop("disabled", true); + } else { + $(".containerModule").prop("disabled", false); + } + }); }); diff --git a/core/module/user/view/profilEdit/profilEdit.php b/core/module/user/view/profilEdit/profilEdit.php index 2a9e6666..1befaa18 100644 --- a/core/module/user/view/profilEdit/profilEdit.php +++ b/core/module/user/view/profilEdit/profilEdit.php @@ -129,7 +129,6 @@
-
$this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'blog', 'option']) @@ -161,6 +160,45 @@
+
+
+
+

+ +

+
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'news', 'add']) + ]); ?> +
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'news', 'edit']) + ]); ?> +
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'news', 'delete']) + ]); ?> +
+
+
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'news', 'config']) + ]); ?> +
+
+ $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'news', 'option']) + ]); ?> +
+ +
+
+
+