You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2008/12/12 19:20:18 UTC
svn commit: r726079 [32/32] - in /incubator/vcl/tags/import: ./
managementnode/ managementnode/bin/ managementnode/etc/
managementnode/etc/vcl/ managementnode/legacy_vcl_vbs_scripts/
managementnode/lib/ managementnode/lib/VCL/ managementnode/lib/VCL/Mo...
Added: incubator/vcl/tags/import/web/js/computers.js
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/js/computers.js?rev=726079&view=auto
==============================================================================
--- incubator/vcl/tags/import/web/js/computers.js (added)
+++ incubator/vcl/tags/import/web/js/computers.js Fri Dec 12 10:20:10 2008
@@ -0,0 +1,250 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+var allcomps = '';
+var allgroups = '';
+var allcompgroups = '';
+
+function addRemItem(cont, objid1, objid2, cb) {
+ document.body.style.cursor = 'wait';
+ var obj = document.getElementById(objid1);
+ var id = obj.options[obj.selectedIndex].value;
+
+ obj = document.getElementById(objid2);
+ var listids = "";
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected) {
+ listids = listids + ',' + obj.options[i].value;
+ obj.remove(i);
+ }
+ }
+ if(listids == "")
+ return;
+ dojo.xhrPost({
+ url: 'index.php',
+ load: cb,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ listids: listids,
+ id: id},
+ timeout: 15000
+ });
+}
+
+function addRemGroup2(data, ioArgs) {
+ /*
+ for each compid sent back we
+ search through allcomps until we find it keeping track of the previous item with inout == 1
+ we set allcomps[compid].inout to 1
+ we find the previous item in the select.options array
+ we insert a new option right after that one
+ */
+ var comps = data.items.comps;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ if(addrem)
+ var obj = document.getElementById('incomps');
+ else
+ var obj = document.getElementById('outcomps');
+ for(var i = 0; i < comps.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allcomps.length; j++) {
+ if(allcomps[j].id == comps[i]) {
+ if(addrem == 1)
+ allcomps[j].inout = 1;
+ else
+ allcomps[j].inout = 0;
+ if(lastid < 0) {
+ var before = obj.options[0];
+ var newoption = new Option(allcomps[j].name, allcomps[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ var before = obj.options[k + 1];
+ var newoption = new Option(allcomps[j].name, allcomps[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allcomps[j].inout == addrem)
+ lastid = allcomps[j].id;
+ }
+ }
+ document.body.style.cursor = 'default';
+}
+
+function addRemComp2(data, ioArgs) {
+ var groups = data.items.groups;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ if(addrem)
+ var obj = document.getElementById('ingroups');
+ else
+ var obj = document.getElementById('outgroups');
+ for(var i = 0; i < groups.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allgroups.length; j++) {
+ if(allgroups[j].id == groups[i]) {
+ if(addrem == 1)
+ allgroups[j].inout = 1;
+ else
+ allgroups[j].inout = 0;
+ if(lastid < 0) {
+ var before = obj.options[0];
+ var newoption = new Option(allgroups[j].name, allgroups[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ var before = obj.options[k + 1];
+ var newoption = new Option(allgroups[j].name, allgroups[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allgroups[j].inout == addrem) {
+ lastid = allgroups[j].id;
+ }
+ }
+ }
+ document.body.style.cursor = 'default';
+}
+
+function errorHandler(data, ioArgs) {
+ alert('Error encountered while processing AJAX callback');
+}
+
+function getCompsButton() {
+ document.body.style.cursor = 'wait';
+ var selobj1 = document.getElementById('incomps');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('outcomps');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var obj = document.getElementById('compGroups');
+ var groupid = obj.options[obj.selectedIndex].value;
+ var groupname = obj.options[obj.selectedIndex].text;
+
+ obj = document.getElementById('ingroupname').innerHTML = groupname;
+ obj = document.getElementById('outgroupname').innerHTML = groupname;
+
+ obj = document.getElementById('compcont');
+
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: compsCallback,
+ error: errorHandler,
+ content: {continuation: obj.value,
+ groupid: groupid},
+ timeout: 15000
+ });
+}
+
+function compsCallback(data, ioArgs) {
+ var inobj = document.getElementById('incomps');
+ for(var i = 0; i < data.items.incomps.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.incomps[i].name, data.items.incomps[i].id);
+ }
+ var outobj = document.getElementById('outcomps');
+ for(var i = 0; i < data.items.outcomps.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.outcomps[i].name, data.items.outcomps[i].id);
+ }
+ allcomps = data.items.all;
+ document.body.style.cursor = 'default';
+}
+
+function getGroupsButton() {
+ document.body.style.cursor = 'wait';
+ var selobj1 = document.getElementById('ingroups');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('outgroups');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var obj = document.getElementById('comps');
+ var compid = obj.options[obj.selectedIndex].value;
+ var compname = obj.options[obj.selectedIndex].text;
+
+ obj = document.getElementById('incompname').innerHTML = compname;
+ obj = document.getElementById('outcompname').innerHTML = compname;
+
+ obj = document.getElementById('grpcont');
+
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: groupsCallback,
+ error: errorHandler,
+ content: {continuation: obj.value,
+ compid: compid},
+ timeout: 15000
+ });
+}
+
+function groupsCallback(data, ioArgs) {
+ var inobj = document.getElementById('ingroups');
+ for(var i = 0; i < data.items.ingroups.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.ingroups[i].name, data.items.ingroups[i].id);
+ }
+ var outobj = document.getElementById('outgroups');
+ for(var i = 0; i < data.items.outgroups.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.outgroups[i].name, data.items.outgroups[i].id);
+ }
+ allgroups = data.items.all;
+ document.body.style.cursor = 'default';
+}
Added: incubator/vcl/tags/import/web/js/groups.js
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/js/groups.js?rev=726079&view=auto
==============================================================================
--- incubator/vcl/tags/import/web/js/groups.js (added)
+++ incubator/vcl/tags/import/web/js/groups.js Fri Dec 12 10:20:10 2008
@@ -0,0 +1,87 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+var xhrobj;
+var blockHide = 0;
+
+function getGroupInfo(cont, groupid) {
+ xhrobj = dojo.xhrPost({
+ url: 'index.php',
+ load: showGroupInfo,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ groupid: groupid,
+ mousex: mouseX,
+ mousey: mouseY},
+ timeout: 15000
+ });
+}
+
+function mouseoverHelp() {
+ var data = [];
+ data['items'] = [];
+ data['items']['members'] = [];
+ data['items']['members'][0] = 'mouse over icon to<br>display a group’s<br>resources';
+ data['items']['x'] = mouseX;
+ data['items']['y'] = mouseY;
+ showGroupInfo(data);
+}
+
+function showGroupInfo(data, ioArgs) {
+ var members = data.items.members;
+ var mx = data.items.x;
+ var my = data.items.y;
+ var text = "";
+ for(var i = 0; i < members.length; i++) {
+ text = text + members[i] + '<br>';
+ }
+ var obj = document.getElementById('content');
+ var x = findPosX(obj);
+ var y = findPosY(obj);
+ obj = document.getElementById('listitems');
+ obj.innerHTML = text;
+ //if(browser == 'IE') {
+ var a = mx - obj.clientWidth - 2;
+ var b = my - (obj.clientHeight / 2);
+ /*}
+ else {
+ var a = mx - x - obj.clientWidth;
+ var b = my - y - obj.clientHeight;
+ }*/
+ obj.style.left = a + "px";
+ obj.style.top = b + "px";
+ obj.style.zIndex = 10;
+}
+
+function clearGroupPopups() {
+ setTimeout(function() {clearGroupPopups2(1);}, 50);
+}
+
+function clearGroupPopups2(fromicon) {
+ if(xhrobj)
+ xhrobj.ioArgs.xhr.abort();
+ if(fromicon && blockHide)
+ return;
+ blockHide = 0;
+ var obj = document.getElementById('listitems');
+ obj.innerHTML = '';
+ obj.style.zIndex = -10;
+}
+
+function blockClear() {
+ blockHide = 1;
+}
Added: incubator/vcl/tags/import/web/js/images.js
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/js/images.js?rev=726079&view=auto
==============================================================================
--- incubator/vcl/tags/import/web/js/images.js (added)
+++ incubator/vcl/tags/import/web/js/images.js Fri Dec 12 10:20:10 2008
@@ -0,0 +1,514 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+var allimages = '';
+var allgroups = '';
+var allcompgroups = '';
+var allimggroups = '';
+
+function addRemItem(cont, objid1, objid2, cb) {
+ document.body.style.cursor = 'wait';
+ var obj = document.getElementById(objid1);
+ var id = obj.options[obj.selectedIndex].value;
+
+ obj = document.getElementById(objid2);
+ var listids = "";
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected) {
+ listids = listids + ',' + obj.options[i].value;
+ obj.remove(i);
+ }
+ }
+ if(listids == "")
+ return;
+ dojo.xhrPost({
+ url: 'index.php',
+ load: cb,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ listids: listids,
+ id: id},
+ timeout: 15000
+ });
+}
+
+function addRemGroup2(data, ioArgs) {
+ /*
+ for each imageid sent back we
+ search through allimages until we find it keeping track of the previous item with inout == 1
+ we set allimages[imageid].inout to 1
+ we find the previous item in the select.options array
+ we insert a new option right after that one
+ */
+ var images = data.items.images;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ if(addrem)
+ var obj = document.getElementById('inimages');
+ else
+ var obj = document.getElementById('outimages');
+ for(var i = 0; i < images.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allimages.length; j++) {
+ if(allimages[j].id == images[i]) {
+ if(addrem == 1)
+ allimages[j].inout = 1;
+ else
+ allimages[j].inout = 0;
+ if(lastid < 0) {
+ var before = obj.options[0];
+ var newoption = new Option(allimages[j].name, allimages[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ var before = obj.options[k + 1];
+ var newoption = new Option(allimages[j].name, allimages[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allimages[j].inout == addrem)
+ lastid = allimages[j].id;
+ }
+ }
+ document.body.style.cursor = 'default';
+}
+
+function addRemImage2(data, ioArgs) {
+ var groups = data.items.groups;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ if(addrem)
+ var obj = document.getElementById('ingroups');
+ else
+ var obj = document.getElementById('outgroups');
+ for(var i = 0; i < groups.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allgroups.length; j++) {
+ if(allgroups[j].id == groups[i]) {
+ if(addrem == 1)
+ allgroups[j].inout = 1;
+ else
+ allgroups[j].inout = 0;
+ if(lastid < 0) {
+ var before = obj.options[0];
+ var newoption = new Option(allgroups[j].name, allgroups[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ var before = obj.options[k + 1];
+ var newoption = new Option(allgroups[j].name, allgroups[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allgroups[j].inout == addrem) {
+ lastid = allgroups[j].id;
+ }
+ }
+ }
+ document.body.style.cursor = 'default';
+}
+
+function addRemCompGrpImgGrp(data, ioArgs) {
+ var groups = data.items.groups;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ if(addrem)
+ var obj = document.getElementById('incompgroups');
+ else
+ var obj = document.getElementById('outcompgroups');
+ for(var i = 0; i < groups.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allcompgroups.length; j++) {
+ if(allcompgroups[j].id == groups[i]) {
+ if(addrem == 1)
+ allcompgroups[j].inout = 1;
+ else
+ allcompgroups[j].inout = 0;
+ if(lastid < 0) {
+ var before = obj.options[0];
+ var newoption = new Option(allcompgroups[j].name, allcompgroups[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ var before = obj.options[k + 1];
+ var newoption = new Option(allcompgroups[j].name, allcompgroups[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allcompgroups[j].inout == addrem) {
+ lastid = allcompgroups[j].id;
+ }
+ }
+ }
+ document.body.style.cursor = 'default';
+}
+
+function addRemImgGrpCompGrp(data, ioArgs) {
+ var groups = data.items.groups;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ if(addrem)
+ var obj = document.getElementById('inimggroups');
+ else
+ var obj = document.getElementById('outimggroups');
+ for(var i = 0; i < groups.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allimggroups.length; j++) {
+ if(allimggroups[j].id == groups[i]) {
+ if(addrem == 1)
+ allimggroups[j].inout = 1;
+ else
+ allimggroups[j].inout = 0;
+ if(lastid < 0) {
+ var before = obj.options[0];
+ var newoption = new Option(allimggroups[j].name, allimggroups[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ var before = obj.options[k + 1];
+ var newoption = new Option(allimggroups[j].name, allimggroups[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allimggroups[j].inout == addrem) {
+ lastid = allimggroups[j].id;
+ }
+ }
+ }
+ document.body.style.cursor = 'default';
+}
+
+function errorHandler(data, ioArgs) {
+ alert('Error encountered while processing AJAX callback');
+}
+
+function getImagesButton() {
+ document.body.style.cursor = 'wait';
+ var selobj1 = document.getElementById('inimages');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('outimages');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var obj = document.getElementById('imgGroups');
+ var groupid = obj.options[obj.selectedIndex].value;
+ var groupname = obj.options[obj.selectedIndex].text;
+
+ obj = document.getElementById('ingroupname').innerHTML = groupname;
+ obj = document.getElementById('outgroupname').innerHTML = groupname;
+
+ obj = document.getElementById('imgcont');
+
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: imagesCallback,
+ error: errorHandler,
+ content: {continuation: obj.value,
+ groupid: groupid},
+ timeout: 15000
+ });
+}
+
+function imagesCallback(data, ioArgs) {
+ var inobj = document.getElementById('inimages');
+ for(var i = 0; i < data.items.inimages.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.inimages[i].name, data.items.inimages[i].id);
+ }
+ var outobj = document.getElementById('outimages');
+ for(var i = 0; i < data.items.outimages.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.outimages[i].name, data.items.outimages[i].id);
+ }
+ allimages = data.items.all;
+ document.body.style.cursor = 'default';
+}
+
+function getGroupsButton() {
+ document.body.style.cursor = 'wait';
+ var selobj1 = document.getElementById('ingroups');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('outgroups');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var obj = document.getElementById('images');
+ var imageid = obj.options[obj.selectedIndex].value;
+ var imagename = obj.options[obj.selectedIndex].text;
+
+ obj = document.getElementById('inimagename').innerHTML = imagename;
+ obj = document.getElementById('outimagename').innerHTML = imagename;
+
+ obj = document.getElementById('grpcont');
+
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: groupsCallback,
+ error: errorHandler,
+ content: {continuation: obj.value,
+ imageid: imageid},
+ timeout: 15000
+ });
+}
+
+function groupsCallback(data, ioArgs) {
+ var inobj = document.getElementById('ingroups');
+ for(var i = 0; i < data.items.ingroups.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.ingroups[i].name, data.items.ingroups[i].id);
+ }
+ var outobj = document.getElementById('outgroups');
+ for(var i = 0; i < data.items.outgroups.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.outgroups[i].name, data.items.outgroups[i].id);
+ }
+ allgroups = data.items.all;
+ document.body.style.cursor = 'default';
+}
+
+function getMapCompGroupsButton() {
+ document.body.style.cursor = 'wait';
+ var selobj1 = document.getElementById('incompgroups');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('outcompgroups');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var obj = document.getElementById('imagegrps');
+ var imagegrpid = obj.options[obj.selectedIndex].value;
+ var imagegrpname = obj.options[obj.selectedIndex].text;
+
+ obj = document.getElementById('inimagegrpname').innerHTML = imagegrpname;
+ obj = document.getElementById('outimagegrpname').innerHTML = imagegrpname;
+
+ obj = document.getElementById('compcont');
+
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: mapCompGroupsCB,
+ error: errorHandler,
+ content: {continuation: obj.value,
+ imagegrpid: imagegrpid},
+ timeout: 15000
+ });
+}
+
+function mapCompGroupsCB(data, ioArgs) {
+ var inobj = document.getElementById('incompgroups');
+ for(var i = 0; i < data.items.ingroups.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.ingroups[i].name, data.items.ingroups[i].id);
+ }
+ var outobj = document.getElementById('outcompgroups');
+ for(var i = 0; i < data.items.outgroups.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.outgroups[i].name, data.items.outgroups[i].id);
+ }
+ allcompgroups = data.items.all;
+ document.body.style.cursor = 'default';
+}
+
+function getMapImgGroupsButton() {
+ document.body.style.cursor = 'wait';
+ var selobj1 = document.getElementById('inimggroups');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('outimggroups');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var obj = document.getElementById('compgroups');
+ var compgrpid = obj.options[obj.selectedIndex].value;
+ var compgrpname = obj.options[obj.selectedIndex].text;
+
+ obj = document.getElementById('incompgroupname').innerHTML = compgrpname;
+ obj = document.getElementById('outcompgroupname').innerHTML = compgrpname;
+
+ obj = document.getElementById('imgcont');
+
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: mapImgGroupsCB,
+ error: errorHandler,
+ content: {continuation: obj.value,
+ compgrpid: compgrpid},
+ timeout: 15000
+ });
+}
+
+function mapImgGroupsCB(data, ioArgs) {
+ var inobj = document.getElementById('inimggroups');
+ for(var i = 0; i < data.items.ingroups.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.ingroups[i].name, data.items.ingroups[i].id);
+ }
+ var outobj = document.getElementById('outimggroups');
+ for(var i = 0; i < data.items.outgroups.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.outgroups[i].name, data.items.outgroups[i].id);
+ }
+ allimggroups = data.items.all;
+ document.body.style.cursor = 'default';
+}
+
+function generalCB(data, ioArgs) {
+ document.body.style.cursor = 'default';
+}
+
+function updateRevisionProduction(cont) {
+ document.body.style.cursor = 'wait';
+ dojo.xhrPost({
+ url: 'index.php',
+ load: generalCB,
+ error: errorHandler,
+ content: {continuation: cont},
+ timeout: 15000
+ });
+}
+
+function updateRevisionComments(id, cont) {
+ document.body.style.cursor = 'wait';
+ var comments = dijit.byId(id).value;
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: updateRevisionCommentsCB,
+ error: errorHandler,
+ content: {continuation: cont,
+ comments: comments},
+ timeout: 15000
+ });
+}
+
+function updateRevisionCommentsCB(data, ioArgs) {
+ var obj = dijit.byId('comments' + data.items.id);
+ obj.setValue(data.items.comments);
+ document.body.style.cursor = 'default';
+}
+
+function deleteRevisions(cont, idlist) {
+ var ids = idlist.split(',');
+ var checkedids = new Array();
+ for(var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ var obj = document.getElementById('chkrev' + id);
+ var obj2 = document.getElementById('radrev' + id);
+ if(obj.checked) {
+ if(obj2.checked) {
+ alert('You cannot delete the production revision.');
+ return;
+ }
+ checkedids.push(id);
+ }
+ }
+ if(checkedids.length == 0)
+ return;
+ checkedids = checkedids.join(',');
+ dojo.xhrPost({
+ url: 'index.php',
+ handleAs: "json-comment-filtered",
+ load: deleteRevisionsCB,
+ error: errorHandler,
+ content: {continuation: cont,
+ checkedids: checkedids},
+ timeout: 15000
+ });
+}
+
+function deleteRevisionsCB(data, ioArgs) {
+ var obj = document.getElementById('revisiondiv');
+ obj.innerHTML = data.items.html;
+}
Added: incubator/vcl/tags/import/web/js/vm.js
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/js/vm.js?rev=726079&view=auto
==============================================================================
--- incubator/vcl/tags/import/web/js/vm.js (added)
+++ incubator/vcl/tags/import/web/js/vm.js Fri Dec 12 10:20:10 2008
@@ -0,0 +1,720 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+var currvms = '';
+var curprofileid = '';
+var fromok = 0;
+var allvms = '';
+var curprofile = '';
+
+function getVMHostData(cont) {
+ var hostid = document.getElementById('vmhostid').value;
+ document.body.style.cursor = 'wait';
+ dijit.byId('messages').hide();
+ document.getElementById('vmhostdata').className = 'hidden';
+ document.getElementById('movevms').className = 'hidden';
+ document.getElementById('vmstate').innerHTML = '';
+
+ var selobj1 = document.getElementById('currvms');
+ for(var i = selobj1.options.length - 1; i >= 0; i--) {
+ selobj1.remove(i);
+ }
+ var selobj2 = document.getElementById('freevms');
+ for(i = selobj2.options.length - 1; i >= 0; i--) {
+ selobj2.remove(i);
+ }
+ var selobj3 = document.getElementById('movevmssel');
+ for(i = selobj3.options.length - 1; i >= 0; i--) {
+ selobj3.remove(i);
+ }
+
+ dojo.xhrPost({
+ url: 'index.php',
+ load: VMHostDataCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ vmhostid: hostid},
+ timeout: 15000
+ });
+}
+
+function VMHostDataCB(data, ioArgs) {
+ if(data.items.failed) {
+ alert('You do not have access to manage this host.');
+ document.body.style.cursor = 'default';
+ return;
+ }
+ document.getElementById('vmlimit').value = data.items.vmlimit;
+ document.getElementById('vmhostdata').className = 'shown';
+
+ curprofileid = data.items.profileid;
+
+ // leave this block for allowing changing of profiles later
+ /*var selobj = document.getElementById('vmprofileid');
+ for(var i = 0; i < selobj.options.length; i++) {
+ if(selobj.options[i].value == data.items.profile.id) {
+ selobj.selectedIndex = i;
+ break;
+ }
+ }*/
+ var profile = data.items.profile;
+ var obj = dijit.byId('vmprofile');
+ obj.setTitle(profile.name);
+ var ct = '<table>';
+ ct += '<tr><th align=right>VM type:</th><td>' + profile.type + '</td></tr>';
+ ct += '<tr><th align=right>Image:</th><td>' + profile.image + '</td></tr>';
+ ct += '<tr><th align=right>NAS Share:</th><td>' + profile.nasshare + '</td></tr>';
+ ct += '<tr><th align=right>Datastore Path:</th><td>' + profile.datastorepath + '</td></tr>';
+ ct += '<tr><th align=right>VM Path:</th><td>' + profile.vmpath + '</td>';
+ ct += '<tr><th align=right>Virtual Switch 0:</th><td>' + profile.virtualswitch0 + '</td></tr>';
+ ct += '<tr><th align=right>Virtual Switch 1:</th><td>' + profile.virtualswitch1 + '</td></tr>';
+ ct += '<tr><th align=right>VM Disk:</th><td>' + profile.vmdisk + '</td></tr>';
+ ct += '</table>';
+ obj.setContent(ct);
+ if(obj.open)
+ obj.toggle();
+
+ allvms = data.items.allvms;
+ currvms = data.items.currvms;
+
+ var inobj = document.getElementById('currvms');
+ for(var i = 0; i < data.items.currvms.length; i++) {
+ inobj.options[inobj.options.length] = new Option(data.items.currvms[i].name, data.items.currvms[i].id);
+ }
+ var outobj = document.getElementById('freevms');
+ for(var i = 0; i < data.items.freevms.length; i++) {
+ outobj.options[outobj.options.length] = new Option(data.items.freevms[i].name, data.items.freevms[i].id);
+ }
+
+ if(data.items.movevms.length) {
+ document.getElementById('movevms').className = 'shown';
+ obj = document.getElementById('movevmssel');
+ var movevms = data.items.movevms;
+ for(var i = 0; i < movevms.length; i++) {
+ var label = movevms[i]['hostname'] + ' (' + movevms[i]['time'] + ')';
+ obj.options[obj.options.length] = new Option(label, data.items.movevms[i].id);
+ }
+ }
+
+ //document.getElementById('changevmcont').value = data.items.continuation;
+
+ document.body.style.cursor = 'default';
+}
+
+function updateVMlimit(cont) {
+ var hostid = document.getElementById('vmhostid').value;
+ var newlimit = document.getElementById('vmlimit').value;
+ document.body.style.cursor = 'wait';
+
+ dojo.xhrPost({
+ url: 'index.php',
+ load: updateVMlimitCB,
+ error: errorHandler,
+ content: {continuation: cont,
+ vmhostid: hostid,
+ newlimit: newlimit},
+ timeout: 15000
+ });
+}
+
+function updateVMlimitCB(data, ioArgs) {
+ if(data != 'SUCCESS') {
+ alert(data);
+ }
+ document.body.style.cursor = 'default';
+}
+
+function showVMstate() {
+ var selobj = document.getElementById('currvms');
+ var cnt = 0;
+ var state = '';
+ for(var i = 0; i < selobj.options.length; i++) {
+ if(selobj.options[i].selected) {
+ cnt++;
+ state = currvms[i].state;
+ }
+ }
+ if(cnt == 1)
+ document.getElementById('vmstate').innerHTML = state;
+ else
+ document.getElementById('vmstate').innerHTML = '';
+}
+
+function changeVMprofile() {
+ var hostid = document.getElementById('vmhostid').value;
+ var selobj = document.getElementById('vmprofileid');
+ var newid = selobj.options[selobj.selectedIndex].value;
+ dijit.byId('profileDlg').show();
+}
+
+function cancelVMprofileChange() {
+ if(fromok) {
+ fromok = 0;
+ }
+ else {
+ var selobj = document.getElementById('vmprofileid');
+ for(var i = 0; i < selobj.options.length; i++) {
+ if(selobj.options[i].value == curprofileid) {
+ selobj.selectedIndex = i;
+ break;
+ }
+ }
+ }
+}
+
+function submitChangeProfile() {
+ fromok = 1;
+ var hostid = document.getElementById('vmhostid').value;
+ var cont = document.getElementById('changevmcont').value;
+ var selobj = document.getElementById('vmprofileid');
+ var oldid = curprofileid;
+ var newid = selobj.options[selobj.selectedIndex].value;
+ dijit.byId('profileDlg').hide();
+ dojo.xhrPost({
+ url: 'index.php',
+ load: submitChangeProfileCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ vmhostid: hostid,
+ oldprofileid: oldid,
+ newprofileid: newid},
+ timeout: 15000
+ });
+}
+
+function submitChangeProfileCB(data, ioArgs) {
+ var selobj = document.getElementById('vmprofileid');
+ curprofileid = selobj.options[selobj.selectedIndex].value;
+ document.getElementById('changevmcont').value = data.items.continuation;
+ alert(data.items.msg);
+}
+
+function vmToHost(cont) {
+ document.body.style.cursor = 'wait';
+ var hostid = document.getElementById('vmhostid').value;
+
+ var obj = document.getElementById('freevms');
+ var listids = new Array();
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected) {
+ listids.push(obj.options[i].value);
+ }
+ }
+ //var limit = dijit.byId('vmlimit').value;
+ var limit = document.getElementById('vmlimit').value;
+ var currcnt = document.getElementById('currvms').options.length;
+ if(limit < currcnt + listids.length) {
+ alert('You\'re attempting to add more VMs to this host\nthan the current VM limit. This is not allowed.');
+ document.body.style.cursor = 'default';
+ return;
+ }
+
+ if(listids.length == 0) {
+ document.body.style.cursor = 'default';
+ return;
+ }
+
+ dojo.xhrPost({
+ url: 'index.php',
+ load: vmToHostCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ listids: listids.join(','),
+ hostid: hostid},
+ timeout: 15000
+ });
+}
+
+function vmToHostCB(data, ioArgs) {
+ if(data.items.failed) {
+ if(data.items.failed == 'nohostaccess')
+ alert('You do not have access to manage this VM host.');
+ else if(data.items.failed == 'vmlimit')
+ alert('You\'re attempting to add more VMs to this host\nthan the current VM limit. This is not allowed.');
+ document.body.style.cursor = 'default';
+ return;
+ }
+ /*
+ for each vmid sent back we
+ search through allvms until we find it keeping track of the previous item with inout == 1
+ we set allvms[vmid].inout to 1
+ we find the previous item in the select.options array
+ we insert a new option right after that one
+ */
+ var vms = data.items.vms;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ var fails = data.items.fails;
+ var obj = document.getElementById('freevms');
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected) {
+ var remove = 1;
+ for(var j = 0; j < fails.length; j++) {
+ if(obj.options[i].value == fails[j].id) {
+ obj.options[i].selected = false;
+ remove = 0;
+ break;
+ }
+ }
+ if(remove)
+ obj.remove(i);
+ }
+ }
+ var obj = document.getElementById('currvms');
+ for(var i = 0; i < vms.length; i++) {
+ var lastid = -1;
+ for(var j = 0; j < allvms.length; j++) {
+ if(allvms[j].id == vms[i].id) {
+ allvms[j].inout = addrem;
+ if(lastid < 0) {
+ if(addrem)
+ currvms.splice(0, 0, vms[i]);
+ var before = obj.options[0];
+ var newoption = new Option(allvms[j].name, allvms[j].id);
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, 0);
+ }
+ break;
+ }
+ else {
+ for(var k = 0; k < obj.options.length; k++) {
+ if(obj.options[k].value == lastid) {
+ if(addrem)
+ currvms.splice(0, 0, vms[i]);
+ var before = obj.options[k + 1];
+ var newoption = new Option(allvms[j].name, allvms[j].id);
+ if(before)
+ try {
+ obj.add(newoption, before);
+ }
+ catch(ex) {
+ obj.add(newoption, k + 1);
+ }
+ else
+ obj.options[obj.options.length] = newoption;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if(allvms[j].inout == addrem)
+ lastid = allvms[j].id;
+ }
+ }
+ document.body.style.cursor = 'default';
+ if(fails.length) {
+ var msg = '';
+ var msg1 = 'There was a problem that prevented the following\n'
+ + 'VM(s) from being added to the host:\n\n';
+ var msg2 = 'You do not have access to add the following vm(s):\n\n';
+ var msg3 = ''; // problem
+ var msg4 = ''; // no access
+ for(var i = 0; i < fails.length; i++) {
+ if(fails[i].reason == 'noaccess')
+ msg4 += fails[i].name + '\n';
+ else
+ msg3 += fails[i].name + '\n';
+ }
+ if(msg3 != '')
+ msg += msg1 + msg3 + '\n';
+ if(msg4 != '')
+ msg += msg2 + msg4 + '\n';
+ alert(msg);
+ }
+}
+
+function vmFromHost(cont) {
+ document.body.style.cursor = 'wait';
+ var hostid = document.getElementById('vmhostid').value;
+
+ var obj = document.getElementById('currvms');
+ var listids = new Array();
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected)
+ listids.push(obj.options[i].value);
+ }
+
+ if(listids.length == 0) {
+ document.body.style.cursor = 'default';
+ return;
+ }
+ dojo.xhrPost({
+ url: 'index.php',
+ load: vmFromHostCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ listids: listids.join(','),
+ hostid: hostid},
+ timeout: 15000
+ });
+}
+
+function vmFromHostCB(data, ioArgs) {
+ if(data.items.failed) {
+ alert('You do not have access to manage this VM host.');
+ document.body.style.cursor = 'default';
+ return;
+ }
+ /*
+ for each vmid sent back we
+ search through allvms until we find it keeping track of the previous item with inout == 1
+ we set allvms[vmid].inout to 1
+ we find the previous item in the select.options array
+ we insert a new option right after that one
+ */
+ var vms = data.items.vms;
+ var addrem = data.items.addrem; // 1 for add, 0 for rem
+ var checks = data.items.checks;
+ var fails = data.items.fails;
+ var obj = document.getElementById('currvms');
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected) {
+ var remove = 1;
+ for(var j = 0; j < checks.length; j++) {
+ if(obj.options[i].value == checks[j].id) {
+ obj.options[i].selected = false;
+ remove = 0;
+ break;
+ }
+ }
+ for(var j = 0; j < fails.length; j++) {
+ if(obj.options[i].value == fails[j].id) {
+ obj.options[i].selected = false;
+ remove = 0;
+ break;
+ }
+ }
+ if(remove) {
+ obj.remove(i);
+ document.getElementById('vmstate').innerHTML = '';
+ currvms.splice(i, 1);
+ }
+ }
+ }
+ for(var i = 0; i < vms.length; i++) {
+ for(var j = 0; j < allvms.length; j++) {
+ if(allvms[j].id == vms[i].id) {
+ allvms.splice(j, 1);
+ break;
+ }
+ }
+ }
+
+ if(data.items.vms.length) {
+ document.getElementById('movevms').className = 'shown';
+ obj = document.getElementById('movevmssel');
+ var vms = data.items.vms;
+ for(var i = 0; i < vms.length; i++) {
+ var label = vms[i]['hostname'] + ' (' + vms[i]['time'] + ')';
+ obj.options[obj.options.length] = new Option(label, data.items.vms[i].reqid);
+ }
+ }
+
+ if(fails.length) {
+ var msg = 'You do not have access to remove the following vm(s):\n\n';
+ for(var i = 0; i < fails.length; i++) {
+ msg += fails[i].name + '\n';
+ }
+ alert(msg);
+ }
+
+ var checks = data.items.checks;
+ if(checks.length) {
+ var content = 'The following computer(s) have reservations on them that cannot be<br>'
+ + 'moved. Click <strong>Move Later</strong> to move the computer(s) off of the host<br>'
+ + 'at the listed time(s) or click <strong>Cancel</strong> to leave the computer(s) on<br>'
+ + 'the host:<br><br>';
+ for(var i = 0; i < checks.length; i++) {
+ content += 'computer: ' + checks[i].hostname + '<br>';
+ content += 'free at: ' + checks[i].end + '<br><br>';
+ }
+ var func = function() {vmFromHostDelayed(data.items.cont);};
+ setMessageWindow('Delayed Move', 'Move Later', content, func);
+ }
+ document.body.style.cursor = 'default';
+}
+
+function vmFromHostDelayed(cont) {
+ dojo.xhrPost({
+ url: 'index.php',
+ load: reloadVMhostCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont},
+ timeout: 15000
+ });
+}
+
+function reloadVMhostCB(data, ioArgs) {
+ if(data.items.failed) {
+ alert('You do not have access to manage this VM host.');
+ document.body.style.cursor = 'default';
+ return;
+ }
+ if(data.items.failed && data.items.fails.length) {
+ var msg = 'You do not have access to remove the following vm(s):\n\n';
+ for(var i = 0; i < data.items.fails.length; i++) {
+ msg += data.items.fails[i].name + '\n';
+ }
+ alert(msg);
+ }
+ if(data.items.msg == 'SUCCESS')
+ getVMHostData(data.items.cont);
+ else
+ document.body.style.cursor = 'default';
+}
+
+function setMessageWindow(title, okbtntext, content, submitFunc) {
+ obj = dijit.byId('messages');
+ obj.titleNode.innerHTML = title;
+ document.getElementById('messagestext').innerHTML = content;
+ document.getElementById('messagesokbtn').innerHTML = okbtntext;
+ document.getElementById('messagesokbtn').onclick = submitFunc;
+ obj.show();
+}
+
+function cancelVMmove(cont) {
+ document.body.style.cursor = 'wait';
+ var hostid = document.getElementById('vmhostid').value;
+
+ var obj = document.getElementById('movevmssel');
+ var listids = new Array();
+ for(var i = obj.options.length - 1; i >= 0; i--) {
+ if(obj.options[i].selected)
+ listids.push(obj.options[i].value);
+ }
+
+ if(listids.length == 0) {
+ document.body.style.cursor = 'default';
+ return;
+ }
+ dojo.xhrPost({
+ url: 'index.php',
+ load: reloadVMhostCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ listids: listids.join(','),
+ hostid: hostid},
+ timeout: 15000
+ });
+}
+
+function getVMprofileData(cont) {
+ document.body.style.cursor = 'wait';
+ document.getElementById('vmprofiledata').className = 'hidden';
+ var profileid = document.getElementById('profileid').value;
+
+ dojo.xhrPost({
+ url: 'index.php',
+ load: getVMprofileDataCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ profileid: profileid},
+ timeout: 15000
+ });
+}
+
+function getVMprofileDataCB(data, ioArgs) {
+ if(data.items.failed) {
+ alert('You do not have access to manage this vm profile.');
+ document.body.style.cursor = 'default';
+ return;
+ }
+ curprofile = data.items.profile;
+ var obj = dijit.byId('ptype');
+ var store = new dojo.data.ItemFileReadStore({data: data.items.types});
+ obj.store = store;
+ obj.setValue(curprofile.vmtypeid);
+
+ var obj = dijit.byId('pimage');
+ var store = new dojo.data.ItemFileReadStore({data: data.items.images});
+ obj.store = store;
+ obj.setValue(curprofile.imageid);
+
+ var obj = dijit.byId('pvmdisk');
+ var store = new dojo.data.ItemFileReadStore({data: data.items.vmdisk});
+ obj.store = store;
+ obj.setValue(curprofile.vmdisk);
+
+ dijit.byId('pname').noValueIndicator = '(empty)';
+ dijit.byId('pnasshare').noValueIndicator = '(empty)';
+ dijit.byId('pdspath').noValueIndicator = '(empty)';
+ dijit.byId('pvmpath').noValueIndicator = '(empty)';
+ dijit.byId('pvs0').noValueIndicator = '(empty)';
+ dijit.byId('pvs1').noValueIndicator = '(empty)';
+
+ dijit.byId('pname').setValue(curprofile.name);
+ dijit.byId('pnasshare').setValue(curprofile.nasshare);
+ dijit.byId('pdspath').setValue(curprofile.datastorepath);
+ dijit.byId('pvmpath').setValue(curprofile.vmpath);
+ dijit.byId('pvs0').setValue(curprofile.virtualswitch0);
+ dijit.byId('pvs1').setValue(curprofile.virtualswitch1);
+ document.getElementById('vmprofiledata').className = 'shown';
+ document.body.style.cursor = 'default';
+}
+
+function newProfile(cont) {
+ var title = 'Create New Profile';
+ var btn = 'Create Profile';
+ var content = 'Enter name of new profile:<br>'
+ + '<input type=text id=newprofile><br>'
+ + '<font color=red><em><span id=nperrormsg></span></em></font><br>';
+ var func = function() {
+ var newname = document.getElementById('newprofile').value;
+ var regex = new RegExp('^[-A-Za-z0-9:\(\)# ]{3,56}$');
+ if(! newname.match(regex)) {
+ alert('Name must be between 3 and 56 characters\nand can only include letters, numbers,\nspaces, and these characters -:()#');
+ return;
+ }
+ document.body.style.cursor = 'wait';
+ dojo.xhrPost({
+ url: 'index.php',
+ load: newProfileCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ newname: newname},
+ timeout: 15000
+ });
+ };
+ setMessageWindow(title, btn, content, func);
+}
+
+function newProfileCB(data, ioArgs) {
+ if(data.items.failed) {
+ document.getElementById('nperrormsg').innerHTML =
+ 'A profile with this name already exists';
+ return;
+ }
+ dijit.byId('messages').hide();
+ alert('Be sure to finish configuring this profile');
+ var obj = document.getElementById('profileid');
+ obj.options[obj.options.length] = new Option(data.items.profile.name, data.items.profile.id);
+ obj.options[obj.options.length - 1].selected = true;
+ // TODO insert new entry in correct order
+ getVMprofileDataCB(data, ioArgs);
+}
+
+function delProfile(cont) {
+ var title = 'Delete Profile';
+ var btn = 'Delete Profile';
+ var content = "Delete the following profile?<br>";
+ content += "<table summary=\"\">";
+ content += "<tr>";
+ content += "<th align=right>Name:</th>";
+ content += "<td>" + curprofile.name + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>Type:</th>";
+ content += "<td>" + curprofile.type + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>Image:</th>";
+ content += "<td>" + curprofile.image + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>NAS Share:</th>";
+ content += "<td>" + curprofile.nasshare + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>Data Store Path:</th>";
+ content += "<td>" + curprofile.datastorepath + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>VM Path:</th>";
+ content += "<td>" + curprofile.vmpath + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>Virtual Switch 0:</th>";
+ content += "<td>" + curprofile.virtualswitch0 + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>Virtual Switch 1:</th>";
+ content += "<td>" + curprofile.virtualswitch1 + "</td>";
+ content += "</tr>";
+ content += "<tr>";
+ content += "<th align=right>VM Disk:</th>";
+ content += "<td>" + curprofile.vmdisk + "</td>";
+ content += "</tr>";
+ content += "</table>";
+ var func = function() {
+ var profileid = document.getElementById('profileid').value;
+ if(profileid == curprofileid)
+ document.getElementById('vmhostdata').className = 'hidden';
+ document.body.style.cursor = 'wait';
+ dojo.xhrPost({
+ url: 'index.php',
+ load: delProfileCB,
+ handleAs: "json-comment-filtered",
+ error: errorHandler,
+ content: {continuation: cont,
+ profileid: profileid},
+ timeout: 15000
+ });
+ };
+ setMessageWindow(title, btn, content, func);
+}
+
+function delProfileCB(data, ioArgs) {
+ if(data.items.failed) {
+ alert('You do not have access to manage this vm profile.');
+ dijit.byId('messages').hide();
+ document.body.style.cursor = 'default';
+ return;
+ }
+ dijit.byId('messages').hide();
+ var obj = document.getElementById('profileid');
+ obj.remove(obj.selectedIndex);
+ document.getElementById('vmprofiledata').className = 'hidden';
+ document.body.style.cursor = 'default';
+}
+
+function updateProfile(id, field) {
+ var newvalue = dijit.byId(id).value;
+ if(curprofile[field] == newvalue)
+ return;
+ document.body.style.cursor = 'wait';
+
+ var profileid = document.getElementById('profileid').value;
+ var cont = document.getElementById('pcont').value;
+ if(profileid == curprofileid)
+ document.getElementById('vmhostdata').className = 'hidden';
+
+ dojo.xhrPost({
+ url: 'index.php',
+ load: updateProfileCB,
+ error: errorHandler,
+ content: {continuation: cont,
+ profileid: profileid,
+ item: field,
+ newvalue: newvalue},
+ timeout: 15000
+ });
+}
+
+function updateProfileCB(data, ioArgs) {
+ eval(data);
+ document.body.style.cursor = 'default';
+}
Added: incubator/vcl/tags/import/web/themes/default/css/vcl.css
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/css/vcl.css?rev=726079&view=auto
==============================================================================
--- incubator/vcl/tags/import/web/themes/default/css/vcl.css (added)
+++ incubator/vcl/tags/import/web/themes/default/css/vcl.css Fri Dec 12 10:20:10 2008
@@ -0,0 +1,383 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+body {
+ font: 11px helvetica, arial, sans;
+ color: black;
+ background: #FFFFFF;
+ margin: 0;
+ padding: 0;
+ text-align: center;
+
+}
+
+p {
+ font: 11px arial, helvetica, sans;
+ margin-top: 0px;
+ text-align: left;
+}
+
+pre {
+ font: 11px trebuchet ms, arial, helvetica, sans;
+ font-weight: bold;
+}
+
+a:link {
+ text-decoration: none;
+ color: #990000;
+}
+
+a:visited {
+ text-decoration: none;
+ color: #595959;
+}
+
+a:hover, a:active {
+ background: #CCCCCC;
+ text-decoration: none;
+ color: black;
+}
+
+table, td {
+ font: 11px helvetica, arial, sans;
+ font-weight: normal;
+ color: black;
+}
+
+table tr td.white {
+ background: white;
+}
+
+th {
+ font: 12px helvetica, arial, sans;
+ font-weight: bold;
+ color: black;
+ cursor: default;
+}
+
+h1, h2, h3 span {display:none}
+
+form {
+ margin-bottom: 0;
+}
+
+#container {
+ background: #E5E5E5 url(../images/background.gif) repeat-y center;
+ display: block;
+ position: relative;
+ border: none;
+ margin: 0 auto 0 auto;
+ width: 752px;
+ min-height: 768px;
+ text-align: center;
+ overflow: visible;
+}
+
+#gradient {
+ background: url(../images/background_gradient.gif) left top;
+ display: block;
+ position: relative;
+ border: none;
+ min-height: 768px;
+ text-align: center;
+ overflow: visible;
+}
+
+#container-whitespace {
+ background: url(../images/background_whitespace.gif) center;
+ display: block;
+ border: none;
+ padding: 0;
+ text-align: center;
+ overflow: visible;
+}
+
+#container-inner {
+ background: transparent url(../images/menu_bg.jpg) repeat-y left top;
+ display: block;
+ border: none;
+ margin: 0 3px 0 3px;
+ padding: 0;
+ overflow: visible;
+}
+
+#header {
+ display: block;
+ background: transparent;
+ height: 100px;
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+
+#bar {
+ background: url(../images/bar_bg.jpg) repeat-x left top;
+ display: block;
+ height: 23px;
+ margin: 0;
+ padding: 0;
+}
+
+#menu {
+ float: left;
+ width: 160px;
+ padding: 0;
+ border: 0;
+}
+
+#menulist {
+ background: none;
+ display: block;
+ margin: 0;
+ border: 0;
+ padding: 0;
+}
+
+#menulist ul {
+ margin: 0;
+ padding: 0;
+}
+
+#menulist ul li {
+ display: block;
+ background: url(../images/menu.jpg) no-repeat left top;
+ height: 22px;
+ width: 158px;
+ list-style-type: none;
+ margin: 0 1px 0 0;
+ padding: 0;
+ text-align: left;
+ vertical-align: bottom;
+}
+
+#menulist ul li a {
+ display: block;
+ background: none;
+ font: 12px arial, helvetica, sans-serif;
+ font-weight: bold;
+ text-align: left;
+ color: black;
+ line-height: 13px;
+ padding: 4px 0 0 4px;
+}
+
+#menulist ul li a:visted {
+ display: block;
+ background: none;
+ font: 12px arial, helvetica, sans-serif;
+ font-weight: bold;
+ text-align: left;
+ line-height: 13px;
+ color: black;
+}
+
+#menulist ul li a:hover, a:active {
+ text-decoration: none;
+ color: #B90000;
+}
+
+#menulist ul li.selected {
+ display: block;
+ background: url(../images/menu_selected.jpg) no-repeat left top;
+ height: 22px;
+ width: 158px;
+ list-style-type: none;
+ padding: 0;
+ margin: 0 1px 0 0;
+ vertical-align: bottom;
+}
+
+#menulist ul li.selected a {
+ display: block;
+ background: none;
+ font: 12px arial, helvetica, sans-serif;
+ font-weight: bold;
+ text-align: left;
+ color: white;
+ line-height: 13px;
+ padding: 4px 0 0 4px;
+}
+
+#menulist ul li.selected a:visted {
+ display: block;
+ background: none;
+ font: 12px arial, helvetica, sans-serif;
+ font-weight: bold;
+ text-align: left;
+ line-height: 13px;
+ color: white;
+}
+
+#menulist ul li.selected a:hover, a:active {
+ text-decoration: none;
+ color: black;
+}
+
+#links {
+ width: 158px;
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+
+#links p {
+ margin: 0;
+ padding: 5px;
+ font: 10px arial, helvetica, sans-serif;
+ color: black;
+}
+
+#content {
+ margin: 0px 0px 0px 10px;
+ display: block;
+ text-align: left;
+ overflow: visible;
+}
+
+#content h2 {
+ display: block;
+ font-family: arial, helvetica, sans;
+ text-shadow: #ccc 0 0 2px;
+ color: #111;
+}
+
+
+#content table {
+ background: #ffffff;
+ border-spacing: 1px;
+ margin: 10px 10px 10px 0;
+ padding: 0;
+}
+
+#content table th {
+ margin: 0;
+ padding: 3px;
+ vertical-align: top;
+}
+
+#content table td {
+ margin: 0;
+ padding: 3px;
+
+}
+
+
+#ext {
+ clear: left;
+ height: 1px;
+}
+
+#footer {
+ background: transparent;
+ width: 750px;
+ margin: 0 8px 0 8px;
+ padding: 0 0 20px 0;
+}
+
+#footer-top {
+ height: 5px;
+ width: 724px;
+ margin: 0;
+ padding: 0;
+}
+
+#footer-top span {display: none}
+
+#footer-padding {
+ clear: left;
+ background: transparent;
+ width: 724px;
+ height: 10px;
+ margin: 0;
+ padding: 0;
+}
+
+#footer-box-left {
+ float: left;
+ background: #F2F2F2;
+ width: 350px;
+ margin: 8px 1px 1px 1px;
+ padding: 5px;
+ border: #595959 1px solid;
+ color: black;
+ font: 9px helvetica, arial, sans;
+}
+
+#footer-box-left p {
+ margin: 0;
+ padding: 0;
+}
+
+#footer-box-left p a:link {
+ text-decoration: none;
+ color: black;
+}
+
+#footer-box-left p a:visited {
+ text-decoration: none;
+ color: #595959;
+}
+
+#footer-box-left p a:hover, a:active {
+ background: #CCCCCC;
+ text-decoration: none;
+ color: black;
+}
+
+
+#footer-box-right {
+ display: block;
+ background: transparent;
+ margin: 8px 0 0 370px;
+ padding: 0;
+}
+
+#footer-box-right p {
+ font: 9px helvetica, arial, sans;
+ text-align: left;
+ color: black;
+}
+
+.leftlabel {
+ width: 150px;
+ float: left;
+ text-align: right;
+ margin-right: 0.5em;
+ margin-bottom: 0.2em;
+ display: block;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+.helpformleftlabel {
+ width: 80px;
+ float: left;
+ text-align: right;
+ margin-right: 0.5em;
+ margin-bottom: 0.2em;
+ display: block;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+.leftlabeldiv {
+ float: left;
+}
+
+.test1 {
+ float: none;
+ display: block;
+}
Added: incubator/vcl/tags/import/web/themes/default/images/background.gif
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background.gif?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_L.png
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_L.png?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_L.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_R.png
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_R.png?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_R.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_bottom_C.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_bottom_C.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_bottom_C.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_bottom_L.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_bottom_L.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_bottom_L.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_bottom_R.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_bottom_R.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_bottom_R.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_gradient.gif
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_gradient.gif?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_gradient.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/background_whitespace.gif
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/background_whitespace.gif?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/background_whitespace.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/bar_bg.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/bar_bg.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/bar_bg.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/belltower.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/belltower.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/belltower.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/black.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/black.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/black.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/content_border_R.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/content_border_R.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/content_border_R.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/menu-leaf.png
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/menu-leaf.png?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/menu-leaf.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/menu.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/menu.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/menu.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/menu_bg.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/menu_bg.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/menu_bg.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/menu_dividerblock.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/menu_dividerblock.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/menu_dividerblock.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/menu_selected.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/menu_selected.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/menu_selected.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/vclbanner_C.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/vclbanner_C.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/vclbanner_C.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/vclbanner_L.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/vclbanner_L.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/vclbanner_L.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/images/vclbanner_R.jpg
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/images/vclbanner_R.jpg?rev=726079&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/vcl/tags/import/web/themes/default/images/vclbanner_R.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/vcl/tags/import/web/themes/default/page.php
URL: http://svn.apache.org/viewvc/incubator/vcl/tags/import/web/themes/default/page.php?rev=726079&view=auto
==============================================================================
--- incubator/vcl/tags/import/web/themes/default/page.php (added)
+++ incubator/vcl/tags/import/web/themes/default/page.php Fri Dec 12 10:20:10 2008
@@ -0,0 +1,139 @@
+<?php
+/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+////////////////////////////////////////////////////////////////////////////////
+///
+/// \fn getHeader($refresh)
+///
+/// \param $refresh - bool for adding code to refresh page
+///
+/// \return string of html to go before the main content
+///
+/// \brief builds the html that goes before the main content
+///
+////////////////////////////////////////////////////////////////////////////////
+function getHeader($refresh) {
+ global $user, $mode, $authed;
+ $rt = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
+ $rt .= "<html lang=\"en\">\n";
+ $rt .= "<head>\n";
+ $rt .= "<title>VCL :: Virtual Computing Lab</title>\n";
+ $rt .= "<link rel=stylesheet type=\"text/css\" href=\"css/vcl.css\">\n";
+ $rt .= "<link rel=stylesheet type=\"text/css\" href=\"themes/default/css/vcl.css\">\n";
+ if($mode == 'viewdocs')
+ $rt .= "<link rel=stylesheet type=\"text/css\" href=\"css/doxygen.css\" />\n";
+ $rt .= "<script src=\"js/code.js\" type=\"text/javascript\"></script>\n";
+ $rt .= "<script type=\"text/javascript\">\n";
+ $rt .= "var cookiedomain = '" . COOKIEDOMAIN . "';\n";
+ $rt .= "</script>\n";
+ $rt .= getDojoHTML($refresh);
+ if($refresh)
+ $rt .= "<noscript><META HTTP-EQUIV=REFRESH CONTENT=20></noscript>\n";
+ $rt .= "</head>\n\n";
+ $rt .= "<body>\n\n";
+ $rt .= "<a class=hidden href=\"#content\" accesskey=2>Skip to content</a>\n";
+ $rt .= "<table border=0 cellpadding=0 cellspacing=0 summary=\"\">\n";
+ $rt .= " <TR>\n";
+ $rt .= " <TD width=80px nowrap></TD>\n";
+ $rt .= " <TD width=6px background=\"themes/default/images/background_L.png\" nowrap></TD>\n";
+ $rt .= " <TD width=8px background=\"themes/default/images/background_gradient.gif\" nowrap></TD>\n";
+ $rt .= " <TD background=\"themes/default/images/background_gradient.gif\" width=\"100%\">\n";
+ $rt .= " <table border=0 cellpadding=0 cellspacing=0 width=\"100%\" summary=\"\">\n";
+ $rt .= " <TR>\n";
+ $rt .= " <TD width=1px background=\"themes/default/images/black.jpg\" nowrap></TD>\n";
+ $rt .= " <TD width=215px nowrap><img src=\"themes/default/images/vclbanner_L.jpg\" alt=\"\"></TD>\n";
+ $rt .= " <TD background=\"themes/default/images/vclbanner_C.jpg\" width=\"100%\"></TD>\n";
+ $rt .= " <TD width=198px nowrap><img src=\"themes/default/images/vclbanner_R.jpg\" alt=\"\"></TD>\n";
+ $rt .= " <TD width=3px background=\"themes/default/images/content_border_R.jpg\" nowrap></TD>\n";
+ $rt .= " </TR>\n";
+ $rt .= " <TR>\n";
+ $rt .= " <TD width=1px background=\"themes/default/images/black.jpg\" nowrap></TD>\n";
+ $rt .= " <TD background=\"themes/default/images/bar_bg.jpg\" width=\"100%\" colspan=3 height=23px></TD>\n";
+ $rt .= " <TD width=3px background=\"themes/default/images/content_border_R.jpg\" nowrap></TD>\n";
+ $rt .= " </TR>\n";
+ $rt .= " </table>\n";
+ $rt .= " <table border=0 cellpadding=0 cellspacing=0 width=\"100%\" summary=\"\">\n";
+ $rt .= " <TR valign=top>\n";
+ $rt .= " <TD width=160px background=\"themes/default/images/menu_bg.jpg\" nowrap>\n";
+ $rt .= "<div id=menulist>\n";
+ $rt .= "<h3 class=hidden>Resources</h3>\n";
+ $rt .= "<ul>\n";
+ if($authed)
+ $rt .= getNavMenu(1, 1);
+ /*else
+ $rt .= "<img src=\"themes/default/images/belltower.jpg\" height=200 width=160 alt=\"\">\n";*/
+ $rt .= "</ul>\n";
+ if($authed)
+ $rt .= "<img src=\"themes/default/images/menu_dividerblock.jpg\" border=0 width=158 height=83 alt=\"\"><br/>\n";
+ $rt .= "</div>\n";
+ $rt .= " </TD>\n";
+ $rt .= " <TD width=\"100%\" style=\"align: left; background: #ffffff;\">\n";
+ $rt .= "<div id=content class=default>\n";
+ return $rt;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+///
+/// \fn getFooter()
+///
+/// \return string of html to go after the main content
+///
+/// \brief builds the html that goes after the main content
+///
+////////////////////////////////////////////////////////////////////////////////
+function getFooter() {
+ $year = date("Y");
+ $rt = "</div>\n";
+ $rt .= " </TD>\n";
+ $rt .= " <TD width=3px background=\"themes/default/images/content_border_R.jpg\" nowrap></TD>\n";
+ $rt .= " </TR>\n";
+ $rt .= " <TR>\n";
+ $rt .= " <TD width=160px nowrap><img src=\"themes/default/images/background_bottom_L.jpg\" alt=\"\"></TD>\n";
+ $rt .= " <TD background=\"themes/default/images/background_bottom_C.jpg\" width=\"100%\"></TD>\n";
+ $rt .= " <TD width=3px nowrap><img src=\"themes/default/images/background_bottom_R.jpg\" alt=\"\"></TD>\n";
+ $rt .= " </TR>\n";
+ $rt .= " </table>\n";
+ $rt .= "<div id=\"footer\">\n";
+ $rt .= "<div id=\"footer-top\">\n";
+ $rt .= "<span>This support page is for students, faculty, and staff of North Carolina State University</span>\n";
+ $rt .= "</div>\n";
+ $rt .= "<div id=\"footer-box-left\">\n";
+ $rt .= "<p>\n";
+ $rt .= "North Carolina State University, Raleigh, NC<br/>\n";
+ $rt .= "<a href=\"http://vcl.ncsu.edu/\">vcl.ncsu.edu</a> | \n";
+ $rt .= "Comments to <a href=\"mailto:vcl_help@ncsu.edu\" accesskey=9>vcl_help@ncsu.edu</a>\n";
+ $rt .= "</p>\n";
+ $rt .= "</div>\n";
+ $rt .= "<div id=\"footer-box-right\">\n";
+ $rt .= "<p>\n";
+ $rt .= "Copyright © 2004-$year by NC State University and others, All Rights Reserved.\n";
+ $rt .= "</p>\n";
+ $rt .= "</div>\n";
+ $rt .= "<div id=\"footer-padding\"><span></span></div>\n";
+ $rt .= "</div>\n";
+ $rt .= "<!-- end footer -->\n";
+ $rt .= "</TD>\n";
+ $rt .= "<TD width=8px background=\"themes/default/images/background_gradient.gif\" nowrap></TD>\n";
+ $rt .= "<TD width=6px background=\"themes/default/images/background_R.png\" nowrap></TD>\n";
+ $rt .= "<TD width=80px nowrap></TD>\n";
+ $rt .= "</TR>\n";
+ $rt .= "</table>\n";
+ $rt .= "</body>\n";
+ $rt .= "</html>\n";
+ return $rt;
+}