[Hw4mdl-svn] SF.net SVN: hw4mdl: [228] branches/team/Thomas/integrations_common
Brought to you by:
jhlinder,
trollinger
From: <tro...@us...> - 2008-01-17 21:18:31
|
Revision: 228 http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=228&view=rev Author: trollinger Date: 2008-01-17 13:18:29 -0800 (Thu, 17 Jan 2008) Log Message: ----------- the path of the pictures and the xsl is not static anymore Modified Paths: -------------- branches/team/Thomas/integrations_common/php/common/WimbaUI.php branches/team/Thomas/integrations_common/web/js/ajax.js branches/team/Thomas/integrations_common/web/js/constants.js branches/team/Thomas/integrations_common/web/js/hwCommons.js branches/team/Thomas/integrations_common/web/js/xsl/wimba.xsl Removed Paths: ------------- branches/team/Thomas/integrations_common/web/js/manageXml.js Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php =================================================================== --- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-17 21:12:04 UTC (rev 227) +++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-17 21:18:29 UTC (rev 228) @@ -94,25 +94,25 @@ HEADER *********/ if($this->session->isInstructor()){ - $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "true"); + $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "true"); }else{ - $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "false"); + $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "false"); } /******** MENU *********/ - $this->xml->addButtonElement("all", "all", "disabled", "pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'liveclassroom'), "javascript:LaunchElement('doAction.php','liveclassroom');"); + $this->xml->addButtonElement("all", "all", "disabled", "lib/web/pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'liveclassroom'), "javascript:LaunchElement('doAction.php','liveclassroom');"); if($this->session->isInstructor()){ - $this->xml->addButtonElement("instructor", "all", "disabled", 'pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'liveclassroom'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=liveclassroom')"); + $this->xml->addButtonElement("instructor", "all", "disabled", 'lib/web/pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'liveclassroom'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=liveclassroom')"); - $this->xml->addButtonElement("instructor", "all", "enabled", "pictures/buttons/toolbar-new", get_string('toolbar_new', 'liveclassroom'), "javascript:loadNewSettings('generateSettings.php','create','liveclassroom' ,'liveclassroom','all')"); + $this->xml->addButtonElement("instructor", "all", "enabled", "lib/web/pictures/buttons/toolbar-new", get_string('toolbar_new', 'liveclassroom'), "javascript:loadNewSettings('generateSettings.php','create','liveclassroom' ,'liveclassroom','all')"); $this->xml->addSpaceElement("20px", "instructor"); - $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-content", get_string('toolbar_content', 'liveclassroom'), "javascript:openContent('doAction.php');"); - $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-poll", get_string('toolbar_reports', 'liveclassroom'), "javascript:openReport('doAction.php');"); + $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-content", get_string('toolbar_content', 'liveclassroom'), "javascript:openContent('doAction.php');"); + $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-poll", get_string('toolbar_reports', 'liveclassroom'), "javascript:openReport('doAction.php');"); $this->xml->addSpaceElement("10px", "instructor"); - $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'liveclassroom'), "javascript:editSettings('generateSettings.php','all');"); - $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'liveclassroom'), "javascript:deleteResource('doAction.php');"); + $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'liveclassroom'), "javascript:editSettings('generateSettings.php','all');"); + $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'liveclassroom'), "javascript:deleteResource('doAction.php');"); $this->xml->addSpaceElement("50px", "instructor"); }else{ $this->xml->addSpaceElement("300px", "instructor"); @@ -157,21 +157,21 @@ HEADER *********/ if($this->session->isInstructor()){ - $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "true"); + $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "true"); }else{ - $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "false", "false"); + $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "false", "false"); } /******** MENU *********/ - $this->xml->addButtonElement("all", "all", "disabled", "pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'voicetools'), "javascript:LaunchElement('manageAction.php','voicetools');"); + $this->xml->addButtonElement("all", "all", "disabled", "lib/web/pictures/buttons/toolbar-launch", get_string('toolbar_launch', 'voicetools'), "javascript:LaunchElement('manageAction.php','voicetools');"); if($this->session->isInstructor()){ - $this->xml->addButtonElement("instructor", "all", "disabled", 'pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'voicetools'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=voicetools')"); - $this->xml->addButtonElement("instructor", "all", "enabled", "pictures/buttons/toolbar-new", get_string('toolbar_new', 'voicetools'), "javascript:launchAjaxRequest('getXmlChoicePage.php','create' ,'true','all')"); + $this->xml->addButtonElement("instructor", "all", "disabled", 'lib/web/pictures/buttons/toolbar-activities', get_string('toolbar_activity', 'voicetools'), "doOpenAddActivity('../../course/mod.php','section=0&sesskey=" . sesskey() . "&add=voicetools')"); + $this->xml->addButtonElement("instructor", "all", "enabled", "lib/web/pictures/buttons/toolbar-new", get_string('toolbar_new', 'voicetools'), "javascript:launchAjaxRequest('getXmlChoicePage.php','create' ,'true','all')"); $this->xml->addSpaceElement("150px", "instructor"); - $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'voicetools'), "javascript:editSettings('getXmlNewPanel.php','all');"); - $this->xml->addButtonElement("instructor", "all", "disabled", "pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'voicetools'), "javascript:deleteResource('manageAction.php');"); + $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-settings", get_string('toolbar_settings', 'voicetools'), "javascript:editSettings('getXmlNewPanel.php','all');"); + $this->xml->addButtonElement("instructor", "all", "disabled", "lib/web/pictures/buttons/toolbar-delete", get_string('toolbar_delete', 'voicetools'), "javascript:deleteResource('manageAction.php');"); $this->xml->addSpaceElement("50px", "instructor"); }else{ $this->xml->addSpaceElement("300px", "instructor"); @@ -281,7 +281,7 @@ /******** HEADER *********/ - $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true"); + $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true"); if($update=="update"){ @@ -320,7 +320,7 @@ } function getVTSettingsView($update, $createWorkflow) { - //list_dir("pictures",$pictures);//list the directory + //list_dir("lib/web/pictures",$lib/web/pictures);//list the directory /******** SESSION *********/ @@ -328,7 +328,7 @@ /******** HEADER *********/ - $this->xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true"); + $this->xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true"); if($update=="update"){ $this->xml->addContextElement(get_string("contextbar_settings", "voicetools"), get_string("general_" . $this->product, "voicetools"), $this->currentObject->getTitle(), ""); Modified: branches/team/Thomas/integrations_common/web/js/ajax.js =================================================================== --- branches/team/Thomas/integrations_common/web/js/ajax.js 2008-01-17 21:12:04 UTC (rev 227) +++ branches/team/Thomas/integrations_common/web/js/ajax.js 2008-01-17 21:18:29 UTC (rev 228) @@ -23,7 +23,12 @@ * * ******************************************************************************/ +function initPath(xsl,pictures){ + pathXsl=xsl; + pathPictures=pictures; +} + /* * Get the parameters passed with the GET Method and put them into a * javascript array @@ -156,12 +161,12 @@ if (action != null) { url += "?action=" + action; } - - - transform(url,"js/xsl/wimba.xsl","first",div,nextAction) + transform(url,"first",div,nextAction) } + + /* * Create the context of the Ajax request and execute it * @@ -185,7 +190,8 @@ url += "&createWorkflow=" + createWorkflow; } isFilter = false; - transform(url,"js/xsl/wimba.xsl","",div) + + transform(url,"",div) if (init == true) { currentId = ""; @@ -215,7 +221,7 @@ xmlSource = dom; if (xslData == null) { //get the stylesheet dojo.io.bind({ - url:"js/xsl/wimba.xsl", + url:pathXsl, mimetype:"application/xml", load:function (type, data, evt) { xslData = data; @@ -264,7 +270,7 @@ * For Safari: we used he dojo framework to get the xml,xsl by Ajax and the google library * (Google AJAXSLT) to execute the xslt transformation because it is not supported natively */ -function transform(urlXml, stylesheet,TypeParams, div,nextAction) { +function transform(urlXml,TypeParams, div,nextAction) { if(window.ActiveXObject){//ie @@ -290,7 +296,7 @@ var xslDoc = new ActiveXObject("Microsoft.XMLDOM") xslDoc.async = false - xslDoc.load("js/xsl/wimba.xsl"); + xslDoc.load(pathXsl); xsltTransformation(sourceDoc,xslDoc,div,nextAction); @@ -309,10 +315,11 @@ xmlSource = data; //get the stylesheet dojo.io.bind({ - url:stylesheet, + url:pathXsl, mimetype:"application/xml", load:function (type, data, evt) { //do the xslt transformatio + xsltTransformation(xmlSource,data,div,nextAction) }, @@ -339,7 +346,7 @@ xmlSource = dom; dojo.io.bind({ - url:"js/xsl/wimba.xsl", + url:pathXsl, mimetype:"application/xml", load:function (type, data, evt) { //do the xslt transformatio @@ -386,6 +393,8 @@ }else if (window.XSLTProcessor){//firefox var processor = new XSLTProcessor(); + processor.setParameter(null, 'pathPictures', pathPictures); + processor.importStylesheet(xsl); document.getElementById(div).innerHTML=""; var resultDocument = processor.transformToFragment(xml, document); @@ -544,3 +553,5 @@ return params; } + + Modified: branches/team/Thomas/integrations_common/web/js/constants.js =================================================================== --- branches/team/Thomas/integrations_common/web/js/constants.js 2008-01-17 21:12:04 UTC (rev 227) +++ branches/team/Thomas/integrations_common/web/js/constants.js 2008-01-17 21:18:29 UTC (rev 228) @@ -50,9 +50,9 @@ // xml var objDom; var objDomTree; -var stylesheet="js/xsl/wimba.xsl"; +var xsl=""; +var pathPictures=""; - var myDOM; var xmlDoc; var xslData=null; Modified: branches/team/Thomas/integrations_common/web/js/hwCommons.js =================================================================== --- branches/team/Thomas/integrations_common/web/js/hwCommons.js 2008-01-17 21:12:04 UTC (rev 227) +++ branches/team/Thomas/integrations_common/web/js/hwCommons.js 2008-01-17 21:18:29 UTC (rev 228) @@ -94,7 +94,7 @@ if(archiveMatched>0){//change the pciture var pictureId = elements[roomLinked].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-show.png"); + changePicture(pictureId, pathPictures+"listitem-show.png"); } elements[roomLinked].setAttribute("stateSearch", "");//change the status of the element to manage the display elements[roomLinked].style.display = display; @@ -136,10 +136,10 @@ //management of the picture to expand the archives if(archiveMatched>0){ var pictureId = elements[roomLinked].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-hide.png"); + changePicture(pictureId, pathPictures+"listitem-hide.png"); }else{ var pictureId = elements[roomLinked].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/space-16px.png"); + changePicture(pictureId, pathPictures+"space-16px.png"); } } } else { @@ -160,7 +160,7 @@ elements[roomLinked].style.display = display; elements[roomLinked].setAttribute("stateSearch", ""); var pictureId = elements[roomLinked].id + "_ExpandPicture"; - changePicture(pictureId, "pictures/items/listitem-hide.png"); + changePicture(pictureId, pathPictures+"listitem-hide.png"); }else{ elements[roomLinked].style.display = "none"; elements[roomLinked].setAttribute("stateSearch", "ignore"); @@ -189,15 +189,15 @@ if (currentId != "" && currentId != id) { document.getElementById(currentId).style.backgroundColor = "white"; if(document.getElementById(currentId).getAttribute("typeProduct")=="archive"){ - document.getElementById(currentId+"_archive_subitem").src="pictures/items/listitem-subitem.jpg"; - document.getElementById(currentId+"_archive_icon").src="pictures/items/listitem-archiveicon.jpg"; + document.getElementById(currentId+"_archive_subitem").src=pathPictures+"listitem-subitem.jpg"; + document.getElementById(currentId+"_archive_icon").src=pathPictures+"listitem-archiveicon.jpg"; } } if (lineCurrentId != id) { document.getElementById(id).style.backgroundColor = "#c3dbf7"; if(type=="archive"){ - document.getElementById(id+"_archive_subitem").src="pictures/items/listitem-subitem-selected.jpg"; - document.getElementById(id+"_archive_icon").src="pictures/items/listitem-archiveicon-selected.jpg"; + document.getElementById(id+"_archive_subitem").src=pathPictures+"listitem-subitem-selected.jpg"; + document.getElementById(id+"_archive_icon").src=pathPictures+"listitem-archiveicon-selected.jpg"; } } @@ -234,13 +234,13 @@ } } if(archiveAvailable==true){ - changePicture(id + "_ExpandPicture", "pictures/items/listitem-hide.png"); + changePicture(id + "_ExpandPicture", pathPictures+"listitem-hide.png"); div.style.height=""; document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='RemoveAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>Show Top 5...</label>"; expandState=1; } else{ - changePicture(id + "_ExpandPicture", "pictures/items/listitem-show.png"); + changePicture(id + "_ExpandPicture", pathPictures+"listitem-show.png"); if(expandState!=1) document.getElementById(nameMore).innerHTML = "<label class='moreRoom' onclick='displayAllDiv(\"" + name + "\",\"" + nameMore + "\",\"" + (listRoomsArchives.length-numHide) + "\")'>"+(listRoomsArchives.length-numHide-5)+" more...</label>"; else @@ -345,7 +345,7 @@ elements[i].style.display = "none"; if(elements[i + 1] != null && elements[i + 1].getAttribute("typeProduct") == "archive"){//this room contains archives document.getElementById(elements[linkedRoom].id + "_ExpandPicture").style.visibility="visible"; - changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), "pictures/items/listitem-show.png"); + changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"listitem-show.png"); while (elements[i + 1].getAttribute("typeProduct") == "archive") { elements[i + 1].className = "archiveHide"; elements[i + 1].setAttribute("stateStudentView", "ignore"); @@ -370,7 +370,7 @@ } if(archiveMatched==0){//hide the element which allow the expand/collapse document.getElementById(elements[linkedRoom].id + "_ExpandPicture").style.visibility="hidden"; - changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), "pictures/items/listitem-show.png"); + changePicture(document.getElementById(elements[linkedRoom].id + "_ExpandPicture"), pathPictures+"listitem-show.png"); } } @@ -387,7 +387,7 @@ elements[i].style.display = display; if(elements[i+1]!=null && elements[i+1].getAttribute("typeProduct") == "archive"){ document.getElementById(elements[i].id + "_ExpandPicture").style.visibility="visible"; - changePicture(document.getElementById(elements[i].id + "_ExpandPicture"), "pictures/items/listitem-show.png"); + changePicture(document.getElementById(elements[i].id + "_ExpandPicture"), pathPictures+"listitem-show.png"); } } else { @@ -480,19 +480,19 @@ if(document.getElementById("collapsePictureliveclassroom")) { - changePicture("collapsePictureliveclassroom", "pictures/items/category-expanded.png"); + changePicture("collapsePictureliveclassroom", pathPictures+"/items/category-expanded.png"); document.getElementById("div_liveclassroom").setAttribute("state", "expand"); } if(document.getElementById("collapsePictureboard")) { - changePicture("collapsePictureboard", "pictures/items/category-expanded.png"); + changePicture("collapsePictureboard", pathPictures+"/items/category-expanded.png"); document.getElementById("div_board").setAttribute("state", "expand"); } if(document.getElementById("collapsePicturepresentation")) { - changePicture("collapsePicturepresentation", "pictures/items/category-expanded.png"); + changePicture("collapsePicturepresentation", pathPictures+"/items/category-expanded.png"); document.getElementById("div_presentation").setAttribute("state", "expand"); } if(document.getElementById("collapsePicturepc")) { - changePicture("collapsePicturepc", "pictures/items/category-expanded.png"); + changePicture("collapsePicturepc", pathPictures+"/items/category-expanded.png"); document.getElementById("div_pc").setAttribute("state", "expand"); } @@ -576,7 +576,7 @@ if (divProduct.getAttribute("state") == "expand") { divProduct.style.display = "none"; divProductMore.style.display = "none"; - changePicture(pictureId, "pictures/items/category-collapsed.png"); + changePicture(pictureId, pathPictures+"/items/category-collapsed.png"); divProduct.setAttribute("state", "collapse"); } else { divProduct.style.display = "block"; @@ -585,7 +585,7 @@ } else { divProductMore.style.display = "none"; } - changePicture(pictureId, "pictures/items/category-expanded.png"); + changePicture(pictureId, pathPictures+"/items/category-expanded.png"); divProduct.setAttribute("state", "expand"); } } Deleted: branches/team/Thomas/integrations_common/web/js/manageXml.js =================================================================== --- branches/team/Thomas/integrations_common/web/js/manageXml.js 2008-01-17 21:12:04 UTC (rev 227) +++ branches/team/Thomas/integrations_common/web/js/manageXml.js 2008-01-17 21:18:29 UTC (rev 228) @@ -1,1338 +0,0 @@ -/****************************************************************************** - * * - * Copyright (c) 1999-2007 Horizon Wimba, All Rights Reserved. * - * * - * COPYRIGHT: * - * This software is the property of Horizon Wimba. * - * You can redistribute it and/or modify it under the terms of * - * the GNU General Public License as published by the * - * Free Software Foundation. * - * * - * WARRANTIES: * - * This software is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with the Horizon Wimba Moodle Integration; * - * if not, write to the Free Software Foundation, Inc., * - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * - * * - * Author: Hugues Pisapia * - * * - ******************************************************************************/ - -function manageXml(search, divToReload, displayMessage) -{ - var display = ""; - var message = false; - if(divToReload == "all") - { - display += "<form method=post name=myform>" - display += initDisplay(); - - } - // session management - var information = objDomTree.getElements("information"); - - if(information != "") - createSession(information); - - // Get windows Element - var windows = objDomTree.getElements("windows"); - // get the different part of the windows - var windowsElements = windows[0].getElements("windowsElement"); - - for(var i = 0; i < windowsElements.length;i ++ ) - { - var type = windowsElements[i].getElements("type")[0].getText(); - - switch(type) - { - case "headerBar" : - if(divToReload == "all" ) - { - display += openDiv("headerBar", "headerBar"); - display += displayHeaderBar(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "headerBar") - { - - display += displayHeaderBar(windowsElements[i].getElements("windowsElementParameters")); - - } - break; - case "toolBar" : - if(divToReload == "all") - { - display += openDiv("toolBar", "toolBar") - display += displayToolBar(windowsElements[i].getElements("windowsElementParameters"), search); - display += closeDiv(); - } - else if(divToReload == "toolBar") - { - display += displayToolBar(windowsElements[i].getElements("windowsElementParameters"), search); - - } - - break; - case "filterBar" : - if(divToReload == "all") - { - display += openDiv("filterBar", "filterBar") - display += displayFilterBar(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "filterBar") - { - - display += displayFilterBar(windowsElements[i].getElements("windowsElementParameters")); - - } - - break; - case "message" : - message = true; - if(divToReload == "all") - { - display += openDiv("messageBar", "messageBar") - display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "messageBar") - { - - display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters")); - - } - - break; - case "error" : - if(divToReload == "all") - { - display += openDiv("messageBar", "messageBar") - display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "messageBar") - { - - display += displayMessageBar(windowsElements[i].getElements("windowsElementParameters")); - - } - break; - case "list" ://list of element(room,board,presentation) - if(divToReload == "all") - { - display += openDiv("list", "list") - display += displayList(windowsElements[i].getElements("windowsElementParameters"), search); - display += closeDiv(); - } - else if(divToReload == "list") - { - - display += displayList(windowsElements[i].getElements("windowsElementParameters"), search); - - } - - break; - case "settings" : - if(divToReload == "all" ) - { - display += openDiv("settings", "settings") - display += displaySettings(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "settings") - { - display += displaySettings(windowsElements[i].getElements("windowsElementParameters")); - - - } - break; - case "contextBar" : - if(divToReload == "all") - { - display += openDiv("contextBar", "contextBar") - display += displayContextBar(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "contextBar") - { - - display += displayContextBar(windowsElements[i].getElements("windowsElementParameters")); - - } - break; - case "validationBar" : - if(divToReload == "all" ) - { - display += openDiv("validationBar", "validationBar") - display += displayValidationBar(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - - display += "</form>" - } - else if(divToReload == "validationBar") - { - display += displayValidationBar(windowsElements[i].getElements("windowsElementParameters")); - display += "</form>" - - } - break; - case "productChoice" : - if(divToReload == "all") - { - display += openDiv("productChoice", "productChoice") - display += displayProductChoice(windowsElements[i].getElements("windowsElementParameters")); - display += closeDiv(); - } - else if(divToReload == "productChoice") - { - - display += displayProductChoice(windowsElements[i].getElements("windowsElementParameters")); - - } - break; - - } - - } - display += closeDisplay(); - document.getElementById(divToReload).innerHTML = display; - if(navigator.appName.indexOf("Explorer") > - 1 && parseFloat(navigator.appVersion) < 5.5) - { - correctPNG(); - } - if(divToReload == "all" || divToReload == "list") - { - gestionDisplay(); - document.getElementById("search").focus(); - } - - // manage the display of the information message - if(displayMessage == true && message == true) - { - if(document.getElementById("list") != null) - document.getElementById("list").className="listMinHeigth" - } - else if(displayMessage == false) - { - if(document.getElementById("list") != null) - document.getElementById("list").className="list" - if(document.getElementById("messageBar") != null) - document.getElementById("messageBar").style.display = "none" - } - else - { - if(document.getElementById("list") != null) - document.getElementById("list").className="list" - if(document.getElementById("messageBar") != null) - document.getElementById("messageBar").style.display = "none" - } -} - - - - -function displayMessageBar(elementParameters) -{ - var display = ""; - var messageInformations = elementParameters[0].getElements("message") - - switch(messageInformations[0].getElements("type")[0].getText()) - { - case "message" : - display = "<table style='background-color:#ffff99' width=100%><tr><td laign=right><img src='pictures/items/messagelabel-info.png'></td><td>" + messageInformations[0].getElements("value")[0].getText() + "</td></tr></table>" - - break; - case "error" ://display the error windows - - display += "<table width='100%' height='32' border='0' align='center' cellpadding='0' cellspacing='0' background='headerbar.png'>" - display += "<tr><td>" - display += "<div id='headerBar' class='headerBar'>" - display += " <table cellpadding='0' cellspacing='0' id='TABLE1' style='padding-left:5px'>" - display += "<tbody>" - display += "<tr><td>" - display += "<img src='pictures/items/headerbar-logo.png'>" - display += "</td> " - display += "<td align='right' valign='middle'>" - display += "<select id='view' onchange='ChangeView()'>" - display += "<option value='normal'>Instructor View</option>" - display += "<option value='student'>Student View</option>" - display += "</select>" - display += "</td></table></div>" - display += "</tr><tr><td><div id='contextBar' class='contextBar'>" - display += "<table cellspacing='0' cellpadding='0'>" - display += "<tr>" - display += "<td align=left><label class='roomNameForSettings'>Error</label></td>" - display += "</tr>" - display += "</table></div>" - display += "</td>" - display += "</tr>"; - display += "</tr><tr><td>" - display += "<div id='error_frame' align='center'>" - display += "<table width='100%' border='0' cellpadding='0' height='254px'>" - display += "<tr>" - display += "<td width='10%'></td>" - display += "<td valign='middle'><img src='pictures/items/warning.png' alt='' width='60' height='60' border='0'></td>" - display += "<td width='20'></td>" - display += "<td valign='middle' >" - display += "<div id='error_title'>Error" - display += "<div id='error_body'>" - display += "<p>" + messageInformations[0].getElements("value")[0].getText() + "</p>" - display += "</div>" - display += "</td>" - display += "</tr>" - display += "</table>" - display += "</div>" - display += "</td>" - display += "</tr>"; - display += "</tbody>" - display += "</table>" - break; - } - - return display; -} - -function displayHeaderBar(elementParameters) -{ - var display = ""; - var headerBarInformations = elementParameters[0].getElements("headerBarInformations") - display = "<table cellspacing=0 cellpadding=0>" - display += "<tr>" - display += "<td><img height='32px' width='80px' src='"+headerBarInformations[0].getElements("pictureUrl")[0].getText()+"' /></td>" - display += "<td align='right' valign='middle'>" - if(session["role"] == "Instructor") - { - display += "<select id='view' onchange='ChangeView()'>" - display += "<option value='normal'>"+headerBarInformations[0].getElements("instructorView")[0].getText()+"</option>" - - if(studentView == true) - display += "<option value='student' selected>"+headerBarInformations[0].getElements("studentView")[0].getText()+"</option>" - else - display += "<option value='student'>"+headerBarInformations[0].getElements("studentView")[0].getText()+"</option>" - display += "</select>" - } - display += "</td>" - display += "</tr>" - display += "</table>" - return display; - -} - -// Manage The toolBar -function displayToolBar(elementParameters, search) -{ - var display = ""; - var toolbar = elementParameters[0].getElements("menuElements"); - var menuElements = toolbar[0].getElements("menuElement"); - display += "<table cellspacing=0 cellpadding=0 >" - display += "<tr id='menu'>" - for(var i = 0; i < menuElements.length; i ++ ) - { - if(menuElements[i].getElements("type")[0].getText() == "button"){ - display += displayToolBarButton(menuElements[i].getElements("typeOfProduct")[0].getText(), menuElements[i].getElements("availibility")[0].getText(), menuElements[i].getElements("typeOfUser")[0].getText(), menuElements[i].getElements("pictureUrl")[0].getText(), menuElements[i].getElements("value")[0].getText(), menuElements[i].getElements("action")) ; - } - else if(menuElements[i].getElements("type")[0].getText() == "separator"){ - display += displayToolBarSeparator(search); - } - else if(menuElements[i].getElements("type")[0].getText() == "search"){ - display += displayToolBarSearch(search); - } - else if(menuElements[i].getElements("type")[0].getText() == "variableSpace"){ - display += displaySearch(search); - } - else if(menuElements[i].getElements("type")[0].getText() == "fixSpace"){ - display += displaySpace(); - } - } - display += "</tr></table>"; - return display; -} - -function displayToolBarButton(product, availibility, typeOfUser, pictureUrl, value, action) -{ - var display = ""; - var actionString = "" - if(session["role"] == "Student") - studentView = true; - var actionString = action[0].getElements("name")[0].getText() + "("; - var actionParam = action[0].getElements("parameters"); - var actionParameters = actionParam[0].getElements("parameter"); - for(var j = 0; j < actionParameters.length;j ++ ) - { - if(j == (actionParameters.length - 1))//last param - actionString += "\'"+actionParameters[j].getText()+"\' "; - else - actionString += "\'"+ actionParameters[j].getText()+"\',"; - } - actionString += ")"; - var actionDelete = ""; - if( typeOfUser == "all" || (typeOfUser == "instructor" && studentView == false))//check the context to display - { - if(availibility == "true" || currentId != "") - { - if(product="all" || currentTool == "all") - { - if(value == "Delete")//add a validation for the bouton delete - { - actionDelete = "onclick=\"javascript : return confirmDelete(); \"" - } - display += "<td align='center' class='button_enabled' " + actionDelete + ">" - display += "<a href=\"javascript:"+actionString+";\">" - display += "<img src='"+pictureUrl+".png' style='text-decoration:none;height:26px' border=0 id='"+value+"' name='"+value+"_icon' ><br style='text-decoration:none;' />" - display += value ; - display += "</a></td> " - } - else if(currentTool == product) - { - if(value == "Delete")//add a validation for the bouton delete - { - actionDelete = "onclick=\"javascript : return confirmDelete(); \"" - } - display += "<td align='center' class='button_enabled' " + actionDelete + ">" - display += "<a href=\"javascript:"+actionString+";\">" - display += "<img src='"+pictureUrl+".png' style='text-decoration:none;height:26px' border=0 id='"+value+"' name='"+value+"_icon' ><br style='text-decoration:none;' />" - display += value ; - display += "</a></td> " - } - else if(currentTool != product )//button not valid for the tool available - { - display += "<td align='center' class='empty_space'> </td>" - } - else//bouton available but disabled - { - display += "<td align='center' class='button_disabled' " + actionDelete + ">" - display += "<img src='"+pictureUrl+"-disabled.png' border=0 id='"+value+"' name='"+value+"_icon' height='24' width='24'><br />" - display += value ; - display += "</td> " - } - } - else - { - - if(currentTool == product || product == "all" || currentTool == "all") - { - display += "<td align='center' class='button_disabled' " + actionDelete + " >" - display += "<img src='"+pictureUrl+"-disabled.png' border=0 id='"+value+"' name='"+value+"_icon' height='24' width='24'><br />" - display += value ; - display += "</td> " - } - else - { - display += "<td align='center' class='empty_space'> </td>" - } - } - - } - else - { - // the button is unavalaible for this user - display += "<td align='center' class='empty_space'> </td>" - } - display += "<td class='separator_space'> </td> " - return display; -} - - -function displayToolBarSearch(search) -{ - var display = ""; - if(navigator.userAgent.indexOf("Safari") != - 1 ) - { - display += "<td align='right' width=120px>" - display += "<table border=0 class='search' cellspacing=0 cellpadding=0 style=border:none >" - display += "<tr>" - display += "<td align='right'>" - display += "<input name='search' id='search' type='search' style='border:0; width: 105px;' " - display += "onkeyup='javascript:manageXml(search.value,\"list\",false);' onClick='javascript:initSearch(search.value);' value='"+search+"' />" - display += "</td>" - display += "</tr>" - display += "</table>" - display += "</td>" - } - else - { - display += "<td align='right' width=115px>" - display += "<table border=0 class='search' cellspacing=0 cellpadding=0 style=border:none>" - display += "<tr>" - display += "<td align='right' width=26px style='background-image: url(pictures/items/headerbar-searchfield-left.png); background-repeat:no-repeat;'>" - display += "</td>" - display += "<td align='right' height=26px style='background-image: url(pictures/items/headerbar-searchfield-middle.png); '>" - display += "<input name='search' id='search' type='search' style='border:0; width: 50px;' " - display += "onkeyup='javascript:manageXml(search.value,\"list\",false);' onClick='javascript:initSearch(search.value);' value='"+search+"' />" - display += "</td>" - display += "<td align=left width=26px style='background-image: url(pictures/items/headerbar-searchfield-right.png); background-repeat:no-repeat;'>" - display += "<div id='croix' style='display:none'> " - display += "<img onmouseover='overCroix(this)' Onclick='clickCroix();launchDisplay();' Onmouseout='overCroix(this)' src='pictures/x_normal.gif' align='middle' style='border:none ' />" - display += "</div>" - display += "</td>" - display += "<td width=5px></td>" - display += "</tr>" - display += "</table>" - display += "</td>" - } - - return display; -} - -function displayToolBarSeparator() -{ - var display = ""; - display += "<td width='1px'><img src='pictures/items/toolbar-separator.png' height='44px' width='1px' /></td> "; - display += "<td width='12px'></td> " - return display; -} - - -// Manage the filterBar - -function displayFilterBar(elementParameters) -{ - var display = ""; - var filterBar = elementParameters[0].getElements("filters"); - var filterElements = filterBar[0].getElements("filter"); - display += "<table cellspacing='0' cellpadding='0' width=100% >" - display += "<tr>" - for(var i = 0; i < filterElements.length; i ++ ) - { - display += "<td class='filterSpace'>" - display += displayfilter(filterElements[i].getElements("value")[0].getText(), filterElements[i].getElements("name")[0].getText(), filterElements[i].getElements("action")[0].getText(), filterElements[i].getElements("availibility")[0].getText()); - display += "</td>" - } - display += "</tr></table>"; - return display; -} - -function displayfilter(value, name, action, availibility) -{ - var display = ""; - display += "<table align='center' cellpadding='0' cellspacing='0' heigth='24px'>"; - display += "<tr heigth='24px' class='filter'>"; - - if(currentFilter == name)//filter enabled - { - display += "<td class='filter_left_enabled' width=8px id='"+name+"_left'></td>"; - display += "<td class='filter_middle_enabled' id='"+name+"_center' class='filter_selected' onclick=" + action + " onmouseover=\"onFilter('"+name+"')\" onmouseout=\"outFilter('"+name+"')\">"; - display += value; - display += "</td>"; - display += "<td class='filter_right_enabled' width=8px id='"+name+"_right'></td>"; - - } - else - { - display += "<td width=8px id='"+name+"_left' ></td>"; - display += "<td id='"+name+"_center' class='filter_enabled' onclick=" + action + " onmouseover=\"onFilter('"+name+"')\" onmouseout=\"outFilter('"+name+"')\">"; - display += value; - display += "</td>"; - display += "<td width=8px id='"+name+"_right'></td>"; - } - display += "</tr>"; - display += "</table>"; - return display; -} - - -// ManageList -function displayList(elementParameters, search) -{ - // clear the global variable - numberMainLectureRoom = 0; - numberDiscussionRoom = 0; - numberVoiceBoard = 0; - numberVoicePresentation = 0; - - var parts = new Array();//one part=one tool - var numberProducts = new Array(); - var breakout = ""; - - var numberArchive = 0; - var number = 0; - var roomId; - var mysearch = new String(search); - - // get the list of products - var list = elementParameters[0].getElements("products"); - var listProducts = list[0].getElements("listProducts"); - - // get the different informations for each product - var products = listProducts[0].getElements("productInformations"); - var start = 0; - //creation of the product separator - for(i = 0; i < products.length; i ++ ) - { - var positionOfDiv = products[i].getElements("position")[0].getText(); - if(currentFilter == "all" || currentDiv == positionOfDiv) - { - var cssStyle = products[i].getElements("style")[0].getText(); - var value = products[i].getElements("value")[0].getText(); - // string display - parts[eval(parseInt(positionOfDiv))] = openDivProduct(positionOfDiv, cssStyle, value) - } - if(start > parseInt(positionOfDiv) || start == 0)//if liveclassroom disabled start=2 - start = parseInt(positionOfDiv); - } - var content = list[0].getElements("listElements"); - //add the element to the list - if(content != "") - { - var listElements = content[0].getElements("listElement"); - var positionDiscussionRoom = 0; - var positionMainLecture = 0; - var orphanedMainLecture = ""; - var orphanedDiscussion = ""; - if(session["role"] == "Student") - studentView = true; - for(i = 0; i < listElements.length; i ++ ) - { - var parameters = listElements[i].getElements("listElementParameters"); - - var results = parameters[0].getElements("nameDisplay")[0].getText().toLowerCase().match(mysearch.toLowerCase()) - if(search == null || results != null) - { - if(studentView == false || ((studentView == true) && parameters[0].getElements("preview")[0].getText() == "available")) - { - - switch(parameters[0].getElements("typeOfElement")[0].getText()) - { - case LC_MAINLECTURE : - if(currentFilter == "all" || currentDiv == parameters[0].getElements("position")[0].getText()) - { - parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addRoomElement(LC_MAINLECTURE, parameters); - numberMainLectureRoom ++ ; - positionMainLecture = parameters[0].getElements("position")[0].getText(); - } - break; - case LC_DISCUSSION : - if(currentFilter == "all" || currentDiv == parameters[0].getElements("position")[0].getText()) - { - parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addRoomElement("Discussion", parameters); - numberDiscussionRoom ++ ; - positionDiscussionRoom = parameters[0].getElements("position")[0].getText(); - } - break; - case VB_PRODUCT : - parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addBoardElement(VB_PRODUCT, parameters); - numberVoiceBoard ++ ; - - break; - case VP_PRODUCT : - parts[parameters[0].getElements("position")[0].getText()] = parts[parameters[0].getElements("position")[0].getText()] + addBoardElement(VP_PRODUCT, parameters); - numberVoicePresentation ++ ; - - break; - case "orphanedArchive" : - if(parameters[0].getElements("type")[0].getText() == LC_DISCUSSION) - { - orphanedDiscussion = orphanedDiscussion + addOrphanedElement(parameters); - numberDiscussionRoom ++ ; - } - else if(parameters[0].getElements("type")[0].getText() == LC_MAINLECTURE) - { - orphanedMainLecture = orphanedMainLecture + addOrphanedElement(parameters); - numberMainLectureRoom ++ ; - } - break; - } - } - } - } - } - var display = ""; - display += "<table border='0' align='center' cellpadding='0' cellspacing='0' width=100% >"; - //create the complete list - for(i = start; i < parts.length; i ++ ) - { - if(currentFilter == "all" || currentDiv == i) - { - display += "<tr><td>"; - if(positionMainLecture == i) - parts[i] = parts[i].toString() + orphanedMainLecture; - if(positionDiscussionRoom == i) - parts[i] = parts[i].toString() + orphanedDiscussion; - - parts[i] = parts[i].toString() + closeDivProduct(i); - parts[i] += "<div id='div"+i+"More' class='hide'></div>" - display += parts[i]; - display += "</td></tr>"; - display += "<tr><td><div id='div"+i+"Space'><table><tr><td height=5px></td></tr></table></div></td></tr>" - } - } - display += "</table>"; - return display; -} - - -function openDivProduct(name, cssStyle, value) -{ - var display = ""; - display += "<div id='div"+name+"Title' class='separateProduct'>"; - display += "<table cellpadding='0' cellspacing='0' width='100%'>"; - display += "<tr class='productTitle'>"; - display += "<td class='lineTitle' onclick='javascript:hideDiv(\"div"+name+"\",\""+name+"toggleimgorphaned\")'>"; - display += "<img width=16px height=16px src='pictures/items/category-expanded.png' id='"+name+"toggleimgorphaned' border='0'>"; - display += "</td>"; - display += "<td class='shortShift' align=left width=100%>" + value + "</td>"; - display += "</tr>"; - display += "<tr><td colspan=3>" - display += "<div id='div"+name+"' style='display:block;overflow:hidden'>"; - display += "<table width='100%' cellspacing='0' cellpadding='1' border='0' class='divProduct'>"; - return display -} - - -function addOrphanedElement(parameters) -{ - var display = ""; - display += "<tr id=" + parameters[0].getElements("id")[0].getText() + " height=16px Onclick=\"OneClick('"+parameters[0].getElements("id")[0].getText()+"', '"+LC_PRODUCT+"', 'archive')\" Ondblclick=\"javascript : startHorizon('"+parameters[0].getElements("id")[0].getText()+"', null, null, null, null, 'hzA="+session["authToken"]+"')\" class='archive'>" - display += "<td width=16px align=\"left\"><img src=\"pictures/items/listitem-liveclassroomicon.png\" border=\"0\" /></td>"; - display += "<td width=16px align=\"left\"><img src=\"pictures/items/space-16x16px.png\" border=\"0\" /></td>"; - display += "<td width='300px' <label onmousemove='javascript:ShowToolTip(event,\""+parameters[0].getElements("nameDisplay")[0].getText()+"\",\""+parameters[0].getElements("preview")[0].getText()+"\")' onmouseout='javascript:HideToolTip()'>" + parameters[0].getElements("nameDisplay")[0].getText() + "</label></td>"; - display += "<td class='shiftAvailability' align=right><img width=16px height=16px src=\"pictures/items/listitem-"+parameters[0].getElements("preview")[0].getText()+".png\"/></td>"; - display += "</tr>"; - return display; -} - - -function addBoardElement(type, parameters) -{ - var display = ""; - display += displayBoard(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("rid")[0].getText(), parameters[0].getElements("nid")[0].getText()); - return display; - -} - -function displayBoard(type, availibility, title, rid, nid) -{ - var display = ""; - display += "<tr id='"+rid+"' height=16px Onclick=\"OneClick('"+rid+"', '"+VT_PRODUCT+"', '"+type+"', '"+nid+"')\" Ondblclick=\"javascript : dclick('"+rid+"')\" class='room'>" - display += "<td width=16px align=\"left\"><img src=\"pictures/items/listitem-"+type+"icon.png\" border=\"0\" /></td>"; - display += "<td width=16px align=\"left\" Ondblclick=''></td>"; - display += "<td width='300px' ><label onmousemove='javascript:ShowToolTip(event,\""+title+"\",\""+availibility+"\")' onmouseout='javascript:HideToolTip()'>" + title + "</label></td>"; - display += "<td class='shiftAvailability' align=right><img src=\"pictures/items/listitem-"+availibility+".png\"/></td>"; - display += "</tr>"; - return display; -} - -function addRoomElement(type, parameters) -{ - var display = ""; - var archives; - if(parameters[0].getElements("archives") != "") - archives = parameters[0].getElements("archives"); - if(archives != null ) - { - if(studentView == false || parameters[0].getElements("closedArchive")[0].getText() == "false") - display = displayRoom(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("id")[0].getText(), "pictures/items/listitem-show.png", archives) - else - display = displayRoom(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("id")[0].getText(), "pictures/items/space-16x16px.png", archives) - } - else - { - display = displayRoom(type, parameters[0].getElements("preview")[0].getText(), parameters[0].getElements("nameDisplay")[0].getText(), parameters[0].getElements("id")[0].getText(), "pictures/items/space-16x16px.png", archives) - - } - return display; -} - -function displayRoom(type, availibility, longname, roomId, archive, archives) -{ - - var display = ""; - display += "<tr id=" + roomId + " height=16px class='room'>" - display += "<td Ondblclick=\"dclick('"+roomId+"')\" Onclick=\"OneClick('"+roomId+"', '"+LC_PRODUCT+"', '"+type+"')\" width=16px align=\"left\"><img width=16px height=16px src=\"pictures/items/listitem-liveclassroomicon.png\" border=\"0\" /></td>"; - display += "<td align=\"left\"Onclick=\"javascript : hideArchive('"+type+"', '"+roomId+"hide', 'toggleimg"+roomId+"hide', '"+roomId+"')\" width=16px><img width=16px height=16px src='"+archive+"' id=\"toggleimg"+roomId+"hide\" border=\"0\" /></td>"; - display += "<td Ondblclick=\"dclick('"+roomId+"')\" Onclick=\"OneClick('"+roomId+"', '"+LC_PRODUCT+"', '"+type+"')\" width=300px ><label onmousemove='javascript:ShowToolTip(event,\""+longname+"\",\""+availibility+"\")' onmouseout='javascript:HideToolTip()'>" + longname + "</label></td>"; - display += "<td Ondblclick=\"dclick('"+roomId+"')\" Onclick=\"OneClick('"+roomId+"', '"+LC_PRODUCT+"', '"+type+"')\" class='shiftAvailability' align=right ><img width=16px height=16px src=\"pictures/items/listitem-"+availibility+".png\"/></td>"; - display += "</tr>"; - if(archives != null) - { - display += displayArchive(roomId, archives); - } - return display; -} - -function displayArchive(roomId, archives) -{ - var closeArchive = 0; - var archive = archives[0].getElements("archive"); - if(archive != "") - { - var display = "<tr><td colspan=5 style='padding:0px 0px 0px 0px'><div id='"+roomId+"hide' class='hide' >"; - display += " <table width=100% cellspacing=0 cellpadding=1 border=0>"; - for(var i = 0; i < archive.length; i ++ ) - { - //closed archive not available for student - if(studentView == false || (studentView == true && archive[i].getElements("preview")[0].getText() == "available")) - { - - display += "<tr id=" + archive[i].getElements("id")[0].getText() + " height=16px Onclick=\"OneClick('"+archive[i].getElements("id")[0].getText()+"', '"+LC_PRODUCT+"')\" Ondblclick=\"javascript : startHorizon('"+archive[i].getElements("id")[0].getText()+"', null, null, null, null, 'hzA="+session["authToken"]+"')\" class='archive'>" - display += "<td width=16px align=\"left\"><img width=16px height=16px src=\"pictures/items/listitem-liveclassroomicon.jpg\" border=\"0\" /></td>"; - display += "<td width=16px align=\"left\"><img width=16px height=16px src=\"pictures/items/listitem-subitem.jpg\" border=\"0\" /></td>"; - display += "<td width='300px'><label onmousemove='javascript:ShowToolTip(event,\""+archive[i].getElements("nameDisplay")[0].getText()+"\",\""+archive[i].getElements("preview")[0].getText()+"\")' onmouseout='javascript:HideToolTip()'>" + archive[i].getElements("nameDisplay")[0].getText() + "</label></td>"; - display += "<td class='shiftAvailability' align=right><img width=16px height=16px src=\"pictures/items/listitem-"+archive[i].getElements("preview")[0].getText()+".jpg\"/></td>"; - display += "</tr>"; - } - else - { - closeArchive ++ ; - } - } - display += "</table></div></td></tr>"; - } - numberArchive[roomId] = archive.length - closeArchive; - if(closeArchive == archive.length) - { - // no open archive for student - // changePicture("toggleimg" + roomId + "hide", "pictures/items/listitem-subitem.png"); - - } - return display; - -} - - -function displayProductChoice(elementParameters) -{ - var display = ""; - var informations = elementParameters[0].getElements("productInformations"); - var action = informations[0].getElements("action"); - - var actionJavascript = "" + action[0].getElements("name")[0].getText() + "("; - - var actionParam = action[0].getElements("parameters"); - var actionParameters = actionParam[0].getElements("parameter"); - for(var j = 0; j < actionParameters.length;j ++ ) - { - if(j == (actionParameters.length - 1)) - actionJavascript += "\""+ actionParameters[j].getText()+"\" "; - else - actionJavascript += "\""+ actionParameters[j].getText()+"\","; - } - actionJavascript += ")"; - var height = "75px"; - - - if(currentTool == VT_PRODUCT)//change the heigth to have two product - height = "116px" - display += "<table cellspacing='0' cellpadding='0' align=center width=100% border='0' height=" + height + " >"; - display += "<tr onclick='"+actionJavascript+"'>"; - display += "<td align=center width=130px><img src='"+informations[0].getElements("pictureUrl")[0].getText()+"' /><br><label>" + informations[0].getElements("value")[0].getText() + "</label></td>" - display += "<td>" + informations[0].getElements("description")[0].getText() + "</td>"; - display += "</tr>"; - display += "</table>"; - return display; - -} - -function displaySettings(elementParameters) -{ - - var display = ""; - display += "<table cellspacing='0' cellpadding='0' width='100%' border='0' ><tr><td style='padding:0px 0px 0px 0px'>" - var displayPanelTitle = ""; - var displayPanel = ""; - var panelsSettings = elementParameters[0].getElements("panelsSettings"); - var panelSettings = panelsSettings[0].getElements("panelSettings"); - for(var i = 0; i < panelSettings.length; i ++ ) - { - var panelInformations = panelSettings[i].getElements("panelInformations"); - var panelContent = panelSettings[i].getElements("panelContent"); - displayPanelTitle += DisplayTab(panelInformations); - displayPanel += DisplayDivSettings(panelInformations, panelContent); - } - display += DisplayTabtitle(displayPanelTitle); - display += displayPanel; - return display; -} - -function DisplayTabtitle(alltab) -{ - var display = ""; - display += "<div cellspacing='0' cellpadding='0' id='' class=tabBackground>"; - display += "<table cellspacing='0' cellpadding='0' border='0' width=100%>"; - display += "<tr>"; - display += "<td width='2px' style='border-bottom: #818181 1px solid; height: 18px;'> </td>"; - display += alltab; - display += "<td style='border-bottom: #818181 1px solid; height: 18px;' align='center'> </td>"; - display += "</tr>"; - display += "</table>"; - display += "</div>"; - return display; -} - - -function DisplayTab(panelInformations) -{ - var display = ""; - var context = new String(panelInformations[0].getElements("contextDisplay")[0].getText()); - if(context.indexOf("all") != - 1 || context.indexOf(typeSelect) != - 1) - display += "<td onclick='onTab("+panelInformations[0].getElements("position")[0].getText()+")' id='tab"+panelInformations[0].getElements("position")[0].getText()+"' class='"+panelInformations[0].getElements("styleEnabled")[0].getText()+"' "; - else//the tab is not available for this type of element - display += "<td class='"+panelInformations[0].getElements("styleDisabled")[0].getText()+"' "; - display += "align='center'>"; - display += panelInformations[0].getElements("name")[0].getText() + "</td>"; - display += "<td width='2px' style='border-bottom: #818181 1px solid; height: 18px;'> </td>"; - return display; -} - -function DisplayDivSettings(panelInformations, panelContent) -{ - var display = ""; - display += "<tr><td class=settingsPadding>"; - for(var j = 0; j < panelContent.length; j ++ ) - { - var line = panelContent[j].getElements("panelLine"); - display += "<div style='display:"+panelInformations[j].getElements("display")[0].getText()+";' id='span"+panelInformations[j].getElements("position")[0].getText()+"' class=tab>"; - display += "<table cellspacing='5px' cellpadding='0px' align='center' border='0' width=100%>"; - for(var i = 0; i < line.length; i ++ ) - { - if(line[i].getElements("style")[0].getText() == "hide" ) - { - display +... [truncated message content] |