summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-12-26 14:35:01 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-12-26 14:35:33 +0100
commit6953090e7d789f52761a8f4b505cfbcf0c347018 (patch)
tree2b1794f92fd00a130b4fb8696bd6bbbaebd676cb
parentf1b794697579d63a49345e50861b14874419bab5 (diff)
392: Show warning message when editing html news without proper permissions to save them, Closes #392
-rw-r--r--includes/helper/message_helper.php22
-rw-r--r--includes/pages/admin_news.php9
-rw-r--r--locale/de_DE.UTF-8/LC_MESSAGES/default.mobin43418 -> 43607 bytes
-rw-r--r--locale/de_DE.UTF-8/LC_MESSAGES/default.po4
4 files changed, 30 insertions, 5 deletions
diff --git a/includes/helper/message_helper.php b/includes/helper/message_helper.php
index 4fa0efe3..3d2b663a 100644
--- a/includes/helper/message_helper.php
+++ b/includes/helper/message_helper.php
@@ -1,7 +1,7 @@
<?php
/**
- * Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher
+ * Returns messages from session and removes them from the stack
*
* @return string
*/
@@ -16,7 +16,7 @@ function msg()
}
/**
- * Rendert eine Information
+ * Renders an information message
*
* @param string $msg
* @param bool $immediately
@@ -28,7 +28,19 @@ function info($msg, $immediately = false)
}
/**
- * Rendert eine Fehlermeldung
+ * Renders a warning message
+ *
+ * @param string $msg
+ * @param bool $immediately
+ * @return string
+ */
+function warning($msg, $immediately = false)
+{
+ return alert('warning', $msg, $immediately);
+}
+
+/**
+ * Renders an error message
*
* @param string $msg
* @param bool $immediately
@@ -40,7 +52,7 @@ function error($msg, $immediately = false)
}
/**
- * Rendert eine Erfolgsmeldung
+ * Renders a success message
*
* @param string $msg
* @param bool $immediately
@@ -52,7 +64,7 @@ function success($msg, $immediately = false)
}
/**
- * Renders an alert with given alert-* class.
+ * Renders an alert message with the given alert-* class.
*
* @param string $class
* @param string $msg
diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php
index eb3a250e..7f912773 100644
--- a/includes/pages/admin_news.php
+++ b/includes/pages/admin_news.php
@@ -29,6 +29,15 @@ function admin_news()
switch ($request->input('action')) {
case 'edit':
$user_source = User($news['UID']);
+ if (
+ !in_array('admin_news_html', $privileges)
+ && strip_tags($news['Text']) != $news['Text']
+ ) {
+ $html .= warning(
+ _('This message contains HTML. After saving the post some formatting will be lost!'),
+ true
+ );
+ }
$html .= form(
[
diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo
index d601751b..6cb4b885 100644
--- a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo
+++ b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo
Binary files differ
diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.po b/locale/de_DE.UTF-8/LC_MESSAGES/default.po
index 19247210..5779141d 100644
--- a/locale/de_DE.UTF-8/LC_MESSAGES/default.po
+++ b/locale/de_DE.UTF-8/LC_MESSAGES/default.po
@@ -1203,6 +1203,10 @@ msgstr "Log"
msgid "Edit news entry"
msgstr "News-Eintrag bearbeiten"
+#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_news.php:37
+msgid "This message contains HTML. After saving the post some formatting will be lost!"
+msgstr "Diese Nachricht beinhaltet HTML. Wenn du sie speicherst gehen diese Formatierungen verloren!"
+
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/admin_news.php:36
msgid "Author"
msgstr "Autor"