$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;
function ds_controlPane()
{
- echo "<table>";
- echo "<tr><td>DataStore Name</td><td>DataStore Path</td><td>Size</td><td>Usage</td><td>Control</td></tr>";
+ global $GLOBAL_BASE_URL;
+ echo "<h3>DataStores</h3>";
+ $dss = ds_listDS();
- echo "</table>";
- echo "<form method=\"post\" action=\"".urlCreate("/ds/createds")."\">";
- echo "DataStore Name: <input type=\"text\" name=\"dsname\">";
- echo "DataStore Location: <input type=\"text\" name=\"dsloc\">";
+ if($dss != false) {
+ echo "<table border=1>";
+ echo "<tr><td>DataStore Name</td><td>DataStore Path</td><td>Size</td><td>Usage</td><td>Control</td></tr>";
+ foreach($dss as $dsl) {
+ $dsname = $dsl["dsname"];
+ $dspath = $dsl["dslocation"];
+ echo "<tr><td>$dsname</td><td>$dspath</td></tr>";
+ }
+ echo "</table>";
+ }
+ echo "<h3>Create DataStore</h3>";
+ echo "<form method=\"post\" action=\"".urlCreate("/dsp/createds")."\">";
+ echo "DataStore Name: <input type=\"text\" name=\"dsname\"><br>";
+ echo "DataStore Location: <input type=\"text\" name=\"dsloc\"><br>";
echo "<input type=\"submit\" name=\"create\" value=\"create\">";
echo "</form>";
function ds_leftMenu()
{
global $GLOBAL_BASE_URL;
- echo "<b>Browse</b><br>";
+ echo "<h3>Browse</h3>";
$dss = ds_listDS();
//echo "<pre>";
//print_r($dss);
www_header();
}
- echo "<table><tr><td>";
+ echo "<table><tr><td colspan=\"2\">";
// top
if(isset($calls["top_function"])) {
www_contentpane();
}
- echo "</td></tr><tr><td>";
+ echo "</td></tr><tr colspan=\"2\"><td>";
// footer
if(isset($calls["footer_function"])) {
function www_header()
{
- echo "<html><head></head><body>";
+ echo "<html><head>";
+ echo "<link rel=\"stylesheet\" href=\"".urlCreate("/css/content.css")."\" type=\"text/css\" media=\"screen, projection\" /> ";
+ echo "</head><body>";
}
function www_top()
echo "</tr></table>";
if(function_exists("msg_haveMessages")) if(msg_haveMessages()) {
- echo "<table bgcolor=\"#ddddff\">";
+ echo "<table bgcolor=\"#eeeeff\">";
$msgs = msg_getMessages();
foreach($msgs as $msg) {