function linking($fin, $fout, $issuedescription, $issuenumber) { global $header; $input = file($fin); $input = array_map('trim', $input); $outfile = fopen($fout, "w"); fputs($outfile, $header); fputs($outfile, "<h1>{$issuedescription} (See " . '<a href="https://github.com/sanskrit-lexicon/hwnorm1/issues/' . $issuenumber . '">This issue</a>)</h1>'); $counter = 1; foreach ($input as $value) { $split = explode(':', $value); $dict = $split[0]; $word = $split[1]; fputs($outfile, "<tr><td>" . $counter . "</td><td>" . webpagelink($dict, $word) . "</td><td>" . pdflink($dict, $word) . "</td></tr>\n"); $counter++; } fputs($outfile, "</table></body></html>"); fclose($outfile); echo "Check {$fout} for testing.\n"; }
// 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>"); }
if ($o->canview() || $o->hasPermissionDown("add or edit or delete")) { if ($i != $total - 1 || $action == 'viewsite' && $_SESSION[atype] == 'admin') { if ($o->getField("type") == 'section') { $link = "{$PHP_SELF}?{$sid}&site={$site}&section={$s}&action={$action}&supplement=listarticles"; } if ($o->getField("type") == 'url') { $link = $o->getField("url"); $target = "_self"; } $extra = ''; $pdfname = $filename = $fileurl = ''; $pdfname = createPdfName($o->getField("title")); $filename = "{$uploaddir}/" . $thisSite->name . "/{$pdfname}"; $fileurl = "{$uploadurl}/" . $thisSite->name . "/{$pdfname}"; if (file_exists($filename)) { $extra .= "<div align='center' class='leftmargin smaller'>" . pdflink($filename, $fileurl, 2) . "</div>"; } if ($isediting) { $extra .= $thisSite->hasPermission("edit") ? "\n<a href='{$PHP_SELF}?{$sid}&site={$site}&section={$s}&action=edit_section&edit_section={$s}&comingFrom=viewsite' class='small' title='Edit the title and properties of this section'>edit</a>" : ""; $extra .= $thisSite->hasPermission("delete") ? "\n<a href='javascript:doconfirm(\"Are absolutely sure you want to PERMANENTLY DELETE this section, including anything that may be held within it?? (you better be SURE!)\",\"{$PHP_SELF}?{$sid}&" . $envvars . "&action=delete_section&delete_section={$s}\")' class='small' title='Delete this section'>del</a>" : ""; } add_link(leftnav2, $o->getField("title"), $link, $extra, $s, $target); } $i++; } } } if ($isediting) { $leftnav_extra = $thisSite->hasPermission("add") ? " <a href='{$PHP_SELF}?{$sid}&" . $envvars . "&action=add_section&comingFrom=viewsite' class='small' title='Add a new Section to this site. A section can hold one or many pages of content. You can also add a Link here instead of a Section.'>+ add issue</a>" : ""; } /******************************************************************************