From: paulr Date: Sun, 24 Jul 2011 16:17:34 +0000 (+1000) Subject: Lots of little changes, basic structure now looking pretty good X-Git-Url: http://git.pjr.cc/?p=glcas.git;a=commitdiff_plain;h=f99212f7d29b648f3698cf31cbcda6bc04cda182 Lots of little changes, basic structure now looking pretty good --- diff --git a/libglcas/web.php b/libglcas/web.php index 6c3723b..a8d013a 100644 --- a/libglcas/web.php +++ b/libglcas/web.php @@ -29,21 +29,72 @@ class GLCASWeb { } +function GLCASMenuBuilder() +{ + global $BASE_URL; + ?> +Home +">Admin + Messages not implemented yet"; +} + function GLCASpageBuilder($bodyClass, $bodyFunction, $title="GLCAS") { - global $WEB_ROOT_FS; + global $WEB_ROOT_FS, $BASE_URL; // TODO: load css - // TODO: load js // header - echo "$title"; + echo "$title"; + + // load css + if(file_exists("$WEB_ROOT_FS/css")) { + $dh = opendir("$WEB_ROOT_FS/css"); + if($dh) { + while(($file = readdir($dh))!==false) { + $mt = preg_match("/.*.css$/", $file); + if($mt > 0) { + error_log("loading css $file"); + echo ""; + //echo "required $basedir/$file\n"; + } + } + } + } + + // load js + if(file_exists("$WEB_ROOT_FS/js")) { + $dh = opendir("$WEB_ROOT_FS/js"); + if($dh) { + while(($file = readdir($dh))!==false) { + $mt = preg_match("/.*.js$/", $file); + if($mt > 0) { + error_log("loading js $file"); + echo ""; + //echo "required $basedir/$file\n"; + } + } + } + } + + + // start body + echo ""; // page top echo "

GLCAS


"; - echo "
messages go here
"; + echo "
"; + GLCASMessageBuilder(); + echo "
"; // menu, then body - echo "
Menu goes here
"; + echo "
"; + GLCASMenuBuilder(); + echo "
"; // body $url = "/"; if(isset($_REQUEST["q"])) { diff --git a/plugins/admin.php b/plugins/admin.php index 4e24665..8b6c2a9 100644 --- a/plugins/admin.php +++ b/plugins/admin.php @@ -15,9 +15,82 @@ class GLCASAdmin { function go($url) { - echo "admin page"; + error_log("repo:go called"); + + if(isset($_REQUEST["action"])) { + switch($_REQUEST["action"]) { + case "addrepo": + GLCASpageBuilder($this,"doAddRepo"); + return; + break; + case "scanrepo": + break; + } + } + GLCASpageBuilder($this, "body"); + } + + function body($url) + { + // for the main admin body, we hae the following components + + // 1. list of currently available repos and stuff + + // 2. way to add a repo direct + + // 3. way to scan for a repo given a url + + // so first, lets do the main body + $this->mainBody($url); + } + + function doAddRepo($url) + { + $myRep = new GLCASRepo($this->config); + + $glt = $myRep->getRepoDetailsYum($_REQUEST["repourl"]); + + echo "
$glt
"; } + function mainBody($url) + { + // first, list available repos + echo "

Repositories


"; + echo ""; + echo "
NameTypeVersionBrowseControl


"; + + // wrap all this in a table + echo "
"; + // now, add a repo + echo "

Add A Repo

"; + echo "
"; + echo "Type
"; + echo "URL
"; + echo "
"; + echo "

"; + + echo "
"; + + // now scan for a repo + echo "

Scan For Repos

