summaryrefslogtreecommitdiff
blob: 20899bbc0a3b55cf952436ce1b2627a6caef5472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
function gentoo_init_step1() {
	return array('title' => 'Step 1 - Choose Profile');
}
function gentoo_body_step1() {
	global $S;
	$configuration=&$S['wizard.configuration'];
	//$opts=$configuration->get_configopts(); // TODO use this to set selected="selected" on the current profile
	echo 'Profile: <select name="profileid">';
	$r=$S['pdo']->query('SELECT * FROM `gentoo_profiles` WHERE `flags` NOT LIKE "%d%"'); // d for disabled
	while ($profile=$r->fetch(PDO::FETCH_ASSOC)) {
		$profile=new sql_gentoo_profile($profile);
		$display=$profile->name?$profile->name:($profile->pkgdir?$profile->pkgdir:'/');
		echo '<option value="'.$profile->id.'">'.htmlentities($display).'</option>';
	}
	echo '</select><br/>';
}
function gentoo_process_step1() {
	global $S, $request;
	$profile=new sql_gentoo_profile($request['profileid']);
	$profileopt=new sql_configopt($S['wizard.configuration']->id, 'profile', $profile->id);
	$profileopt->write();
}
?>