Example #1
0
core_declare_input("author", "");
core_declare_input("selectPP", "");
$title = array($NOR_fields[$group]);
if ($period != "all") {
    $title[] = $period;
}
if (TRUE) {
    $title[] = "preprints";
}
if ($author != "") {
    $title[] = "with author '" . $author . "'";
}
startPage(join(" ", $title));
$t = new table("width='95%'", "<form action='index.php' method='get'>");
$t->tro();
$t->td("align='left'", getSelection());
if ($authClass->authenticated()) {
    if (getAllPreprints()) {
        $t->td("", core_getLink("manage preprints", "show_preprints.php"));
    }
    if ($authClass->isAdmin()) {
        $t->td("", core_getLink("manage users", "edit_users.php"));
    }
    if ($authClass->isAdmin()) {
        $t->td("", core_getLink("see access log", "listLog.php"));
    }
    if (True) {
        $t->td("", core_getLink(PP_RESERVE, "edit_preprints.php?nor_pp_period=" . $nor_pp_period . "&amp;nor_pp_mode=" . NOR_PP_MODE_RESERVE));
    }
} else {
    $t->td("", "<div class='only_online'>" . pp_getLink("how to submit preprint", "howto.php", $modal = True) . "</div>");
?>
</label>
    </td>
    <td valign="top" class="primary">
      <?php 
require_once "../classes/Dm.php";
require_once "../classes/DmQuery.php";
$dmQ = new DmQuery();
$dmQ->connect();
$dms = $dmQ->getWithStats("collection_dm");
$dmQ->close();
$options = array();
foreach ($dms as $dm) {
    $options[$dm->getDescription()] = $dm->getCode();
}
echo getSelection('fiction_code', $options, $postVars);
?>
    </td>
  </tr>
<?php 
/*
  <tr>
    <td class="primary" valign="top">
      <label for="fiction_loc"><?php echo $loc->getText("lookup_optsLocFictionCodes"); ?></label>
    </td>
    <td valign="top" class="primary">
      <?php printMyInputText("fiction_loc",30,50,$postVars,$pageErrors); ?>
    </td>
  </tr>
  <tr>
    <td class="primary" valign="top">
     $entry->put_value($selection);
     echo formatJSEND('success');
     break;
 case 'getUsersAndSelectionsForFile':
     /* Get an object containing all the users registered to the given file
      * and their associated selections. The data corresponding to the
      * current user is omitted. */
     if (!isset($_POST['filename']) || empty($_POST['filename'])) {
         exit(formatJSEND('error', 'No filename specified in getUsersAndSelectionsForFile'));
     }
     $filename = $_POST['filename'];
     $usersAndSelections = array();
     $users = getRegisteredUsersForFile($filename);
     foreach ($users as $user) {
         if ($user !== $_SESSION['user']) {
             $selection = getSelection($filename, $user);
             if (!empty($selection)) {
                 $data = array("selection" => $selection, "color" => getColorForUser($user));
                 $usersAndSelections[$user] = $data;
             }
         }
     }
     echo formatJSEND('success', $usersAndSelections);
     break;
 case 'sendShadow':
     if (!isset($_POST['filename']) || empty($_POST['filename'])) {
         exit(formatJSEND('error', 'No filename specified in sendShadow'));
     }
     if (!isset($_POST['shadow'])) {
         exit(formatJSEND('error', 'No shadow specified in sendShadow'));
     }