summaryrefslogtreecommitdiff
path: root/lib/deck/view.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:29:55 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:29:55 +0200
commit738639355db0dd88682385873c047b3f96969622 (patch)
tree5d78ec2a958e007c09a5b9687dbfceead599a6f1 /lib/deck/view.php
parenta565e649898c629874ef812a13806b1c384f68e4 (diff)
downloadBits-738639355db0dd88682385873c047b3f96969622.tar.gz
Bits-738639355db0dd88682385873c047b3f96969622.zip
Bugfixes.
Diffstat (limited to 'lib/deck/view.php')
-rw-r--r--lib/deck/view.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/deck/view.php b/lib/deck/view.php
index 5604395..e9a83e6 100644
--- a/lib/deck/view.php
+++ b/lib/deck/view.php
@@ -9,6 +9,9 @@ $deck = mysql_fetch_assoc(sql(
"WHERE decks.id = $deckid"));
assert_error($deck, "This deck does not exist.");
+$can_edit = false;
+if ($deck["owner_id"] == $user['id']) $can_edit = true;
+
$filters = array (
"order" => array (
"name" => "card name",
@@ -18,7 +21,7 @@ $filters = array (
);
$fdefaults = array (
"order" => "number",
- "way" => "ASC",
+ "way" => ($can_edit ? "DESC" : "ASC"),
);
$cards = array();
@@ -28,9 +31,6 @@ $n = sql(
);
while ($nn = mysql_fetch_assoc($n)) $cards[] = $nn;
-$can_edit = false;
-if ($deck["owner_id"] == $user['id']) $can_edit = true;
-
$can_start_study = false;
if ($user['id'] != 0) {
if (!mysql_fetch_assoc(sql("SELECT id FROM deck_study WHERE deck = $deckid AND user = " . $user['id'])))