Changeset 1829

Show
Ignore:
Timestamp:
05/30/07 22:05:05 (2 years ago)
Author:
anarcat
Message:

add a dropdown to choose the databases backup to ease restores

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/bureau/admin/sql_restore.php

    r765 r1829  
    5252<table cellspacing="0" cellpadding="4"> 
    5353<tr class="lst2"> 
     54        <th><label for="restfile"><?php __("Please choose the filename containing SQL data to be restored."); ?></label></th> 
     55<td><select class="int" id="restfile" name="restfile"> 
     56<?php 
     57// Open a known directory, and proceed to read its contents 
     58$dir = getuserpath(). $r['dir']; 
     59if (is_dir($dir)) { 
     60  if ($dh = opendir($dir)) { 
     61    while (($file = readdir($dh)) !== false) { 
     62      if (filetype($dir . '/' . $file) == 'file') { 
     63        echo '<option value="' . $r['dir'] . '/' . $file . '">'. $file . '</option>'; 
     64      } 
     65    } 
     66    closedir($dh); 
     67  } 
     68} 
     69?> 
     70</select></td> 
     71</tr> 
     72<tr> 
     73<td colspan="2"><input class="inb" type="submit" name="submit" value="<?php __("Restore my database"); ?>" /></td> 
     74</tr> 
     75</table> 
     76</form> 
     77<?php __("OR");?> 
     78<form action="sql_dorestore.php" method="post"> 
     79<input type="hidden" name="id" value="<?php echo $id ?>" /> 
     80<table cellspacing="0" cellpadding="4"> 
     81<tr class="lst2"> 
    5482        <th><label for="restfile"><?php __("Please enter the filename containing SQL data to be restored."); ?></label></th> 
    5583        <td><input type="text" class="int" id="restfile" name="restfile" size="30" maxlength="255" value="" /></td>