summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/modules/news.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/modules/news.php b/utils/modules/news.php
index 00f1d4c..032c342 100644
--- a/utils/modules/news.php
+++ b/utils/modules/news.php
@@ -56,7 +56,7 @@ class NewsEntry {
fwrite($fp, " userid=\"" . xmlenc($this->userid) . "\"\n");
fwrite($fp, " icon=\"" . xmlenc($this->icon) . "\">");
fwrite($fp, xmlenc($this->description));
- fwrite($fp, " </newsentry>\n");
+ fwrite($fp, "</newsentry>\n");
}
public function __toString()
@@ -129,6 +129,7 @@ class News {
$time = DateTimeEdit::toTimestamp($vars, "time");
$category = $vars["category"];
$description = $vars["description"];
+ $icon = $vars["icon"];
default:
$form = new Form("preview");
$form->addWidget(new LineEdit("Title", "title", $title));
@@ -209,8 +210,10 @@ class News {
default:
$newslist = array();
foreach($this->news as $newsentry) {
- $newslist[$newsentry->title] = $newsentry->time;
+ $newslist[date("Y-m/d h:i:s", $newsentry->time) . ": " .
+ $newsentry->title] = $newsentry->time;
}
+ krsort($newslist);
$form = new Form("edit");
$form->addWidget(new ComboBox("Edit this entry:", "newsid", "", $newslist));
@@ -246,8 +249,11 @@ class News {
default:
$newslist = array();
foreach($this->news as $newsentry) {
- $newslist[$newsentry->title] = $newsentry->time;
+ $newslist[date("Y-m/d h:i:s", $newsentry->time) . ": " .
+ $newsentry->title] = $newsentry->time;
}
+ krsort($newslist);
+
$form = new Form("confirm");
$form->addWidget(new ComboBox("Delete this entry:", "newsid", "", $newslist));
$form->addWidget(new Button("Delete..."));