/[scire]/webgli/etc_portage.php
Gentoo

Contents of /webgli/etc_portage.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (show annotations) (download)
Sun May 7 19:57:58 2006 UTC (11 years, 6 months ago) by codeman
File size: 1741 byte(s)
adding a lot of webgli screens, some of which are done
the details of the status of webgli is in /webgli/TODO

1 <?php
2 include('webgliIP.php');
3 include('webgliUtility.php');
4
5 include('Smarty.class.php');
6 $smarty = new Smarty;
7
8 $smarty->template_dir = './templates';
9 $smarty->compile_dir = './templates_c';
10 $smarty->cache_dir = './cache';
11 $smarty->config_dir = './configs';
12
13 $ip = new InstallProfile();
14 $ip->parse('test.xml');
15
16 $error_msg = "";
17 $etc_files = $ip->get("etc_files");
18 $smarty->assign('dynamic', $ip->get("dynamic_stage3"));
19
20 if ($_POST['save']) {
21 if ( !$_POST['currentfile'] ) {
22 $error_msg .= "ERROR you must select a file to edit!<br>";
23 }
24 $file = $_POST['currentfile'];
25 #if (array_key_exists($file,$etc_files)) {
26 $etc_files[$file] = $_POST['filecontents'];
27 #} else {
28 # $etc_files[$file] =
29 #etc_files[file].append($_POST['filecontents'])
30 $ip->set("etc_files",$etc_files);
31 #SAVE VALUES
32 file_put_contents('test.xml', $ip->serialize()); #PHP 5 only
33 if ( !$error_msg ) { $error_msg = "Values saved successfully"; }
34 }
35 if ($_POST['fileeditsubmit']) {
36 if ($_POST['editfile']) {
37 $file_to_edit = $_POST['editfile'];
38 $smarty->assign('file_to_edit',$file_to_edit);
39 if (array_key_exists($file_to_edit,$etc_files)) {
40 $previous_contents = join("\n",$etc_files[$file_to_edit]);
41 } else {
42 $previous_contents = "";
43 }
44 }
45 }
46
47 #get portage file list here
48 $file_list["portage/package.mask"] = "A list of DEPEND atoms to mask.";
49 $file_list["portage/package.unmask"] = "A list of packages to unmask.";
50 $file_list["portage/package.keywords"] = "Per-package KEYWORDS (like ACCEPT_KEYWORDS).";
51 $file_list["portage/package.use"] = "Per-package USE flags.";
52 $smarty->assign('file_list',$file_list);
53 $smarty->assign('error_msg',$error_msg);
54 $smarty->assign('previous_contents',$previous_contents);
55 $smarty->display('etc_portage.tpl');
56
57 ?>

  ViewVC Help
Powered by ViewVC 1.1.20