Thread: [Hw4mdl-svn] SF.net SVN: hw4mdl: [100] trunk/moodle/mod/voicetool
Brought to you by:
jhlinder,
trollinger
|
From: <sh...@us...> - 2006-11-24 15:32:00
|
Revision: 100
http://svn.sourceforge.net/hw4mdl/?rev=100&view=rev
Author: shazan
Date: 2006-11-24 07:31:35 -0800 (Fri, 24 Nov 2006)
Log Message:
-----------
Add new files to generate the list of Voice Tools and to choose the different types of products
Modified Paths:
--------------
trunk/moodle/mod/voicetool/index.php
trunk/moodle/mod/voicetool/lib.php
trunk/moodle/mod/voicetool/mod.html
trunk/moodle/mod/voicetool/view.php
trunk/moodle/mod/voicetool/voicetoolapi.php
Added Paths:
-----------
trunk/moodle/mod/voicetool/displayChoicePage.php
trunk/moodle/mod/voicetool/generateListPanel.php
trunk/moodle/mod/voicetool/welcome.php
Added: trunk/moodle/mod/voicetool/displayChoicePage.php
===================================================================
--- trunk/moodle/mod/voicetool/displayChoicePage.php (rev 0)
+++ trunk/moodle/mod/voicetool/displayChoicePage.php 2006-11-24 15:31:35 UTC (rev 100)
@@ -0,0 +1,175 @@
+<?PHP
+
+/******************************************************************************
+ * *
+ * Copyright (c) 1999-2006 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: Hazan Samy *
+ * *
+ * Date: October 2006 *
+ * *
+ ******************************************************************************/
+
+/* $Id$ */
+
+
+ require_once("../../config.php");
+ require_once("lib.php");
+ // require_once("api.php");
+
+ // Variables needed
+ global $CFG;
+
+ if(empty($_POST)){
+ $params = $_GET;
+ }
+ else $params = $_POST;
+
+
+ //print_r($params);
+ $courseid = $params['enc_course_id'];
+ add_to_log("", "voicetool", "view", "test", $courseid);
+ // echo $courseid;
+/*
+
+ if(isteacher($courseid, $USER->id) ) {
+ $userid = liveclassroom_api_get_teacher_user_id($courseid);
+ $isteacher = 1;
+
+ }
+ else if (isstudent($courseid) ) {
+
+ $userid = liveclassroom_api_get_student_user_id($courseid);
+ $isteacher = 0;
+
+ }
+
+ if (!liveclassroom_init_session($params)) {
+ error("ExpiredSessionException");
+ }
+*/
+
+ $xmldoc = new DomDocument();
+
+ $root = $xmldoc->createElement('root');
+
+ $root->appendChild(voicetool_get_session_params($xmldoc,$params));
+
+ $windows = $xmldoc->createElement('windows');
+
+ //HEADER BAR
+ $windows->appendChild(voicetool_create_headerbar($xmldoc));
+
+ // NEW BOARD
+ $productChoice = $xmldoc->createElement('windowsElement');
+ $productChoicetype = $xmldoc->createElement('type');
+ $productChoicetype->appendChild($xmldoc->createTextNode("productChoice"));
+ $productChoice->appendChild($productChoicetype);
+
+ $productChoiceElementParameters = $xmldoc->createElement("windowsElementParameters");
+
+ $productInfo = $xmldoc->createElement('productInformations');
+
+ $action = $xmldoc->createElement('action');
+
+ $actionName = $xmldoc->createElement('name');
+ $actionName->appendChild($xmldoc->createTextNode("gaga.php"));
+ $action->appendChild($actionName);
+
+ $productParameters = $xmldoc->createElement('parameters');
+ $productParameter = $xmldoc->createElement('parameter');
+ $productParameter->appendChild($xmldoc->createTextNode("test=2"));
+ $productParameters->appendChild($productParameter);
+ $action->appendChild($productParameters);
+
+ $productInfo->appendChild($action);
+
+ $pictureUrl = $xmldoc->createElement('pictureUrl');
+ $pictureUrl->appendChild($xmldoc->createTextNode("pictures/buttons/new-createvoiceboard.png"));
+ $productInfo->appendChild($pictureUrl);
+
+ $value = $xmldoc->createElement('value');
+ $value->appendChild($xmldoc->createTextNode("New Board"));
+ $productInfo->appendChild($value);
+
+ $description = $xmldoc->createElement('description');
+ $description->appendChild($xmldoc->createTextNode(get_string('newVoiceBoard', 'voicetool')));
+ $productInfo->appendChild($description);
+
+ $productChoiceElementParameters->appendChild($productInfo);
+
+ $productChoice->appendChild($productChoiceElementParameters);
+
+ $windows->appendChild($productChoice);
+
+ // NEW PRESENTATION
+ $productPresentation = $xmldoc->createElement('windowsElement');
+ $productPresentationtype = $xmldoc->createElement('type');
+ $productPresentationtype->appendChild($xmldoc->createTextNode("productChoice"));
+ $productPresentation->appendChild($productPresentationtype);
+
+ $productPresentationElementParameters = $xmldoc->createElement("windowsElementParameters");
+
+ $productPresentationInfo = $xmldoc->createElement('productInformations');
+
+ $productPresentationaction = $xmldoc->createElement('action');
+
+ $productPresentationactionName = $xmldoc->createElement('name');
+ $productPresentationactionName->appendChild($xmldoc->createTextNode("gaga.php"));
+ $productPresentationaction->appendChild($productPresentationactionName);
+
+ $productPresentationproductParameters = $xmldoc->createElement('parameters');
+ $productPresentationproductParameter = $xmldoc->createElement('parameter');
+ $productPresentationproductParameter->appendChild($xmldoc->createTextNode("test=2"));
+ $productPresentationproductParameters->appendChild($productPresentationproductParameter);
+ $productPresentationaction->appendChild($productPresentationproductParameters);
+
+ $productPresentationInfo->appendChild($productPresentationaction);
+
+ $productPresentationpictureUrl = $xmldoc->createElement('pictureUrl');
+ $productPresentationpictureUrl->appendChild($xmldoc->createTextNode("pictures/buttons/new-createvoicepresentation.png"));
+ $productPresentationInfo->appendChild($productPresentationpictureUrl);
+
+ $productPresentationvalue = $xmldoc->createElement('value');
+ $productPresentationvalue->appendChild($xmldoc->createTextNode("New Presentation"));
+ $productPresentationInfo->appendChild($productPresentationvalue);
+
+ $productPresentationdescription = $xmldoc->createElement('description');
+ $productPresentationdescription->appendChild($xmldoc->createTextNode(get_string('newVoicePresentation', 'voicetool')));
+ $productPresentationInfo->appendChild($productPresentationdescription);
+
+ $productPresentationElementParameters->appendChild($productPresentationInfo);
+
+ $productPresentation->appendChild($productPresentationElementParameters);
+
+ //---------
+
+ $windows->appendChild($productPresentation);
+
+ $root->appendChild($windows);
+
+ $xmldoc->appendChild($root);
+ $xmldoc->save('choice.xml');
+
+ $xmlstring = $xmldoc->saveXML(); // Xml datas into a string
+
+ $finalstring = str_replace("\n", '', $xmlstring);
+ echo $xmlstring;
+?>
\ No newline at end of file
Property changes on: trunk/moodle/mod/voicetool/displayChoicePage.php
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Added: trunk/moodle/mod/voicetool/generateListPanel.php
===================================================================
--- trunk/moodle/mod/voicetool/generateListPanel.php (rev 0)
+++ trunk/moodle/mod/voicetool/generateListPanel.php 2006-11-24 15:31:35 UTC (rev 100)
@@ -0,0 +1,154 @@
+<?PHP
+
+/******************************************************************************
+ * *
+ * Copyright (c) 1999-2006 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: Hazan Samy *
+ * *
+ * Date: October 2006 *
+ * *
+ ******************************************************************************/
+
+/* $Id$ */
+
+/// This page is to generate the list of VT
+
+ require_once("../../config.php");
+ require_once("lib.php");
+ // require_once("api.php");
+
+ // Variables needed
+ global $CFG;
+
+ if(empty($_POST)){
+ $params = $_GET;
+ }
+ else $params = $_POST;
+
+
+ //print_r($params);
+ $courseid = $params['enc_course_id'];
+ add_to_log("", "voicetool", "view", "test", $courseid);
+ // echo $courseid;
+/*
+
+ if(isteacher($courseid, $USER->id) ) {
+ $userid = liveclassroom_api_get_teacher_user_id($courseid);
+ $isteacher = 1;
+
+ }
+ else if (isstudent($courseid) ) {
+
+ $userid = liveclassroom_api_get_student_user_id($courseid);
+ $isteacher = 0;
+
+ }
+
+ if (!liveclassroom_init_session($params)) {
+ error("ExpiredSessionException");
+ }
+*/
+
+ $xmldoc = new DomDocument();
+
+ $root = $xmldoc->createElement('root');
+
+ $root->appendChild(voicetool_get_session_params($xmldoc,$params));
+
+ $windows = $xmldoc->createElement('windows');
+
+ //HEADER BAR
+ $windows->appendChild(voicetool_create_headerbar($xmldoc));
+
+
+ //TOOL BAR
+ $toolbar = $xmldoc->createElement('windowsElement');
+ $tbtype = $xmldoc->createElement('type');
+ $tbtype->appendChild($xmldoc->createTextNode("toolBar"));
+ $toolbar->appendChild($tbtype);
+
+ $tbelementParameters = $xmldoc->createElement("windowsElementParameters");
+
+ $menubar = $xmldoc->createElement('menuElements');
+
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false', 'button', 'all', 'all', 'pictures/buttons/toolbar-launch', 'Launch', 'Launch()', ''));
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true', 'button', 'instructor', 'all', 'pictures/buttons/toolbar-new', 'New', "launchAjaxRequest('displayChoicePage.php','Management','new','true')", ''));
+ //separator
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', ''));
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false', 'button', 'instructor', 'all', 'pictures/buttons/toolbar-activities', 'Add Activity', "doOpenAddActivity('../../course/mod.php','add=liveclassroom')",''));
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false','button', 'instructor', 'all', 'pictures/buttons/toolbar-settings', 'Settings', "launchAjaxRequest('generateSettings.php','Management','update','false')", ''));
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'false','button', 'instructor', 'all', 'pictures/buttons/toolbar-delete', 'Delete', 'doDelete()', ''));
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true', 'fixSpace', 'all', 'all', '', '', '', '', ''));
+ $menubar->appendChild(voicetool_create_menu_element($xmldoc,'true','search', 'all','all', "", "", "", "",""));
+
+ $tbelementParameters->appendChild($menubar);
+ $toolbar->appendChild($tbelementParameters);
+
+ $windows->appendChild($toolbar);
+ /*
+ // MESSAGE BAR
+ if (isset($params['messageType'])) {
+ $windows->appendChild(liveclassroom_create_message($xmldoc, 'info', liveclassroom_get_message($params['messageType'])));
+ }
+ */
+ // LIST
+
+ $list = $xmldoc->createElement('windowsElement');
+ $typeWindowsElement = $xmldoc->createElement('type');
+ $typeWindowsElement->appendChild($xmldoc->createTextNode("list"));
+ $list->appendChild($typeWindowsElement);
+
+ $elementParameters = $xmldoc->createElement('windowsElementParameters');
+
+ $products = $xmldoc->createElement('products');
+
+ // LIST PRODUCTS
+
+ $listProducts = $xmldoc->createElement('listProducts');
+
+ $listProducts->appendChild(voicetool_create_product_information($xmldoc,'1','','productType','Voice Boards'));
+ $listProducts->appendChild(voicetool_create_product_information($xmldoc,'2','','productType','Voice Presentations'));
+
+ $products->appendChild($listProducts);
+
+
+ // PRODUCTS CONTENT
+ $productContent = $xmldoc->createElement('productsContent');
+ $productContent->appendChild(voicetool_xml_list_voice_board($xmldoc,$courseid));
+
+ $products->appendChild($productContent);
+
+ $elementParameters->appendChild($products);
+
+ $list->appendChild($elementParameters);
+
+ $windows->appendChild($list);
+
+ $root->appendChild($windows);
+
+ $xmldoc->appendChild($root);
+ $xmldoc->save('list.xml');
+ $xmlstring = $xmldoc->saveXML(); // Xml datas into a string
+
+ $finalstring = str_replace("\n", '', $xmlstring);
+ echo $xmlstring;
+
+?>
\ No newline at end of file
Property changes on: trunk/moodle/mod/voicetool/generateListPanel.php
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Modified: trunk/moodle/mod/voicetool/index.php
===================================================================
--- trunk/moodle/mod/voicetool/index.php 2006-11-23 16:30:56 UTC (rev 99)
+++ trunk/moodle/mod/voicetool/index.php 2006-11-24 15:31:35 UTC (rev 100)
@@ -30,11 +30,12 @@
/// This page lists all the instances of voicetools in a particular course
- require_once("../../config.php");
+ require_once("../../config.php");
require_once("lib.php");
- require_variable($id); // course
-
+ $id = optional_param('id', 0, PARAM_INT); // course
+ //$course = optional_param('course', 0, PARAM_INT);
+ $course = optional_param('course', 0, PARAM_INT);
if (! $course = get_record("course", "id", $id)) {
error("Course ID is incorrect");
}
@@ -60,51 +61,42 @@
/// Get all the appropriate data
- if (! $voicetools = get_all_instances_in_course("voicedirect", $course)) {
+ if (! $voicetools = get_all_instances_in_course("voicetool", $course)) {
notice("There are no voicetools", "../../course/view.php?id=$course->id");
die;
}
+
+ global $CFG;
-/// Print the list of instances (your module will probably extend this)
+
+ $url = voicetool_get_url_params($course->id);
+
+?>
- $timenow = time();
- $strname = get_string("name");
- $strweek = get_string("week");
- $strtopic = get_string("topic");
+ <head>
+ </head>
+<br>
+<body>
+<br>
- if ($course->format == "weeks") {
- $table->head = array ($strweek, $strname);
- $table->align = array ("CENTER", "LEFT");
- } else if ($course->format == "topics") {
- $table->head = array ($strtopic, $strname);
- $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT");
- } else {
- $table->head = array ($strname);
- $table->align = array ("LEFT", "LEFT", "LEFT");
- }
+<div align="center">
+ <table height="95%">
+ <iframe src="welcome.php?id=<?php echo $id; ?>&<?php echo $url; ?>&time=<?php echo time() ?>" width="800" height="400" name="frameWidget" FRAMEBORDER=0 align="middle">
+ <p>Sorry your navigator can't display this iframe
- foreach ($voicetools as $voicetool) {
- if (!$voicetool->visible) {
- //Show dimmed if the mod is hidden
- $link = "<A class=\"dimmed\" HREF=\"view.php?id=$voicetool->coursemodule\">$voicetool->name</A>";
- } else {
- //Show normal if the mod is visible
- $link = "<A HREF=\"view.php?id=$voicetool->coursemodule\">$voicetool->name</A>";
- }
+ </iframe>
+</table>
+</div>
+
+</body>
- if ($course->format == "weeks" or $course->format == "topics") {
- $table->data[] = array ($voicedirect->section, $link);
- } else {
- $table->data[] = array ($link);
- }
- }
- echo "<BR>";
- print_table($table);
-/// Finish the page
- print_footer($course);
+<?php
+/// Finish the page
+
+ print_footer($course);
?>
Modified: trunk/moodle/mod/voicetool/lib.php
===================================================================
--- trunk/moodle/mod/voicetool/lib.php 2006-11-23 16:30:56 UTC (rev 99)
+++ trunk/moodle/mod/voicetool/lib.php 2006-11-24 15:31:35 UTC (rev 100)
@@ -29,7 +29,8 @@
/* $Id$ */
require_once ('voicetoolapi.php');
-
+require_once($CFG->libdir.'/datalib.php');
+require_once($CFG->dirroot.'/course/lib.php');
/// Library of functions and constants for module voicetool
@@ -242,7 +243,7 @@
$result = new PairSet ();
- $result->addNameValuePair ('type', $VT_API_VDIRECT);
+ $result->addNameValuePair ('type', 'board');
$result->addNameValuePair ('title', $voicetool->name);
$result->addNameValuePair ('description', $voicetool->description);
$result->addNameValuePair ('email', $voicetool->email);
@@ -284,10 +285,10 @@
$rights = new PairSet ();
if (isteacher($voicetool->course)) {
- $rights->addNameValuePair ('profile', 'blackboard.voicetool.instructor');
+ $rights->addNameValuePair ('profile', 'moodle.voicetool.instructor');
}
else {
- $rights->addNameValuePair ('profile', 'blackboard.voicetool.student');
+ $rights->addNameValuePair ('profile', 'moodle.voicetool.student');
}
return array ('user' => $user->getData(),
@@ -296,4 +297,309 @@
'rights' => $rights->getData() );
}
-?>
+/**
+ * List all the board for the course given
+ * @param $courseId - the current course id
+ * @return the list of boards
+ */
+function voicetool_get_voiceBoard_list($courseId) {
+
+ if(!($board_list = get_records('voicetool','course',$courseId))) {
+ error( "Response get_board_list : query to database failed");
+ }
+ $result = array();
+ foreach($board_list as $board) {
+
+ if ($board->type == "board") array_push($result, $board);
+
+ }
+
+ return $result;
+}
+
+/**
+ * List all the voice direct for the course given
+ * @param $courseId - the current course id
+ * @return the list of voice direct
+ */
+function voicetool_get_voicePresentation_list($courseId) {
+
+ if(!($voicedirect_list = get_records('voicetool','course',$courseId))) {
+ error( "Response get_voicedirect_list : query to database failed");
+ }
+ $result = array();
+ foreach($voicedirect_list as $presentation) {
+
+ if ($presentation->type == "presentation") array_push($result, $presentation);
+
+ }
+ return $result;
+
+}
+
+function voicetool_get_all_tools_list($courseId) {
+
+ if(!($voicedirect_list = get_records('voicetool','course',$courseId))) {
+ error( "Response get_voicedirect_list : query to database failed");
+ }/*
+ $result = array();
+ foreach($voicedirect_list as $presentation) {
+
+ if ($presentation->type == "presentation") array_push($result, $presentation);
+
+ }*/
+ return $voicedirect_list;
+
+}
+
+
+/*
+* Create a header bar element
+*
+* @param $xmldoc : the DOM document
+*
+* Return a DOM document element which represent the header bar
+**/
+function voicetool_create_headerbar($xmldoc){
+ $headerbar = $xmldoc->createElement('windowsElement');
+
+ $hbtype = $xmldoc->createElement('type');
+ $hbtype->appendChild($xmldoc->createTextNode("headerBar"));
+ $headerbar->appendChild($hbtype);
+ $hbelementParameters = $xmldoc->createElement("windowsElementParameters");
+ $headerbarinformations = $xmldoc->createElement("headerBarInformations");
+ $hbstyle = $xmldoc->createElement("style");
+ $hbstyle->appendChild($xmldoc->createTextNode("headerBar"));
+ $headerbarinformations->appendChild($hbstyle);
+ $hbpictureUrl = $xmldoc->createElement("pictureUrl");
+ $hbpictureUrl->appendChild($xmldoc->createTextNode("pictures/items/headerbar-logo.png"));
+ $headerbarinformations->appendChild($hbpictureUrl);
+ $hbelementParameters->appendChild($headerbarinformations);
+
+ $headerbar->appendChild($hbelementParameters);
+
+ return $headerbar;
+}
+
+/*
+* Create a menu element
+*
+* @param $xmldoc : the DOM document
+* @params $p_... : parameters of the menu element
+*
+* Return a DOM document element which correspond to a menu element
+**/
+function voicetool_create_menu_element($xmldoc,$p_availibility, $p_type, $p_typeOfUser, $p_typeOfProduct, $p_pictureUrl, $p_value, $p_lcTypeAction, $p_lcNameAction){
+
+ $menuElement = $xmldoc->createElement('menuElement');
+
+ $type = $xmldoc->createElement('type');
+ $type->appendChild($xmldoc->createTextNode("$p_type"));
+ $menuElement->appendChild($type);
+
+ $typeOfProduct = $xmldoc->createElement('typeOfProduct');
+ $typeOfProduct->appendChild($xmldoc->createTextNode("$p_typeOfProduct"));
+ $menuElement->appendChild($typeOfProduct);
+
+ $availibility = $xmldoc->createElement('availibility');
+ $availibility->appendChild($xmldoc->createTextNode("$p_availibility"));
+ $menuElement->appendChild($availibility);
+
+ $typeOfUser = $xmldoc->createElement('typeOfUser');
+ $typeOfUser->appendChild($xmldoc->createTextNode("$p_typeOfUser"));
+ $menuElement->appendChild($typeOfUser);
+
+ $pictureUrl = $xmldoc->createElement('pictureUrl');
+ $pictureUrl->appendChild($xmldoc->createTextNode("$p_pictureUrl"));
+ $menuElement->appendChild($pictureUrl);
+
+ $value = $xmldoc->createElement('value');
+ $value->appendChild($xmldoc->createTextNode("$p_value"));
+ $menuElement->appendChild($value);
+
+ $lcAction = $xmldoc->createElement('action');
+ $lcActionName = $xmldoc->createElement('name');
+ $lcActionName->appendChild($xmldoc->createTextNode("$p_lcTypeAction"));
+
+ $lcAction->appendChild($lcActionName);
+ $lcActionParameters = $xmldoc->createElement('parameters');
+
+ $lcActionParameter = $xmldoc->createElement('parameter');
+ $lcActionParameter->appendChild($xmldoc->createTextNode("$p_lcNameAction"));
+ $lcActionParameters->appendChild($lcActionParameter);
+
+ $lcAction->appendChild($lcActionParameters);
+
+ $lcAction->appendChild($lcActionParameters);
+
+
+ $menuElement->appendChild($lcAction);
+
+ $xmldoc->appendChild($menuElement);
+
+ return $menuElement;
+}
+/*
+* Create a product information element
+*
+* @param $xmldoc : the DOM document
+* @param $position : type of the element
+* @param $name : name of the element
+* @param $style : style of the element
+* @param $value : value of the element
+*
+* Return a DOM document element which correspond to a product information element
+**/
+function voicetool_create_product_information($xmldoc,$position,$name,$style,$value) {
+
+ $productInfo = $xmldoc->createElement('productInformations');
+
+ $productPosition = $xmldoc->createElement('position');
+ $productPosition->appendChild($xmldoc->createTextNode("$position"));
+ $productInfo->appendChild($productPosition);
+
+ $productName = $xmldoc->createElement('name');
+ $productName->appendChild($xmldoc->createTextNode("$name"));
+ $productInfo->appendChild($productName);
+
+ $productStyle = $xmldoc->createElement('style');
+ $productStyle->appendChild($xmldoc->createTextNode("$style"));
+ $productInfo->appendChild($productStyle);
+
+ $productValue = $xmldoc->createElement('value');
+ $productValue->appendChild($xmldoc->createTextNode("$value"));
+ $productInfo->appendChild($productValue);
+
+ return $productInfo;
+
+}
+
+function voicetool_xml_list_voice_board($xmldoc, $courseId) {
+
+ $list = voicetool_get_all_tools_list($courseId);
+ $listElements = $xmldoc->createElement('listElements');
+ //print_($list);
+
+ add_to_log("", "voicetool", "view", "size", sizeof($list));
+ foreach ($list as $board) {
+
+ $element = $xmldoc->createElement('listElement');
+ $roomParameters = $xmldoc->createElement('listElementParameters');
+
+ $type = $xmldoc->createElement('typeOfElement');
+ $type->appendChild($xmldoc->createTextNode("VoiceBoard"));
+ $roomParameters->appendChild($type);
+ $position = $xmldoc->createElement('position');
+ if($board->type == "board"){
+ $position->appendChild($xmldoc->createTextNode("1"));
+ }
+ else if($board->type == "presentation"){
+ $position->appendChild($xmldoc->createTextNode("2"));
+ }
+
+ $roomParameters->appendChild($position);
+
+ $longname = $xmldoc->createElement('nameDisplay');
+ $longname->appendChild($xmldoc->createTextNode($board->name));
+ $roomParameters->appendChild($longname);
+ $preview = $xmldoc->createElement('preview');
+ $preview->appendChild($xmldoc->createTextNode("available"));
+ $roomParameters->appendChild($preview);
+ $nid = $xmldoc->createElement('nid');
+ $nid->appendChild($xmldoc->createTextNode($board->id));
+ $roomParameters->appendChild($nid);
+ $rid = $xmldoc->createElement('rid');
+ $rid->appendChild($xmldoc->createTextNode($board->rid));
+ $roomParameters->appendChild($rid);
+ /*if ($roompreview=="1")
+ {
+ $preview->appendChild($xmldoc->createTextNode("unavailable"));
+ }
+ else
+ {
+ $preview->appendChild($xmldoc->createTextNode("available"));
+ }
+ */
+
+ $element->appendChild($roomParameters);
+ $listElements->appendChild($element);
+
+ }
+ $xmldoc->appendChild($listElements);
+
+
+
+ return $listElements;
+
+}
+
+/*
+* Give the parameters with the signature md5 to give to the frame
+* @param $courseid : the id of the current course
+* return a string with all the parameters to give to the url
+*/
+function voicetool_get_url_params($courseid) {
+
+ global $USER;
+
+ if (isstudent($courseid)) {
+ $role='Student';
+ }
+ else if (isteacher($courseid, $USER->id)) {
+ $role='Instructor';
+ }
+ $signature = md5($courseid.$USER->email.$USER->firstname.$USER->lastname.$role);
+ $url_params = "enc_course_id=".$courseid."&enc_email=".$USER->email."&enc_firstname=".$USER->firstname."&enc_lastname=".$USER->lastname."&enc_role=".$role."&signature=".$signature;
+
+ return $url_params;
+}
+
+
+
+/* Create a information element
+* @param $xmldoc : the DOM document to add the information element
+* @param $sessionParams : array with the url parameters
+* return a DOM Document element with the general information
+*/
+
+function voicetool_get_session_params($xmldoc, $sessionParams) {
+
+// General Information
+
+ $information = $xmldoc->createElement("information");
+
+ $firstName = $xmldoc->createElement("firstName");
+ $firstName->appendChild($xmldoc->createTextNode($sessionParams['enc_firstname']));
+ $lastName = $xmldoc->createElement("lastName");
+ $lastName->appendChild($xmldoc->createTextNode($sessionParams['enc_lastname']));
+ $role = $xmldoc->createElement("role");
+ $role->appendChild($xmldoc->createTextNode($sessionParams['enc_role']));
+ $email = $xmldoc->createElement("email");
+ $email->appendChild($xmldoc->createTextNode($sessionParams['enc_email']));
+ $timeOfLoad = $xmldoc->createElement("timeOfLoad");
+ $timeOfLoad->appendChild($xmldoc->createTextNode($sessionParams['time']));
+ $courseId = $xmldoc->createElement("courseId");
+ $courseId->appendChild($xmldoc->createTextNode($sessionParams['enc_course_id']));
+ if ($sessionParams['authToken'] != null) {
+ $authToken = $xmldoc->createElement("authToken");
+ $authToken->appendChild($xmldoc->createTextNode($sessionParams['authToken']));
+ }
+ $signature = $xmldoc->createElement("signature");
+ $signature->appendChild($xmldoc->createTextNode($sessionParams['signature']));
+
+ $information->appendChild($firstName);
+ $information->appendChild($lastName);
+ $information->appendChild($role);
+ ...
[truncated message content] |
|
From: <sh...@us...> - 2006-11-24 15:37:07
|
Revision: 101
http://svn.sourceforge.net/hw4mdl/?rev=101&view=rev
Author: shazan
Date: 2006-11-24 07:37:06 -0800 (Fri, 24 Nov 2006)
Log Message:
-----------
pictures/css/js files
Added Paths:
-----------
trunk/moodle/mod/voicetool/css/
trunk/moodle/mod/voicetool/css/StyleSheet.css
trunk/moodle/mod/voicetool/js/
trunk/moodle/mod/voicetool/js/General.js
trunk/moodle/mod/voicetool/js/verif.js
trunk/moodle/mod/voicetool/js/xml.js
trunk/moodle/mod/voicetool/js/xmldom.js
trunk/moodle/mod/voicetool/pictures/
trunk/moodle/mod/voicetool/pictures/backgrounds/
trunk/moodle/mod/voicetool/pictures/backgrounds/headerbar.png
trunk/moodle/mod/voicetool/pictures/backgrounds/toolbar.png
trunk/moodle/mod/voicetool/pictures/buttons/
trunk/moodle/mod/voicetool/pictures/buttons/angel.gif
trunk/moodle/mod/voicetool/pictures/buttons/general-cancel.png
trunk/moodle/mod/voicetool/pictures/buttons/general-create.png
trunk/moodle/mod/voicetool/pictures/buttons/general-empty-over.png
trunk/moodle/mod/voicetool/pictures/buttons/general-empty.png
trunk/moodle/mod/voicetool/pictures/buttons/general-saveall.png
trunk/moodle/mod/voicetool/pictures/buttons/headerbar-logo.png
trunk/moodle/mod/voicetool/pictures/buttons/listitem-available.png
trunk/moodle/mod/voicetool/pictures/buttons/listitem-hide.png
trunk/moodle/mod/voicetool/pictures/buttons/listitem-show.png
trunk/moodle/mod/voicetool/pictures/buttons/listitem-unavailable.png
trunk/moodle/mod/voicetool/pictures/buttons/new-createroom.png
trunk/moodle/mod/voicetool/pictures/buttons/new-createvoiceboard.png
trunk/moodle/mod/voicetool/pictures/buttons/new-createvoicepresentation.png
trunk/moodle/mod/voicetool/pictures/buttons/searchfield.gif
trunk/moodle/mod/voicetool/pictures/buttons/tab.gif
trunk/moodle/mod/voicetool/pictures/buttons/tab_disabled.gif
trunk/moodle/mod/voicetool/pictures/buttons/tab_over.gif
trunk/moodle/mod/voicetool/pictures/buttons/tab_select.gif
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-activities-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-activities.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-availability-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-availability.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-content-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-content.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-delete-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-delete.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-launch-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-launch.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-new.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-newboard-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-newboard.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-newroom-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-poll-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-poll.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-schedule-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-schedule.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-settings-disabled.png
trunk/moodle/mod/voicetool/pictures/buttons/toolbar-settings.png
trunk/moodle/mod/voicetool/pictures/items/
trunk/moodle/mod/voicetool/pictures/items/category-collapsed.png
trunk/moodle/mod/voicetool/pictures/items/category-expanded.png
trunk/moodle/mod/voicetool/pictures/items/filter-enabled-left.png
trunk/moodle/mod/voicetool/pictures/items/filter-enabled-middle.png
trunk/moodle/mod/voicetool/pictures/items/filter-enabled-right.png
trunk/moodle/mod/voicetool/pictures/items/filter-rollover-left.png
trunk/moodle/mod/voicetool/pictures/items/filter-rollover-middle.png
trunk/moodle/mod/voicetool/pictures/items/filter-rollover-right.png
trunk/moodle/mod/voicetool/pictures/items/filterbar-separator.png
trunk/moodle/mod/voicetool/pictures/items/headerbar-logo.png
trunk/moodle/mod/voicetool/pictures/items/headerbar-searchfield-left.png
trunk/moodle/mod/voicetool/pictures/items/headerbar-searchfield-middle.png
trunk/moodle/mod/voicetool/pictures/items/headerbar-searchfield-right.png
trunk/moodle/mod/voicetool/pictures/items/listitem-available.png
trunk/moodle/mod/voicetool/pictures/items/listitem-hide.png
trunk/moodle/mod/voicetool/pictures/items/listitem-liveclassroomicon.png
trunk/moodle/mod/voicetool/pictures/items/listitem-show.png
trunk/moodle/mod/voicetool/pictures/items/listitem-subitem.png
trunk/moodle/mod/voicetool/pictures/items/listitem-unavailable.png
trunk/moodle/mod/voicetool/pictures/items/listitem-voiceboardicon.png
trunk/moodle/mod/voicetool/pictures/items/listitem-voicepresentationicon.png
trunk/moodle/mod/voicetool/pictures/items/messagelabel-info.png
trunk/moodle/mod/voicetool/pictures/items/space-16px.png
trunk/moodle/mod/voicetool/pictures/items/space-16x16px.png
trunk/moodle/mod/voicetool/pictures/items/space-18px.png
trunk/moodle/mod/voicetool/pictures/items/space-24px.png
trunk/moodle/mod/voicetool/pictures/items/space-32px.png
trunk/moodle/mod/voicetool/pictures/items/space-44px.png
trunk/moodle/mod/voicetool/pictures/items/toolbar-separator.png
trunk/moodle/mod/voicetool/pictures/items/wheel-03.gif
trunk/moodle/mod/voicetool/pictures/items/x_normal.gif
trunk/moodle/mod/voicetool/pictures/items/x_normal.png
trunk/moodle/mod/voicetool/pictures/items/x_over.gif
trunk/moodle/mod/voicetool/pictures/items/x_over.png
trunk/moodle/mod/voicetool/pictures/minus.gif
trunk/moodle/mod/voicetool/pictures/plus.gif
trunk/moodle/mod/voicetool/pictures/tab.gif
trunk/moodle/mod/voicetool/pictures/tab_Select.gif
trunk/moodle/mod/voicetool/pictures/tab_disabled.gif
trunk/moodle/mod/voicetool/pictures/tab_over.gif
Added: trunk/moodle/mod/voicetool/css/StyleSheet.css
===================================================================
--- trunk/moodle/mod/voicetool/css/StyleSheet.css (rev 0)
+++ trunk/moodle/mod/voicetool/css/StyleSheet.css 2006-11-24 15:37:06 UTC (rev 101)
@@ -0,0 +1,370 @@
+body
+{ background-color:#ffffff;
+ margin-top:0px;
+ margin-bottom:0px;
+ margin-right:0px;
+ margin-left:0px;
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size:70%;
+}
+/* size remaining text relative to baseline */
+/* some indiv classes and elements have different sizes, later in doc */
+body a,
+body table, body td, body th,
+body p, body div, body li, body li li,
+body input, body textarea, body select, body option ,td textarea
+{font-size:100%;}
+.page_title
+{
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-size:14px;
+font-weight:bold;
+color:#3c4b5b;
+vertical-align: middle;
+}
+.area_title
+{
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-size:12px;
+font-weight:bold;
+color:#3c4b5b;
+vertical-align: middle;
+background-color:#c4cedc;
+
+padding-left:2px;
+vertical-align:middle;
+}
+table.tab
+{
+ width:100%;
+}
+table.tab td
+{
+ vertical-align:top;
+}
+div.tab
+{
+ padding-top:2%;
+ padding-left:5%;
+ display: none;
+ height:180px;
+}
+div.current_tab
+{
+ margin-top:2%;
+ margin-left:5%;
+ position: relative;
+ display: block;
+ height:180px;
+}
+td.tabSelected
+{
+background-image:url(../pictures/tab_Select.gif);
+ background-repeat: no-repeat;
+ width: 78px;
+ font-size: 10pt;
+ font-family: Verdana;
+}
+td.tabDisabled
+{
+background-image:url(../pictures/tab_disabled.gif);
+ background-repeat: no-repeat;
+ width: 78px;
+ font-size: 10pt;
+ font-family: Verdana;
+ border-bottom:solid 1px #818181;
+}
+td.tabNoSelected
+{
+background-image:url(../pictures/tab.gif);
+ background-repeat: no-repeat;
+ width: 78px;
+ font-size: 10pt;
+ font-family: Verdana;
+ border-bottom:solid 1px #818181;
+}
+a {
+text-decoration:none;
+ color:Black; }
+a:hover {
+ text-decoration:none;
+ color:Black; }
+td.action,input.action{
+ background-image:url(../pictures/buttons/general-empty.png);
+ background-repeat :no-repeat;
+ background-position:center;
+ text-decoration:none;
+ color:Black;
+ text-align:center;
+ cursor:pointer
+}
+td.action:hover,input.action:hover{
+ background-image:url(../pictures/buttons/general-empty-over.png);
+ background-repeat :no-repeat;
+ background-position:center;
+ text-decoration:none;
+ color:Black;
+ text-align:center;
+ cursor:pointer
+}
+.action label
+{
+ cursor:pointer
+}
+.alert
+{
+ color:Red;
+}
+a.room {
+color:#889EB3;
+text-decoration:none;
+display:block;
+width:100%;
+}
+a.room:hover {color:#889EB3;
+ text-decoration:none;
+ border: none;
+ background-position: 3px 4px;
+}
+.info a{
+ position:relative; /*this is the key*/
+ z-index:24;
+ color:#000;
+ text-decoration:none}
+.info a:hover{z-index:25;text-decoration:underline;}
+.info a span{display: none;font-size:8pt;}
+.info a:hover span{ /*the span will display just on :hover state*/
+ font-size:8pt;
+ display:block;
+ position:absolute;
+ top:1.5em; left:5em; width:28em;
+ border:1px solid #FFF99F;
+ background-color:#FFF99F; color:#000;
+ text-align: center}
+.button_disabled a{
+ color:#666666;
+ font-family: Arial;
+ text-decoration:none;
+ font-size: 9px;
+ height:44px;
+}
+.button_disabled a:hover
+{
+ color:#666666;
+ font-family: Arial;
+ text-decoration:none;
+ font-size: 9px;
+ cursor:pointer;
+}
+.button_enabled a
+{
+ color:black;
+ font-family: Arial;
+ text-decoration:none;
+ font-size: 9px;
+}
+.button_enabled a:hover{ color:black;
+ font-family: Arial;
+ font-size: 9px;
+ text-decoration: underline;
+ display:block;
+ cursor:hand;
+}
+tr.selectRoom{
+ background-color:red;
+ cursor:hand;
+}
+.divProduct
+{
+ padding-top:3px;
+}
+.shortShift{
+ padding-left:5px;
+}
+.room td{
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:pointer;
+}
+.room label{
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:pointer;
+}
+tr.overRoom{
+ font-family:Verdana;
+ color:Black;
+ font-size:11px;
+ border-bottom:solid 1px #F3F3F3;
+ background-color:#f0f3f5;
+ cursor:pointer;
+ cursor:hand;
+}
+.archive{
+ font-family:Verdana;
+ color:#666666;
+ font-style:italic;
+ font-size:11px;
+ border-bottom:solid 1px #F3F3F3;
+}
+.filterBar {
+ background-image:url("../pictures/backgrounds/filterbar.png");
+ height:24px;
+ font-weight:bold ;
+ width:100%;
+ border-bottom:fine 1px #C7D3E1
+}
+.filter_enabled
+{
+ font-family :Verdana;
+ color:#333333;
+ height:24px;
+ font-size:12px;
+ font-weight:bold ;
+}
+.filter_selected
+{ font-weight:bold ;
+ font-family :Verdana;
+ color:#ffffff;
+ height:24px;
+ font-size:12px;
+}
+.filter_left_enabled
+{
+ background-image:url("../pictures/items/filter-enabled-left.png");
+}
+.filter_middle_enabled
+{
+ background-image:url("../pictures/items/filter-enabled-middle.png");
+ font-family :Verdana;
+ color:#ffffff;
+ height:24px;
+ font-size:12px;
+ font-weight:bold ;
+}
+.filter_right_enabled
+{
+ background-image:url("../pictures/items/filter-enabled-right.png");
+}
+.contextBar table
+{
+ background-image:url("../pictures/backgrounds/toolbar.png");
+ height:30px;
+ width:100%
+}
+.tabBackground
+{
+ background-image:url("../pictures/backgrounds/toolbar.png");
+}
+.productChoice table
+{
+ height:72px;
+ border-bottom:solid 1px #F0F0F0;
+ margin-left:10px;
+ margin-right:10px;
+}
+.comment{
+ font-family:Verdana;
+ color:#555555;
+ font-style:italic;
+ font-size:11px;
+ padding-left:20px;
+}
+.subOption td {
+ font-family:Verdana;
+ font-size:11px;
+ padding-left:20px;
+ vertical-align:top;
+}
+.roomNameForSettings
+{
+ font-family:Verdana;
+ font-weight: bold;
+ font-size:12px;
+}
+.hide
+{
+ display:none;
+}
+.visible
+{
+ display:block;
+}
+label.moreRoom
+{
+ color:Navy;
+ text-decoration:underline;
+ padding-left:20px;
+ font-weight: bold;
+}
+#popup {
+display:none;
+ font-size:8pt;
+ display:block;
+ position:absolute;
+ top:50%; left:50%;
+ color:#000;
+ text-align: center;
+}
+.expand
+{
+ background-color:Black;
+}.headerBar table
+{
+padding:0px ;
+width:100%;
+background-image:url("../pictures/backgrounds/headerbar.png");
+height:32px;
+border-bottom:solid 1px Black;
+}
+.toolBar table
+{
+ width:100%;
+ padding:0px ;
+ background-image:url("../pictures/backgrounds/toolbar.png");
+}
+.search
+{
+ max-width:105px;
+ }
+.list
+{
+ height:280px;
+ overflow-y:scroll;
+}
+.productTitle {
+ background-color:#B0C1D5;
+ font-family:Verdana;
+ color:White;
+ font-size:12px;
+ height:16px;
+ font-weight:bold;
+ cursor:default;
+}
+.validationBar table
+{
+ width:100%;
+ height:24px ;
+ padding:0px ;
+ background-color:#F0F0F0;
+}
+.panelSettings table
+{
+border-bottom: #818181 1px solid;
+height:220px;
+display:none;
+width:100%
+}
+.part td
+ {
+ width:100%;
+ border-bottom: #818181 1px solid;
+ }
+ .messageBar
+ {
+ background-color:#ffff99;
+ }
\ No newline at end of file
Property changes on: trunk/moodle/mod/voicetool/css/StyleSheet.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Added: trunk/moodle/mod/voicetool/js/General.js
===================================================================
--- trunk/moodle/mod/voicetool/js/General.js (rev 0)
+++ trunk/moodle/mod/voicetool/js/General.js 2006-11-24 15:37:06 UTC (rev 101)
@@ -0,0 +1,369 @@
+// JScript File
+
+ function toggleUserlimit(isLimited){
+ document.forms[0].userlimittext.disabled = (isLimited==false);
+ }
+ function doChangeChat() {
+ var radio = document.forms[0].privateChatEnabled;
+ for (i=0; i<radio.length; i++) {
+ radio[i].disabled = !document.forms[0].chatEnabled.checked;
+ }
+ }
+
+ function doChangeMedia(mediatype)
+ {
+ document.forms[0].student_simulcast.disabled = (mediatype=="video" || mediatype=="none")
+ document.forms[0].two_way_enabled.disabled = (mediatype=="video" || mediatype=="none")
+ if (mediatype=="video"){document.getElementById('roomId_row').style.display="block"}else{
+ document.getElementById('roomId_row').style.display="none"}
+ }
+ function doChangeLink()
+ {
+
+ if (document.getElementById('launcher_link_row').style.display=="block"){
+ document.getElementById('launcher_link_row').style.display="none"
+ }else{
+ document.getElementById('launcher_link_row').style.display="block"
+ }
+ }
+
+
+ function toggleType(type)
+ {
+ typeSelect=type;
+ manageXml('','all');
+
+
+
+
+ }
+ function confirmDelete(delUrl, type){
+ if (confirm("Are you sure you want to delete this " + type)) {
+ if (confirm("Are you really sure you want to delete this " + type)) {
+ location.href = delUrl
+ }
+ }
+ }
+
+
+
+ var currentIdtab="1";
+ function onTab(id)
+ {
+
+ document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab_Select.gif)";
+ document.getElementById('tab'+currentIdtab).style.borderBottom="#818181 1px solid";
+ document.getElementById('tab'+currentIdtab).style.backgroundImage="url(pictures/tab.gif)";
+ document.getElementById('tab'+id).style.borderBottom="none";
+ document.getElementById('span'+currentIdtab).style.display="none";
+ document.getElementById('span'+id).style.display="block";
+ currentIdtab=id;
+ }
+
+ function onOver(id)
+ {
+ if(currentIdtab!=id)
+ document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab_over.gif)";
+
+ }
+ function onOut(id)
+ {
+ if(currentIdtab!=id)
+ document.getElementById('tab'+id).style.backgroundImage="url(pictures/tab.gif)";
+
+ }
+
+ function hwSubmit(action) {
+ if(action != null)
+ {
+ document.forms[0].action.value=action;
+ }
+ document.forms[0].submit();
+ }
+
+
+ function hideDiv(id,pictureId){
+ if (document.getElementById(id).style.display=="none")
+ {
+
+ document.getElementById(id).style.display="block";
+ document.getElementById(id+"More").style.display="block";
+ if(pictureId!="")
+ document.images[pictureId].src="pictures/items/category-expanded.png";
+
+ }
+ else if (document.getElementById(id).style.display=="block")
+ {
+
+ document.getElementById(id).style.display="none";
+ document.getElementById(id+"More").style.display="none";
+ if(pictureId!="")
+ document.images[pictureId].src="pictures/items/category-collapsed.png";
+ }
+ if (document.getElementById(id).className=="hide")
+ {
+ document.getElementById(id).className="visible";
+ document.getElementById(id+"More").className="visible";
+
+ if(pictureId!="")
+ document.images[pictureId].src="pictures/items/category-expanded.png";
+
+ }
+ else if (document.getElementById(id).className=="visible")
+ {
+ document.getElementById(id).className="hide";
+ document.getElementById(id+"More").className="hide";
+
+ if(pictureId!="")
+ document.images[pictureId].src="pictures/items/category-collapsed.png";
+ }
+}
+
+
+
+
+function hideArchive(type,id,pictureId,roomId)
+{
+
+ if (document.getElementById(id).style.display=="none")
+ {
+ if(type=="MainLecture")
+ numberMainLectureRoom+=numberArchive[roomId];
+ else
+ numberBreakoutRoom+=numberArchive[roomId];
+ document.getElementById(id).style.display="block";
+ document.images[pictureId].src="pictures/minus.gif";
+
+
+ }
+ else
+ {
+ if(type=="MainLecture")
+ numberMainLectureRoom-=numberArchive[roomId];
+ else
+ numberBreakoutRoom-=numberArchive[roomId];
+
+ document.getElementById(id).style.display="none";
+ document.images[pictureId].src="pictures/plus.gif";
+
+
+ }
+ gestionDisplay(false)
+}
+
+function Navigateur()
+{
+ if (navigator.appName.indexOf("Netscape") > -1)
+ {
+ return "Netscape";
+ }
+ if (navigator.appName.indexOf("Explorer") > -1)
+ {
+ return "Explorer";
+ }
+ return "Unknown";
+}
+
+
+function changePicture(id,pictureUrl){
+ if(Navigateur()=="Explorer" && parseFloat(navigator.appVersion)<5.5)
+ {
+ document.getElementById(id).style.filter=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+pictureUrl+"', sizingMethod='scale')";
+ }
+ else
+ {
+ // document.images[id].src=pictureUrl;
+
+ }
+
+}
+
+function OneClick(id,product,type)
+
+{
+
+ if(currentId!="" && currentId!=id)
+ document.getElementById(currentId).style.backgroundColor="white";
+ if(currentId!=id)
+ {
+ document.getElementById(id).style.backgroundColor="#c3dbf7";
+ }
+ currentId=id;
+ currentProduct=product;
+ typeSelect=type;
+
+ //alert(typeSelect);
+ if(document.getElementById("info")!=null && document.getElementById("info").style.display=="block")
+ document.getElementById("info").style.display="none";
+ if(currentId!="")
+ manageXml("","toolBar");
+}
+function dclick(id)
+{
+ if(currentId!=""){
+ document.getElementById(currentId).style.backgroundColor="white";
+ currentId=id;
+ Launch();
+ }
+}
+
+function Horizon()
+{
+
+ if(currentId!="")
+ startHorizon(currentId, null, null, null, null, 'hzA='+session['authToken'])
+}
+
+function ChangeView()
+{
+//alert("eeeE")
+ if( document.getElementById("view").value=="student")
+ {
+ studentView=true;
+
+ }
+ else
+ {
+ studentView=false;
+ }
+ currentId="";
+ currentProduct="";
+ manageXml("","all");
+
+
+}
+
+function LaunchWizard(url)
+{
+var w = window.open(url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500');
+w.focus();
+}
+
+function doOpen(url,param)
+{
+
+ if(currentId!="")
+ {
+ var complete_url=url+'?roomId='+currentId+'&'+param;
+
+ window.open(complete_url,"_self");
+
+ }
+}
+function doOpenPopup(url,param)
+{
+ if(currentId!="")
+ {
+ var complete_url=url+'?roomId='+currentId+'&'+param;
+ var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500');
+ w.focus();
+ }
+}
+function doOpenExtern(url,param)
+{
+ if(currentId!="")
+ {
+ var complete_url=url+'?class_id='+currentId+'&'+param;
+ var w = window.open(complete_url,'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500');
+ w.focus();
+ }
+}
+function hideCroix(v)
+{
+ if(v.length>0)
+ document.getElementById("croix").style.display="block";
+ else
+ document.getElementById("croix").style.display="none";
+}
+var hiddenCroix=0;
+function overCroix(v)
+{
+ if(hiddenCroix==0)
+ {
+ v.src="pictures/x_normal.gif";
+ hiddenCroix=1;
+ }
+ else
+ {
+ v.src="pictures/x_over.gif";
+ hiddenCroix=0;
+
+ }
+}
+function clickCroix()
+{
+ document.getElementById("search").value="";
+ document.getElementById("croix").style.display="none";
+}
+
+// JScript File
+
+//manage the filter
+function activateFilter(id,divNumber){
+ currentFilter=id;
+ currentDiv=divNumber;
+ currentId="";
+ currentProduct="";
+ manageXml('',"all");
+
+}
+
+function onFilter(id){
+ if(currentFilter!=id){
+ document.getElementById(id+"_left").style.backgroundImage="url(pictures/items/filter-rollover-left.png)";
+ document.getElementById(id+"_center").style.backgroundImage="url(pictures/items/filter-rollover-middle.png)";
+ document.getElementById(id+"_right").style.backgroundImage="url(pictures/items/filter-rollover-right.png)";
+ }
+}
+
+function outFilter(id){
+
+ if(currentFilter==id){
+ document.getElementById(id+"_left").style.backgroundImage="url(pictures/items/filter-enabled-left.png)";
+ document.getElementById(id+"_center").style.backgroundImage="url(pictures/items/filter-enabled-middle.png)";
+ document.getElementById(id+"_right").style.backgroundImage="url(pictures/items/filter-enabled-right.png)";
+ }else{
+ document.getElementById(id+"_left").style.backgroundImage="";
+ document.getElementById(id+"_center").style.backgroundImage="";
+ document.getElementById(id+"_right").style.backgroundImage="";
+ }
+}
+function startBoard()
+{
+
+ if(currentId!="")
+ {
+ //openPopup('<%=Setup.getInstance().getVtServerURL()%>/board?action=display_popup&nid='+currentId)
+ }
+
+}
+
+function search(value){
+ currentId=""
+ currentProduct=""
+ manageXml(search.value,"all");
+
+}
+function Launch(){
+
+ if(currentProduct="liveclassroom"){
+ Horizon();
+ }else if(currentProduct="voiceboard"){
+ startBoard();
+ }
+
+}
+
+function openContentWindows(){
+ if(currentId!="")
+ window.open('http://test13.horizonwimba.com/admin/class/carousels.epl?class_id='+currentId+'&hzA='+session["authToken"],'lc_popup','scrollbars=yes,resizable=yes,width=800,height=500');
+}
+
+
+
+function submitForm(url,action){
+ //alert(currentId)
+ document.myform.action=url+'?id='+currentId+'&action='+action+'&time='+session["timeOfLoad"]+'&enc_course_id='+session["courseId"]+'&enc_email='+session["email"]+'&enc_firstname='+session["firstName"]+'&enc_lastname='+session["lastName"]+'&enc_role='+session["role"]+'&signature='+session["signature"];
+ document.myform.submit();
+ }
+
\ No newline at end of file
Property changes on: trunk/moodle/mod/voicetool/js/General.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Added: trunk/moodle/mod/voicetool/js/verif.js
===================================================================
--- trunk/moodle/mod/voicetool/js/verif.js (rev 0)
+++ trunk/moodle/mod/voicetool/js/verif.js 2006-11-24 15:37:06 UTC (rev 101)
@@ -0,0 +1,57 @@
+// JScript File
+
+ function verifyFormUpdate() {
+ var theForm = window.document.entry_info_form;
+ var validated = false;
+ var errorMessage = "";
+ var roomIdPattern = /^[a-z|A-Z|0-9|_]{1,32}$/;
+ var longnamePattern = /^[a-z|A-Z|0-9|_| |\'|!|?|(|)|:|\-|\/|]{1,50}$/;
+ if (!longnamePattern.test(theForm.longname.value)){
+ errorMessage += "Please fill in a Title that is 1-50 alphanumeric or space characters or - / : ' ? ! ( )\n";
+ }
+ if (theForm.longname.length > 50) {
+ errorMessage += "The Title you have entered is too long. This field should not exceed 50 characters.\n";
+ }
+ if (errorMessage.length > 0) {
+ alert(errorMessage);
+ } else {
+
+ theForm.submit();
+ }
+ }
+
+ function verifyForm() {
+
+ var theForm = window.document.entry_info_form;
+ var validated = false;
+ var errorMessage = "";
+ var roomIdPattern = /^[a-z|A-Z|0-9|_]{1,32}$/;
+ var userlimitPattern = /^[0-9]+[0-9]*$/;
+ var longnamePattern = /^[a-z|A-Z|0-9|_| |\'|!|?|(|)|]{1,50}$/;
+ if (!longnamePattern.test(theForm.longname.value)){
+ errorMessage += "Please fill in a Title that is 1-50 alphanumeric or space characters or ' ? ! ( ) \n";
+ }
+ if (theForm.longname.length > 50) {
+ errorMessage += "The Title you have entered is too long. This field should not exceed 50 characters.\n";
+ }
+ var radio = theForm.userlimit;
+
+ for (i=0; i<radio.length; i++) {
+ if(radio[i].checked && radio[i].value == "true"){
+ if (theForm.userlimitValue.value == null || theForm.userlimitValue == "") {
+ errorMessage += "Please fill in the user limit value\n";
+ }
+ if (!userlimitPattern.test(theForm.userlimitValue.value)) {
+ errorMessage += "User Limit should be an integer\n";
+ } else if (parseInt(theForm.userlimitValue.value) > 100) {
+ errorMessage += "User Limit should be less than 100\n";
+ }
+ }
+ }
+
+ if (errorMessage.length > 0) {
+ alert(errorMessage);
+ } else {
+ theForm.submit();
+ }
+ }
\ No newline at end of file
Property changes on: trunk/moodle/mod/voicetool/js/verif.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Added: trunk/moodle/mod/voicetool/js/xml.js
===================================================================
--- trunk/moodle/mod/voicetool/js/xml.js (rev 0)
+++ trunk/moodle/mod/voicetool/js/xml.js 2006-11-24 15:37:06 UTC (rev 101)
@@ -0,0 +1,956 @@
+// JScript File
+
+function manageXml(search,divToReload){
+
+ var display="";
+
+ if(divToReload=="all"){
+ display+="<form method=post name=myform>"
+ display+=initDisplay();
+...
[truncated message content] |
|
From: <sh...@us...> - 2006-12-29 16:03:28
|
Revision: 153
http://svn.sourceforge.net/hw4mdl/?rev=153&view=rev
Author: shazan
Date: 2006-12-29 08:03:27 -0800 (Fri, 29 Dec 2006)
Log Message:
-----------
latest version for Voice Tools, integrate a part of the integration, form and list
Modified Paths:
--------------
trunk/moodle/mod/voicetool/config.html
trunk/moodle/mod/voicetool/css/StyleSheet.css
trunk/moodle/mod/voicetool/db/mysql.sql
trunk/moodle/mod/voicetool/displayChoicePage.php
trunk/moodle/mod/voicetool/generateListPanel.php
trunk/moodle/mod/voicetool/index.php
trunk/moodle/mod/voicetool/lib.php
trunk/moodle/mod/voicetool/mod.html
trunk/moodle/mod/voicetool/view.php
trunk/moodle/mod/voicetool/welcome.php
Added Paths:
-----------
trunk/moodle/mod/voicetool/api.php
trunk/moodle/mod/voicetool/db/postgres7.php
trunk/moodle/mod/voicetool/db/postgres7.sql
trunk/moodle/mod/voicetool/getXmlNewPanel.php
trunk/moodle/mod/voicetool/js/Ajax.js
trunk/moodle/mod/voicetool/js/constants.js
trunk/moodle/mod/voicetool/js/hwCommons.js
trunk/moodle/mod/voicetool/js/manageXml.js
trunk/moodle/mod/voicetool/js/pngfix.js
trunk/moodle/mod/voicetool/js/verifForm.js
trunk/moodle/mod/voicetool/pictures/items/more-link.png
Added: trunk/moodle/mod/voicetool/api.php
===================================================================
--- trunk/moodle/mod/voicetool/api.php (rev 0)
+++ trunk/moodle/mod/voicetool/api.php 2006-12-29 16:03:27 UTC (rev 153)
@@ -0,0 +1,544 @@
+<?PHP
+/******************************************************************************
+ * *
+ * Copyright (c) 1999-2006 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 *
+ * *
+ * Date: 15th April 2006 *
+ * *
+ ******************************************************************************/
+
+/* $Id$ */
+error_reporting(E_ALL);
+//WebService Client.
+require_once($CFG->libdir.'/soap/nusoap.php');
+//require_once($CFG->dirroot.'/lib/soap/nusoap.php');
+//require_once("$CFG->dirroot./lib/soap/nusoap.php");
+//require_once("lib.php");
+
+/// Library of functions and constants for the voicetool API
+
+$VT_API_VBOARD = 'board';
+$VT_API_VMAIL = 'vmail';
+$VT_API_VDIRECT = 'voicedirect';
+$VT_API_VRECORDER = 'recorder';
+
+$VT_API_QUALITY_BASIC = 'spx_8_q3';
+$VT_API_QUALITY_STANDARD = 'spx_16_q4';
+$VT_API_QUALITY_GOOD = 'spx_16_q6';
+$VT_API_QUALITY_SUPERIOR = 'spx_32_q8'; //ou q10 ??
+
+$VT_API_SERVICES = '/services/Broker?wsdl';
+$VT_API_CREATE_RESOURCE = 'createResource';
+$VT_API_MODIFY_RESOURCE = 'modifyResource';
+$VT_API_DELETE_RESOURCE = 'deleteResource';
+$VT_API_GET_RESOURCE = 'getResource';
+$VT_API_GET_RESOURCES = 'getResources';
+$VT_API_RESOURCE_EXISTS = 'resourceExists';
+$VT_API_CREATE_SESSION = 'createSession';
+$VT_API_ALLOWEDDOCBASE = 'isDocumentBaseAllowed';
+$VT_API_MESSAGE_EXISTS = 'messageExists';
+//-------
+$VT_API_STORE_AUDIO = 'storeAudio';
+
+$VT_API_GET_AUDIO = 'getAudio';
+
+$VT_API_AUDIO_EXISTS = 'audioExists';
+
+
+/**
+ * Send an SDK request to the VT server to create the resource.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_CREATE_RESOURCE
+ * @param $resource_data - the resource to create
+ * @return - the object returned by the call, or false if something goes wrong
+ */
+function voicetools_api_create_resource ($resource_data) {
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_CREATE_RESOURCE;
+
+ // print_r($resource_data);
+
+ // Set the WebService URL
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ // Set the parameters to send to the WebService
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $resource_data);
+
+ //print_r($resource);
+
+ // Call the WebService and store its result in $result.
+ $result = $soapclient->call($VT_API_CREATE_RESOURCE, $resource);
+
+ // echo "create resource".'<br>';
+ //print_r ($result);
+
+ /*
+ if (!voicetool_api_check_result ($result)) {
+
+ return false;
+ }
+ */
+ //return false;
+ return $result;
+}
+
+/**
+ * Send an SDK request to the VT server to create the resource.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_MODIFY_RESOURCE
+ * @param $resource_data - the resource to create
+ * @return - the object returned by the call, or false if something goes wrong
+ */
+function voicetools_api_modify_resource ($resource_data) {
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_MODIFY_RESOURCE;
+
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $resource_data);
+ //print_r($resource);
+
+ $result = $soapclient->call($VT_API_MODIFY_RESOURCE, $resource);
+
+
+ //print_r ($result);
+
+ /*
+ if (!voicetool_api_check_result ($result)) {
+ return false;
+ }
+ */
+ return $result;
+}
+// To CHECK !!!
+function voicetools_api_message_exists ($rid, $mid) {
+
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_MESSAGE_EXISTS;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $rid,
+ $mid);
+ //print_r($resource);
+
+ $result = $soapclient->call($VT_API_MESSAGE_EXISTS, $resource);
+
+ if (!voicetool_api_check_result ($result)) {
+ return false;
+ }
+
+
+ $res=false;
+ foreach ($result['values'] as $item) {
+ if ($item['name'] == 'exists') {
+ $res = $item['value'];
+ }
+ }
+
+ return $res;
+ //return $result;
+}
+
+/**
+ * Send an SDK request to the VT server to delete a resource.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_DELETE_RESOURCE
+ * @param $rid - the rid of the resource to delete
+ * @return - the object returned by the call, or false if something goes wrong
+ */
+function voicetools_api_delete_resource ($rid) {
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_DELETE_RESOURCE;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $rid);
+
+ $result = $soapclient->call($VT_API_DELETE_RESOURCE, $resource);
+
+ /*
+ if (!voicetool_api_check_result ($result)) {
+ return false;
+ }
+ */
+ return $result;
+}
+
+/**
+ * Send an SDK request to the VT server to test if the resource exist.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_RESOURCE_EXISTS
+ * @param $rid - the rid of the resource to find
+ * @return - a boolean. true if the resource exist, false elsewhere.
+ */
+function voicetools_api_resource_exists ($rid) {
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_RESOURCE_EXISTS;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $rid);
+
+ $result = $soapclient->call($VT_API_RESOURCE_EXISTS, $resource);
+ /*
+ if (!voicetool_api_check_result ($result)) {
+ return false;
+ }
+ */
+ $res=false;
+ foreach ($result['values'] as $item) {
+ if ($item['name'] == 'exists') {
+ $res = $item['value'];
+ }
+ }
+
+ return $res;
+}
+
+/**
+ * Send an SDK request to the VT server to get the resource.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_GET_RESOURCE
+ * @param $rid - the rid of the resource to get
+ * @return - the object returned by the call, or false if something goes wrong.
+ */
+function voicetools_api_get_resource($rid) {
+
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_GET_RESOURCE;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $rid);
+
+ $result = $soapclient->call($VT_API_GET_RESOURCE, $resource);
+
+ /*
+ if (!voicetool_api_check_result ($result)) {
+ return false;
+ }
+ */
+ //pair set
+ return $result;
+}
+
+
+/**
+ * Send an SDK request to the VT server to get the resources.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_GET_RESOURCES
+ * @param $ridtable - a table with the rid of the resources to get
+ * @return - an array of the objects returned by the call, or false if something goes wrong.
+ */
+function voicetools_api_get_resources($ridtable) {
+
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_GET_RESOURCES;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $ridtable);
+
+ $result = $soapclient->call($VT_API_GET_RESOURCES, $resource);
+
+ /*
+ if (!voicetool_api_check_result ($result)) {
+ return false;
+ }
+ */
+ //pair set
+ return $result;
+}
+
+
+
+/**
+ * Create the session for a voice direct applet.
+ * @uses CFG
+ * @uses VT_API_SERVICES
+ * @uses VT_API_CREATE_SESSION
+ * @param - the voicetool information
+ * @return - the mid to insert into the html
+ */
+function voicetools_api_create_session ($voicetool) {
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_CREATE_SESSION;
+
+
+ $sessiondata = voicetools_create_session_data($voicetool);
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $sessiondata['user'],
+ $sessiondata['resource'],
+ $sessiondata['message'],
+ $sessiondata['rights']);
+
+ //print_r($resource);
+
+ $result = $soapclient->call($VT_API_CREATE_SESSION, $resource);
+
+ echo "create session".'<br>';
+ print_r ($result);
+
+ if (!voicetools_api_check_result ($result)) {
+
+ return false;
+ }
+
+ foreach ($result['values'] as $item) {
+
+ $values[$item['name']] = $item['value'];
+
+ }
+
+
+ return $values['nid'];
+}
+
+/**
+ * Checks that the documentabase is allowed on the VT server
+ * @param string $server the url of the VT server
+ * @param string $login the API login to use
+ * @param string $password the API password to use
+ * @param string the url that need to be checked
+ * @return string the string 'ok' if the url given is authorized to display voice tools,
+ * or an error message otherwise
+ */
+function voicetools_api_check_documentbase($server, $login, $password, $url) {
+ global $VT_API_SERVICES,
+ $VT_API_ALLOWEDDOCBASE;
+
+
+ $soapclient = new soap_client($server.$VT_API_SERVICES,true);
+
+ $resource = array ($login,
+ $password,
+ $url);
+
+ $result = $soapclient->call($VT_API_ALLOWEDDOCBASE, $resource);
+
+// print_r($result);
+
+ if (!voicetools_api_check_result ($result)) {
+ add_to_log("", "voice tool", "", "", "result ".$result);
+ return voicetools_api_get_error_message ($result);
+ }
+
+ foreach ($result['values'] as $item) {
+ if ($item['name'] == 'is_allowed') {
+ return 'is_allowed.'.$item['value'];
+ }
+ }
+
+ error('Return Value not Found');
+}
+
+function voicetools_api_audio_exists ($rid, $mid) {
+
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_AUDIO_EXISTS;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $rid,
+ $mid);
+ //print_r($resource);
+
+ $result = $soapclient->call($VT_API_AUDIO_EXISTS, $resource);
+
+ if (!voicetools_api_check_result ($result)) {
+ return false;
+ }
+
+
+ $res=false;
+ foreach ($result['values'] as $item) {
+ if ($item['name'] == 'exists') {
+ $res = $item['value'];
+ }
+ }
+
+ return $res;
+ //return $result;
+}
+
+function voicetools_api_store_audio($rid, $mid, $audio, $filename) {
+ global $CFG,
+ $VT_API_SERVICES,
+ $VT_API_STORE_AUDIO;
+
+ $soapclient = new soap_client($CFG->voicetools_servername.$VT_API_SERVICES,true);
+
+ $resource = array ($CFG->voicetools_adminusername,
+ $CFG->voicetools_adminpassword,
+ $rid,
+ $mid,
+ $audio,
+ $filename);
+
+ $result = $soapclient->call($VT_API_STORE_AUDIO, $resource);
+}
+
+////////// Helper Function, kind of private
+
+/**
+ * Return true if the result does not contain an error code, or false wise.
+ * @param $result - a pairset resulting from an API call to $soapclient->call()
+ * @return true f $result does not contain an error code, false otherwise.
+ */
+function voicetools_api_check_result ($result) {
+
+
+ if (empty($result)){
+ //error ("Empty result after call to $VT_API_SERVICES");
+ error_log( "voicetool_api_check_result: Empty result after call to $VT_API_SERVICES");
+ add_to_log("", "voice tool", "", "", "voicetool_api_check_result: Empty result after call to ".$VT_API_SERVICES);
+ return false;
+ }
+
+ //$resultcode = voicetool_api_get_status_code($result);
+ if (voicetools_api_get_status_code($result) != 'ok') {
+ add_to_log("", "voice tool", "", "", "voicetool_api_check_result: not ok");
+ error_log( "voicetool_api_check_result: ".voicetools_api_get_error_message($result));
+ return false;
+ }
+
+ return true;
+}
+
+
+/**
+ * Return the status code as a string
+ * @param array $result - the result from a soap call
+ * @return string - the status code returned if any, or the empty string if none is found
+ */
+function voicetools_api_get_status_code ($result) {
+
+ foreach ($result['values'] as $values) {
+ if ($values['name'] == 'status_code') {
+ return $values['value'];
+ }
+ }
+ return '';
+}
+
+/**
+ * Return the error message as a string
+ * @param array $result - the result from a soap call
+ * @return string - the error message returned if any, or the empty string if none is found
+ */
+function voicetools_api_get_error_message ($result) {
+ foreach ($result['values'] as $values) {
+ if ($values['name'] == 'error_message') {
+ return $values['value'];
+ }
+ }
+ return '';
+}
+
+function voicetools_api_get_options($resourceid) {
+
+ $result = voicetools_api_get_resource($resourceid) ;
+
+ foreach ($result['groups'] as $values) {
+ if ($values['name'] == 'options'){
+ return $values['pairSet'];
+ }
+ }
+
+
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+class PairSet {
+ var $data = array ('values' => array (), 'groups' => array ());
+
+
+ /**
+ * Add a new NameValuePair in this PairSet
+ * @param aname - the name of the new NameValuePair
+ * @param avalue - the value of the new NameValuePair
+ */
+ function addNameValuePair ($aname, $avalue) {
+ array_push ($this->data['values'], array('name' => $aname, 'value' => $avalue));
+ }
+
+ /**
+ * Add a PairSet to this PairSet
+ * @param - the name of the new PairSet
+ * @param - the PairSet to add
+ */
+ function addPairSet ($aname, $aPairSet) {
+ array_push ($this->data['groups'],
+ array('name' => $aname, 'pairSet' => $aPairSet->getData()));
+ }
+
+ /**
+ * @return - an associative array containing this PairSet ready for the web service call
+ */
+ function getData () {
+ return $this->data;
+ }
+}
+
+?>
Property changes on: trunk/moodle/mod/voicetool/api.php
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author Id
Name: svn:eol-style
+ native
Modified: trunk/moodle/mod/voicetool/config.html
===================================================================
--- trunk/moodle/mod/voicetool/config.html 2006-12-29 13:51:23 UTC (rev 152)
+++ trunk/moodle/mod/voicetool/config.html 2006-12-29 16:03:27 UTC (rev 153)
@@ -1,57 +1,55 @@
-<?php
-require_once ("$CFG->dirroot/lib/datalib.php");
-
-
-if (!$courses = get_records ('course', '', '', 'shortname ASC', 'id, shortname, fullname')) {
- error('Cannot retreive Course list');
-}
-
-
-
-?>
-
-
<form method="post" action="module.php" name="form">
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>">
-<input type="hidden" name="module" value="voicetool">
+<input type="hidden" name="module" value="voicetools">
<table cellpadding="9" cellspacing="0" >
<tr>
<td colspan="3" align="center">
- <div><b><?php print_string('serverconfiguration', 'voicetool')?></b></div>
- <div style="font-size: 0.8em;">(<?php print_string('explainserverconfiguration', 'voicetool')?>)</div>
+ <div><b><?php print_string('serverconfiguration', 'voicetools')?></b></div>
+ <div style="font-size: 0.8em;">(<?php print_string('explainserverconfiguration', 'voicetools')?>)</div>
</td>
</tr>
<tr valign="top">
- <td align="right"><?php print_string('servername', 'voicetool')?>:</td>
+ <td align="right"><?php print_string('servername', 'voicetools')?> :</td>
<td>
- <input name="servername" type="text" size="30" value="<?php p($CFG->voicetool_servername) ?>" />
+ <input name="servername" type="text" size="30" value="<?php p($CFG->voicetools_servername) ?>" />
</td>
<td>
- <?php print_string('configservername', 'voicetool') ?>
+ <?php print_string('configservername', 'voicetools') ?>
</td>
</tr>
<tr valign="top">
- <td align="right"><?php print_string('adminusername', 'voicetool')?>:</td>
+ <td align="right"><?php print_string('adminusername', 'voicetools')?> :</td>
<td>
- <input name="adminusername" type="text" size="20" value="<?php p($CFG->voicetool_adminusername) ?>" />
+ <input name="adminusername" type="text" size="30" value="<?php p($CFG->voicetools_adminusername) ?>" />
</td>
<td>
- <?php print_string('configadminusername', 'voicetool') ?>
+ <?php print_string('configadminusername', 'voicetools') ?>
</td>
</tr>
<tr valign="top">
- <td align="right"><?php print_string('adminpassword', 'voicetool')?>:</td>
+ <td align="right"><?php print_string('adminpassword', 'voicetools')?> :</td>
<td>
- <input name="adminpassword" type="text" size="20" value="<?php p($CFG->voicetool_adminpassword) ?>" />
+ <input name="adminpassword" type="text" size="30" value="<?php p($CFG->voicetools_adminpassword) ?>" />
</td>
<td>
- <?php print_string('configadminpassword', 'voicetool') ?>
+ <?php print_string('configadminpassword', 'voicetools') ?>
</td>
</tr>
+
<tr>
+<td><br /></td>
+</tr>
+<tr valign="top">
+ <td align="right"><?php print_string('integrationversion', 'voicetools')?> :</td>
+ <td>
+ <?php print_string("integrationversionnumber", "voicetools") ?>
+ </td>
+</tr>
+
+<tr>
<td colspan="3" align="center">
<input type="submit" value="<?php print_string('savechanges') ?>" /></td>
</tr>
Modified: trunk/moodle/mod/voicetool/css/StyleSheet.css
===================================================================
--- trunk/moodle/mod/voicetool/css/StyleSheet.css 2006-12-29 13:51:23 UTC (rev 152)
+++ trunk/moodle/mod/voicetool/css/StyleSheet.css 2006-12-29 16:03:27 UTC (rev 153)
@@ -14,6 +14,8 @@
body p, body div, body li, body li li,
body input, body textarea, body select, body option ,td textarea
{font-size:100%;}
+
+
.page_title
{
font-family: Verdana, Arial, Helvetica, sans-serif;
@@ -34,61 +36,106 @@
padding-left:2px;
vertical-align:middle;
}
-table.tab
-{
- width:100%;
+.limitWidth
+{
+ width:160px;
}
-table.tab td
+.alignRight
{
- vertical-align:top;
+
+
}
+.shiftAvailability
+{
+
+ padding-right:50px;
+}
div.tab
{
- padding-top:2%;
- padding-left:5%;
+ padding-top:2%;
+
+ padding-left:5%;
+ padding-right:5%;
display: none;
height:180px;
+
+
}
+.titlePodcaster
+ {
+ color:#305060;
+ font-size:14pt;
+ padding-left:10px;
+ font-family:Century Gothic, Verdana, Helvetica, Arial;
+ font-weight:bold;
+ font-style:italic;
+ vertical-align:top;
+
+
+ }
+
+
+ .podcaster
+ {
+ padding-left:15px;
+ }
+.button_hide
+{
+
+ width:25px;
+ display:none;
+}
div.current_tab
{
- margin-top:2%;
- margin-left:5%;
+ padding-top:2%;
+
+ padding-left:5%;
+ padding-right:5%;
position: relative;
display: block;
height:180px;
+
+
}
td.tabSelected
-{
+{
+
background-image:url(../pictures/tab_Select.gif);
background-repeat: no-repeat;
width: 78px;
- font-size: 10pt;
+ font-size: 10px;
font-family: Verdana;
-}
-td.tabDisabled
-{
-background-image:url(../pictures/tab_disabled.gif);
+ }
+
+ td.tabDisabled
+{
+ color:#CACACA;
+ background-image:url(../pictures/tab.gif);
background-repeat: no-repeat;
width: 78px;
- font-size: 10pt;
+ font-size: 10px;
font-family: Verdana;
border-bottom:solid 1px #818181;
-}
+ }
td.tabNoSelected
-{
-background-image:url(../pictures/tab.gif);
+{
+
+ background-image:url(../pictures/tab.gif);
background-repeat: no-repeat;
width: 78px;
- font-size: 10pt;
+ font-size: 10px;
font-family: Verdana;
border-bottom:solid 1px #818181;
}
+
a {
text-decoration:none;
color:Black; }
+
a:hover {
text-decoration:none;
color:Black; }
+
td.action,input.action{
background-image:url(../pictures/buttons/general-empty.png);
background-repeat :no-repeat;
@@ -111,28 +158,44 @@
{
cursor:pointer
}
+
.alert
{
color:Red;
}
-a.room {
-color:#889EB3;
+
+
+
+a.room { color:#889EB3;
+
text-decoration:none;
display:block;
width:100%;
+cursor:help;
+
}
-a.room:hover {color:#889EB3;
+
+a.room:hover {color:#889EB3;
+
+
text-decoration:none;
- border: none;
- background-position: 3px 4px;
+ border: none;
+
+ background-position: 3px 4px;
+ cursor:help;
}
+
+
.info a{
position:relative; /*this is the key*/
z-index:24;
color:#000;
text-decoration:none}
+
.info a:hover{z-index:25;text-decoration:underline;}
+
.info a span{display: none;font-size:8pt;}
+
.info a:hover span{ /*the span will display just on :hover state*/
font-size:8pt;
display:block;
@@ -140,60 +203,91 @@
top:1.5em; left:5em; width:28em;
border:1px solid #FFF99F;
background-color:#FFF99F; color:#000;
- text-align: center}
-.button_disabled a{
+ text-align: center}
+
+
+
+.button_disabled {
+
color:#666666;
font-family: Arial;
text-decoration:none;
font-size: 9px;
- height:44px;
+
}
-.button_disabled a:hover
+
+
+.button_enabled a
{
- color:#666666;
+
+ color:black;
font-family: Arial;
- text-decoration:none;
+ width:30px;
font-size: 9px;
- cursor:pointer;
+
}
-.button_enabled a
+
+.separator_space
{
- color:black;
+ width:2px;
+}
+
+.empty_space
+{
+ width:50px;
+}
+
+
+.button_enabled a:hover{ color:black;
+
font-family: Arial;
- text-decoration:none;
- font-size: 9px;
-}
-.button_enabled a:hover{ color:black;
- font-family: Arial;
font-size: 9px;
- text-decoration: underline;
- display:block;
+
cursor:hand;
}
+
+
+
+
tr.selectRoom{
background-color:red;
cursor:hand;
+ text-decoration:none;
}
.divProduct
{
- padding-top:3px;
+ padding-top:3px;
+padding-left:2px ;
+
}
+.separateProduct
+{
+ border-top:solid 1px #C7D3E1
+}
+
.shortShift{
+
padding-left:5px;
}
-.room td{
+
+.room td{
+ padding-left:0px ;
font-family:Verdana;
color:Black;
font-size:10;
- border-bottom:solid 1px #F3F3F3;
- cursor:pointer;
+
+ cursor:default;
+ text-decoration:none;
}
-.room label{
+
+.room label{
+
font-family:Verdana;
color:Black;
font-size:10;
- border-bottom:solid 1px #F3F3F3;
- cursor:pointer;
+
+ cursor:default;
+ text-decoration:none;
}
tr.overRoom{
font-family:Verdana;
@@ -201,99 +295,212 @@
font-size:11px;
border-bottom:solid 1px #F3F3F3;
background-color:#f0f3f5;
- cursor:pointer;
- cursor:hand;
+
+ cursor:default;
}
-.archive{
+
+.archive td{
+ padding-left:2px ;
font-family:Verdana;
color:#666666;
font-style:italic;
font-size:11px;
+
+}
+
+.room td{
+ padding-left:5px ;
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
border-bottom:solid 1px #F3F3F3;
+ cursor:default;
}
-.filterBar {
+
+.archive label{
+
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:default;
+}
+.room label{
+
+ font-family:Verdana;
+ color:Black;
+ font-size:10;
+ border-bottom:solid 1px #F3F3F3;
+ cursor:default;
+}
+
+
+
+.filterBar table{
+
background-image:url("../pictures/backgrounds/filterbar.png");
height:24px;
font-weight:bold ;
- width:100%;
+
border-bottom:fine 1px #C7D3E1
}
+
+
+
.filter_enabled
{
font-family :Verdana;
color:#333333;
height:24px;
- font-size:12px;
+ text-align:center;
+ font-size:10px;
font-weight:bold ;
}
+
.filter_selected
{ font-weight:bold ;
font-family :Verdana;
color:#ffffff;
+ text-align:center;
height:24px;
- font-size:12px;
+ font-size:10px;
+
}
+
.filter_left_enabled
{
background-image:url("../pictures/items/filter-enabled-left.png");
+ background-repeat:no-repeat;
}
.filter_middle_enabled
{
background-image:url("../pictures/items/filter-enabled-middle.png");
font-family :Verdana;
color:#ffffff;
+ text-align:center;
height:24px;
- font-size:12px;
+ font-size:10px;
font-weight:bold ;
}
.filter_right_enabled
{
background-image:url("../pictures/items/filter-enabled-right.png");
+ background-repeat:no-repeat;
}
+.filter_right_rollover
+{
+ background-image:url("../pictures/items/filter-rollover-right.png");
+ background-repeat:no-repeat;
+}
+.noFilter
+{
+ background-image:none;
+ font-family :Verdana;
+ color:#333333;
+ text-align:center;
+ height:24px;
+ font-size:10px;
+ font-weight:bold ;
+}
+.filter_middle_rollover
+{
+ background-image:url("../pictures/items/filter-rollover-middle.png");
+ font-family :Verdana;
+ color:#333333;
+ text-align:center;
+ height:24px;
+ font-size:10px;
+ font-weight:bold ;
+
+}
+.filter_left_rollover
+{
+ background-image:url("../pictures/items/filter-rollover-left.png");
+ background-repeat:no-repeat;
+}
+.filterSpace
+{
+ padding-left:10px;
+}
+
.contextBar table
{
+ padding-left:5px;
+ padding-right:5px;
background-image:url("../pictures/backgrounds/toolbar.png");
+
height:30px;
- width:100%
+ width:100%
+
}
+
.tabBackground
{
background-image:url("../pictures/backgrounds/toolbar.png");
+
}
+
.productChoice table
-...
[truncated message content] |