tiny-slitaz diff step4.php @ rev 7
Add suggested support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jan 05 17:39:36 2016 +0100 (2016-01-05) |
parents | ac214416e736 |
children | 26cfc967375f |
line diff
1.1 --- a/step4.php Sun Nov 01 16:56:16 2015 +0100 1.2 +++ b/step4.php Tue Jan 05 17:39:36 2016 +0100 1.3 @@ -16,6 +16,13 @@ 1.4 shell_exec("sudo ./helper --post-install $pkg ".$_POST['tmp_dir']); 1.5 } 1.6 1.7 +if (isset($_POST['suggested'])) { 1.8 + foreach ($_POST['suggested'] as $pkg) { 1.9 + $_POST['toconfigure'] .= " ".$pkg; 1.10 + } 1.11 + unset($_POST['suggested']); 1.12 +} 1.13 + 1.14 $output = ''; 1.15 if (!empty($_POST['toconfigure'])) { 1.16 $pkgs = explode(" ",$_POST['toconfigure']); 1.17 @@ -42,6 +49,22 @@ 1.18 <?php 1.19 echo $output; 1.20 post_hidden(); 1.21 + $suggested = shell_exec("./helper --get-suggested $pkg ". 1.22 + $_POST['tmp_dir']); 1.23 + if ($suggested != "") { 1.24 +?> 1.25 +<hr /> 1.26 +<p> 1.27 +You may want to install the following package(s) too: 1.28 +</p> 1.29 +<ol> 1.30 +<?php foreach (explode(" ", $suggested) as $pkg) { ?> 1.31 +<li> 1.32 +<input type="checkbox" name="suggested[]" value="<?php echo $pkg; ?>" checked="checked" /> <?php echo $pkg; ?> 1.33 +</li> 1.34 +<?php } 1.35 + echo "</ol>"; 1.36 + } 1.37 ?> 1.38 </div> 1.39