tiny-slitaz rev 10
Add suggested support (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jan 05 19:54:54 2016 +0100 (2016-01-05) |
parents | 2d67c63d180b |
children | 25fdf21e38d9 |
files | step4.php |
line diff
1.1 --- a/step4.php Tue Jan 05 18:00:29 2016 +0100 1.2 +++ b/step4.php Tue Jan 05 19:54:54 2016 +0100 1.3 @@ -32,7 +32,9 @@ 1.4 $_POST['tmp_dir']); 1.5 unset($pkgs[$key]); 1.6 $_POST['toconfigure'] = implode(" ", $pkgs); 1.7 - if ($output == "") { 1.8 + $suggested = shell_exec("./helper --get-suggested $pkg ". 1.9 + $_POST['tmp_dir']); 1.10 + if ($output == "" && $suggested == "") { 1.11 shell_exec("sudo ./helper --post-install $pkg ". 1.12 $_POST['tmp_dir']); 1.13 continue; 1.14 @@ -49,23 +51,23 @@ 1.15 <?php 1.16 echo $output; 1.17 post_hidden(); 1.18 - $suggested = shell_exec("./helper --get-suggested $pkg ". 1.19 - $_POST['tmp_dir']); 1.20 if ($suggested != "") { 1.21 + $output = "suggested"; 1.22 ?> 1.23 -<hr /> 1.24 -<p> 1.25 -You may want to install the following package(s) too: 1.26 -</p> 1.27 -<ol> 1.28 -<?php foreach (explode(" ", $suggested) as $pkg) { ?> 1.29 -<li> 1.30 -<input type="checkbox" name="suggested[]" value="<?php echo $pkg; ?>" checked="checked" /> <?php echo $pkg; ?> 1.31 -</li> 1.32 -<?php } 1.33 - echo "</ol>"; 1.34 - } 1.35 -?> 1.36 + <hr /> 1.37 + <p> 1.38 + You may want to install the following package(s) too: 1.39 + </p> 1.40 + <ol> 1.41 +<?php foreach (explode(" ", $suggested) as $pkg) 1.42 + if (!strstr(" ".$_POST['packages']." ", 1.43 + " ".$pkg." ")) { ?> 1.44 + <li> 1.45 + <input type="checkbox" name="suggested[]" value="<?php echo $pkg; ?>" checked="checked" /> <?php echo $pkg; ?> 1.46 + </li> 1.47 +<?php } ?> 1.48 + </ol> 1.49 +<?php } ?> 1.50 </div> 1.51 1.52 <div align="center">