reduce complexity of menu and hints

This commit is contained in:
msquare 2016-11-15 16:31:55 +01:00
parent ec6016cd38
commit 918d41ca70
5 changed files with 11 additions and 9 deletions

View File

@ -16,7 +16,7 @@ function user_angeltypes_unconfirmed_hint() {
$unconfirmed_links[] = '<a href="' . page_link_to('angeltypes') . '&action=view&angeltype_id=' . $user_angeltype['angeltype_id'] . '">' . $user_angeltype['name'] . ' (+' . $user_angeltype['count'] . ')' . '</a>'; $unconfirmed_links[] = '<a href="' . page_link_to('angeltypes') . '&action=view&angeltype_id=' . $user_angeltype['angeltype_id'] . '">' . $user_angeltype['name'] . ' (+' . $user_angeltype['count'] . ')' . '</a>';
} }
return info(sprintf(ngettext("There is %d unconfirmed angeltype.", "There are %d unconfirmed angeltypes.", count($unconfirmed_user_angeltypes)), count($unconfirmed_user_angeltypes)) . " " . _('Angel types which need approvals:') . ' ' . join(', ', $unconfirmed_links), true); return sprintf(ngettext("There is %d unconfirmed angeltype.", "There are %d unconfirmed angeltypes.", count($unconfirmed_user_angeltypes)), count($unconfirmed_user_angeltypes)) . " " . _('Angel types which need approvals:') . ' ' . join(', ', $unconfirmed_links);
} }
/** /**

View File

@ -16,7 +16,7 @@ function user_driver_license_required_hint() {
foreach ($angeltypes as $angeltype) { foreach ($angeltypes as $angeltype) {
if ($angeltype['requires_driver_license']) { if ($angeltype['requires_driver_license']) {
return info(sprintf(_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."), '<a href="' . user_driver_license_edit_link() . '">' . _("driving license information") . '</a>'), true); return sprintf(_("You joined an angeltype which requires a driving license. Please edit your driving license information here: %s."), '<a href="' . user_driver_license_edit_link() . '">' . _("driving license information") . '</a>');
} }
} }

View File

@ -15,7 +15,7 @@ function admin_new_questions() {
$new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL"); $new_messages = sql_num_query("SELECT * FROM `Questions` WHERE `AID` IS NULL");
if ($new_messages > 0) { if ($new_messages > 0) {
return info('<a href="' . page_link_to("admin_questions") . '">' . _('There are unanswered questions!') . '</a>', true); return '<a href="' . page_link_to("admin_questions") . '">' . _('There are unanswered questions!') . '</a>';
} }
} }
} }

View File

@ -32,9 +32,11 @@ class UserHintsRenderer {
*/ */
public function addHint($hint, $important = false) { public function addHint($hint, $important = false) {
if ($hint != null && $hint != '') { if ($hint != null && $hint != '') {
$this->hints[] = $hint;
if ($important) { if ($important) {
$this->important = true; $this->important = true;
$this->hints[] = error($hint, true);
} else {
$this->hints[] = info($hint, true);
} }
} }
} }

View File

@ -419,7 +419,7 @@ function render_user_departure_date_hint() {
global $user; global $user;
if (! isset($user['planned_departure_date']) || $user['planned_departure_date'] == null) { if (! isset($user['planned_departure_date']) || $user['planned_departure_date'] == null) {
return info(_("Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities."), true); return _("Please enter your planned date of departure on your settings page to give us a feeling for teardown capacities.");
} }
return null; return null;
@ -429,7 +429,7 @@ function render_user_freeloader_hint() {
global $user; global $user;
if (User_is_freeloader($user)) { if (User_is_freeloader($user)) {
return error(sprintf(_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."), $max_freeloadable_shifts), true); return sprintf(_("You freeloaded at least %s shifts. Shift signup is locked. Please go to heavens desk to be unlocked again."), $max_freeloadable_shifts);
} }
return null; return null;
@ -440,7 +440,7 @@ function render_user_arrived_hint() {
global $user; global $user;
if ($user['Gekommen'] == 0) { if ($user['Gekommen'] == 0) {
return error(_("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already."), true); return _("You are not marked as arrived. Please go to heaven's desk, get your angel badge and/or tell them that you arrived already.");
} }
return null; return null;
@ -450,7 +450,7 @@ function render_user_tshirt_hint() {
global $enable_tshirt_size, $user; global $enable_tshirt_size, $user;
if ($enable_tshirt_size && $user['Size'] == "") { if ($enable_tshirt_size && $user['Size'] == "") {
return error(_("You need to specify a tshirt size in your settings!"), true); return _("You need to specify a tshirt size in your settings!");
} }
return null; return null;
@ -460,7 +460,7 @@ function render_user_dect_hint() {
global $user; global $user;
if ($user['DECT'] == "") { if ($user['DECT'] == "") {
return error(_("You need to specify a DECT phone number in your settings! If you don't have a DECT phone, just enter \"-\"."), true); return _("You need to specify a DECT phone number in your settings! If you don't have a DECT phone, just enter \"-\".");
} }
return null; return null;