summaryrefslogtreecommitdiff
path: root/webgli
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2006-04-15 19:49:20 +0000
committerPreston Cody <codeman@gentoo.org>2006-04-15 19:49:20 +0000
commit794eedb880b0211239edbb4ffb773923941be322 (patch)
tree8d6f23a2a5ec67ceb2ef0bbfbf705d8246a1a32d /webgli
parentabout 1/2 done converting special types (diff)
downloadscire-794eedb880b0211239edbb4ffb773923941be322.tar.gz
scire-794eedb880b0211239edbb4ffb773923941be322.tar.bz2
scire-794eedb880b0211239edbb4ffb773923941be322.zip
adding two functions for configfiles page
svn path=/; revision=14
Diffstat (limited to 'webgli')
-rw-r--r--webgli/webgliUtility.php69
1 files changed, 69 insertions, 0 deletions
diff --git a/webgli/webgliUtility.php b/webgli/webgliUtility.php
index 55c6d43..cb35b52 100644
--- a/webgli/webgliUtility.php
+++ b/webgli/webgliUtility.php
@@ -13,4 +13,73 @@ function list_modules()
return $modules;
}
+function generate_keymap_list()
+{
+ $keymap_list = array();
+ $path = "/usr/share/keymaps";
+
+ # find /usr/share/keymaps -iname *.map.gz -printf "%f \n"
+ exec("find ".$path." -iname *.map.gz -printf \"%f \n\"",$output);
+ foreach ($output as $keymap) {
+ # strip the last 9 chars ( .map.gz\n )
+ $keymap = trim($keymap);
+ $keymap = substr($keymap,0,-9);
+ array_push($keymap_list, $keymap);
+ }
+ # sort the keymap list
+ sort($keymap_list);
+
+ return $keymap_list;
+}
+
+function generate_consolefont_list()
+{
+ $consolefont_list = array();
+ $path = "/usr/share/consolefonts";
+
+ # find /usr/share/consolefonts -iname *.gz -printf "%f \n"
+ 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);
+
+ # test if its psfu or psf or fnt
+ # and remove it if necessary
+ if (substr($consolefont,-4) == "psfu") {
+ $consolefont = substr($consolefont,0,-5);
+ }
+ if (substr($consolefont,-3) == "psf") {
+ $consolefont = substr($consolefont,0,-4);
+ }
+ if (substr($consolefont,-3) =="fnt") {
+ $consolefont = substr($consolefont,0,-4);
+ }
+ array_push($consolefont_list, $consolefont);
+ }
+ # sort the keymap list
+ sort($consolefont_list);
+
+ return $consolefont_list;
+}
+/* We gave up on this feature I think
+function generate_consoletranslation_list()
+{
+ $consoletranslation_list = array();
+ $path = "/usr/share/consoletrans";
+
+ # find /usr/share/keymaps -iname *.trans -printf "%f \n"
+ exec("find ".$path." -iname *.trans -printf \"%f \n\"", $output);
+ foreach ($output as $consoletran) {
+ # strip the last 8 chars ( .trans\n )
+ $consoletran = trim($consoletran);
+ $consoletran = substr($consoletran,0,-8);
+ array_push($consoletranslation_list, $consoletran);
+ }
+ sort($consoletranslation_list);
+
+ return $consoletranslation_list;
+}
+*/
+
?>