Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
juliantenney committed May 1, 2012
1 parent 5fe75a8 commit a1ff5cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
@@ -1 +1 @@
<PG title="YouTube" name="youtube"> <SCR id="ic" name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();if (rootIcon.projMode == "dev"){ // Page Wizard pageIcon.templateData = pageIcon.extXML.toObject(); pageIcon.templateData = pageIcon.templateData.pageWizard[0];} else { // Toolkits myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]); pageIcon.templateData = myXML.toObject();} rootIcon.setTitleText(templateData.learningObject[0].name); // handle multiple page data definitions in a project if (rootIcon.projectPageIndex == undefined){ rootIcon.projectPageIndex = 0;}// check if this page has a definition for the current project index and default to 0 if notif (pageIcon.templateData.youtube[rootIcon.projectPageIndex].name == undefined){ projPI = 0;} else { projPI = rootIcon.projectPageIndex; } // set up text stringsif (pageIcon.templateData.youtuberss[projPI].stopBtnTip != undefined){ stopBtnTip = pageIcon.templateData.youtuberss[projPI].stopBtnTip;} else { stopBtnTip = "Stop Video";}if (pageIcon.templateData.youtuberss[projPI].pauseBtnTip != undefined){ pauseBtnTip = pageIcon.templateData.youtuberss[projPI].pauseBtnTip;} else { pauseBtnTip = "Pause Video";}if (pageIcon.templateData.youtuberss[projPI].playBtnTip != undefined){ playBtnTip = pageIcon.templateData.youtuberss[projPI].playBtnTip;} else { playBtnTip = "Play Video";}if (pageIcon.templateData.youtuberss[projPI].toggleBtnTip != undefined){ toggleBtnTip = pageIcon.templateData.youtuberss[projPI].toggleBtnTip;} else { toggleBtnTip = "Toggle Full Screen";}if (pageIcon.templateData.youtuberss[projPI].playMessage != undefined){ playMessage = pageIcon.templateData.youtuberss[projPI].playMessage;} else { playMessage = "Press Play";}if (pageIcon.templateData.youtuberss[projPI].playerMessage != undefined){ playerMessage = pageIcon.templateData.youtuberss[projPI].playerMessage;} else { playerMessage = "Player Loading...";}if (pageIcon.templateData.youtuberss[projPI].loadingMessage != undefined){ loadingMessage = pageIcon.templateData.youtuberss[projPI].loadingMessage;} else { loadingMessage = "Loading...";}xml = new XML(pageIcon.templateData.youtube[projPI]);embedObj = xml.toObject();//new iframe code...if (pageIcon.templateData.youtube[projPI].indexOf('iframe') != -1){ //find the ID str = pageIcon.templateData.youtube[projPI].split("rel=0").join(''); s = str.indexOf('src') + 5; f = str.indexOf('"', s); src = str.substr(s, f-s); vidID = src.substr(src.lastIndexOf('/') + 1); //any params being passed in? vidID = vidID.split('?')[0]; } else { //two types of object embed code... if (embedObj.object[0].embed[0].src.split('/')[4].indexOf('?') != -1){ vidID = embedObj.object[0].embed[0].src.split('/')[4].split('?')[0]; } else { vidID = embedObj.object[0].embed[0].src.split('/')[4].split('&')[0]; }}align = pageIcon.templateData.youtube[projPI].align;if (pageIcon.templateData.youtube[projPI].videoSize != undefined){ ytWidth = Number(pageIcon.templateData.youtube[projPI].videoSize.split(',')[0]); ytHeight = Number(pageIcon.templateData.youtube[projPI].videoSize.split(',')[1]);} else { ytWidth = 320; ytHeight = 240;}d = new Date();ytID = 'yt' + d.getTime();icon.parentNode.getChildByName('youtube').attributes.id = ytID;]]></SCR> <DIS h="ytHeight + 50" w="ytWidth + 20" tabIndex="-1" id="panel" name="panel" x="align == 'Left' ? 800 - 40 - ytWidth : 20" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <DIS textColour="#999999" textSize="10" id="status" name="status" x="panel._x + 62" y="panel._y + ytHeight + 22" w="240" h="10" type="text"><![CDATA[{playerMessage}]]></DIS> <DIS scrolling="auto" id="txt" name="text" x="align == 'Left' ? 20 : ytWidth + 60" y="20" w="800 - ytWidth - 80" h="484" type="text"><![CDATA[{pageIcon.templateData.youtube[projPI].text}]]></DIS> <COM id="coded" y="panel._y + 10" x="panel._x+ 1000" name="youtube" url="templatePath + 'common/youtube.swf?' + yt" initObject="{ id: vidID}" /> <SCR name="setup"><![CDATA[//the player is hidden to begin with... then repositioned in onPlayerLoadstatus.txt.selectable = false;status.lineStyle(0,0x999999,100);status.drawRect(0,0,ytWidth - 80,18);icon.previousSibling.clip()._visible = false;if (pageIcon.templateData.youtube[projPI].narration != undefined){ narration = pageIcon.templateData.youtube[projPI].narration; rootIcon.broadcast('showAudio');} ]]></SCR> <INT name="controls" perpetual="0"> <RES name="onPlayerLoad" type="event" eventName="onPlayerLoad" icon="engine[ytID]" erase="1" exit="0"> <SCR name="handler"><![CDATA[btnToggle.setEnabled(true);btnPlay.setEnabled(true);status.setText(playMessage);rootIcon.enableControls(true, 100);if (pageIcon.templateData.youtube[projPI].toggle == "true"){ ytTog = true; engine[ytID].setSize(800,515); engine[ytID]._x = 0; engine[ytID]._y = 0; btnStop._x = 10; btnStop._y = 484; btnPlay._x = 35; btnPlay._y = 484; btnPause._x = 35; btnPause._y = 484; btnToggle._x = 60; btnToggle._y = 484; } else { ytTog = false; engine[ytID].setSize(ytWidth,ytHeight); engine[ytID]._x = panel._x + 10; engine[ytID]._y = panel._y + 10; btnStop._x = panel._x + 10; btnStop._y = ytHeight + 40; btnPlay._x = panel._x + 35; btnPlay._y = ytHeight + 40; btnPause._x = panel._x + 35; btnPause._y = ytHeight + 40; btnToggle._x = panel._x + ytWidth - 10; btnToggle._y = ytHeight + 40;}if (pageIcon.templateData.youtube[projPI].autoplay == "true"){ if (engine[ytID].playerLoaded != true){ engine[ytID].loadVideoById(vidID); btnPlay.setEnabled(false); status.setText("Loading and will autoplay..."); } else { engine[ytID].playVideo(); }}]]></SCR> </RES> <RES name="onPlayerStateChange" type="event" eventName="onPlayerStateChange" icon="engine[ytID]" erase="1" exit="0"> <SCR name="handler"><![CDATA[if (engine[ytID].state == 1){ //playing btnStop.setEnabled(true); btnPause.setEnabled(true); btnPlay._visible = false; btnPause._visible = true;} else if (engine[ytID].state == 2){ //paused btnPlay.setEnabled(true); btnPlay._visible = true; btnPause._visible = false; }]]></SCR> </RES> <RES name="onProgress" type="event" eventName="onProgress" icon="engine[ytID]" erase="1" exit="0"> <SCR name="handler"><![CDATA[engine[ytID].playerLoaded = true;status.setText(engine[ytID].statusStr);status.clear();status.lineStyle(0,0x999999,100);status.drawRect(0,0,ytWidth - 80,18);status.lineStyle();status.beginFill(STYLES.fillColour,50);status.drawRect(0,0,engine[ytID].bytesPercent*((ytWidth - 80) / 100),18);status.lineStyle(0,0x999999,100);status.beginFill(STYLES.fillColour,100);status.drawRect(0,0,engine[ytID].percent*((ytWidth - 80) / 100),18);]]></SCR> </RES> <RES name="onRelease" type="event" eventName="onRelease" icon="status" erase="1" exit="0"> <SCR name="seek"><![CDATA[nt = Math.floor(status._xmouse / (ytWidth - 80) * engine[ytID].duration);engine[ytID].seekTo(nt ,true);]]></SCR> </RES> <RES toolTip="{stopBtnTip}" enabled="0" rs="btnStop" swf="templatePath + 'common/stopMedia.swf'" name="stop" type="button" x="panel._x + 10" y="ytHeight + 40" label="Stop" erase="1" exit="0"> <SCR name="stop"><![CDATA[engine[ytID].pauseVideo();engine[ytID].seekTo(0,true);//reset the status informationstatus.setText('0:00 / ' + engine[ytID].durationStr);status.clear();status.lineStyle(0,0x999999,100);status.drawRect(0,0,ytHeight,18);]]></SCR> </RES> <RES enabled="0" toolTip="{pauseBtnTip}" rs="btnPause" swf="templatePath + 'common/pauseMedia.swf'" name="pause" type="button" x="panel._x + 35" y="ytHeight + 40" label="Pause" erase="1" exit="0"> <SCR name="play"><![CDATA[engine[ytID].pauseVideo();]]></SCR> </RES> <RES enabled="0" toolTip="{playBtnTip}" rs="btnPlay" swf="templatePath + 'common/playMedia.swf'" name="play" type="button" x="panel._x + 35" y="ytHeight + 40" label="Play" erase="1" exit="0"> <SCR name="play"><![CDATA[if (engine[ytID].playerLoaded != true){ engine[ytID].loadVideoById(vidID); btnPlay.setEnabled(false); status.setText(loadingMessage);} else { engine[ytID].playVideo();}]]></SCR> </RES> <RES toolTip="{toggleBtnTip}" enabled="0" rs="btnToggle" swf="templatePath + 'common/zoomMedia.swf'" name="toggle" type="button" x="panel._x + ytWidth - 10" y="ytHeight + 40" label="Resize" erase="1" exit="0"> <SCR name="resize"><![CDATA[if (ytTog != true){ ytTog = true; engine[ytID].setSize(800,515); engine[ytID]._x = 0; engine[ytID]._y = 0; btnStop._x = 10; btnStop._y = 484; btnPlay._x = 35; btnPlay._y = 484; btnPause._x = 35; btnPause._y = 484; btnToggle._x = 60; btnToggle._y = 484; } else { ytTog = false; engine[ytID].setSize(ytWidth,ytHeight); engine[ytID]._x = panel._x + 10; engine[ytID]._y = panel._y + 10; btnStop._x = panel._x + 10; btnStop._y = ytHeight + 40; btnPlay._x = panel._x + 35; btnPlay._y = ytHeight + 40; btnPause._x = panel._x + 35; btnPause._y = ytHeight + 40; btnToggle._x = panel._x + ytWidth - 10; btnToggle._y = ytHeight + 40;}]]></SCR> </RES> </INT> </PG>
<PG title="Enter page title" name="newWindow"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();if (extXML == undefined){ // Page Wizard pageIcon.templateData = pageIcon.extXML.toObject(); pageIcon.templateData = pageIcon.templateData.pageWizard[0];} else { // Toolkits myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]); pageIcon.templateData = myXML.toObject(); rootIcon.setTitleText(templateData.learningObject[0].name);}]]></SCR> <SCR name="setup"><![CDATA[xml = new XML(pageIcon.templateData.youtube[0]);embedObj = xml.toObject();//new iframe code...if (pageIcon.templateData.youtube[0].indexOf('iframe') != -1){ //find the ID str = pageIcon.templateData.youtube[0].split("rel=0").join(''); s = str.indexOf('src') + 5; f = str.indexOf('"', s); src = str.substr(s, f-s); vidID = src.substr(src.lastIndexOf('/') + 1); //any params being passed in? vidID = vidID.split('?')[0]; } else { //two types of object embed code... if (embedObj.object[0].embed[0].src.split('/')[4].indexOf('?') != -1){ vidID = embedObj.object[0].embed[0].src.split('/')[4].split('?')[0]; } else { vidID = embedObj.object[0].embed[0].src.split('/')[4].split('&')[0]; }}align = pageIcon.templateData.youtube[0].align;previewURL = 'http://img.youtube.com/vi/' + vidID + '/0.jpg';params = new Object();params.url = embedObj.iframe[0].src;params.width = 420;params.height = 315;if (pageIcon.templateData.newWindow[0].narration != undefined){ narration = pageIcon.templateData.newWindow[0].narration; rootIcon.broadcast('showAudio');}]]></SCR> <SCR isFunc="1" name="launchNewWindow"><![CDATA[if (pageIcon.templateData.newWindow[0].htm != undefined){ callJS('createWindow', params);} else { callJS('openWindow', params);}]]></SCR> <DIS tabIndex="-1" id="panel" name="panel" x="-300" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <INT name="loadPanel" perpetual="0"> <RES name="onLoad" type="event" eventName="onLoad" icon="panel" erase="1" exit="1"> <SCR name="exit"><![CDATA[//ok to move on]]></SCR> </RES> </INT> <DIS toolTip="Launch Video" scrolling="auto" id="graphic" name="graphic" x="coded" y="30" type="ext" url="previewURL"><![CDATA[Launch Video]]></DIS> <INT name="loadImage" perpetual="0"> <RES name="onLoad" type="event" eventName="onLoad" icon="graphic" erase="1" exit="1"> <SCR name="calculate"><![CDATA[graphic.constrain(465,465);//resize the panel to the graphicpanel._width = graphic._width + 20;panel._height = graphic._height + 20;panel._x = stageWidth - panel._width - 20;graphic._x = panel._x + 10;textX = 20;textY = 20;textWidth = stageWidth - 80 - graphic._width;graphic.useHandCursor = true;]]></SCR> </RES> </INT> <DIS scrolling="auto" id="textBlock" h="480" name="text" x="textX" y="textY" w="textWidth" type="text"><![CDATA[{pageIcon.templateData.youtube[0].text + '<br><br><a href="asfunction:_level0.engine.launchNewWindow">Launch Video</a>'}]]></DIS> <INT name="launch" perpetual="0"> <RES name="onRelease" type="event" eventName="onRelease" icon="graphic" erase="1" exit="0"> <SCR name="calculate"><![CDATA[launchNewWindow();]]></SCR> </RES> </INT> </PG>
Expand Down
28 changes: 14 additions & 14 deletions website_code/php/scorm/export.php
Expand Up @@ -135,24 +135,24 @@



/*
* Language support
*/

mkdir($dir_path . 'languages');
chmod($dir_path . 'languages', 0777);
array_push($delete_folder_array, $dir_path . 'languages');
/*
* Language support
*/

mkdir($dir_path . 'languages');
chmod($dir_path . 'languages', 0777);

array_push($delete_folder_array, $dir_path . 'languages');

copy($xerte_toolkits_site->root_file_path . "languages/language-config.xml", $dir_path . "languages/language-config.xml");

array_push($delete_file_array, $dir_path . "languages/language-config.xml");


copy($xerte_toolkits_site->root_file_path . "languages/engine_" . $_SESSION['default_language'] . ".xml", $dir_path . "languages/engine_" . $_SESSION['default_language'] . ".xml");

array_push($delete_file_array, $dir_path . "languages/engine_" . $_SESSION['default_language'] . ".xml");
copy($xerte_toolkits_site->root_file_path . "languages/language-config.xml", $dir_path . "languages/language-config.xml");

array_push($delete_file_array, $dir_path . "languages/language-config.xml");


copy($xerte_toolkits_site->root_file_path . "languages/engine_" . $_SESSION['default_language'] . ".xml", $dir_path . "languages/engine_" . $_SESSION['default_language'] . ".xml");

array_push($delete_file_array, $dir_path . "languages/engine_" . $_SESSION['default_language'] . ".xml");



Expand Down

0 comments on commit a1ff5cb

Please sign in to comment.