Adjusted order function so that arrow changes direction when changing order
This commit is contained in:
@@ -20,8 +20,31 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
|
||||
# print the bookmark header if enabled.
|
||||
# Yes, it's ugly PHP code, but beautiful HTML code.
|
||||
if ($show_header) {
|
||||
$order[0] == 'titleasc' ? $sort_t = 'titledesc' : $sort_t = 'titledasc';
|
||||
$order[0] == 'dateasc' ? $sort_d = 'datedesc' : $sort_d = 'dateasc';
|
||||
if ($order[0] == 'titleasc') {
|
||||
$sort_t = 'titledesc';
|
||||
$img_t = '<img src="./images/ascending.gif" alt="">';
|
||||
}
|
||||
else if ($order[0] == 'titledesc') {
|
||||
$sort_t = 'titleasc';
|
||||
$img_t = '<img src="./images/descending.gif" alt="">';
|
||||
}
|
||||
else {
|
||||
$sort_t = 'titleasc';
|
||||
$img_t = '<img src="./images/descending.gif" alt="" class="invisible">';
|
||||
}
|
||||
|
||||
if ($order[0] == 'dateasc') {
|
||||
$sort_d = 'datedesc';
|
||||
$img_d = '<img src="./images/ascending.gif" alt="">';
|
||||
}
|
||||
else if ($order[0] == 'datedesc') {
|
||||
$sort_d = 'dateasc';
|
||||
$img_d = '<img src="./images/descending.gif" alt="">';
|
||||
}
|
||||
else {
|
||||
$sort_d = 'dateasc';
|
||||
$img_d = '<img src="./images/descending.gif" alt="" class="invisible">';
|
||||
}
|
||||
|
||||
echo '<div class="bookmarkcaption">' . "\n";
|
||||
if ($show_folder) {
|
||||
@@ -39,12 +62,12 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
|
||||
'order' => $sort_d,
|
||||
);
|
||||
if (isset ($GLOBALS['user']) && $GLOBALS['user'] != '') {
|
||||
$query_data ['user'] = $GLOBALS['user'];
|
||||
$query_data['user'] = $GLOBALS['user'];
|
||||
}
|
||||
$query_string = assemble_query_string ($query_data);
|
||||
echo "\t\t" . '<div class="bmright">' . "\n";
|
||||
echo "\t\t\t" . '<span class="date">' . "\n";
|
||||
echo "\t\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Date <img src="./images/ascending.gif" alt=""></a>' . "\n";
|
||||
echo "\t\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Date ' . $img_d . '</a>' . "\n";
|
||||
echo "\t\t\t" . '</span>' . "\n";
|
||||
if ($show_edit) {
|
||||
echo "\t\t\t" . '<img src="./images/edit.gif" alt="" class="invisible">' . "\n";
|
||||
@@ -63,7 +86,7 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
|
||||
}
|
||||
$query_data ['order'] = $sort_t;
|
||||
$query_string = assemble_query_string ($query_data);
|
||||
echo "\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Title <img src="./images/ascending.gif" alt=""></a>' . "\n";
|
||||
echo "\t\t\t" . '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $query_string . '" class="f">Title ' . $img_t . '</a>' . "\n";
|
||||
echo "\t\t" . '</div>' . "\n";
|
||||
echo "\t" . '</div>' . "\n\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user