replace icons with glyphicons

main
Philip Häusler 10 years ago
parent bd2a8b441f
commit 4931fbb372

@ -48,6 +48,9 @@ function user_controller() {
} }
} }
if ($user_source['api_key'] == "")
User_reset_api_key($user_source);
return array( return array(
$user_source['Nick'], $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']) 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'])

@ -26,7 +26,7 @@ function user_myshifts() {
} }
return page_with_title(_("Reset API key"), array( 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), 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'])) { } elseif (isset($_REQUEST['edit']) && preg_match("/^[0-9]*$/", $_REQUEST['edit'])) {
$id = $_REQUEST['edit']; $id = $_REQUEST['edit'];

@ -1,4 +1,5 @@
<?php <?php
function shifts_title() { function shifts_title() {
return _("Shifts"); return _("Shifts");
} }
@ -501,7 +502,10 @@ function view_user_shifts() {
$is_free = false; $is_free = false;
$shifts_row = $shift['name']; $shifts_row = $shift['name'];
if (in_array('admin_shifts', $privileges)) if (in_array('admin_shifts', $privileges))
$shifts_row .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', _("edit")) . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete")); $shifts_row .= ' ' . table_buttons(array(
button(page_link_to('user_shift') . '&edit_shift=' . $shift['SID'], glyph('edit'), 'btn-xs'),
button(page_link_to('user_shift') . '&delete_shift=' . $shift['SID'], glyph('trash'), 'btn-xs')
));
$shifts_row .= '<br />'; $shifts_row .= '<br />';
$query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id` $query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id`
FROM `NeededAngelTypes` FROM `NeededAngelTypes`
@ -534,7 +538,9 @@ function view_user_shifts() {
$style .= " text-decoration: line-through;"; $style .= " text-decoration: line-through;";
} }
if (in_array('user_shifts_admin', $privileges)) if (in_array('user_shifts_admin', $privileges))
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")) . '</span>'; $entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . ' ' . table_buttons(array(
button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs')
)) . '</span>';
else else
$entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . "</span>"; $entry_list[] = "<span style=\"$style\">" . User_Nick_render($entry) . "</span>";
} }
@ -632,7 +638,10 @@ function view_user_shifts() {
); );
if (in_array('admin_shifts', $privileges)) 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'] .= '<br />'; $shift_row['entries'] .= '<br />';
$is_free = false; $is_free = false;
$shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']); $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; $freeloader = 0;
foreach ($entries as $entry) { foreach ($entries as $entry) {
if (in_array('user_shifts_admin', $privileges)) 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 else
$member = User_Nick_render($entry); $member = User_Nick_render($entry);
if ($entry['freeloaded']) { if ($entry['freeloaded']) {
@ -743,7 +754,7 @@ function view_user_shifts() {
'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")), 'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")),
'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " <a href=\"" . page_link_to('angeltypes') . '&action=about' . "\">" . _("Description of the jobs.") . "</a>", 'task_notice' => '<sup>1</sup>' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " <a href=\"" . page_link_to('angeltypes') . '&action=about' . "\">" . _("Description of the jobs.") . "</a>",
'new_style_checkbox' => '<label><input type="checkbox" name="new_style" value="1" ' . ($_SESSION['user_shifts']['new_style'] ? ' checked' : '') . '> ' . _("Use new style if possible") . '</label>', 'new_style_checkbox' => '<label><input type="checkbox" name="new_style" value="1" ' . ($_SESSION['user_shifts']['new_style'] ? ' checked' : '') . '> ' . _("Use new style if possible") . '</label>',
'shifts_table' =>msg(). $shifts_table, 'shifts_table' => msg() . $shifts_table,
'ical_text' => '<h2>' . _("iCal export") . '</h2><p>' . sprintf(_("Export of shown shifts. <a href=\"%s\">iCal format</a> or <a href=\"%s\">JSON format</a> available (please keep secret, otherwise <a href=\"%s\">reset the api key</a>)."), 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') . '</p>', 'ical_text' => '<h2>' . _("iCal export") . '</h2><p>' . sprintf(_("Export of shown shifts. <a href=\"%s\">iCal format</a> or <a href=\"%s\">JSON format</a> available (please keep secret, otherwise <a href=\"%s\">reset the api key</a>)."), 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') . '</p>',
'filter' => _("Filter") 'filter' => _("Filter")
)), )),

@ -373,10 +373,6 @@ function html_select_key($id, $name, $rows, $selected) {
return $html; return $html;
} }
function img_button($link, $icon, $text, $extra_text = '') {
return '<a href="' . htmlspecialchars($link) . '"><img src="pic/icons/' . htmlspecialchars($icon) . '.png" alt="' . $text . '" ' . (empty($text) ? '' : 'title="' . $text . '"') . '>' . (empty($extra_text) ? '' : ' ' . $extra_text) . '</a>';
}
function ReplaceSmilies($neueckig) { function ReplaceSmilies($neueckig) {
$neueckig = str_replace(";o))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig); $neueckig = str_replace(";o))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig);
$neueckig = str_replace(":-))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig); $neueckig = str_replace(":-))", "<img src=\"pic/smiles/icon_redface.gif\">", $neueckig);

@ -131,11 +131,12 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel
$myshift['comment'] .= '<br /><p class="error">' . _("Freeloaded") . '</p>'; $myshift['comment'] .= '<br /><p class="error">' . _("Freeloaded") . '</p>';
} }
$myshift['actions'] = ""; $myshift['actions'] = array();
if ($its_me || in_array('user_shifts_admin', $privileges)) 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)) 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']) if ($shift['freeloaded'])
$timesum += - 2 * ($shift['end'] - $shift['start']); $timesum += - 2 * ($shift['end'] - $shift['start']);
@ -182,8 +183,9 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel
buttons(array( buttons(array(
$admin_user_privilege ? button(page_link_to('admin_user') . '&id=' . $user_source['UID'], '<span class="glyphicon glyphicon-edit"></span> ' . _("edit")) : '', $admin_user_privilege ? button(page_link_to('admin_user') . '&id=' . $user_source['UID'], '<span class="glyphicon glyphicon-edit"></span> ' . _("edit")) : '',
! $user_source['Gekommen'] ? button(page_link_to('admin_arrive') . '&arrived=' . $user_source['UID'], _("arrived")) : '', ! $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'], '<span class="glyphicon glyphicon-calendar"></span> ' . _("iCal 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'], '<span class="glyphicon glyphicon-export"></span> ' . _("JSON 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) ? '<h2>' . _("Shifts") . '</h2>' : '', ($its_me || $admin_user_privilege) ? '<h2>' . _("Shifts") . '</h2>' : '',
($its_me || $admin_user_privilege) ? table(array( ($its_me || $admin_user_privilege) ? table(array(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

Loading…
Cancel
Save