Revision: 235
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=235&view=rev
Author: trollinger
Date: 2008-01-25 14:56:11 -0800 (Fri, 25 Jan 2008)
Log Message:
-----------
code review and cleaning
Modified Paths:
--------------
branches/team/Thomas/integrations_common/php/common/WimbaLib.php
branches/team/Thomas/integrations_common/php/common/WimbaUI.php
branches/team/Thomas/integrations_common/php/common/WimbaXml.php
branches/team/Thomas/integrations_common/php/common/XmlResource.php
branches/team/Thomas/integrations_common/php/vt/WimbaVoicetoolsAPI.php
Modified: branches/team/Thomas/integrations_common/php/common/WimbaLib.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-25 22:54:52 UTC (rev 234)
+++ branches/team/Thomas/integrations_common/php/common/WimbaLib.php 2008-01-25 22:56:11 UTC (rev 235)
@@ -20,7 +20,8 @@
array("value"=>"studentView","type"=>PARAM_BOOL,"default_value"=>null),
array("value"=>"createWorkflow","type"=>PARAM_BOOL,"default_value"=>null),
array("value"=>"action","type"=>PARAM_ALPHA,"default_value"=>null),
- array("value"=>"resource_id","type"=>PARAM_CLEAN,"default_value"=>"0"),
+ array("value"=>"resource_id","type"=>PARAM_CLEAN,"default_value"=>"0"),
+ array("value"=>"error","type"=>PARAM_CLEAN,"default_value"=>""),
);
}
@@ -54,7 +55,7 @@
return array (
- array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>null),
+ array("value"=>"longname","type"=>PARAM_CLEAN,"default_value"=>""),
array("value"=>"description","type"=>PARAM_CLEAN,"default_value"=>"dd"),
array("value"=>"led","type"=>PARAM_ALPHA,"default_value"=>"instructor"),
@@ -145,6 +146,27 @@
}
+function redirection($url){
+ header('Location:'.$url);
+ exit ();
+}
+function parentRedirection($url){
+ echo '<script> window.top.location="' . $url . '"; </script>';
+ exit ();
+}
+
+function manage_error($errno,$error,$file,$line,$context){
+ global $CFG;
+ if($errno<10){
+
+ redirection('welcome.php?error=rrr');
+ }
+ if($errno<10){
+ //add to log
+ }
+}
+
+
function txt($string){
$result = str_replace("<br />", "" ,$string);
$result = str_replace("<p>", "" ,$result);
Modified: branches/team/Thomas/integrations_common/php/common/WimbaUI.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-25 22:54:52 UTC (rev 234)
+++ branches/team/Thomas/integrations_common/php/common/WimbaUI.php 2008-01-25 22:56:11 UTC (rev 235)
@@ -141,9 +141,6 @@
$this->xml->setError(get_string("error_connection_lc", "liveclassroom"));
}
-
-
-
return $this->xml->getXml();
}
@@ -201,13 +198,13 @@
if (isset ($message) && $message!="") {
$this->xml->addMessage($message);
}
- return $this->xml->getXml();
+
}
function setError($error) {
$this->xml->setError($error);
- return $this->xml->getXml();
+
}
function getListVoiceTools() {
@@ -294,7 +291,6 @@
}
-
/********
* Settings tabs
*/
@@ -385,7 +381,7 @@
else {
$this->xml->createValidationButtonElement(get_string("validationElement_saveAll", "voicetools"), "action", "javascript:submitForm('manageAction.php','update','" . $this->currentObject->getRid() . "')", "setting_Save");
}
- return $this->xml->getXml();
+
}
/*
@@ -1914,5 +1910,11 @@
$this->xml->createLine();
$this->xml->createPanelSettings(get_string("tab_title_features", 'voicetools'), "none", "Features", "tabNoSelected", "all");
}
+
+ function getXmlString()
+ {
+ return $this->xml->getXml();
+ }
+
}
?>
Modified: branches/team/Thomas/integrations_common/php/common/WimbaXml.php
===================================================================
--- branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-25 22:54:52 UTC (rev 234)
+++ branches/team/Thomas/integrations_common/php/common/WimbaXml.php 2008-01-25 22:56:11 UTC (rev 235)
@@ -27,832 +27,665 @@
******************************************************************************/
/* $Id: $ */
-
-
class WimbaXml{
-
-
- var $xmldoc;
- var $part=array(); //contains the different part of the UI
- var $linePart=array();
- var $lineElement=array();
- var $panelLines=array();
- var $validationElements;
- var $Informations;
- var $error=NULL;
-
- function WimbaXml()
- {
- $this->xmldoc = domxml_new_doc("1.0");
-
- //XmlElement root = xml.CreateElement("root");
- //xml.AppendChild(root);
- //windows = xml.CreateElement("windows");
-
-
- }
-
-
- function getXml()
- {
- // XmlElement products = xml.CreateElement("products");
- // Boolean listAvailable = false;
- $root = $this->xmldoc->create_element("root");
- $windows = $this->xmldoc->create_element("windows");
- //xml.AppendChild(root);
- //windows = xml.CreateElement("windows");
-
- if($this->error==NULL){
- $root->append_child($this->Informations);
- foreach ($this->part as $key => $value)
- {
-
- $windows->append_child($this->addWindowsElement($key, $value));
- }
- }else{
-
- $windows->append_child($this->addWindowsElement("error",$this->error));
- }
+ var $xmldoc;
+ var $part=array(); //contains the different part of the UI
+ var $linePart=array();
+ var $lineElement=array();
+ var $panelLines=array();
+ var $validationElements;
+ var $Informations;
+ var $error=NULL;
- $root->append_child($windows);
- $this->xmldoc->append_child($root);
+ function WimbaXml()
+ {
+ $this->xmldoc = domxml_new_doc("1.0");
+ }
- $xmlstring = $this->xmldoc->dump_mem(true); // Xml datas into a string
-
- $finalstring = str_replace("\n", '', $xmlstring);
-
- return $finalstring;
-
-
- }
-
-
- function addFilter($value,$name,$action,$availibility)
- {
- if (!isset($this->part["filterBar"]))//first elemet of the filterBar
+ function getXml()
{
- //creation of the filterbar element
- $this->part["filterBar"]= $this->xmldoc->create_element("filters");
-
+ $root = $this->xmldoc->create_element("root");
+ $windows = $this->xmldoc->create_element("windows");
+
+ if($this->error==NULL)
+ {
+ $root->append_child($this->Informations);
+ foreach ($this->part as $key => $value)
+ {
+ $windows->append_child($this->addWindowsElement($key, $value));
+ }
+ }
+ else
+ {
+ $windows->append_child($this->addWindowsElement("error",$this->error));
+ }
+
+ $root->append_child($windows);
+ $this->xmldoc->append_child($root);
+ $xmlstring = $this->xmldoc->dump_mem(true); // Xml datas into a string
+ $finalstring = str_replace("\n", '', $xmlstring);
+ return $finalstring;
}
- $filter = $this->xmldoc->create_element('filter');
- $filterValue = $this->xmldoc->create_element("value");
- $filterValue->append_child($this->xmldoc->create_text_node($value));
- $filter->append_child($filterValue);
-
- $filterName = $this->xmldoc->create_element("name");
- $filterName->append_child($this->xmldoc->create_text_node($name));
- $filter->append_child($filterName);
-
- $filterValue = $this->xmldoc->create_element("value");
- $filterValue->append_child($this->xmldoc->create_text_node($value));
- $filter->append_child($filterValue);
- $filterAvailibility = $this->xmldoc->create_element("availibility");
- $filterAvailibility->append_child($this->xmldoc->create_text_node($availibility));
- $filter->append_child($filterAvailibility);
-
- $filterAction = $this->xmldoc->create_element("action");
- $filterAction->append_child($this->xmldoc->create_text_node($action));
- $filter->append_child($filterAction);
-
-
- $this->part["filterBar"]->append_child($filter);
-
- }
-
- function addHeaderElement($pictureUrl,$disabled,$isInstructor)
- {
- if (!isset($this->part["headerBar"]))
+ function addFilter($value,$name,$action,$availibility)
{
- $this->part["headerBar"]=$this->xmldoc->create_element("headerBarInformations");
-
+ if (!isset($this->part["filterBar"]))//first elemet of the filterBar
+ {
+ //creation of the filterbar element
+ $this->part["filterBar"]= $this->xmldoc->create_element("filters");
+ }
+
+ $filter = $this->xmldoc->create_element('filter');
+ $filterValue = $this->xmldoc->create_element("value");
+ $filterValue->append_child($this->xmldoc->create_text_node($value));
+ $filter->append_child($filterValue);
+ $filterName = $this->xmldoc->create_element("name");
+ $filterName->append_child($this->xmldoc->create_text_node($name));
+ $filter->append_child($filterName);
+ $filterValue = $this->xmldoc->create_element("value");
+ $filterValue->append_child($this->xmldoc->create_text_node($value));
+ $filter->append_child($filterValue);
+ $filterAvailibility = $this->xmldoc->create_element("availibility");
+ $filterAvailibility->append_child($this->xmldoc->create_text_node($availibility));
+ $filter->append_child($filterAvailibility);
+ $filterAction = $this->xmldoc->create_element("action");
+ $filterAction->append_child($this->xmldoc->create_text_node($action));
+ $filter->append_child($filterAction);
+ $this->part["filterBar"]->append_child($filter);
}
- $picture = $this->xmldoc->create_element("pictureUrl");
- $picture->append_child($this->xmldoc->create_text_node($pictureUrl));
-
- $disable = $this->xmldoc->create_element("disabled");
- $disable->append_child($this->xmldoc->create_text_node($disabled));
-
- $hbinstructorview = $this->xmldoc->create_element("instructorView");
- $hbinstructorview->append_child($this->xmldoc->create_text_node(get_string('instructorview', 'voicetools')));
- $hbstudentview = $this->xmldoc->create_element("studentView");
- $hbstudentview->append_child($this->xmldoc->create_text_node(get_string('studentview', 'voicetools')));
-
- $isInstructorElement = $this->xmldoc->create_element("isInstructor");
- $isInstructorElement->append_child($this->xmldoc->create_text_node($isInstructor));
-
- $this->part["headerBar"]->append_child($picture);
- $this->part["headerBar"]->append_child($hbinstructorview);
- $this->part["headerBar"]->append_child($hbstudentview);
- $this->part["headerBar"]->append_child($disable);
- $this->part["headerBar"]->append_child($isInstructorElement);
- }
-
- function addContextElement($context, $product="",$name="",$style="")
- {
- if (!isset($this->part["contextBar"]))
+ function addHeaderElement($pictureUrl,$disabled,$isInstructor)
{
- $this->part["contextBar"] = $this->xmldoc->create_element("contextBarInformations");
-
+ if (!isset($this->part["headerBar"]))
+ {
+ $this->part["headerBar"]=$this->xmldoc->create_element("headerBarInformations");
+ }
+
+ $picture = $this->xmldoc->create_element("pictureUrl");
+ $picture->append_child($this->xmldoc->create_text_node($pictureUrl));
+ $disable = $this->xmldoc->create_element("disabled");
+ $disable->append_child($this->xmldoc->create_text_node($disabled));
+ $hbinstructorview = $this->xmldoc->create_element("instructorView");
+ $hbinstructorview->append_child($this->xmldoc->create_text_node(get_string('instructorview', 'voicetools')));
+ $hbstudentview = $this->xmldoc->create_element("studentView");
+ $hbstudentview->append_child($this->xmldoc->create_text_node(get_string('studentview', 'voicetools')));
+ $isInstructorElement = $this->xmldoc->create_element("isInstructor");
+ $isInstructorElement->append_child($this->xmldoc->create_text_node($isInstructor));
+ $this->part["headerBar"]->append_child($picture);
+ $this->part["headerBar"]->append_child($hbinstructorview);
+ $this->part["headerBar"]->append_child($hbstudentview);
+ $this->part["headerBar"]->append_child($disable);
+ $this->part["headerBar"]->append_child($isInstructorElement);
}
- $contextBarType = $this->xmldoc->create_element("context");
- $contextBarType->append_child($this->xmldoc->create_text_node($context));
- $contextBarStyle = $this->xmldoc->create_element("style");
- $contextBarStyle->append_child($this->xmldoc->create_text_node($style));
-
- $contextBarProduct = $this->xmldoc->create_element("product");
- $contextBarProduct->append_child($this->xmldoc->create_text_node($product));
-
- $contextBarName = $this->xmldoc->create_element("name");
- $contextBarName->append_child($this->xmldoc->create_text_node($name));
-
- $this->part["contextBar"]->append_child($contextBarType);
- $this->part["contextBar"]->append_child($contextBarProduct);
- $this->part["contextBar"]->append_child($contextBarName);
- $this->part["contextBar"]->append_child($contextBarStyle);
- }
-
-
- function addButtonElement($typeOfUser, $typeOfProduct, $availibility="", $pictureUrl="", $value="", $action="")
- {
- if (!isset($this->part["toolBar"]))
+ function addContextElement($context, $product="",$name="",$style="")
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["contextBar"]))
+ {
+ $this->part["contextBar"] = $this->xmldoc->create_element("contextBarInformations");
+ }
+
+ $contextBarType = $this->xmldoc->create_element("context");
+ $contextBarType->append_child($this->xmldoc->create_text_node($context));
+ $contextBarStyle = $this->xmldoc->create_element("style");
+ $contextBarStyle->append_child($this->xmldoc->create_text_node($style));
+ $contextBarProduct = $this->xmldoc->create_element("product");
+ $contextBarProduct->append_child($this->xmldoc->create_text_node($product));
+ $contextBarName = $this->xmldoc->create_element("name");
+ $contextBarName->append_child($this->xmldoc->create_text_node($name));
+ $this->part["contextBar"]->append_child($contextBarType);
+ $this->part["contextBar"]->append_child($contextBarProduct);
+ $this->part["contextBar"]->append_child($contextBarName);
+ $this->part["contextBar"]->append_child($contextBarStyle);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("button"));
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
- $elementTypeOfProduct = $this->xmldoc->create_element("typeOfProduct");//for student and isntructor or just for instructor
- $elementTypeOfProduct->append_child($this->xmldoc->create_text_node($typeOfProduct));
- $elementPictureUrl = $this->xmldoc->create_element("pictureUrl");
- $elementPictureUrl->append_child($this->xmldoc->create_text_node($pictureUrl));
- $elementValue = $this->xmldoc->create_element("value");
- $elementValue->append_child($this->xmldoc->create_text_node($value));
- $elementAvailibility = $this->xmldoc->create_element("availibility");
- $elementAvailibility->append_child($this->xmldoc->create_text_node($availibility));
- $elementAction = $this->xmldoc->create_element("action");
-
- $elementAction->append_child($this->xmldoc->create_text_node($action));
-
- $element->append_child($elementAvailibility);
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
- $element->append_child($elementTypeOfProduct);
- $element->append_child($elementPictureUrl);
- $element->append_child($elementValue);
- $element->append_child($elementAction);
- $this->part["toolBar"]->append_child($element);
- }
-
- function addSpaceElement($width, $typeOfUser)
- {
- if (!isset($this->part["toolBar"]))
+ function addButtonElement($typeOfUser, $typeOfProduct, $availibility="", $pictureUrl="", $value="", $action="")
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("button"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $elementTypeOfProduct = $this->xmldoc->create_element("typeOfProduct");//for student and isntructor or just for instructor
+ $elementTypeOfProduct->append_child($this->xmldoc->create_text_node($typeOfProduct));
+ $elementPictureUrl = $this->xmldoc->create_element("pictureUrl");
+ $elementPictureUrl->append_child($this->xmldoc->create_text_node($pictureUrl));
+ $elementValue = $this->xmldoc->create_element("value");
+ $elementValue->append_child($this->xmldoc->create_text_node($value));
+ $elementAvailibility = $this->xmldoc->create_element("availibility");
+ $elementAvailibility->append_child($this->xmldoc->create_text_node($availibility));
+ $elementAction = $this->xmldoc->create_element("action");
+ $elementAction->append_child($this->xmldoc->create_text_node($action));
+ $element->append_child($elementAvailibility);
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $element->append_child($elementTypeOfProduct);
+ $element->append_child($elementPictureUrl);
+ $element->append_child($elementValue);
+ $element->append_child($elementAction);
+ $this->part["toolBar"]->append_child($element);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("space"));
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
- $elementWidth = $this->xmldoc->create_element("width");//for student and isntructor or just for instructor
- $elementWidth->append_child($this->xmldoc->create_text_node($width));
-
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
- $element->append_child($elementWidth);
-
-
- $this->part["toolBar"]->append_child($element);
- }
- function addSeparatorElement($typeOfUser)
- {
- if (!isset($this->part["toolBar"]))
+ function addSpaceElement($width, $typeOfUser)
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("space"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $elementWidth = $this->xmldoc->create_element("width");//for student and isntructor or just for instructor
+ $elementWidth->append_child($this->xmldoc->create_text_node($width));
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $element->append_child($elementWidth);
+ $this->part["toolBar"]->append_child($element);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("separator"));
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
-
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
-
-
- $this->part["toolBar"]->append_child($element);
- }
- function addSearchElement($typeOfUser,$browser)
- {
- if (!isset($this->part["toolBar"]))
+ function addSeparatorElement($typeOfUser)
{
- $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
- // index$this->part[part), "toolBar");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("separator"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $this->part["toolBar"]->append_child($element);
}
- $element = $this->xmldoc->create_element("menuElement");
- $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $elementType->append_child($this->xmldoc->create_text_node("search"));
-
- $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
- $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
- $elementBrowser = $this->xmldoc->create_element("browser");//for student and isntructor or just for instructor
- $elementBrowser->append_child($this->xmldoc->create_text_node($browser));
- $element->append_child($elementType);
- $element->append_child($elementTypeOfUser);
- $element->append_child($elementBrowser);
-
-
- $this->part["toolBar"]->append_child($element);
- }
-
-
-
- function addProduct($name, $cssStyle, $value,$type,$list,$sentence)
- {
-
- if (!isset($this->part["list"]))
+ function addSearchElement($typeOfUser,$browser)
{
- $this->part["list"]=$this->xmldoc->create_element("products");
- // index$this->part[part), "listProducts");
+ if (!isset($this->part["toolBar"]))
+ {
+ $this->part["toolBar"]=$this->xmldoc->create_element("menuElements");
+ }
+ $element = $this->xmldoc->create_element("menuElement");
+ $elementType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $elementType->append_child($this->xmldoc->create_text_node("search"));
+ $elementTypeOfUser = $this->xmldoc->create_element("typeOfUser");//for student and isntructor or just for instructor
+ $elementTypeOfUser->append_child($this->xmldoc->create_text_node($typeOfUser));
+ $elementBrowser = $this->xmldoc->create_element("browser");//for student and isntructor or just for instructor
+ $elementBrowser->append_child($this->xmldoc->create_text_node($browser));
+ $element->append_child($elementType);
+ $element->append_child($elementTypeOfUser);
+ $element->append_child($elementBrowser);
+ $this->part["toolBar"]->append_child($element);
}
-
- $product= $this->xmldoc->create_element("product");
-
- $productName= $this->xmldoc->create_element("productName");
- $productName->append_child($this->xmldoc->create_text_node($name));
- $product->append_child($productName);
-
- $productCssStyle = $this->xmldoc->create_element("style");//for student and isntructor or just for instructor
- $productCssStyle->append_child($this->xmldoc->create_text_node($cssStyle));
- $product->append_child($productCssStyle);
-
- $productValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
- $productValue->append_child($this->xmldoc->create_text_node($value));
- $product->append_child($productValue);
-
- $productType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $productType->append_child($this->xmldoc->create_text_node($type));
- $product->append_child($productType);
-
- if(count($list)>0){
-
-
- $listElements = $this->xmldoc->create_element("listElements");
-
- foreach ($list as $key => $value)
+
+ function addProduct($name, $cssStyle, $value,$type,$list,$sentence)
+ {
+ if (!isset($this->part["list"]))
{
- $listElements->append_child($value->getXml($this->xmldoc));
- }
- $product->append_child($listElements);
- }
-
- $productSentence = $this->xmldoc->create_element("NoElementSentence");//for student and isntructor or just for instructor
- $productSentence->append_child($this->xmldoc->create_text_node($sentence));
- $product->append_child($productSentence);
-
- $this->part["list"]->append_child($product);
-
- }
-
- function createMessageElement($type, $value)
- {
-
- $message = $this->xmldoc->create_element("message");
- $messageType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
- $messageType->append_child($this->xmldoc->create_text_node($type));
- $messageValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
- $messageValue->append_child($this->xmldoc->create_text_node($value));
- $message->append_child($messageType);
- $message->append_child($messageValue);
- return $message;
- }
-
-
-
-
-
- function CreateInformationElement($timeOfLoad, $firstName, $lastName, $email, $role, $courseId, $signature, $authToken,$lc,$vt,$picturesToLoad=null)
- {
-
- $this->Informations = $this->xmldoc->create_element("information");
- $etimeOfLoad = $this->xmldoc->create_element("timeOfLoad");
- $etimeOfLoad->append_child($this->xmldoc->create_text_node($timeOfLoad));
-
- $efirstName = $this->xmldoc->create_element("firstName");
- $efirstName->append_child($this->xmldoc->create_text_node(rawurlencode($firstName)));
- $elastName = $this->xmldoc->create_element("lastName");
- $elastName->append_child($this->xmldoc->create_text_node(rawurlencode($lastName)));
- $eemail = $this->xmldoc->create_element("email");
- $eemail->append_child($this->xmldoc->create_text_node(rawurlencode($email)));
- $erole = $this->xmldoc->create_element("role");
- $erole->append_child($this->xmldoc->create_text_node(rawurlencode($role)));
-
- $ecourseId = $this->xmldoc->create_element("courseId");
- $ecourseId->append_child($this->xmldoc->create_text_node(rawurlencode($courseId)));
- $esignature = $this->xmldoc->create_element("signature");
- $esignature->append_child($this->xmldoc->create_text_node(rawurlencode($signature)));
- $eauthToken = $this->xmldoc->create_element("authToken");
- $eauthToken->append_child($this->xmldoc->create_text_node($authToken));
- $vtUrl = $this->xmldoc->create_element("vtServerUrl");
- $vtUrl->append_child($this->xmldoc->create_text_node($vt));
- $lcUrl = $this->xmldoc->create_element("lcServerUrl");
- $lcUrl->append_child($this->xmldoc->create_text_node($lc));
- if($picturesToLoad!=null){
- $epicturesToLoad = $this->xmldoc->create_element("picturesToLoad");
- $epicturesToLoad->append_child($this->xmldoc->create_text_node($picturesToLoad));
- $this->Informations->append_child($epicturesToLoad);
+ $this->part["list"]=$this->xmldoc->create_element("products");
+ }
+
+ $product= $this->xmldoc->create_element("product");
+ $productName= $this->xmldoc->create_element("productName");
+ $productName->append_child($this->xmldoc->create_text_node($name));
+ $product->append_child($productName);
+ $productCssStyle = $this->xmldoc->create_element("style");//for student and isntructor or just for instructor
+ $productCssStyle->append_child($this->xmldoc->create_text_node($cssStyle));
+ $product->append_child($productCssStyle);
+ $productValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
+ $productValue->append_child($this->xmldoc->create_text_node($value));
+ $product->append_child($productValue);
+ $productType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $productType->append_child($this->xmldoc->create_text_node($type));
+ $product->append_child($productType);
+ if(count($list)>0)
+ {
+ $listElements = $this->xmldoc->create_element("listElements");
+ foreach ($list as $key => $value)
+ {
+ $listElements->append_child($value->getXml($this->xmldoc));
+ }
+ $product->append_child($listElements);
+ }
+ $productSentence = $this->xmldoc->create_element("NoElementSentence");//for student and isntructor or just for instructor
+ $productSentence->append_child($this->xmldoc->create_text_node($sentence));
+ $product->append_child($productSentence);
+ $this->part["list"]->append_child($product);
}
- $this->Informations->append_child($etimeOfLoad);
- $this->Informations->append_child($efirstName);
- $this->Informations->append_child($elastName);
- $this->Informations->append_child($erole);
- $this->Informations->append_child($ecourseId);
- $this->Informations->append_child($esignature);
- $this->Informations->append_child($eauthToken);
- $this->Informations->append_child($eemail);
- $this->Informations->append_child($vtUrl);
- $this->Informations->append_child($lcUrl);
-
- //xml.DocumentElement->append_child(Informations);
- }
-
-
- function addWindowsElement($type, $elementParameters)
- {
-
- $windowsElement = $this->xmldoc->create_element("windowsElement");
- $windowsElementType = $this->xmldoc->create_element("type");
- $windowsElementType->append_child($this->xmldoc->create_text_node($type));
-
- $windowsElement->append_child($windowsElementType);
- $windowsElement->append_child($elementParameters);
-
- return $windowsElement;
-
- }
-
-
-
-
- function addProductChoice($pictureUrl,$value,$description,$action){
-
- if (!isset($this->part["productChoice"]))
+ function createMessageElement($type, $value)
{
- $this->part["productChoice"]=$this->xmldoc->create_element("products");
- // index$this->part[part), "listProducts");
+ $message = $this->xmldoc->create_element("message");
+ $messageType = $this->xmldoc->create_element("type");//for student and isntructor or just for instructor
+ $messageType->append_child($this->xmldoc->create_text_node($type));
+ $messageValue = $this->xmldoc->create_element("value");//for student and isntructor or just for instructor
+ $messageValue->append_child($this->xmldoc->create_text_node($value));
+ $message->append_child($messageType);
+ $message->append_child($messageValue);
+ return $message;
}
-
- $product = $this->xmldoc->create_element("product");
-
- $productPictureUrl = $this->xmldoc->create_element('pictureUrl');
- $productPictureUrl->append_child( $this->xmldoc->create_text_node($pictureUrl));
- $product->append_child($productPictureUrl);
-
- $productValue = $this->xmldoc->create_element('value');
- $productValue->append_child($this->xmldoc->create_text_node($value));
- $product->append_child($productValue);
-
- $productDescription = $this->xmldoc->create_element('description');
- $productDescription->append_child($this->xmldoc->create_text_node($description));
- $product->append_child($productDescription);
-
- $productAction = $this->xmldoc->create_element("action");
- $productAction->append_child($this->xmldoc->create_text_node($action));
- $product->append_child($productAction);
-
-
- $this->part["productChoice"]->append_child($product);
-
-
- }
- /*
- *
- *Use to create the line corresponding to a TR
- *
- */
- function addInputElement($type,$parameters=NULL)
- {
- $this->addSimpleLineElement($type,"",$parameters);
- }
-function addTextAreaElement($type,$parameters=NULL)
- {
-
-
- $this->addSimpleLineElement($type,"",$parameters);
- }
-
- function addSimpleLineElement($type,$display="",$parameters=NULL)
- {
-
-
- $element = $this->xmldoc->create_element("lineElement");
- $elementType = $this->xmldoc->create_element("type");
- $elementType->append_child($this->xmldoc->create_text_node($type));
- $element->append_child($elementType);
- if($display!=""){
- $elementDisplay = $this->xmldoc->create_element("display");
- $elementDisplay->append_child($this->xmldoc->create_text_node($display));
- $element->append_child( $elementDisplay);
- }
-
-
- if($parameters !=NULL){
- $elementParameters = $this->xmldoc->create_element("parameters");
- foreach ($parameters as $key => $value)
- {
- $parameter = $this->xmldoc->create_element("parameter");
- $parameterName = $this->xmldoc->create_element("name");
- $parameterName->append_child($this->xmldoc->create_text_node($key));
- $parameterValue = $this->xmldoc->create_element("value");
- if (isset($value)){
- $parameterValue->append_child($this->xmldoc->create_text_node($value));
- }
- $parameter->append_child($parameterName);
- $parameter->append_child($parameterValue);
- $elementParameters->append_child($parameter);
-
- }
- $element->append_child($elementParameters);
- }
-
-
- $this->lineElement[]=$element;
-
- }
-
- function addDivLineElement($type, $displayContext,$parameters)
- {
-
- $element = $this->xmldoc->create_element("lineElement");
- $elementType = $this->xmldoc->create_element("type");
- $elementType->append_child($this->xmldoc->create_text_node("div"));
- $elementDisplayContext = $this->xmldoc->create_element("displayContext");
- $elementDisplayContext->append_child($this->xmldoc->create_text_node($displayContext));
- $elementParameters = $this->xmldoc->create_element("parameters");
- for ($i = 0; $i < count($parameters);$i++)
+
+ function CreateInformationElement($timeOfLoad, $firstName, $lastName, $email, $role, $courseId, $signature, $authToken,$lc,$vt,$picturesToLoad=null)
{
- $parameter = $this->xmldoc->create_element("parameter");
- $parameterName = $this->xmldoc->create_element("name");
- $parameterName->append_child($this->xmldoc->create_text_node($parameters[$i]));
- $parameterValue = $this->xmldoc->create_element("value");
- if ($parameters.GetByIndex(i) != NULL){
- $parameterValue->append_child($this->xmldoc->create_text_node($parameters[$i]));
- }
- $parameter->append_child($parameterName);
- $parameter->append_child($parameterValue);
- $elementParameters->append_child($parameter);
-
+ $this->Informations = $this->xmldoc->create_element("information");
+ $etimeOfLoad = $this->xmldoc->create_element("timeOfLoad");
+ $etimeOfLoad->append_child($this->xmldoc->create_text_node($timeOfLoad));
+ $efirstName = $this->xmldoc->create_element("firstName");
+ $efirstName->append_child($this->xmldoc->create_text_node(rawurlencode($firstName)));
+ $elastName = $this->xmldoc->create_element("lastName");
+ $elastName->append_child($this->xmldoc->create_text_node(rawurlencode($lastName)));
+ $eemail = $this->xmldoc->create_element("email");
+ $eemail->append_child($this->xmldoc->create_text_node(rawurlencode($email)));
+ $erole = $this->xmldoc->create_element("role");
+ $erole->append_child($this->xmldoc->create_text_node(rawurlencode($role)));
+ $ecourseId = $this->xmldoc->create_element("courseId");
+ $ecourseId->append_child($this->xmldoc->create_text_node(rawurlencode($courseId)));
+ $esignature = $this->xmldoc->create_element("signature");
+ $esignature->append_child($this->xmldoc->create_text_node(rawurlencode($signature)));
+ $eauthToken = $this->xmldoc->create_element("authToken");
+ $eauthToken->append_child($this->xmldoc->create_text_node($authToken));
+ $vtUrl = $this->xmldoc->create_element("vtServerUrl");
+ $vtUrl->append_child($this->xmldoc->create_text_node($vt));
+ $lcUrl = $this->xmldoc->create_element("lcServerUrl");
+ $lcUrl->append_child($this->xmldoc->create_text_node($lc));
+ if($picturesToLoad!=null)
+ {
+ $epicturesToLoad = $this->xmldoc->create_element("picturesToLoad");
+ $epicturesToLoad->append_child($this->xmldoc->create_text_node($picturesToLoad));
+ $this->Informations->append_child($epicturesToLoad);
+ }
+ $this->Informations->append_child($etimeOfLoad);
+ $this->Informations->append_child($efirstName);
+ $this->Informations->append_child($elastName);
+ $this->Informations->append_child($erole);
+ $this->Informations->append_child($ecourseId);
+ $this->Informations->append_child($esignature);
+ $this->Informations->append_child($eauthToken);
+ $this->Informations->append_child($eemail);
+ $this->Informations->append_child($vtUrl);
+ $this->Informations->append_child($lcUrl);
}
- $element->append_child($elementType);
- $element->append_child($elementDisplayContext);
-
- $element->append_child($elementParameters);
- $lineElement[]=$element;
-
- }
-
-
-
- function createOptionElement($name,$id, $listOptions,$disabled="")
- {
-
- $element = $this->xmldoc->create_element("lineElement");
- $elementType = $this->xmldoc->create_element("type");
- $elementType->append_child($this->xmldoc->create_text_node("select"));
-
- $elementDisplayContext = $this->xmldoc->create_element("displayContext");
- $elementDisplayContext->append_child($this->xmldoc->create_text_node("all"));
-
- $elementName = $this->xmldoc->create_element("name");
- $elementName->append_child($this->xmldoc->create_text_node($name));
- if($disabled!=""){
- $elementDisabled = $this->xmldoc->create_element("disabled");
- $elementDisabled->append_child($this->xmldoc->create_text_node($disabled));
- $element->append_child($elementDisabled);
- }
- $elementId = $this->xmldoc->create_element("id");
- $elementId->append_child($this->xmldoc->create_text_node($id));
-
- $options=$this->xmldoc->create_element("options");
- for ($j = 0; $j < count($listOptions); $j++){
-
-
-
- $parameters=$listOptions[$j];
- $option=$this->xmldoc->create_element("option");
-
- foreach ($parameters as $key=>$value)
- {
- $optionParameter = $this->xmldoc->create_element($key);
- $optionParameter->append_child($this->xmldoc->create_text_node($value));
- $option->append_child($optionParameter);
- }
-
- $options->append_child($option);
-
-
-
- }
- $element->append_child($elementType);
- $element->append_child($elementDisplayContext);
- $element->append_child($elementName);
- $element->append_child($elementId);
- $element->append_child($options);
- $this->lineElement[]=$element;
-
- }
-
-
- function createValidationButtonElement($value,$style,$action,$id)
- {
- if (!isset($this->part["validationBar"]))
+ function addWindowsElement($type, $elementParameters)
{
- $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
- // index$this->part[part), "validationBar");
+ $windowsElement = $this->xmldoc->create_element("windowsElement");
+ $windowsElementType = $this->xmldoc->create_element("type");
+ $windowsElementType->append_child($this->xmldoc->create_text_node($type));
+ $windowsElement->append_child($windowsElementType);
+ $windowsElement->append_child($elementParameters);
+ return $windowsElement;
}
-
- $element=$this->xmldoc->create_element("validationButton");
- $elementaction = $this->xmldoc->create_element("action");
- $elementaction->append_child($this->xmldoc->create_text_node($action));
+ function addProductChoice($pictureUrl,$value,$description,$action){
- $elementstyle = $this->xmldoc->create_element("style");
- $elementstyle->append_child($this->xmldoc->create_text_node($style));
+ if (!isset($this->part["productChoice"]))
+ {
+ $this->part["productChoice"]=$this->xmldoc->create_element("products");
+ }
+
+ $product = $this->xmldoc->create_element("product");
+ $productPictureUrl = $this->xmldoc->create_element('pictureUrl');
+ $productPictureUrl->append_child( $this->xmldoc->create_text_node($pictureUrl));
+ $product->append_child($productPictureUrl);
+ $productValue = $this->xmldoc->create_element('value');
+ $productValue->append_child($this->xmldoc->create_text_node($value));
+ $product->append_child($productValue);
+ $productDescription = $this->xmldoc->create_element('description');
+ $productDescription->append_child($this->xmldoc->create_text_node($description));
+ $product->append_child($productDescription);
+ $productAction = $this->xmldoc->create_element("action");
+ $productAction->append_child($this->xmldoc->create_text_node($action));
+ $product->append_child($productAction);
+ $this->part["productChoice"]->append_child($product);
+ }
- $elementvalue = $this->xmldoc->create_element("value");
- $elementvalue->append_child($this->xmldoc->create_text_node($value));
-
- $elementid = $this->xmldoc->create_element("id");
- $elementid->append_child($this->xmldoc->create_text_node($id));
-
- $element->append_child($elementaction);
- $element->append_child($elementstyle);
- $element->append_child($elementvalue);
- $element->append_child($elementid);
-
- $this->part["validationBar"]->append_child($element);
- }
-
- function createValidationCommentElement($parameters)
- {
- if (!isset($this->part["validationBar"]))
+ /*
+ *
+ *Use to create the line corresponding to a TR
+ *
+ */
+ function addInputElement($type,$parameters=NULL)
{
- $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
- // index$this->part[part), "validationBar");
+ $this->addSimpleLineElement($type,"",$parameters);
}
- $element = $this->xmldoc->create_element("validationElement");
- $name = $this->xmldoc->create_element("type");
- $name->append_child($this->xmldoc->create_text_node("validationComment"));
- foreach ($parameters as $key => $value)
+ function addTextAreaElement($type,$parameters=NULL)
{
- $parameterName = $this->xmldoc->create_element($key);
- $parameterName->append_child($this->xmldoc->create_text_node($value));
- $element->append_child($parameterName);
+ $this->addSimpleLineElement($type,"",$parameters);
}
- $element->append_child($name);
-
- $this->part["validationBar"]->append_child($element);
- }
-
-
- /*
- *
- * Line
- *
- */
- function createLine($style="", $id="")
- {
-
- $line = $this->xmldoc->create_element("panelLine");
-
- $lineStyle = $this->xmldoc->create_element("style");
- $lineStyle->append_child($this->xmldoc->create_text_node($style));
- $line->append_child($lineStyle);
- //necessary for hidden div
- $lineId = $this->xmldoc->create_element("id");
- $lineId->append_child($this->xmldoc->create_text_node($id));
- $line->append_child($lineId);
-
- for ($i = 0; $i < count($this->linePart);$i++)
+
+ function addSimpleLineElement($type,$display="",$parameters=NULL)
{
-
- $line->append_child($this->linePart[$i]);
+ $element = $this->xmldoc->create_element("lineElement");
+ $elementType = $this->xmldoc->create_element("type");
+ $elementType->append_child($this->xmldoc->create_text_node($type));
+ $element->append_child($elementType);
+ if($display!="")
+ {
+ $elementDisplay = $this->xmldoc->create_element("display");
+ $elementDisplay->append_child($this->xmldoc->create_text_node($display));
+ $element->append_child( $elementDisplay);
+ }
+ if($parameters !=NULL)
+ {
+ $elementParameters = $this->xmldoc->create_element("parameters");
+ foreach ($parameters as $key => $value)
+ {
+ $parameter = $this->xmldoc->create_element("parameter");
+ $parameterName = $this->xmldoc->create_element("name");
+ $parameterName->append_child($this->xmldoc->create_text_node($key));
+ $parameterValue = $this->xmldoc->create_element("value");
+ if (isset($value))
+ {
+ $parameterValue->append_child($this->xmldoc->create_text_node($value));
+ }
+ $parameter->append_child($parameterName);
+ $parameter->append_child($parameterValue);
+ $elementParameters->append_child($parameter);
+ }
+ $element->append_child($elementParameters);
+ }
+ $this->lineElement[]=$element;
}
- $this->panelLines[]=$line;
- $this->linePart=array();
- }
-
-
-
-
- function createLinePart($parameters=NULL)
- {
- $panelLinePart = $this->xmldoc->create_element("panelLinePart");
- if(isset($parameters["style"])){
- $elementStyle = $this->xmldoc->create_element("style");
- $elementStyle->append_child($this->xmldoc->create_text_node($parameters["style"]));
- $panelLinePart->append_child($elementStyle);
+
+ function addDivLineElement($type, $displayContext,$parameters)
+ {
+ $element = $this->xmldoc->create_element("lineElement");
+ $elementType = $this->xmldoc->create_element("type");
+ $elementType->append_child($this->xmldoc->create_text_node("div"));
+ $elementDisplayContext = $this->xmldoc->create_element("displayContext");
+ $elementDisplayContext->append_child($this->xmldoc->create_text_node($displayContext));
+ $elementParameters = $this->xmldoc->create_element("parameters");
+ for ($i = 0; $i < count($parameters);$i++)
+ {
+ $parameter = $this->xmldoc->create_element("parameter");
+ $parameterName = $this->xmldoc->create_element("name");
+ $parameterName->append_child($this->xmldoc->create_text_node($parameters[$i]));
+ $parameterValue = $this->xmldoc->create_element("value");
+ if ($parameters.GetByIndex(i) != NULL){
+ $parameterValue->append_child($this->xmldoc->create_text_node($parameters[$i]));
+ }
+ $parameter->append_child($parameterName);
+ $parameter->append_child($parameterValue);
+ $elementParameters->append_child($parameter);
+ }
+ $element->append_child($elementType);
+ $element->append_child($elementDisplayContext);
+ $element->append_child($elementParameters);
+ $lineElement[]=$element;
}
- if(isset($parameters["align"])){
- $elementAlign = $this->xmldoc->create_element("align");
- $elementAlign->append_child($this->xmldoc->create_text_node($parameters["align"]));
- $panelLinePart->append_child($elementAlign);
+
+ function createOptionElement($name,$id, $listOptions,$disabled="")
+ {
+ $element = $this->xmldoc->create_element("lineElement");
+ $elementType = $this->xmldoc->create_element("type");
+ $elementType->append_child($this->xmldoc->create_text_node("select"));
+ $elementDisplayContext = $this->xmldoc->create_element("displayContext");
+ $elementDisplayContext->append_child($this->xmldoc->create_text_node("all"));
+ $elementName = $this->xmldoc->create_element("name");
+ $elementName->append_child($this->xmldoc->create_text_node($name));
+ if($disabled!=""){
+ $elementDisabled = $this->xmldoc->create_element("disabled");
+ $elementDisabled->append_child($this->xmldoc->create_text_node($disabled));
+ $element->append_child($elementDisabled);
+ }
+ $elementId = $this->xmldoc->create_element("id");
+ $elementId->append_child($this->xmldoc->create_text_node($id));
+ $options=$this->xmldoc->create_element("options");
+ for ($j = 0; $j < count($listOptions); $j++){
+ $parameters=$listOptions[$j];
+ $option=$this->xmldoc->create_element("option");
+ foreach ($parameters as $key=>$value)
+ {
+ $optionParameter = $this->xmldoc->create_element($key);
+ $optionParameter->append_child($this->xmldoc->create_text_node($value));
+ $option->append_child($optionParameter);
+ }
+ $options->append_child($option);
+ }
+ $element->append_child($elementType);
+ $element->append_child($elementDisplayContext);
+ $element->append_child($elementName);
+ $element->append_child($elementId);
+ $element->append_child($options);
+ $this->lineElement[]=$element;
}
- if(isset($parameters["colspan"])){
- $elementColpsan = $this->xmldoc->create_element("colspan");
- $elementColpsan->append_child($this->xmldoc->create_text_node($parameters["colspan"]));
- $panelLinePart->append_child($elementColpsan);
+
+
+ function createValidationButtonElement($value,$style,$action,$id)
+ {
+ if (!isset($this->part["validationBar"]))
+ {
+ $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
+ }
+ $element=$this->xmldoc->create_element("validationButton");
+ $elementaction = $this->xmldoc->create_element("action");
+ $elementaction->append_child($this->xmldoc->create_text_node($action));
+ $elementstyle = $this->xmldoc->create_element("style");
+ $elementstyle->append_child($this->xmldoc->create_text_node($style));
+ $elementvalue = $this->xmldoc->create_element("value");
+ $elementvalue->append_child($this->xmldoc->create_text_node($value));
+ $elementid = $this->xmldoc->create_element("id");
+ $elementid->append_child($this->xmldoc->create_text_node($id));
+ $element->append_child($elementaction);
+ $element->append_child($elementstyle);
+ $element->append_child($elementvalue);
+ $element->append_child($elementid);
+ $this->part["validationBar"]->append_child($element);
}
- if(isset($parameters["id"])){
- $elementId = $this->xmldoc->create_element("id");
- $elementId->append_child($this->xmldoc->create_text_node($parameters["id"]));
- $panelLinePart->append_child($elementId);
- }
- if(isset($parameters["context"])){
- $elementContext = $this->xmldoc->create_element("context");
- $elementContext->append_child($this->xmldoc->create_text_node($parameters["context"]));
- $panelLinePart->append_child($elementContext);
- }
- for ($j = 0; $j < count($this->lineElement); $j++)
+
+ function createValidationCommentElement($parameters)
{
- $panelLinePart->append_child($this->lineElement[$j]);
+ if (!isset($this->part["validationBar"]))
+ {
+ $this->part["validationBar"]=$this->xmldoc->create_element("validationElements");
+ }
+ $element = $this->xmldoc->create_element("validationElement");
+ $name = $this->xmldoc->create_element("type");
+ $name->append_child($this->xmldoc->create_text_node("validationComment"));
+ foreach ($parameters as $key => $value)
+ {
+ $parameterName = $this->xmldoc->create_element($key);
+ $parameterName->append_child($this->xmldoc->create_text_node($value));
+ $element->append_child($parameterName);
+ }
+ $element->append_child($name);
+ $this->part["validationBar"]->append_child($element);
}
-
- $this->linePart[]=$panelLinePart;
- $this->lineElement=array();//clear the tab lineElement
- }
-
-
-
-
-
- function createPanelSettings($name, $display, $id,$style, $contextDisplay,$additionalFunction="")
- {
- if (!isset($this->part["tabs"]))
+ /*
+ *
+ * Line
+ *
+ */
+ function createLine($style="", $id="")
{
- $this->part["tabs"]=$this->xmldoc->create_element("tabsInformations");
-
+ $line = $this->xmldoc->create_element("panelLine");
+ $lineStyle = $this->xmldoc->create_element("style");
+ $lineStyle->append_child($this->xmldoc->create_text_node($style));
+ $line->append_child($lineStyle);
+ //necessary for hidden div
+ $lineId = $this->xmldoc->create_element("id");
+ $lineId->append_child($this->xmldoc->create_text_node($id));
+ $line->append_child($lineId);
+
+ for ($i = 0; $i < count($this->linePart);$i++)
+ {
+ $line->append_child($this->linePart[$i]);
+ }
+ $this->panelLines[]=$line;
+ $this->linePart=array();
}
- if (!isset($this->part["tabsContent"]))
+
+ function createLinePart($parameters=NULL)
{
- $this->part["tabsContent"]=$this->xmldoc->create_element("tabsContent");
-
+ $panelLinePart = $this->xmldoc->create_element("panelLinePart");
+ if(isset($parameters["style"]))
+ {
+ $elementStyle = $this->xmldoc->create_element("style");
+ $elementStyle->append_child($this->xmldoc->create_text_node($parameters["style"]));
+ $panelLinePart->append_child($elementStyle);
+ }
+ if(isset($parameters["align"]))
+ {
+ $elementAlign = $this->xmldoc->create_element("align");
+ $elementAlign->append_child($this->xmldoc->create_text_node($parameters["align"]));
+ $panelLinePart->append_child($elementAlign);
+ }
+ if(isset($parameters["colspan"]))
+ {
+ $elementColpsan = $this->xmldoc->create_element("colspan");
+ $elementColpsan->append_child($this->xmldoc->create_text_node($parameters["colspan"]));
+ $panelLinePart->append_child($elementColpsan);
+ }
+ if(isset($parameters["id"]))
+ {
+ $elementId = $this->xmldoc->create_element("id");
+ $elementId->append_child($this->xmldoc->create_text_node($parameters["id"]));
+ $panelLinePart->append_child($elementId);
+ }
+ if(isset($parameters["context"]))
+ {
+ $elementContext = $this->xmldoc->create_element("context");
+ $elementContext->append_child($this->xmldoc->create_text_node($parameters["context"]));
+ $panelLinePart->append_child($elementContext);
+ }
+ for ($j = 0; $j < count($this->lineElement); $j++)
+ {
+ $panelLinePart->append_child($this->lineElement[$j]);
+ }
+ $this->linePart[]=$panelLinePart;
+ $this->lineElement=array();//clear the tab lineElement
}
- $panelSettings = $this->xmldoc->create_element("tabInformation");
- $divName = $this->xmldoc->create_element("name");
- $divName->append_child($this->xmldoc->create_text_node($name));
- $divDisplay = $this->xmldoc->create_element("display");
- $divDisplay->append_child($this->xmldoc->create_text_node($display));
- $divId = $this->xmldoc->create_element("id");
- $divId->append_child($this->xmldoc->create_text_node($id));
- $divStyle = $this->xmldoc->create_element("style");
- $divStyle->append_child($this->xmldoc->create_text_node($style));
- $divContextDisplay = $this->xmldoc->create_element("contextDisplay");
- $divContextDisplay->append_child($this->xmldoc->create_text_node($contextDisplay));
- if($additionalFunction!=""){
- $divContextAdditionalFunction = $this->xmldoc->create_element("additionalFunction");
- $divContextAdditionalFunction->append_child($this->xmldoc->create_text_node($additionalFunction));
- $panelSettings->append_child($divContextAdditionalFunction);
-
+ function createPanelSettings($name, $display, $id,$style, $contextDisplay,$additionalFunction="")
+ {
+ if (!isset($this->part["tabs"]))
+ {
+ $this->part["tabs"]=$this->xmldoc->create_element("tabsInformations");
+ }
+ if (!isset($this->part["tabsContent"]))
+ {
+ $this->part["tabsContent"]=$this->xmldoc->create_element("tabsContent");
+ }
+ $panelSettings = $this->xmldoc->create_element("tabInformation");
+ $divName = $this->xmldoc->create_element("name");
+ $divName->append_child($this->xmldoc->create_text_node($name));
+ $divDisplay = $this->xmldoc->create_element("display");
+ $divDisplay->append_child($this->xmldoc->create_text_node($display));
+ $divId = $this->xmldoc->create_element("id");
+ $divId->append_child($this->xmldoc->create_text_node($id));
+ $divStyle = $this->xmldoc->create_element("style");
+ $divStyle->append_child($this->xmldoc->create_text_node($style));
+ $divContextDisplay = $this->xmldoc->create_element("contextDisplay");
+ $divContextDisplay->append_child($this->xmldoc->create_text_node($contextDisplay));
+ if($additionalFunction!=""){
+ $divContextAdditionalFunction = $this->xmldoc->create_element("additionalFunction");
+ $divContextAdditionalFunction->append_child($this->xmldoc->create_text_node($additionalFunction));
+ $panelSettings->append_child($divContextAdditionalFunction);
+ }
+ $panelSettings->append_child($divName);
+ $panelSettings->append_child($divDisplay);
+ $panelSettings->append_child($divStyle);
+ $panelSettings->append_child($divId);
+ $panelSettings->append_child($divContextDisplay);
+ $panelContent = $this->xmldoc->create_element("tabContent");
+ $panelContent->append_child($divDisplay->clone_node(true));
+ $panelContent->append_child($divId->clone_node(true));
+
+ for ($i = 0; $i < count($this->panelLines);$i++)
+ {
+ $panelContent->append_child($this->panelLines[$i]);
+ }
+ $this->panelLines=array();
+ $this->part["tabs"]->append_child($panelSettings);
+ $this->part["tabsContent"]->append_child($panelContent);
}
- $panelSettings->append_child($divName);
- $panelSettings->append_child($divDisplay);
- $panelSettings->append_child($divStyle);
- $panelSettings->append_child($divId);
- $panelSettings->append_child($divContextDisplay);
-
- $panelContent = $this->xmldoc->create_element("tabContent");
- $panelContent->append_child($divDi...
[truncated message content] |