From 51cecb27e5bd4edd24ee238e9145e4888f0ec4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Sat, 23 Aug 2014 14:30:45 +0200 Subject: [PATCH] better layout for user settings --- includes/pages/user_settings.php | 72 +++++++++++++++++--------------- includes/sys_menu.php | 9 ++-- includes/sys_template.php | 2 +- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index da671b0b..1e593652 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -166,39 +166,45 @@ function user_settings() { sprintf(_("Hello %s, here you can change your personal settings i.e. password, color settings etc."), User_Nick_render($user)), $msg, msg(), - form(array( - form_info("", _("Here you can change your user details.")), - form_text('nick', _("Nick") . "*", $nick), - form_text('lastname', _("Last name"), $lastname), - form_text('prename', _("First name"), $prename), - form_text('age', _("Age"), $age), - form_text('tel', _("Phone"), $tel), - form_text('dect', _("DECT"), $dect), - form_text('mobile', _("Mobile"), $mobile), - form_text('mail', _("E-Mail") . "*", $mail), - form_text('icq', _("ICQ"), $icq), - form_text('jabber', _("Jabber"), $jabber), - form_text('hometown', _("Hometown"), $hometown), - $enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '', - form_checkboxes('angel_types', _("What do you want to do?") . sprintf(" (%s)", page_link_to('angeltypes') . '&action=about', _("Description of job types")), $angel_types, $selected_angel_types), - form_submit('submit', _("Save")) - )), - form(array( - form_info("", _("Here you can change your password.")), - form_password('password', _("Old password:")), - form_password('new_password', _("New password:")), - form_password('new_password2', _("Password confirmation:")), - form_submit('submit_password', _("Save")) - )), - form(array( - form_info("", _("Here you can choose your color settings:")), - form_select('theme', _("Color settings:"), $themes, $selected_theme), - form_submit('submit_theme', _("Save")) - )), - form(array( - form_info("", _("Here you can choose your language:")), - form_select('language', _("Language:"), $locales, $selected_language), - form_submit('submit_language', _("Save")) + div('row', array( + div('col-md-6', array( + form(array( + form_info(_("Here you can change your user details.")), + form_text('nick', _("Nick") . "*", $nick), + form_text('lastname', _("Last name"), $lastname), + form_text('prename', _("First name"), $prename), + form_text('age', _("Age"), $age), + form_text('tel', _("Phone"), $tel), + form_text('dect', _("DECT"), $dect), + form_text('mobile', _("Mobile"), $mobile), + form_text('mail', _("E-Mail") . "*", $mail), + form_text('icq', _("ICQ"), $icq), + form_text('jabber', _("Jabber"), $jabber), + form_text('hometown', _("Hometown"), $hometown), + $enable_tshirt_size ? form_select('tshirt_size', _("Shirt size"), $tshirt_sizes, $tshirt_size) : '', + form_checkboxes('angel_types', _("What do you want to do?") . sprintf(" (%s)", page_link_to('angeltypes') . '&action=about', _("Description of job types")), $angel_types, $selected_angel_types), + form_submit('submit', _("Save")) + )) + )), + div('col-md-6', array( + form(array( + form_info(_("Here you can change your password.")), + form_password('password', _("Old password:")), + form_password('new_password', _("New password:")), + form_password('new_password2', _("Password confirmation:")), + form_submit('submit_password', _("Save")) + )), + form(array( + form_info(_("Here you can choose your color settings:")), + form_select('theme', _("Color settings:"), $themes, $selected_theme), + form_submit('submit_theme', _("Save")) + )), + form(array( + form_info(_("Here you can choose your language:")), + form_select('language', _("Language:"), $locales, $selected_language), + form_submit('submit_language', _("Save")) + )) + )) )) )); } diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 4bfcb696..830bd4e3 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -16,9 +16,12 @@ function page_link_to_absolute($page) { function header_toolbar() { global $p, $privileges, $user; - $toolbar_items = array( - make_langselect() - ); + $toolbar_items = array(); + + if (isset($user)) + $toolbar_items[] = toolbar_item_link('#', 'time', User_shift_mode_render(User_shift_state($user))); + + $toolbar_items[] = make_langselect(); if (in_array('register', $privileges)) $toolbar_items[] = toolbar_item_link(page_link_to('register'), 'plus', register_title(), $p == 'register'); diff --git a/includes/sys_template.php b/includes/sys_template.php index 2015a0d7..3366346b 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -149,7 +149,7 @@ function form_radio($name, $label, $selected, $value) { /** * Rendert einen Infotext in das Formular */ -function form_info($label, $text) { +function form_info($label, $text = "") { if ($label == "") return '' . $text . ''; if ($text == "")