Revision: 230
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=230&view=rev
Author: trollinger
Date: 2008-01-22 14:59:37 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
Update lib and pictures path into differents files
Modified Paths:
--------------
branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css
branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
branches/team/Thomas/moodle/mod/voicetools/index.php
branches/team/Thomas/moodle/mod/voicetools/manageAction.php
branches/team/Thomas/moodle/mod/voicetools/mod.html
branches/team/Thomas/moodle/mod/voicetools/view.php
branches/team/Thomas/moodle/mod/voicetools/welcome.php
Modified: branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/css/StyleSheet.css 2008-01-22 22:59:37 UTC (rev 230)
@@ -126,7 +126,7 @@
height: 32px;
border-bottom: solid 1px Black;
- background:white url( "../pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
+ background:white url( "../lib/web/pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
}
.headerBarRight
@@ -141,7 +141,7 @@
/*contextBar*/
#contextBar table
{
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
height: 30px;
width: 100%;
border-bottom: solid 1px #F0F0F0;
@@ -167,7 +167,7 @@
#filterBar
{
- background-image: url( "../pictures/backgrounds/filterbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/filterbar.png" );
height: 24px;
font-weight: bold;
border-bottom: fine 1px #C7D3E1;
@@ -200,22 +200,22 @@
a.filterenabled span
{
- background:url("../pictures/items/filter-enabled-right.png") no-repeat right top;
+ background:url("../lib/web/pictures/items/filter-enabled-right.png") no-repeat right top;
color:white;
}
a.filterenabled
{
- background:url("../pictures/items/filter-enabled-left.png") no-repeat left top;
+ background:url("../lib/web/pictures/items/filter-enabled-left.png") no-repeat left top;
}
a.filterrollover
{
- background:url("../pictures/items/filter-rollover-left.png") no-repeat left top;
+ background:url("../lib/web/pictures/items/filter-rollover-left.png") no-repeat left top;
}
a.filterrollover span
{
- background:url("../pictures/items/filter-rollover-right.png") no-repeat right top;
+ background:url("../lib/web/pictures/items/filter-rollover-right.png") no-repeat right top;
}
/*list*/
@@ -403,7 +403,7 @@
padding-left: 5px;
width: 100%;
height:40px;
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
border-bottom: solid 1px #999999;
}
@@ -459,12 +459,12 @@
/*tabs*/
#tabs
{
- background-image: url( "../pictures/backgrounds/toolbar.png" );
+ background-image: url( "../lib/web/pictures/backgrounds/toolbar.png" );
}
td.tabSelected,td.tabDisabled,td.tabNoSelected
{
- background-image: url(../pictures/items/tab-selected.gif);
+ background-image: url(../lib/web/pictures/items/tab-selected.gif);
background-repeat: no-repeat;
width: 78px;
font-size: 10px;
@@ -476,12 +476,12 @@
{
color: #CACACA;
z-index:-14;
- background-image: url(../pictures/items/tab-unselected.gif);
+ background-image: url(../lib/web/pictures/items/tab-unselected.gif);
border-bottom: solid 1px #818181;
}
td.tabNoSelected
{
- background-image: url(../pictures/items/tab-unselected.gif);
+ background-image: url(../lib/web/pictures/items/tab-unselected.gif);
border-bottom: solid 1px #818181;
}
@@ -563,7 +563,7 @@
td.action, input.action
{
- background-image: url(../pictures/buttons/general-empty.png);
+ background-image: url(../lib/web/pictures/buttons/general-empty.png);
background-repeat: no-repeat;
background-position: center;
text-decoration: none;
@@ -574,7 +574,7 @@
}
td.action:hover, input.action:hover
{
- background-image: url(../pictures/buttons/general-empty-over.png);
+ background-image: url(../lib/web/pictures/buttons/general-empty-over.png);
}
.action label
@@ -724,7 +724,7 @@
top:0px;
width:10px;
height:150px;
- background-image: url( "../pictures/items/window-left.png" );
+ background-image: url( "../lib/web/pictures/items/window-left.png" );
background-repeat:none;
}
@@ -734,7 +734,7 @@
top:0px;
width:330px;
height:150px;
- background-image: url( "../pictures/items/window-middle.png" );
+ background-image: url( "../lib/web/pictures/items/window-middle.png" );
}
@@ -754,7 +754,7 @@
top:0px;
width:10px;
height:200px;
- background-image: url( "../pictures/items/window200_left.png" );
+ background-image: url( "../lib/web/pictures/items/window200_left.png" );
background-repeat:none;
}
@@ -764,7 +764,7 @@
top:0px;
width:380px;
height:200px;
- background-image: url( "../pictures/items/window200_middle.png" );
+ background-image: url( "../lib/web/pictures/items/window200_middle.png" );
}
@@ -774,7 +774,7 @@
top:0px;
width:10px;
height:200px;
- background-image: url( "../pictures/items/window200_right.png" );
+ background-image: url( "../lib/web/pictures/items/window200_right.png" );
background-repeat:none;
}
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlChoicePage.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -29,52 +29,35 @@
/* $Id: getXmlChoicePage.php 52853 2007-08-24 17:55:26Z thomasr $ */
error_reporting(E_ERROR);
-
+global $CFG;
require_once("../../config.php");
-// require_once("lib.php");
+require_once("lib.php");
require_once("lib/php/common/WimbaXml.php");
require_once("lib/php/common/WimbaCommons.php");
+require_once("lib/php/common/WimbaLib.php");
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
-
-// Variables needed
-global $CFG;
-
-$params = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $params[$key] = $val;
- }
-
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $params[$key] = $val;
- }
-
-}
+require_login($params["enc_course_id"]);
$xml=new WimbaXml();
$session=new WimbaMoodleSession($params);
-if($session->error==false)
-{
- if(isset($params["createWorkflow"]) )
- $createWorkflow= $params["createWorkflow"];
- else
- $createWorkflow=false;
-
-
-
-
+if($session->error==false)//no error
+{
/********
HEADER
*********/
- $xml->addHeaderElement("pictures/items/headerbar-logo.png", "true", "true");
+ $xml->addHeaderElement("lib/web/pictures/items/headerbar-logo.png", "true", "true");
/********
SESSION
*********/
- $xml->CreateInformationElement($session->timeOfLoad,$session->hparams["firstname"],$session->hparams["lastname"],$session->hparams["email"],$session->hparams["role"],$session->hparams["courseId"],$session->signature,"","",$CFG->voicetools_servername,$pictures);
+ $xml->CreateInformationElement($session->timeOfLoad,$session->hparams["firstname"],$session->hparams["lastname"],$session->hparams["email"],$session->hparams["role"],$session->hparams["course_id"],$session->signature,"","",$CFG->voicetools_servername);
/************
INFORMATIONS
@@ -84,10 +67,10 @@
/***************
PRODUCTS CHOICE
****************/
- $xml->addProductChoice("pictures/buttons/new-createvoiceboard.png",get_string('new_board', 'voicetools'),get_string('VoiceBoardDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','board','all','".$createWorkflow."')");
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createvoiceboard.png",get_string('new_board', 'voicetools'),get_string('VoiceBoardDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','board','all','".$createWorkflow."')");
- $xml->addProductChoice("pictures/buttons/new-createvoicepresentation.png",get_string('new_presentation', 'voicetools'),get_string('VoicePresentationDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','presentation','all','".$createWorkflow."')");
- $xml->addProductChoice("pictures/buttons/new-createpodcaster.png",get_string('new_podcaster', 'voicetools'),get_string('PodcasterDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','pc','all','".$createWorkflow."')");//for 3.1
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createvoicepresentation.png",get_string('new_presentation', 'voicetools'),get_string('VoicePresentationDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','presentation','all','".$createWorkflow."')");
+ $xml->addProductChoice("lib/web/pictures/buttons/new-createpodcaster.png",get_string('new_podcaster', 'voicetools'),get_string('PodcasterDescription', 'voicetools'),"javascript:loadNewSettings('getXmlNewPanel.php','create' ,'voicetools','pc','all','".$createWorkflow."')");//for 3.1
/***************
VALIDATION BAR
@@ -100,15 +83,8 @@
$xml->createValidationButtonElement(get_string("validationElement_cancel", "voicetools"), "action", "javascript:launchAjaxRequest('getXmlListPanel.php','',true,'all')", "setting_Cancel");
-
- }else{ //bad session
-
- if($session->error=="session")
- $xml->setError(get_string ('session', 'voicetools'));
- else if($session->error=="signature")
- $xml->setError(get_string ('signature', 'voicetools'));
- echo $xml->getXml();
- exit();
- }
- echo $xml->getXml();
+}else{ //bad session
+ $xml->setError(get_string ($session->error, 'voicetools'));
+}
+echo $xml->getXml();
?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlListPanel.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -31,41 +31,32 @@
/// This page generates the xml of the principal window
error_reporting(E_ERROR);
+global $CFG;
+
require_once("../../config.php");
require_once("lib.php");
-
require_once("lib/php/common/WimbaXml.php");
require_once("lib/php/common/WimbaCommons.php");
require_once("lib/php/common/WimbaUI.php");
require_once("lib/php/common/XmlResource.php");
require_once('lib/php/vt/WimbaVoicetools.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once('lib/php/common/WimbaLib.php');
-
-set_time_limit(30);
-
-
-// Variables needed
-global $CFG;
-
-$params = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $params[$key] = $val;
- }
-
+if (version_compare(PHP_VERSION,'5','>=')) {
+ require_once('lib/php/common/domxml-php4-php5.php');
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $params[$key] = $val;
- }
-
-}
+$messageProduct=optional_param("messageProduct","");
+$messageAction=optional_param("messageAction","");
-if (version_compare(PHP_VERSION,'5','>=')) {
- require_once('lib/common/domxml-php4-php5.php');
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
+
+require_login($params["enc_course_id"]);
$session=new WimbaMoodleSession($params);
$uiManager=new WimbaUI($session);
if(isset($params["error"])){
@@ -73,26 +64,19 @@
}
else
{
- //Session Management
-
- $message="";
- if(isset($params["messageProduct"]) && isset($params["messageAction"]))
- $message=get_string("message_" . $params["messageProduct"] . "_start", "voicetools")." ".get_string("message_" . $params["messageAction"] . "_end","voicetools");
-
+ //Session Management
if($session->error==false)//good
{
+ $message="";
+ if(!empty($messageProduct) && !empty($messageAction))
+ $message=get_string("message_".$messageProduct."_start", "voicetools")." ".get_string("message_".$messageAction."_end","voicetools");
$display=$uiManager->getVTPrincipalView($message);
}
else
{ //bad session
- if($session->error=="session")
- $display=$uiManager->setError(get_string ('error_session', 'voicetools'));
- else if($session->error=="signature")
- $display=$uiManager->setError(get_string ('error_signature', 'voicetools'));
- echo $display;
- exit();
+ $display="";//to make sure that nothing was displayed before
+ $display=$uiManager->setError(get_string ('error_'.$session->error, 'voicetools'));
}
}
echo $display;
-
- ?>
\ No newline at end of file
+?>
\ No newline at end of file
Modified: branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/getXmlNewPanel.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -40,54 +40,45 @@
require_once("lib/php/common/WimbaCommons.php");
require_once("lib/php/common/WimbaXml.php");
require_once("lib/php/common/WimbaUI.php");
-
-set_time_limit(30);
-
+require_once("lib/php/common/WimbaLib.php");
if (version_compare(PHP_VERSION,'5','>=')) {
require_once('lib/php/common/domxml-php4-php5.php');
}
+set_time_limit(30);
-
-$list_attributes = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $list_attributes[$key] = $val;
- }
-
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+foreach(getKeysOfGeneralParameters() as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $list_attributes[$key] = $val;
- }
-
-}
-$session=new WimbaMoodleSession($list_attributes);
+
+require_login($params["enc_course_id"]);
+
+$session=new WimbaMoodleSession($params);
$uiManager=new WimbaUI($session);
if($session->error==false)
{
- if(isset($_GET["createWorkflow"]) && $_GET["createWorkflow"]=="true")
- $createWorkflow= "true";
- else
- $createWorkflow="false";
+
/*******************
GET URL INFORMATIONS
********************/
$action = optional_param('action', ""); // Course Module ID, or
- $typeProduct = $list_attributes['type'];
+ $typeProduct = $params['type'];
add_to_log($session->getCourseId(), "voicetools", "xml", "product" , $typeProduct);
if($action == 'update') { //get the information of the resource
- $currentBoard = voicetools_api_get_resource($list_attributes["id"]);
+ $currentBoard = voicetools_api_get_resource($params["resource_id"]);
if($currentBoard==null || $currentBoard->error==true){
$xml->setError(get_string('problem_vt','voicetools'));
echo $xml->getXml();
exit();
}
- $currentBoardInformations=voicetools_get_voiceboard_Informations($list_attributes["id"]);
+ $currentBoardInformations=voicetools_get_voiceboard_Informations($params["resource_id"]);
if($currentBoard->error==true){
$xml->setError(get_string('problem_bd','voicetools'));
echo $xml->getXml();
@@ -111,6 +102,6 @@
}
- echo $display;
- ?>
+echo $display;
+?>
Modified: branches/team/Thomas/moodle/mod/voicetools/index.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/index.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/index.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -29,18 +29,15 @@
/* $Id: index.php 52852 2007-08-24 17:50:59Z thomasr $ */
/// This page lists all the instances of voicetools in a particular course
-
+error_reporting(E_ERROR);
require_once("../../config.php");
require_once("lib.php");
require_once("lib/php/common/WimbaLib.php");
-$id = optional_param('id', 0, PARAM_INT); // course
-$course = optional_param('course', 0, PARAM_INT);
-$type = optional_param('type');
+$course_id = optional_param('id', 0, PARAM_INT); // course
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
-
-
-if (! $course = get_record("course", "id", $id)) {
+if (! $course = get_record("course", "id", $course_id)) {
error("Course ID is incorrect");
}
@@ -48,22 +45,15 @@
add_to_log($course->id, "voicetool", "view all", "index.php?id=$course->id", "");
-
-$id = optional_param('id', 0, PARAM_INT);
-if (! $course = get_record("course", "id", $id)) {
- error("Course ID is incorrect");
-}
-require_login($course->id);
$strvoicetools = get_string("modulenameplural", "voicetools");
$strvoicetool = get_string("modulename", "voicetools");
$navigation = array();
- if ($course->id != SITEID) {
+if ($course->id != SITEID) {
$navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id";
}
$navigation[$strvoicetools] = "";
-
$urls = array();
foreach($navigation as $text => $href) {
if (empty($href)) {
@@ -75,45 +65,25 @@
$breadcrumb = implode(' -> ', $urls);
print_header("$course->shortname", "$course->fullname",
-"$breadcrumb",
-"", "", true, "",
-"");
-$url = get_url_params($course->id);
+ "$breadcrumb","", "",true,"","");
+$url_params = get_url_params($course->id);
-if(isset($_GET["createWorkflow"]) && $_GET["createWorkflow"]==true)
- $novoicetools="&createWorkflow=true&type=".$type;
-else
- $novoicetools="";
-?>
+//create the url which all the parameters needed
+$url="welcome.php?id=".$course->id."&".$url_params."&time=".time()."&createWorkflow=".$createWorkflow;
- <head>
-
-
- </head>
-<br>
+?>
+<br>
<body>
-<br>
-
-
-<div align="center">
- <table height="95%">
- <iframe src="welcome.php?id=<?php echo $id; ?>&<?php echo $url; ?>&time=<?php echo time() ?><?php echo $novoicetools ?>" width="705px" height="405px" name="frameWidget" style="overflow:hidden;" FRAMEBORDER=0 align="middle">
- <p>Sorry your navigator can't display this iframe
-
- </iframe>
-</table>
-</div>
-
+ <div align="center">
+ <table height="95%">
+ <iframe src="<?=$url?>" width="705px" height="405px" name="frameWidget" style="overflow:hidden;" FRAMEBORDER=0>
+ <p>Sorry your navigator can't display this iframe
+ </iframe>
+ </table>
+ </div>
</body>
-
-
-
-
-
-
<?php
-/// Finish the page
-
+/// Finish the page
print_footer($course);
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/manageAction.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/manageAction.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -38,50 +38,38 @@
require_once ("lib/php/common/WimbaCommons.php");
require_once ('lib/php/vt/WimbaVoicetools.php');
require_once ('lib/php/vt/WimbaVoicetoolsAPI.php');
+require_once ('lib/php/vt/VtAction.php');
global $CFG;
-$list_attributes = array ();
-if (!empty ($_POST) ) {
- while (list ($key, $val) = each($_POST)) {
- $list_attributes[$key] = $val;
- }
-
+$messageProduct=optional_param("messageProduct","");
+$messageAction=optional_param("messageAction","");
+$notool=optional_param("novoicetools","false");
+$keys=array_merge(getKeysOfGeneralParameters(),getKeyWimbaVoiceForm());
+foreach($keys as $param){
+ $value=optional_param($param["value"],$param["default_value"],$param["type"]);
+ if($value!=null)
+ $params[$param["value"]] = $value;
}
-if (!empty ($_GET) ) {
- while (list ($key, $val) = each($_GET)) {
- $list_attributes[$key] = $val;
- }
-
-}
+require_login($params["enc_course_id"]);
+$vtAction = new vtAction($params);
-$vtAction = new vtAction($list_attributes);
-
-$session = new WimbaMoodleSession($list_attributes);
-
+$session = new WimbaMoodleSession($params);
$messageType = "";
if ($session->error == false && $session != NULL) {
- if (isset ($list_attributes["novoicetools"]) && $list_attributes["novoicetools"] == "true")
- $notool = "true";
- else
- $notool = "false";
- //if(isteacher($session->getCourseId())) {
- if ($_GET['action'] == 'launch') {
- $session->setCurrentVtUSer($list_attributes["type"]);
- if ($_GET["studentView"] == "true") {
- $session->setVtUserRigths($list_attributes["type"], "student");
+
+ if ($params['action'] == 'launch') {
+ $session->setCurrentVtUSer($params["type"]);
+ if ($params["studentView"] == "true") {
+ $session->setVtUserRigths($params["type"], "student");
}
- $resource = voicetools_api_get_resource($list_attributes["id"]);
-
-
+ $resource = voicetools_api_get_resource($params["resource_id"]);
$result = $vtAction->getVtSession($resource, $session->getVtUser(), $session->getVtUserRigths());
-
-
if ($result != NULL) {
- header('Location:' . $CFG->voicetools_servername . '/' . $list_attributes["type"] . '?action=display_popup&nid=' . $result->getNid());
+ header('Location:' . $CFG->voicetools_servername . '/' . $params["type"] . '?action=display_popup&nid=' . $result->getNid());
}
else {
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_vt');
@@ -89,30 +77,30 @@
exit ();
}
- elseif ($list_attributes['action'] == 'create') {
- if ($list_attributes['type'] == "board") {
+ elseif ($params['action'] == 'create') {
+ if ($params['type'] == "board") {
$result = $vtAction->createBoard(); //create the resource on the vt
$messageAction = "created";
$messageProduct = "board";
}
- elseif ($list_attributes['type'] == "presentation") {
+ elseif ($params['type'] == "presentation") {
$result = $vtAction->createPresentation();
$messageAction = "created";
$messageProduct = "presentation";
}
- elseif ($list_attributes['type'] == "pc") {
+ elseif ($params['type'] == "pc") {
$result = $vtAction->createPodcaster();
$messageAction = "created";
$messageProduct = "pc";
}
-
+
if ($result != NULL && $result->error != "error") {
- $resourceId = storeResource($result->getRid(), $session->getCourseId(), $list_attributes['type'],$list_attributes["longname"], $list_attributes);
+ $params["resource_id"] = storeResource($result->getRid(), $session->getCourseId(), $params['type'],$params["longname"], $params);
- if (empty ($resourceId)) {
+ if (empty ($params["resource_id"])) {
error_log(__FUNCTION__ . " : Problem to add the new resource on the database", TRUE);
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_bd');
@@ -131,22 +119,22 @@
exit ();
}
}
- elseif ($list_attributes['action'] == 'update') {
- if ($list_attributes['type'] == "board") {
+ elseif ($params['action'] == 'update') {
+ if ($params['type'] == "board") {
- $result = $vtAction->modifyBoard($list_attributes["id"]); //create the resource on the vt
+ $result = $vtAction->modifyBoard($params["resource_id"]); //create the resource on the vt
$messageAction = "updated";
$messageProduct = "board";
}
- elseif ($list_attributes['type'] == "presentation") {
+ elseif ($params['type'] == "presentation") {
- $result = $vtAction->modifyPresentation($list_attributes["id"]);
+ $result = $vtAction->modifyPresentation($params["resource_id"]);
$messageAction = "updated";
$messageProduct = "presentation";
}
- elseif ($list_attributes['type'] == "pc") {
+ elseif ($params['type'] == "pc") {
- $result = $vtAction->modifyPodcaster($list_attributes["id"]);
+ $result = $vtAction->modifyPodcaster($params["resource_id"]);
$messageAction = "updated";
$messageProduct = "pc";
}
@@ -155,9 +143,9 @@
//create the object to store in the db
- $resourceId = updateResource($result->getRid(), $session->getCourseId(), $list_attributes['type'], $list_attributes, $list_attributes["id"]);
+ $params["resource_id"] = updateResource($result->getRid(), $session->getCourseId(), $param['type'], $param, $params["resource_id"]);
- if (empty ($resourceId)) {
+ if (empty ($params["resource_id"])) {
error_log(__FUNCTION__ . " : Problem to update the resource on the database", TRUE);
header('Location: welcome.php?id=' . $session->getCourseId() . '&' . $session->url_params . '&time=' . $session->timeOfLoad . '&error=problem_bd');
@@ -174,23 +162,23 @@
}
- elseif ($list_attributes['action'] == 'delete') {
+ elseif ($params['action'] == 'delete') {
- $result = $vtAction->deleteRessource($list_attributes["id"]);
+ $result = $vtAction->deleteRessource($params["resource_id"]);
if ($result != NULL && $result->error != "error") { //if no error during the creation
- if (! voicetools_delete_all_instance_of_resource($list_attributes["id"])) {
- notify("Could not delete the activities for the vocietools:". $list_attributes["id"]);
+ if (! voicetools_delete_all_instance_of_resource($params["resource_id"])) {
+ notify("Could not delete the activities for the vocietools:". $params["resource_id"]);
}
- $messageType = 'delete' . $list_attributes["type"];
- $messageAction = "deleted";
+ $messageType = 'delete' . $param["type"];
+ $messageAction = "deleted";
$messageProduct = $_GET["type"];
}
}
- if (isset ($list_attributes["createWorkflow"]) && $list_attributes["createWorkflow"] == "true") {
+ if (isset ($param["createWorkflow"]) && $param["createWorkflow"] == "true") {
if(!isset($result) )
$rid="";
Modified: branches/team/Thomas/moodle/mod/voicetools/mod.html
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/mod.html 2008-01-22 22:59:37 UTC (rev 230)
@@ -294,7 +294,7 @@
if(document.getElementById("description")!=null)
createCookie("description_disabled",document.getElementById("description").disabled);
- location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>&createWorkflow=true&type=";
+ location.href = "<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>&createWorkflow=true";
}
function hideCalendarEvent(value){
@@ -432,7 +432,7 @@
<table cellspacing="0" cellpadding="0" width=700px align=center>
<tr>
<td class="headerBarLeft" align="left">
- <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/items/headerbar-logo.png">
+ <img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/headerbar-logo.png">
</td>
<td align="right" class="headerBarRight">
@@ -503,7 +503,7 @@
<tr valign="top">
<td align="right"><font color="red">*</font><font class="fontCurrent"><?php print_string('voicetoolstype', 'voicetools')?></font></td>
- <td align="left"><select id="resource" name="resource" onclick="javascript:LaunchCreateWorkflowBySelect()">
+ <td align="left"><select id="resource" name="resource">
<option value="empty">
Select...
</option>
@@ -745,7 +745,7 @@
<div align=center width=700px>
<table width=700px cellpadding="5" align=center >
<tr style="border-top:1px solid; background-color:#F0F0F0;">
- <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/items/listitem-voicetoolsicon.gif" ><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>">
+ <td align="left"><img alt="" src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/listitem-voicetoolsicon.gif" ><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $id;?>">
<?php print_string('activity_manageTools', 'voicetools')?></a>
</td>
Modified: branches/team/Thomas/moodle/mod/voicetools/view.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/view.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/view.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -30,7 +30,7 @@
/// This page prints a particular instance of voicedirect
/// (Replace voicedirect with the name of your module)
-error_reporting(E_ERROR^E_NOTICE);
+error_reporting(E_ERROR);
require_once('../../config.php');
require_once('lib.php');
@@ -38,7 +38,8 @@
require_once('lib/php/vt/WimbaVoicetools.php');
require_once('lib/php/vt/WimbaVoicetoolsAPI.php');
require_once('lib/php/common/WimbaCommons.php');
-global $CFG;
+require_once('lib/php/vt/vtAction.php');
+
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
if ((isset($_GET["action"]) && $_GET["action"]!="launchCalendar" ) && $id || !isset($_GET["action"]) ) {
@@ -71,8 +72,7 @@
add_to_log($course->id, "voicetools", "view", "view.php?id=$cm->id", "$voicetool->id");
$session=new WimbaMoodleSession(NULL);
-
-
+
//check the availability of the resource
$vt_informations=voicetools_get_voicetool_informations($voicetool->rid);
if($vt_informations !=null && $vt_informations->availability=="0"){
@@ -110,6 +110,10 @@
$vtAction=new vtAction(NULL);
$session->setCurrentVtUSer($resource->getType(),$USER->firstname."_".$USER->lastname,$USER->email,$role);
+
+//use a vt user
+
+
$vtSession=$vtAction->getVtSession($resource,$session->getVtUser(),$session->getVtUserRigths()) ;
@@ -157,128 +161,53 @@
}
- function startVoiceBoard(){
- <?
- if(isset($roleSwitch) && $roleSwitch==true) {
- ?>
- result=window.confirm("<?php echo get_string ('launchstudent', 'voicetools');?>");
- if(result==true) {
- doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
-
- }
- else
- {
- location.href= document.referrer;
- }
-
- <?}else{
-
- ?>
- doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
-
- <?}?>
- }
+function startVoiceBoard(){
+ <?
+ if(isset($roleSwitch) && $roleSwitch==true) {
+ ?>
+ result=window.confirm("<?php echo get_string ('launchstudent', 'voicetools');?>");
+ if(result==true) {
+ doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
+
+ }
+ else
+ {
+ location.href= document.referrer;
+ }
+
+ <?}else{
+ ?>
+ doOpenPopup("<?php echo $servername ?>/<? echo $resource->getType();?>?action=display_popup&nid=<?php echo $vtSession->getNid() ?>","<?php echo $resource->getType()?>");
+ <?}?>
+}
</script>
-
+<link rel="STYLESHEET" href="<?php p($CFG->wwwroot) ?>/mod/voicetools/css/StyleSheet.css"" type="text/css" />
<style>
-
-
-a.list
-{
-
- font-family:Verdana;
- font-size:10px;
- color : #0000FF ;
- text-decoration : underline ;
+body{
+ font-size:14px;
}
-a.list:hover
-{
- color : #0000FF ;
- text-decoration : none ;
-}
-a.list:visited
-{
- color : #0000FF ;
- text-decoration : underline ;
-}
-a.list:active
-{
- color : #0000FF ;
- text-decoration : none ;
-}
-/*headerBar*/
-#headerBar table
-{
- width: 100%;
- background:white url( "<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/backgrounds/headerbar.png" ) repeat-x bottom left;
-
- height: 32px;
- border-bottom: solid 1px Black;
-}
-
-
-.headerBarRight
-{
- padding-right:10px;
-}
-.headerBarLeft
-{
- padding-left:10px;
-}
-
-/*contextBar*/
-
-
-#contextBar table
-{
- background-image: url( "<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/backgrounds/toolbar.png" );
- height: 30px;
- width: 100%;
- border-bottom: solid 1px #C7D3E1;
-}
-
-
-.contextBarRight
-{
- margin-left:20px;
- font-family: Verdana;
-
- font-size: 12px;
-}
-.contextBarLeft
-{
- margin-left:20px;
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
-}
-
-.roomNameForSettings
-{
- font-family: Verdana;
- font-weight: bold;
- font-size: 12px;
-}
.middle_panel{
height:315px;
-
+
}
html>body .middle_panel{
- height:312px;
-
+ height:312px;
+
}
+
</style>
+
<div style="border:solid 1px #808080;width:700px;height:400px;margin-left:20%;margin-top:5%">
<div class="headerBar" id="headerBar">
<table cellpadding="0" cellspacing="0" width=100%>
<tbody>
<tr>
<td align=left>
- <img src="pictures/items/headerbar-logo.png" height="32" width="80">
+ <img src="lib/web/pictures/items/headerbar-logo.png" height="32" width="80">
</td>
</tr>
</tbody>
@@ -310,18 +239,17 @@
<tr valign=middle align=center>
<td>
<?php if($preview==false){
-
- echo get_string ('activity_tools_not_available', 'voicetools');
-
+ echo get_string ('activity_tools_not_available', 'voicetools');
}else{
- ?>
- <script>
- startVoiceBoard();</script>
- <?php echo get_string ('vtpopupshouldappear.1', 'voicetools');?>
- <a href="javascript:startVoiceBoard ('<?php echo "$CFG->wwwroot/course/view.php?id=$course->id" ?>');">
- <?php echo get_string ('vtpopupshouldappear.2', 'voicetools');?>
- </a>
- <?php echo get_string ('vtpopupshouldappear.3', 'voicetools');?>
+ ?>
+ <script>
+ startVoiceBoard();
+ </script>
+ <?php echo get_string ('vtpopupshouldappear.1', 'voicetools');?>
+ <a href="javascript:startVoiceBoard ('<?php echo "$CFG->wwwroot/course/view.php?id=$course->id" ?>');">
+ <?php echo get_string ('vtpopupshouldappear.2', 'voicetools');?>
+ </a>
+ <?php echo get_string ('vtpopupshouldappear.3', 'voicetools');?>
<?php }?>
</td>
</tr>
@@ -329,27 +257,23 @@
</table>
</div>
<div>
- <table width=100% >
-
- <tr style="border-top:1px solid; background-color:#F0F0F0;">
- <td align=left >
- <img src="<?php echo $CFG->wwwroot;?>/mod/voicetools/pictures/items/listitem-voicetoolsicon.gif" /><a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $cm->course;?>"><?php
- if($role=="Instructor")
- print_string('activity_manageTools', 'voicetools');
- else
- echo "Voice Tools";
-
- ?></a>
-
- </td>
- </td>
-
+ <table width=100% >
+ <tr style="border-top:1px solid; background-color:#F0F0F0;">
+ <td align=left >
+ <img src="<?php echo $CFG->wwwroot;?>/mod/voicetools/lib/web/pictures/items/listitem-voicetoolsicon.gif" />
+ <a class="list" href="<?php echo $CFG->wwwroot;?>/mod/voicetools/index.php?id=<?php echo $cm->course;?>"><?php
+ if($role=="Instructor")
+ print_string('activity_manageTools', 'voicetools');
+ else
+ echo "Voice Tools";
+
+ ?></a>
+ </td>
+ <tr>
</table>
</div>
-</div>
-
-
- <?php
+</div>
+<?php
/// Finish the page
print_footer($course);
?>
Modified: branches/team/Thomas/moodle/mod/voicetools/welcome.php
===================================================================
--- branches/team/Thomas/moodle/mod/voicetools/welcome.php 2008-01-18 21:50:05 UTC (rev 229)
+++ branches/team/Thomas/moodle/mod/voicetools/welcome.php 2008-01-22 22:59:37 UTC (rev 230)
@@ -31,6 +31,8 @@
/// This page creates a link between the CMS and the component
error_reporting(E_ERROR);
+require_once("../../config.php");
+require_once("lib.php");
?>
<html>
<head>
@@ -47,9 +49,7 @@
<script src="lib/web/js/ajaxslt/dom.js" type="text/javascript"></script>
<script src="lib/web/js/ajaxslt/xpath.js" type="text/javascript"></script>
<script src="lib/web/js/hwCommons.js" type="text/javascript"></script>
- <script src="lib/web/js/xmldom.js" type="text/javascript"></script>
-
-
+<script src="lib/web/js/xmldom.js" type="text/javascript"></script>
<script type="text/javascript">
function doOpenAddActivity(url,param){
@@ -68,79 +68,57 @@
}
initPath('lib/web/js/xsl/wimba.xsl','lib/web/pictures');
</script>
+</head>
<?php
-if(isset($_GET["createWorkflow"]) && $_GET["type"]!=""){
- $firstPage= "getXmlNewPanel.php";
- $createWorkflow="true";
- ?>
- <script>
- typeSelect="<?php echo $_GET["type"]?>"
- </script>
- <?php
-
-
-}else if(isset($_GET["createWorkflow"]) && $_GET["type"]==""){
- $createWorkflow="true";
- $firstPage= "getXmlChoicePage.php";
+$createWorkflow = optional_param('createWorkflow', false, PARAM_BOOL); // course
+if($createWorkflow==true)
+{
+ $firstPage= "getXmlChoicePage.php";
}
-else{
- $firstPage="getXmlListPanel.php";
- $createWorkflow="false";
-
+else
+{
+ $firstPage= "getXmlListPanel.php";
}
-
-
-
-?>
-<body id="body" onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ?>','all','','','<?php echo $createWorkflow;?>');" onkeypress="removeEnterKeyPress()">
-
-<div id="all" style="display:block;overflow:hidden;border:solid 1px #808080;width:700px;height:400px;"></div>
-
-<div id="loading" style="display:none;border:solid 1px #808080;width:700px;height:400px">
- <div class="headerBar" id="headerBar">
- <table cellpadding="0" cellspacing="0" width=100%>
- <tbody>
- <tr>
- <td align=left>
- <img src="pictures/items/headerbar-logo.png" height="32" width="80">
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="contextBar" id="contextBar">
- <table>
- <tbody>
- <tr>
- <td></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div >
- <table width=100% style="height:300px">
- <tbody>
- <tr valign=middle>
- <td align=center><img src="pictures/items/wheel.gif"><br>
- <p><font size="-2" face="Verdana" color="666666"> Loading...</font></p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-
-</div>
-<div class='toolTip' id='Tip'>ToolTip</div>
-
-<div style="display:none" id="pictures" >picture</div>
+?>
+
+<body id="body" onLoad="javascript:DisplayFirstPage('<?php echo $firstPage ?>','all','','','<?php echo $createWorkflow;?>');" onkeypress="removeEnterKeyPress()">
+ <div id="all" style="display:block;overflow:hidden;border:solid 1px #808080;width:700px;height:400px;"></div>
+ <div id="loading" style="display:none;border:solid 1px #808080;width:700px;height:400px">
+ <div class="headerBar" id="headerBar">
+ <table cellpadding="0" cellspacing="0" width=100%>
+ <tbody>
+ <tr>
+ <td align=left>
+ <img src="lib/web/pictures/items/headerbar-logo.png" height="32" width="80">
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="contextBar" id="contextBar">
+ <table>
+ <tbody>
+ <tr>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div >
+ <table width=100% style="height:300px">
+ <tbody>
+ <tr valign=middle>
+ <td align=center><img src="lib/web/pictures/items/wheel.gif"><br>
+ <p><font size="-2" face="Verdana" color="666666"> Loading...</font></p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+ </div>
+ <div class='toolTip' id='Tip'>ToolTip</div>
+ <div style="display:none" id="pictures" >picture</div>
</body>
</html>
-
-
-
-<script>
-
-
-
-</script>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|