示例#1
0
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "graph/navbar.inc.php";
require "localSidebar.php";
/*
 * Display right top shortcuts menu
 */
right_top_shortcuts_display();
$p = new PageGenerator(_T("Browse backup", 'backuppc') . ' (' . $_GET['cn'] . ')');
$p->setSideMenu($sidemenu);
$p->display();
require_once "modules/backuppc/includes/xmlrpc.php";
$response = get_share_names($_GET['host'], $_GET['backupnum']);
// Check if error occured
if ($response['err']) {
    new NotifyWidgetFailure(nl2br($response['errtext']));
    return;
}
$sharenames = $response['data'];
$count = count($sharenames);
$params = array();
for ($i = 0; $i < $count; $i++) {
    $params[] = array('host' => $_GET['host'], 'cn' => $_GET['cn'], 'backupnum' => $_GET['backupnum'], 'sharename' => str_replace('&nbsp;', '%20', htmlentities($sharenames[$i])));
}
$n = new OptimizedListInfos($sharenames, _T("Folder", "backuppc"));
$n->setCssClass("folder");
// CSS for icons
$n->setItemCount($count);
示例#2
0
// Check if error occured
if ($response['err']) {
    new NotifyWidgetFailure(nl2br($response['errtext']));
    return;
}
if (count($response['data'])) {
    $backups = $response['data'][0];
} else {
    print _T('There is no backup for this machine yet.', 'backuppc');
    return;
}
// Get all backup shares =================================
$sharenames = array();
// Get all sharenames
foreach ($backups as $backup_num) {
    $response = get_share_names($host, $backup_num);
    if ($response['err']) {
        new NotifyWidgetFailure(nl2br($response['errtext']));
        return;
    }
    $sharenames = array_merge($sharenames, $response['data']);
}
$sharenames = array_unique($sharenames);
// ========= BUILDING FORM ========================================
$f->add(new HiddenTpl("host"), array("value" => $host, "hide" => True));
// =====================================================================
// FILENAME
// =====================================================================
$f->add(new TrFormElement(_T('File name', 'backuppc'), new InputTpl('filename')), array("value" => isset($_POST['filename']) ? $_POST['filename'] : '', "required" => True));
// =============================================================================
// BACKUP NUM SELECT FIELD  =====================================================