function post_params($phpvars) { global $config, $editpostparamid, $FormMethod; $postprocessconfig = LoadPostProcessConfig($config); if (!isset($postprocessconfig)) { return; } echo '<form action="status.php" method=' . $FormMethod . '">'; echo '<input type="hidden" name="save" value="1">'; echo '<input type="hidden" name="editpostparam" value="1">'; echo '<input type="hidden" name="id" value="' . $editpostparamid . '">'; $hasparams = false; $cur_queued = null; if (isset($phpvars['activegroup']) && $phpvars['activegroup']['LastID'] == $editpostparamid) { $cur_queued = $phpvars['activegroup']; } else { foreach ($phpvars['queuedgroups'] as $cur) { if ($cur['LastID'] == $editpostparamid) { $cur_queued = $cur; break; } } } if ($cur_queued != null) { echo '<div class = "block"><center>Postprocessing parameters</center><br>'; echo '<table width="100%">'; echo '<tr><td></td><td>name</td><td width="20">category</td><td width="60" align="right">total</td><td width="60" align="right">left</td><td width="100" align="right">estimated time</td></tr>'; $grouppaused = $cur_queued['PausedSizeLo'] != 0 && $cur_queued['RemainingSizeLo'] == $cur_queued['PausedSizeLo']; if ($grouppaused) { echo '<tr class="pausedgroup">'; } else { echo '<tr class="unpausedgroup">'; } echo '<td width="10"><a href="javascript:updatestatus(\'status.php?action=groupdelete&offset=0&id=' . $cur_queued['LastID'] . '\')"><IMG src=images/cancel.gif width=15 height=15 alt="remove nzb" title="remove nzb"></a></td>'; echo '<td>' . namereplace($cur_queued['NZBNicename']) . '</td>'; echo '<td width="20">'; add_category_combo($cur_queued['Category'], $cur_queued['LastID'], false); echo '</td>'; echo '<td align="right">' . formatSizeMB($cur_queued['FileSizeMB']) . '</td>'; echo '<td align="right">' . formatSizeMB($cur_queued['RemainingSizeMB'] - $cur_queued['PausedSizeMB']) . '</td>'; if ($phpvars['status']['DownloadRate'] > 0) { echo '<td align="right">' . sec2hms(($cur_queued['RemainingSizeMB'] - $cur_queued['PausedSizeMB']) / ($phpvars['status']['DownloadRate'] / 1024 / 1024)) . '</td>'; } else { echo '<td align="right"></td>'; } echo '</tr>'; echo '<tr><td> </td></tr>'; echo '<tr><td colspan="6">'; MergePostValues($config, $cur_queued['Parameters']); $hasparams = count($config) > 0; BuildOptionsContent($config, null, false); echo '</td></tr>'; echo '</table>'; echo '</div>'; } if (!$hasparams) { echo '<div class="block"><table width="100%"><tr><td>'; echo '<span class="INFO">INFO</span> Current postprocessing-script does not have any postprocessing parameters.'; echo '</td></tr></table></div>'; } echo '<div class="block"><table width="100%"><tr><td>'; if ($hasparams) { echo '<input type="submit" value="Save changes"> '; } echo '<input type="button" value="Cancel" onClick="location=\'?\'">'; // TIP: uncomment for debug purposes //echo ' <input type="button" value="Reload (for testing)" onClick="javascript:updatestatus(\'status.php?editpostparam=1&id='.$editpostparamid.'\')">'; echo '</td></tr></table></div>'; echo '</form><br>'; }
?> <div class="block"> <center> <a class="commandlink" href="index.php">back to main page</a> </center> </div> </td> <td valign="top"> <?php echo '<form action="config.php" method=' . $FormMethod . '">'; echo '<input type="hidden" name="save" value="1">'; echo '<input type="hidden" name="section" value="' . $reqsection . '">'; BuildOptionsContent($config, $reqsection, true); echo '<div class="block"><table width="100%"><tr><td><input type="submit" value="Save changes"></td></tr></table></div>'; if (array_key_exists($reqsection, $config)) { $section = $config[$reqsection]; if ($section->category == CATEGORY_SERVER) { echo '<br><div class="block"><table width="100%"><tr><td><font color="red"><b>NOTE:</b></font> NZBGet-Server must be restarted for any changes to have effect.</td></tr></table></div>'; } } echo '</form><br>'; } ?> </td> </tr> </table>