1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
<?php
include('webgliIP.php');
include('webgliUtility.php');
include('Smarty.class.php');
$smarty = new Smarty;
#phpinfo();
$smarty->template_dir = './templates';
$smarty->compile_dir = './templates_c';
$smarty->cache_dir = './cache';
$smarty->config_dir = './configs';
$ip = new InstallProfile();
$ip->parse('test.xml');
$error_msg = "";
if ($_POST['packages']) {
$ip->set("install_packages", $_POST['packages']);
#SERIALIZE
$fh = fopen('test.xml','w');
fwrite($fh, $ip->serialize());
fclose($fh);
}
if ($_POST['manualpackages']) {
$packages = explode(',',$_POST['manualpackages']);
if ($packages) {
$ip->set("install_packages", $packages);
#SERIALIZE
$fh = fopen('test.xml','w');
fwrite($fh, $ip->serialize());
fclose($fh);
}
}
if (!$error_msg) {
$error_msg = "Values saved successfully";
}
$smarty->assign('error_msg',$error_msg);
$install_packages = array();
$install_packages = $ip->get("install_packages");
print "Install Packages:";
var_dump($install_packages);
$smarty->assign('install_packages',$install_packages);
$smarty->assign('current_package_list', join(',',$install_packages));
$grp_list = get_grp_pkgs_from_cd();
$package_list = get_install_package_list();
$smarty->assign('grp_list',$grp_list);
$smarty->assign('package_list',$package_list);
$show_groups = array();
#figure out how to show groups
foreach ($_POST as $item => $param) {
if( stristr($item,'show') and ($param == "Expand")) {
$show_groups[substr($item, 5)] = "Expand";
}
}
#print_r($show_groups);
$smarty->assign('show_groups',$show_groups);
$smarty->display('extrapackages.tpl');
?>
|