From 4931fbb3720ca050eb7719a9b09471e950b0f334 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Sun, 28 Sep 2014 19:44:53 +0200 Subject: replace icons with glyphicons --- includes/controller/users_controller.php | 3 +++ includes/pages/user_myshifts.php | 2 +- includes/pages/user_shifts.php | 21 ++++++++++++++++----- includes/sys_template.php | 4 ---- includes/view/User_view.php | 12 +++++++----- 5 files changed, 27 insertions(+), 15 deletions(-) (limited to 'includes') diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index b24a7fdf..f54cf066 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -48,6 +48,9 @@ function user_controller() { } } + if ($user_source['api_key'] == "") + User_reset_api_key($user_source); + return array( $user_source['Nick'], User_view($user_source, $admin_user_privilege, User_is_freeloader($user_source), User_angeltypes($user_source), User_groups($user_source), $shifts, $user['UID'] == $user_source['UID']) diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 35aa8f54..d1c60dd6 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -26,7 +26,7 @@ function user_myshifts() { } return page_with_title(_("Reset API key"), array( error(_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."), true), - button(page_link_to('myshifts') . '&reset=ack', _("Continue"), 'btn-danger') + button(page_link_to('user_myshifts') . '&reset=ack', _("Continue"), 'btn-danger') )); } elseif (isset($_REQUEST['edit']) && preg_match("/^[0-9]*$/", $_REQUEST['edit'])) { $id = $_REQUEST['edit']; diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 370544a1..04a94c3f 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -1,4 +1,5 @@ '; $query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id` FROM `NeededAngelTypes` @@ -534,7 +538,9 @@ function view_user_shifts() { $style .= " text-decoration: line-through;"; } if (in_array('user_shifts_admin', $privileges)) - $entry_list[] = "" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")) . ''; + $entry_list[] = "" . User_Nick_render($entry) . ' ' . table_buttons(array( + button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs') + )) . ''; else $entry_list[] = "" . User_Nick_render($entry) . ""; } @@ -632,7 +638,10 @@ function view_user_shifts() { ); if (in_array('admin_shifts', $privileges)) - $shift_row['info'] .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete")); + $shift_row['info'] .= ' ' . table_buttons(array( + button(page_link_to('user_shifts') . '&edit_shift=' . $shift['SID'], glyph('edit'), 'btn-xs'), + button(page_link_to('user_shifts') . '&delete_shift=' . $shift['SID'], glyph('trash'), 'btn-xs') + )); $shift_row['entries'] .= '
'; $is_free = false; $shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']); @@ -659,7 +668,9 @@ function view_user_shifts() { $freeloader = 0; foreach ($entries as $entry) { if (in_array('user_shifts_admin', $privileges)) - $member = User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")); + $member = User_Nick_render($entry) . ' ' . table_buttons(array( + button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs') + )); else $member = User_Nick_render($entry); if ($entry['freeloaded']) { @@ -743,7 +754,7 @@ function view_user_shifts() { 'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")), 'task_notice' => '1' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " " . _("Description of the jobs.") . "", 'new_style_checkbox' => '', - 'shifts_table' =>msg(). $shifts_table, + 'shifts_table' => msg() . $shifts_table, 'ical_text' => '

' . _("iCal export") . '

' . sprintf(_("Export of shown shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key)."), page_link_to_absolute('ical') . '&key=' . $user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $user['api_key'], page_link_to('user_myshifts') . '&reset') . '

', 'filter' => _("Filter") )), diff --git a/includes/sys_template.php b/includes/sys_template.php index bf0e81fc..e707ab71 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -373,10 +373,6 @@ function html_select_key($id, $name, $rows, $selected) { return $html; } -function img_button($link, $icon, $text, $extra_text = '') { - return '' . $text . '' . (empty($extra_text) ? '' : ' ' . $extra_text) . ''; -} - function ReplaceSmilies($neueckig) { $neueckig = str_replace(";o))", "", $neueckig); $neueckig = str_replace(":-))", "", $neueckig); diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 912579e7..0bea946c 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -131,11 +131,12 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel $myshift['comment'] .= '

' . _("Freeloaded") . '

'; } - $myshift['actions'] = ""; + $myshift['actions'] = array(); if ($its_me || in_array('user_shifts_admin', $privileges)) - $myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '&id=' . $user_source['UID'], 'pencil', _("edit")); + $myshift['actions'][] = button(page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '&id=' . $user_source['UID'], glyph('edit') . _('edit'), 'btn-xs'); if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) - $myshift['actions'] .= img_button(page_link_to('user_myshifts') . ((! $its_me) ? '&id=' . $user_source['UID'] : '') . '&cancel=' . $shift['id'], 'cross', _("sign off")); + $myshift['actions'][] = button(page_link_to('user_myshifts') . ((! $its_me) ? '&id=' . $user_source['UID'] : '') . '&cancel=' . $shift['id'], glyph('trash') . _('sign off'), 'btn-xs'); + $myshift['actions'] = table_buttons($myshift['actions']); if ($shift['freeloaded']) $timesum += - 2 * ($shift['end'] - $shift['start']); @@ -182,8 +183,9 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel buttons(array( $admin_user_privilege ? button(page_link_to('admin_user') . '&id=' . $user_source['UID'], ' ' . _("edit")) : '', ! $user_source['Gekommen'] ? button(page_link_to('admin_arrive') . '&arrived=' . $user_source['UID'], _("arrived")) : '', - $its_me ? button(page_link_to_absolute('ical') . '&key=' . $user_source['api_key'], ' ' . _("iCal Export")) : '', - $its_me ? button(page_link_to_absolute('shifts_json_export') . '&key=' . $user_source['api_key'], ' ' . _("JSON Export")) : '' + $its_me ? button(page_link_to_absolute('ical') . '&key=' . $user_source['api_key'], glyph('calendar') . _("iCal Export")) : '', + $its_me ? button(page_link_to_absolute('shifts_json_export') . '&key=' . $user_source['api_key'], glyph('export') . _("JSON Export")) : '', + $its_me ? button(page_link_to_absolute('user_myshifts') . '&reset', glyph('repeat') . _('Reset API key')) : '' )), ($its_me || $admin_user_privilege) ? '

' . _("Shifts") . '

' : '', ($its_me || $admin_user_privilege) ? table(array( -- cgit v1.2.3-54-g00ecf