summaryrefslogtreecommitdiff
path: root/webgli
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2006-04-15 20:23:31 +0000
committerPreston Cody <codeman@gentoo.org>2006-04-15 20:23:31 +0000
commitde047f5a78f398e12cb3f4c76452a08a69e3c529 (patch)
tree08d930fb15cc41e8e2bf22f10eaeee370673be68 /webgli
parentworking versions of XMLParser and webgliIP (diff)
downloadscire-de047f5a78f398e12cb3f4c76452a08a69e3c529.tar.gz
scire-de047f5a78f398e12cb3f4c76452a08a69e3c529.tar.bz2
scire-de047f5a78f398e12cb3f4c76452a08a69e3c529.zip
adding initial files for configfiles screen
small updates to the other screens. svn path=/; revision=18
Diffstat (limited to 'webgli')
-rw-r--r--webgli/configfiles.php129
-rw-r--r--webgli/index.php2
-rw-r--r--webgli/templates/bootloader.tpl2
-rw-r--r--webgli/templates/clientconfig.tpl3
-rw-r--r--webgli/templates/configfiles.tpl76
-rw-r--r--webgli/templates/header.tpl2
-rw-r--r--webgli/templates/index.tpl2
-rw-r--r--webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php4
-rw-r--r--webgli/templates_c/%%F7^F7F^F7F34188%%header.tpl.php4
-rw-r--r--webgli/webgliUtility.php6
10 files changed, 218 insertions, 12 deletions
diff --git a/webgli/configfiles.php b/webgli/configfiles.php
new file mode 100644
index 0000000..c06d0b5
--- /dev/null
+++ b/webgli/configfiles.php
@@ -0,0 +1,129 @@
+<?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';
+
+$error_msg = "";
+if ($_POST['SaveConfigFiles']) {
+ $keymap = "";
+ $windowkeys = "";
+ $ext_keymap = "";
+ $font = "";
+ $clock = "";
+ $editor = "";
+ $disp_manager = "";
+ $xsession = "";
+ if ($_POST['clock']) {
+ $clock = $_POST['clock'];
+ }
+ if ($_POST['editor']) {
+ $editor = $_POST['editor'];
+ }
+ if ($_POST['disp_manager']) {
+ $disp_manager = $_POST['disp_manager'];
+ }
+ if ($_POST['keymap']) {
+ $keymap = $_POST['keymap'];
+ }
+ if ($_POST['windowkeys']) {
+ $windowkeys = $_POST['windowkeys'];
+ }
+ if ($_POST['ext_keymap']) {
+ $ext_keymap = $_POST['ext_keymap'];
+ }
+ if ($_POST['font']) {
+ $font = $_POST['font'];
+ }
+ if ($_POST['xsession']) {
+ $xsession = $_POST['xsession'];
+ }
+}
+# Save values. Then load them and smarty-> assign them.
+/* etc_files = shared_info.install_profile.get_etc_files()
+ if not "conf.d/keymaps" in etc_files:
+ if keymap or windowkeys or ext_keymap:
+ etc_files['conf.d/keymaps'] = {}
+ if not "conf.d/consolefont" in etc_files:
+ if font:
+ etc_files['conf.d/consolefont'] = {}
+ if not "conf.d/clock" in etc_files:
+ if clock:
+ etc_files['conf.d/clock'] = {}
+ if not "rc.conf" in etc_files:
+ if editor or disp_manager or xsession:
+ etc_files['rc.conf'] = {}
+ if keymap:
+ etc_files['conf.d/keymaps']['KEYMAP'] = keymap
+ if windowkeys:
+ etc_files['conf.d/keymaps']['SET_WINDOWSKEYS'] = windowkeys
+ if ext_keymap:
+ etc_files['conf.d/keymaps']['EXTENDED_KEYMAPS'] = ext_keymap
+ if font:
+ etc_files['conf.d/consolefont']['CONSOLEFONT'] = font
+ if clock:
+ etc_files['conf.d/clock']['CLOCK'] = clock
+ if editor:
+ etc_files['rc.conf']['EDITOR'] = editor
+ if disp_manager:
+ etc_files['rc.conf']['DISPLAYMANAGER'] = disp_manager
+ if xsession:
+ etc_files['rc.conf']['XSESSION'] = xsession
+ shared_info.install_profile.set_etc_files(etc_files)
+ if not error_msg:
+ error_msg = "Values saved successfully"
+
+etc_files = shared_info.install_profile.get_etc_files()
+*/
+$smarty->assign('clock', $clock);
+$smarty->assign('keymap',$keymap);
+$smarty->assign('windowkeys',$windowkeys);
+$smarty->assign('ext_keymap',$ext_keymap);
+$smarty->assign('font',$font);
+$smarty->assign('editor',$editor);
+$smarty->assign('disp_manager',$disp_manager);
+$smarty->assign('xsession',$xsession);
+
+/*<td><b>Clock:</b><br>Should CLOCK be set to UTC or local? Unless you set your timezone to UTC you will want to choose local.<br><input type="radio" name="clock" value="UTC" <? if ("conf.d/clock" in etc_files) and ("CLOCK" in etc_files['conf.d/clock']) and (etc_files['conf.d/clock']['CLOCK'] == "UTC"): print "checked" ?>>UTC<br>
+ <input type="radio" name="clock" value="local" <? if ("conf.d/clock" in etc_files) and (etc_files['conf.d/clock']['CLOCK'] == "local"): print "checked" ?>>Local
+ </td>
+ </tr>
+ <tr>
+ <td><b>Default Editor:</b><br>Choose your default editor:<br>
+ <input type="radio" name="editor" value="/bin/nano" <? if ("rc.conf" in etc_files) and ("EDITOR" in etc_files['rc.conf']) and (etc_files['rc.conf']['EDITOR'] == "/bin/nano"): print "checked" ?>>/bin/nano (Default editor)<br>
+ <input type="radio" name="editor" value="/usr/bin/vim" <? if ("rc.conf" in etc_files) and ("EDITOR" in etc_files['rc.conf']) and (etc_files['rc.conf']['EDITOR'] == "/usr/bin/vim"): print "checked" ?>>/usr/bin/vim (vi improved editor)<br>
+ <input type="radio" name="editor" value="/usr/bin/emacs" <? if ("rc.conf" in etc_files) and ("EDITOR" in etc_files['rc.conf']) and (etc_files['rc.conf']['EDITOR'] == "/usr/bin/emacs"): print "checked" ?>>/usr/bin/emacs (The emacs editor)
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td width="50%"><b>Display Manager:</b><br>Choose your display manager for Xorg-x11 (note you must make sure that package also gets installed for it to work):<br>
+ <input type="radio" name="disp_manager" value="xdm" <? if ("rc.conf" in etc_files) and ("DISPLAYMANAGER" in etc_files['rc.conf']) and (etc_files['rc.conf']['DISPLAYMANAGER'] == "xdm"): print "checked" ?>>xdm (X Display Manager (NOT recommended))<br>
+ <input type="radio" name="disp_manager" value="gdm" <? if ("rc.conf" in etc_files) and ("DISPLAYMANAGER" in etc_files['rc.conf']) and (etc_files['rc.conf']['DISPLAYMANAGER'] == "gdm"): print "checked" ?>>gdm (Gnome Display Manager)<br>
+ <input type="radio" name="disp_manager" value="kdm" <? if ("rc.conf" in etc_files) and ("DISPLAYMANAGER" in etc_files['rc.conf']) and (etc_files['rc.conf']['DISPLAYMANAGER'] == "kdm"): print "checked" ?>>kdm (KDE Display Manager)
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height="66%">
+ <td>
+ <table width="100%" height="100%" border="1">
+ <tr>
+ <td width="50%"><b>Keymap</b><br>Choose your desired keymap:<br>
+ <select name="keymap">
+ <option value=""> </option>
+*/
+$keymap_list = generate_keymap_list();
+$font_list = generate_consolefont_list();
+$smarty->assign('keymap_list', $keymap_list);
+$smarty->assign('font_list',$font_list);
+
+$smarty->display('configfiles.tpl');
+?>
diff --git a/webgli/index.php b/webgli/index.php
index 1c89f3e..34e81b5 100644
--- a/webgli/index.php
+++ b/webgli/index.php
@@ -18,7 +18,7 @@ $smarty->cache_dir = './cache';
$smarty->config_dir = './configs';
-
+$smarty->assign('advanced',True);
$smarty->display('index.tpl');
diff --git a/webgli/templates/bootloader.tpl b/webgli/templates/bootloader.tpl
index a484bae..2bebdf6 100644
--- a/webgli/templates/bootloader.tpl
+++ b/webgli/templates/bootloader.tpl
@@ -1,4 +1,4 @@
-{include file="header.tpl" title="WebGLI - Bootloader"}
+{include file="header.tpl" title="WebGLI - Bootloader", advanced=$advanced}
<p>Bootloader Settings:</p>
{if $error_msg}
<br>{$error_msg}<br><br>
diff --git a/webgli/templates/clientconfig.tpl b/webgli/templates/clientconfig.tpl
index 21da4cc..3b6ca78 100644
--- a/webgli/templates/clientconfig.tpl
+++ b/webgli/templates/clientconfig.tpl
@@ -1,4 +1,4 @@
-{include file="header.tpl" title="WebGLI - Client Configuration"}
+{include file="header.tpl" title="WebGLI - Client Configuration", advanced=$advanced}
<h2>Client Config</h2>
{if $error_msg}
<br>{$error_msg}<br><br>
@@ -82,3 +82,4 @@ Re-enter Password to verify:<input name="RootPass2" type="password" maxlength="8
</tr>
</table>
</form>
+{include file="bottom.tpl"}
diff --git a/webgli/templates/configfiles.tpl b/webgli/templates/configfiles.tpl
new file mode 100644
index 0000000..3848ee1
--- /dev/null
+++ b/webgli/templates/configfiles.tpl
@@ -0,0 +1,76 @@
+{include file="header.tpl" title="WebGLI - Configuration Files"}
+{if $error_msg}
+<br>{$error_msg}<br><br>
+{/if}
+<form action="" method="POST" enctype="multipart/form-data">
+<table cellspacing="0" cellpadding="0" width="790" height="600" border="1">
+ <tr height="33%">
+ <td>
+ <table width="100%" height="100%" border="1">
+ <tr>
+ <td width="50%">
+ <table width="100%" height="100%" border="1">
+ <tr>
+ <td><b>Clock:</b><br>Should CLOCK be set to UTC or local?<br><input type="radio" name="clock" value="UTC" {if $clock == "UTC"} checked {/if}>UTC<br>
+ <input type="radio" name="clock" value="local" {if $clock == "local"} checked {/if}>Local
+ </td>
+ </tr>
+ <tr>
+ <td><b>Default Editor:</b><br>Choose your default editor:<br>
+ <input type="radio" name="editor" value="/bin/nano" {if $editor == "/bin/nano"} checked {/if}>/bin/nano (Default editor)<br>
+ <input type="radio" name="editor" value="/usr/bin/vim" {if $editor == "/usr/bin/vim"} checked {/if}>/usr/bin/vim (vi improved editor)<br>
+ <input type="radio" name="editor" value="/usr/bin/emacs" {if $editor == "/usr/bin/emacs"} checked {/if}>/usr/bin/emacs (The emacs editor)
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td width="50%"><b>Display Manager:</b><br>Choose your display manager for Xorg-x11 (note you must make sure that package also gets installed for it to work):<br>
+ <input type="radio" name="disp_manager" value="xdm" {if $disp_manager == "xdm"} checked {/if}>xdm (X Display Manager (NOT recommended))<br>
+ <input type="radio" name="disp_manager" value="gdm" {if $disp_manager == "gdm"} checked {/if}>gdm (Gnome Display Manager)<br>
+ <input type="radio" name="disp_manager" value="kdm" {if $disp_manager == "kdm"} checked {/if}>kdm (KDE Display Manager)
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height="66%">
+ <td>
+ <table width="100%" height="100%" border="1">
+ <tr>
+ <td width="50%"><b>Keymap</b><br>Choose your desired keymap:<br>
+ <select name="keymap">
+ <option value=""> </option>
+{section name=key loop=$keymap_list}
+ <option value="{$keymap_list[key]}" {if $keymap_list[key] == $keymap} selected {/if}>{$keymap_list[key]}</option>
+{/section}
+ </select><br>
+ <br><b>Windowkeys</b><br>Should we first load the 'windowkeys' console keymap?
+ <input type="radio" name="windowkeys" value="yes" {if $windowkeys == "yes"} checked {/if}> Yes <input type="radio" name="windowkeys" value="no" {if $windowkeys == "no"} checked {/if}> No <br>
+ <br><b>Extended Keymaps</b><br>This sets the maps to load for extended keyboards. Most users will leave this as is.<br>
+ <input type="text" name="ext_keymap" value="{$ext_keymap}"><br>
+ </td>
+ <td width="50%">
+ <table width="100%" height="100%" border="1">
+ <tr>
+ <td><b>Console Font</b><br>Choose your desired console font:<br>
+ <select name="font">
+ <option value=""> </option>
+ {section name=key loop=$font_list}
+ <option value="{$font_list[key]}" {if $font == $font_list[key]} selected {/if} >{$font_list[key]}</option>
+ {/section}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td><b>Xsession</b><br>Choose what window manager you want to start default with X if run with xdm, startx, or xinit. (common options are Gnome or Xsession: <input type="text" name="xsession" value="{$xsession}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+<input type="submit" name="SaveConfigFiles" value="Save Values">
+</form>
+{include file="bottom.tpl"}
diff --git a/webgli/templates/header.tpl b/webgli/templates/header.tpl
index 4e16042..e12f79f 100644
--- a/webgli/templates/header.tpl
+++ b/webgli/templates/header.tpl
@@ -36,7 +36,7 @@
<li><a class="step" href="/webgli/portagetree.php">Portage Tree</a></li>
<li><a class="step" href="/webgli/globaluse.php">Global USE Flags</a></li>
<li><a class="step" href="/webgli/localuse.php">Local USE Flags</a></li>
-{if $advanced_mode}
+{if $advanced}
<li><a class="step" href="/webgli/makedotconf.php">Make.conf</a></li>
<li><a class="step" href="/webgli/configfiles.php">Config Files</a></li>
<li><a class="step" href="/webgli/etc_portage.php">etc/portage</a></li>
diff --git a/webgli/templates/index.tpl b/webgli/templates/index.tpl
index 8276f7f..6e334f4 100644
--- a/webgli/templates/index.tpl
+++ b/webgli/templates/index.tpl
@@ -1 +1 @@
-{include file="header.tpl" title="WebGLI - Main Page"}
+{include file="header.tpl" title="WebGLI - Main Page", advanced=$advanced}
diff --git a/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php b/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php
index 1637412..76d366c 100644
--- a/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php
+++ b/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php
@@ -1,7 +1,7 @@
-<?php /* Smarty version 2.6.10, created on 2006-04-13 22:13:15
+<?php /* Smarty version 2.6.10, created on 2006-04-15 15:54:44
compiled from index.tpl */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array('title' => "WebGLI - Main Page")));
+$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array('title' => "\"WebGLI - Main Page\",",'advanced' => $this->_tpl_vars['advanced'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?> \ No newline at end of file
diff --git a/webgli/templates_c/%%F7^F7F^F7F34188%%header.tpl.php b/webgli/templates_c/%%F7^F7F^F7F34188%%header.tpl.php
index 6ebc8ce..4c829d8 100644
--- a/webgli/templates_c/%%F7^F7F^F7F34188%%header.tpl.php
+++ b/webgli/templates_c/%%F7^F7F^F7F34188%%header.tpl.php
@@ -1,4 +1,4 @@
-<?php /* Smarty version 2.6.10, created on 2006-04-14 15:00:11
+<?php /* Smarty version 2.6.10, created on 2006-04-15 15:55:23
compiled from header.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', 'header.tpl', 3, false),)), $this); ?>
@@ -41,7 +41,7 @@ smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', '
<li><a class="step" href="/webgli/portagetree.php">Portage Tree</a></li>
<li><a class="step" href="/webgli/globaluse.php">Global USE Flags</a></li>
<li><a class="step" href="/webgli/localuse.php">Local USE Flags</a></li>
-<?php if ($this->_tpl_vars['advanced_mode']): ?>
+<?php if ($this->_tpl_vars['advanced']): ?>
<li><a class="step" href="/webgli/makedotconf.php">Make.conf</a></li>
<li><a class="step" href="/webgli/configfiles.php">Config Files</a></li>
<li><a class="step" href="/webgli/etc_portage.php">etc/portage</a></li>
diff --git a/webgli/webgliUtility.php b/webgli/webgliUtility.php
index a61a0dd..ea16f11 100644
--- a/webgli/webgliUtility.php
+++ b/webgli/webgliUtility.php
@@ -23,7 +23,7 @@ function generate_keymap_list()
foreach ($output as $keymap) {
# strip the last 9 chars ( .map.gz\n )
$keymap = trim($keymap);
- $keymap = substr($keymap,0,-9);
+ $keymap = substr($keymap,0,-7);
array_push($keymap_list, $keymap);
}
# sort the keymap list
@@ -41,8 +41,8 @@ function generate_consolefont_list()
exec("find ".$path." -iname *.gz -printf \"%f \n\"", $output);
foreach ($output as $consolefont) {
# strip the last 5 chars ( .gz\n )
- $consolefont = trim(consolefont);
- $consolefont = substr($consolefont,0,-5);
+ $consolefont = trim($consolefont);
+ $consolefont = substr($consolefont,0,-3);
# test if its psfu or psf or fnt
# and remove it if necessary