/
listissues.inc.php
executable file
·47 lines (41 loc) · 1.91 KB
/
listissues.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<? /* $Id$ */
if ($thisSite) $thisSite->fetchDown();
if ($thisSection) $thisSection->fetchDown();
/* $thisPage->fetchDown(); */
$envvars = "site=".$thisSite->name;
if ($thisSection) $envvars .= "&section=".$thisSection->id;
if ($thisPage) $envvars .= "&page=".$thisPage->id;
// make the navbars!
include("output_modules/publication/navbars.inc.php");
if ($thisSite) {
printc("<div class='title'>Issue listing:</div>");
$newaction = ($isediting)?"viewsite":"site";
$i = 0;
$total = count($thisSite->sections);
printc("<table border='0' width='100%'>");
foreach (array_reverse($thisSite->sections,TRUE) as $s=>$o) {
if ($i != $total - 1) {
$pdfname = $filename = $fileurl = $extra = '';
$pdfname = createPdfName($o->getField("title"));
$filename = "$uploaddir/".$thisSite->name."/$pdfname";
$fileurl = "$uploadurl/".$thisSite->name."/$pdfname";
if (file_exists($filename)) {
$extra .= pdflink($filename,$fileurl,1);
}
printc("<b><a href='$PHP_SELF?$sid&site=$site&section=$s&action=$newaction&supplement=listarticles'>".$o->getField("title")."</a></b>");
if ($isediting) {
printc("<div align='right' class='smaller'>");
if ($o->hasPermission("edit")) printc("<a href='$PHP_SELF?$sid&action=edit_section&site=$site&section=$s&edit_section=$s&comingFrom=viewsite%26supplement%3Dlistissues'>edit</a>\n");
if ($o->hasPermission("delete")) printc("<a href='$PHP_SELF?$sid&action=delete_section&site=$site&section=$s&delete_section=$s&comingFrom=viewsite%26supplement%3Dlistissues'>delete</a>\n");
printc("</div>");
}
printc("</td>");
printc("<td>$extra</td></tr>");
}
$i++;
}
printc("</table>");
if ($isediting && $thisSite->hasPermission("add")) {
printc("<br /><div align='right'><a href='$PHP_SELF?$sid&site=$site&action=add_section&comingFrom=viewsite%26supplement%3Dlistissues'>+ add issue</a>");
}
}