<?php
/**
*
* @author Benjamin Gillissen <hide@address.com>
*
* **************************************************************
Copyright (C) 2009 Benjamin Gillissen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details at:
http://www.gnu.org/copyleft/gpl.html
* **************************************************************
*/
class ajx_deluplnzb extends ajax {
public static function deluplnzb($dids){
parent::$CB = __FUNCTION__;
$dids = split(';', $dids);
$nzdb = new nzbdb();
$repo = new file_abstract('NZB');
$d=0;
foreach($dids as $k => &$ID){
$ID=trim($ID);
if ( !empty($ID) ){
$nzb = $nzdb->get_infos($ID);
if ( FALSE !== $nzb ){
if ( $repo->isfile('/'.$nzb['file']) ){ $repo->remove('/'.$nzb['file'], FALSE); }
$nzdb->remove_nzb($ID);
parent::addAssign("item_$ID", 'innerHTML', '');
$d++;
}
}
}
pagegen::add_event("$d NZB(s) removed.");
return parent::getReply();
}
}