summaryrefslogtreecommitdiff
path: root/includes/pages/admin_questions.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-15 16:28:20 +0100
committermsquare <msquare@notrademark.de>2016-11-15 16:28:20 +0100
commitec6016cd38fc5ce6455cace6ffbc703f78f31096 (patch)
tree961d5d5e90d25c807b77facba897ef6628298d50 /includes/pages/admin_questions.php
parent19d5d68d82232d1047787737795a21bd79f9be95 (diff)
reduce complexity of menu and hints
Diffstat (limited to 'includes/pages/admin_questions.php')
-rw-r--r--includes/pages/admin_questions.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/includes/pages/admin_questions.php b/includes/pages/admin_questions.php
index 8c16255c..13614a66 100644
--- a/includes/pages/admin_questions.php
+++ b/includes/pages/admin_questions.php
@@ -4,18 +4,23 @@ function admin_questions_title() {
return _("Answer questions");
}
+/**
+ * Renders a hint for new questions to answer.
+ */
function admin_new_questions() {
- global $privileges;
+ global $privileges, $page;
- if (in_array("admin_questions", $privileges)) {
- $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL");
-
- if ($new_messages > 0) {
- return info('<a href="' . page_link_to("admin_questions") . '">' . _('There are unanswered questions!') . '</a>', true);
+ if ($page != "admin_questions") {
+ if (in_array("admin_questions", $privileges)) {
+ $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL");
+
+ if ($new_messages > 0) {
+ return info('<a href="' . page_link_to("admin_questions") . '">' . _('There are unanswered questions!') . '</a>', true);
+ }
}
}
- return "";
+ return null;
}
function admin_questions() {