From: paulr Date: Tue, 26 Apr 2011 14:22:47 +0000 (+1000) Subject: moved some stuff back to lib from plugins X-Git-Url: http://git.pjr.cc/?p=glcas.git;a=commitdiff_plain;h=d20e4cb32ea6dd6b3f21b0f9f3106d046d39d9c5 moved some stuff back to lib from plugins --- diff --git a/doc/globals.txt b/doc/globals.txt index e77fa2d..49b5a27 100644 --- a/doc/globals.txt +++ b/doc/globals.txt @@ -4,5 +4,9 @@ $BASE_URLS["ypc"]["function"] = "yp_contentUrlsCtl"; $MENU_ITEMS["yp"]["title"] = "YUM Proxy"; $MENU_ITEMS["yp"]["link"] = "/ypc/proxycontrol"; +$VERSION["item"]["major"] +$VERSION["item"]["minor"] +$VERSION["item"]["release"] + $GLOBAL_BASE_URL="/src/eclipse-workspace/glcas/www/"; $DB_URL="sqlite:$BASE_DIR/var/ds_store.db"; diff --git a/lib/plugins/datastore.php b/lib/datastore.php similarity index 68% rename from lib/plugins/datastore.php rename to lib/datastore.php index db51d36..a074cc3 100644 --- a/lib/plugins/datastore.php +++ b/lib/datastore.php @@ -3,10 +3,44 @@ global $BASE_URLS, $MENU_ITEMS, $GLOBAL_BASE_URL; $BASE_URLS["ds"]["base"] = "ds"; // ap for apt-proxy $BASE_URLS["ds"]["function"] = "ds_contentUrls"; // the page builder function for us + +// the datastore post url +$BASE_URLS["dsp"]["base"] = "dsp"; // ap for apt-proxy +$BASE_URLS["dsp"]["function"] = "ds_contentPostUrls"; // the page builder function for us + $MENU_ITEMS["ds"]["title"] = "DataStores"; $MENU_ITEMS["ds"]["link"] = "/ds/control"; +function ds_contentPostUrls() +{ + $calls["needs_base_page"] = false; + $calls["page_builder"] = "ds_postContent"; + + return $calls; +} + +function ds_postContent() +{ + global $URL_COMPONENTS; + $call = $URL_COMPONENTS[1]; + + switch($call) { + case "createds": + $dsname = $_REQUEST["dsname"]; + $dsloc = $_REQUEST["dsloc"]; + ds_createDS($dsname, $dsloc); + msg_addMessage("#008800", "DataStore, $dsname created at $dsloc"); + break; + } + + $loc = urlCreate("/ds/control"); + header("Location: $loc"); + + return 0; + +} + function ds_contentPane() { global $URL_COMPONENTS; @@ -30,13 +64,24 @@ function ds_contentPane() function ds_controlPane() { - echo ""; - echo ""; + global $GLOBAL_BASE_URL; + echo "

DataStores

"; + $dss = ds_listDS(); - echo "
DataStore NameDataStore PathSizeUsageControl
"; - echo "
"; - echo "DataStore Name: "; - echo "DataStore Location: "; + if($dss != false) { + echo ""; + echo ""; + foreach($dss as $dsl) { + $dsname = $dsl["dsname"]; + $dspath = $dsl["dslocation"]; + echo ""; + } + echo "
DataStore NameDataStore PathSizeUsageControl
$dsname$dspath
"; + } + echo "

Create DataStore

"; + echo ""; + echo "DataStore Name:
"; + echo "DataStore Location:
"; echo ""; echo "
"; @@ -45,7 +90,7 @@ function ds_controlPane() function ds_leftMenu() { global $GLOBAL_BASE_URL; - echo "Browse
"; + echo "

Browse

"; $dss = ds_listDS(); //echo "
";
 	//print_r($dss);
diff --git a/lib/plugins/db.php b/lib/db.php
similarity index 100%
rename from lib/plugins/db.php
rename to lib/db.php
diff --git a/lib/lib.php b/lib/lib.php
index e446b09..63462fe 100644
--- a/lib/lib.php
+++ b/lib/lib.php
@@ -2,7 +2,8 @@
 
 require_once("config.php");
 require_once("wsdl.php");
-
+require_once("www.php");
+require_once("db.php");
 
 // first and foremost, load the plugins
 $basedir = dirname(__FILE__);
diff --git a/lib/plugins/messages.php b/lib/messages.php
similarity index 100%
rename from lib/plugins/messages.php
rename to lib/messages.php
diff --git a/lib/plugins/www.php b/lib/www.php
similarity index 90%
rename from lib/plugins/www.php
rename to lib/www.php
index 3d5b9d1..f356ca0 100644
--- a/lib/plugins/www.php
+++ b/lib/www.php
@@ -41,7 +41,7 @@ function www_basePage($calls)
 		www_header();
 	}
 	
-	echo "
"; + echo "
"; // top if(isset($calls["top_function"])) { @@ -71,7 +71,7 @@ function www_basePage($calls) www_contentpane(); } - echo "
"; + echo "
"; // footer if(isset($calls["footer_function"])) { @@ -95,7 +95,9 @@ function www_basePage($calls) function www_header() { - echo ""; + echo ""; + echo " "; + echo ""; } function www_top() @@ -115,7 +117,7 @@ function www_top() echo "
"; if(function_exists("msg_haveMessages")) if(msg_haveMessages()) { - echo ""; + echo "
"; $msgs = msg_getMessages(); foreach($msgs as $msg) {