Esempio n. 1
0
     # Add to contents
     $content = $templateQueueProcess->contents();
 } elseif (isset($_GET['d']) and is_numeric($_GET['d'])) {
     # Load remove from queue list template
     $templateQueueRemove = new nzbg_template("queue.remove");
     # Get entry ID
     $intEntryID = $_GET['d'];
     # Instantiate queue object
     $objQueue = new nzbg_conf("queue");
     # Fetch all items to array
     $arrQueueList = $objQueue->get_xml_as_array();
     # Instantiate the Log object
     $objNZBLog = new nzbg_log($appConfig);
     # Extra check if the item to delete is correct
     if ($_GET['t'] == $arrQueueList[$intEntryID]['matchtitle']) {
         $objQueue->delete_download($intEntryID);
         $arrPlaceholders = array('ITEM' => $arrQueueList[$intEntryID]['nzb'], 'FONT_COLOR' => 'black', 'COLOR' => 'green');
         $objNZBLog->writeLine("Removed entry \"" . $arrQueueList[$intEntryID]['nzb'] . "\" from the NZB verification queue.");
     } else {
         $arrPlaceholders = array('ITEM' => 'An error occured! Please try again.', 'FONT_COLOR' => 'red', 'COLOR' => 'red');
         $objNZBLog->writeLine("Removed entry \"" . $arrQueueList[$intEntryID]['nzb'] . "\" from the NZB verification queue failed.");
     }
     # Replace placeholders
     $templateQueueRemove->replace_array($arrPlaceholders);
     # Add to contents
     $content = $templateQueueRemove->contents();
 } elseif (isset($_GET['r']) and is_numeric($_GET['r'])) {
     # Load remove from queue list template
     $templateQueueRename = new nzbg_template("queue.rename");
     # Get entry ID
     $intEntryID = $_GET['r'];