page: replace global variables by $Page object
[minimedit.git] / mail / index.php
index 76ec0334a224b5fc5b560b743ac517b94a81269c..67a076e157cf85614b9ea6cc0142dc279386bba0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 $mailbox = 'mail/inbox';
-@list ($msgid) = explode('/', ltrim($Args, '/'));
+@list ($msgid) = explode('/', ltrim($Page->path, '/'));
 
 function parsemailhead($headerdata)
 {
@@ -16,7 +16,7 @@ if ($msgid) {
        list ($headerdata, $rawbody) = explode("\n\n", file_get_contents($filename), 2);
        $head = parsemailhead($headerdata);
 
-       $Article->title = 'Mailbericht ' . $head['date']->format('Y-m-d H:i');
+       $Page->title = 'Mailbericht ' . $head['date']->format('Y-m-d H:i');
        printf("<h2>%s</h2>\n", htmlspecialchars($head['Subject'] ?? 'Mailbericht zonder onderwerp'));
 
        print '<dl class="terse">';
@@ -62,7 +62,7 @@ foreach (array_reverse($rows) as $filename) {
        list ($headerdata) = explode("\n\n", file_get_contents($filename));
        $head = parsemailhead($headerdata);
 
-       printf('<li><a href="%s">', "/$Page/".basename($filename));
+       printf('<li><a href="%s">', "/{$Page->handler}/".basename($filename));
 
        print $head['Subject'];
        printf(' <small class="date">%s</small>',