"; + echo "
"; + echo "Hint
"; + echo "URL
"; + echo "
"; + echo "
"; + + echo "
"; + } + private $config; } diff --git a/plugins/repo.php b/plugins/repo.php index 804a5ce..c85ff12 100644 --- a/plugins/repo.php +++ b/plugins/repo.php @@ -9,7 +9,26 @@ class GLCASRepo { function go($url) { - echo "i am the repo man, i repo the repo"; + error_log("repo:go called"); + GLCASpageBuilder($this, "body"); + } + + function body($url) + { + echo "for the repo, i am the repo $url"; + } + + function getRepoDetailsYum($url) + { + $actionurl = $url."/repodata/repomd.xml"; + + error_log("Getting for action of $actionurl"); + + $ld = file_get_contents($actionurl); + + if(!$ld) return false; + + return $ld; } private $config; diff --git a/plugins/webbase.php b/plugins/webbase.php index 13dbcc3..6fa5943 100644 --- a/plugins/webbase.php +++ b/plugins/webbase.php @@ -19,7 +19,7 @@ class GLCASWebBase { function body($url) { - echo "i am disturbing"; + echo "i am disturbing, $url"; } private $config; diff --git a/www/css/normal.css b/www/css/normal.css new file mode 100644 index 0000000..460827d --- /dev/null +++ b/www/css/normal.css @@ -0,0 +1,129 @@ +head { + color: #333333; +} +body { + color: #333333; +} +table { border-width: 0px; + empty-cells: hide; +} +table.formsection, table.sortable, table.ui_table, table.loginform { + border-collapse: collapse; + border: 1px solid #FFFFFF; + width: 100%; +} +img, a img { border:0; } +tr.row0 {background-color:#e8e8ea;} +tr.row1 {background-color:#f8f8fa;} +table.formsection thead, table.sortable thead, table.ui_table thead, table.loginform thead { +background-color:#427ad1; +border:0px; +color:#ffffff; +border: 2px solid #b3b6b0; +} +table.formsection tbody, table.sortable tbody, table.ui_table tbody, table.loginform tbody { +background-color:#EFEFEF; +} +tr.maintitle { + color: #ffffff; + background-color: #427ad1; +} +td.maintitle { + color: #ffffff; + background-color: #427ad1; +} +tr.maintitle a, tr.maintitle a:visited { + color: #ffffff; +} +td.maintitle a, td.maintitle a:visited { + color: #ffffff; +} +tr.maintitle a:hover { + color: #EFEFEF; +} +td.maintitle a:hover { + color: #EFEFEF; +} +a:link { color: #333399; + text-decoration: none; +} +a:hover, a:visited:hover { color: #6666EE; + text-decoration: none; +} +a:visited { color: #333399; + text-decoration: none; +} +body, p, td, br, center { font-size: 10pt; + font-family: sans-serif; +} +title { color: #333333; + font-family: sans-serif; +} +h1 { color: #333333; + font-size: 150%; + font-family: sans-serif; +} +h2 { color: #333333; + font-size: 130%; + font-family: sans-serif; +} +h3 { color: #333333; + font-size: 125%; + font-family: sans-serif; +} +h4 { color: #333333; + font-size: 120%; + font-family: sans-serif; +} +th { font-size: small; } +pre { font-size: 8pt; } +#main { border-style: solid; + border:1px solid #FFFFFF; + margin:0; + padding:0; +} +tr.mainsel { background-color: #ddffbb; } +tr.mainhigh { background-color: #ffffbb; } +tr.mainhighsel { background-color: #bbffcc; } +.itemhidden { display: none; } +.itemshown { display:block; } +.barchart { padding: 1px; + border: 1px solid #b3b6b0; + position:relative; +} +.ui_post_header{ font-size: 120%; + text-align: center; + padding: 4px; +} +hr { border: 0; + width: 90%; + height: 1px; + color: #D9D9D9; + background-color: #D9D9D9; +} +table.wrapper { + background-color:#D9D9D9; + border:0; + padding:0; + margin:0; + border-collapse:collapse; +} +div.wrapper { + border:1px solid #D9D9D9; + background-color:#F5F5F5; + padding:0; + margin:0; +} +.shrinkwrapper { + background-color:#D9D9D9; + border:0; + padding:0; + margin:0; + border-collapse:collapse; +} +.tabSelected { + background-color:#D9D9D9; +} +.tabUnselected { + background-color:#dadaf8; +} \ No newline at end of file diff --git a/www/index.php b/www/index.php index 4657e52..e6e6f95 100644 --- a/www/index.php +++ b/www/index.php @@ -1,8 +1,9 @@ loadConfig($configpath); $webResponder = new GLCASWeb($glconfig); $webResponder->go($URL_HANDLERS); -/* + +/* echo "
";
+echo "BASEURL: $BASE_URL\n";
+echo "CUSTOM\n";
+print_r($_SERVER);
+
 $vars = get_defined_vars();
 foreach($vars as $var => $vkey) {
 	echo "VAR $var is:\n";
diff --git a/www/js/base.js b/www/js/base.js
new file mode 100644
index 0000000..58fd4b1
--- /dev/null
+++ b/www/js/base.js
@@ -0,0 +1 @@
+// none
\ No newline at end of file