From b5a24c83c59dd09c9f0ea8c348fd12d51d281cd6 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 1 Mar 2010 13:56:45 +0000 Subject: Sort entries by date in admin editor. --- utils/modules/events.php | 13 +++++++------ 1 file 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 @@ -time) . "\"\n"); fwrite($fp, " flyer=\"" . xmlenc($this->flyer) . "\">"); fwrite($fp, xmlenc($this->description)); - fwrite($fp, " \n"); + fwrite($fp, "\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 = "
\n"; $str .= "
" . date("D M jS Y", $this->time) . "
\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)); -- cgit v1.2.3