summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2010-03-01 13:56:45 +0000
committerdeva <deva>2010-03-01 13:56:45 +0000
commitb5a24c83c59dd09c9f0ea8c348fd12d51d281cd6 (patch)
tree19f47e689116ebbe289b2bf7e4b89a73a8924ee8
parent79c1f8ccc3a3e2bc407209d5b05879c2f6a00444 (diff)
Sort entries by date in admin editor.
-rw-r--r--utils/modules/events.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/utils/modules/events.php b/utils/modules/events.php
index 6e1218f..be11dcf 100644
--- a/utils/modules/events.php
+++ b/utils/modules/events.php
@@ -1,5 +1,4 @@
-<?php
-/* -*- Mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+<?php /* -*- Mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
global $UTIL_DIR, $MODULES_DIR;
@@ -19,7 +18,7 @@ class Event {
fwrite($fp, " time=\"" . xmlenc($this->time) . "\"\n");
fwrite($fp, " flyer=\"" . xmlenc($this->flyer) . "\">");
fwrite($fp, xmlenc($this->description));
- fwrite($fp, " </event>\n");
+ fwrite($fp, "</event>\n");
}
public function show()
@@ -28,7 +27,7 @@ class Event {
$icons = new Icons($ICONS_DIR."/");
$icon = $icons->icons[$this->flyer];
- $content = Markdown(htmlspecialchars_decode($this->description));
+ $content = Markdown(htmlspecialchars_decode($this->description));
$str = "<div class=\"event\">\n";
$str .= " <div class=\"event_time\">" . date("D M jS Y", $this->time) . "</div>\n";
@@ -175,8 +174,9 @@ class Events {
default:
$eventlist = array();
foreach($this->events as $event) {
- $eventlist[$event->title] = $event->time;
+ $eventlist[date("Y-m/d h:i:s", $event->time) . ": " . $event->title] = $event->time;
}
+ krsort($eventlist);
$form = new Form("edit");
$form->addWidget(new ComboBox("Edit this event:", "eventid", "", $eventlist));
@@ -212,8 +212,9 @@ class Events {
default:
$eventlist = array();
foreach($this->events as $event) {
- $eventlist[$event->title] = $event->time;
+ $eventlist[date("Y-m/d h:i:s", $event->time) . ": " . $event->title] = $event->time;
}
+ krsort($eventlist);
$form = new Form("confirm");
$form->addWidget(new ComboBox("Delete this event:", "eventid", "", $eventlist));