wok rev 10798

wikiss: list uploaded files
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 03 11:01:10 2011 +0200 (2011-06-03)
parents fc53ede5736e
children 96a38268d475
files wikiss/stuff/plugins/wkp_Upload.php
line diff
     1.1 --- a/wikiss/stuff/plugins/wkp_Upload.php	Thu Jun 02 22:49:19 2011 +0000
     1.2 +++ b/wikiss/stuff/plugins/wkp_Upload.php	Fri Jun 03 11:01:10 2011 +0200
     1.3 @@ -44,6 +44,20 @@
     1.4  <form method="post" enctype="multipart/form-data" action="?action=uploadfile">
     1.5  <input type="file" name="file" value="file"/>
     1.6  <input type="submit"/>
     1.7 +<table>
     1.8 +';
     1.9 +	 if ($handle = @opendir("pages/data")) {
    1.10 +		while(($item = readdir($handle)) !== false) {
    1.11 +			 if ($item == '..' || $item == '.') continue;
    1.12 +		         $CONTENT .= '<tr><td><input type=checkbox ';
    1.13 +		         exec('grep -qs "pages/data/'.$item.'" pages/*.txt', $tmp, $ret);
    1.14 +		         if ($ret == 0) $CONTENT .= 'checked=checked ';
    1.15 +		         $CONTENT .= 'disabled=disabled /><a href="pages/data/'.
    1.16 +		         	$item.'">'.$item.'</a></td></tr>';
    1.17 +		}
    1.18 +	 }
    1.19 +         $CONTENT .= '
    1.20 +</table>
    1.21  </form>
    1.22  ';
    1.23           break;