mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
New user inteface
This commit is contained in:
parent
3320057725
commit
b7ddb4a618
1 changed files with 163 additions and 222 deletions
|
@ -65,20 +65,6 @@
|
||||||
$modestring = '';
|
$modestring = '';
|
||||||
$scoidstring = '';
|
$scoidstring = '';
|
||||||
$currentorgstring = '';
|
$currentorgstring = '';
|
||||||
if (($scorm->popup == "") && ($frameset == "top")) {
|
|
||||||
if (!empty($_GET["mode"])) {
|
|
||||||
$mode = $_GET["mode"];
|
|
||||||
$modestring = '&mode='.$mode;
|
|
||||||
}
|
|
||||||
if (!empty($_GET["scoid"])) {
|
|
||||||
$scoid = $_GET["scoid"];
|
|
||||||
$scoidstring = '&scoid='.$scoid;
|
|
||||||
}
|
|
||||||
if (!empty($_GET['currentorg'])) {
|
|
||||||
$currentorg = $_GET['currentorg'];
|
|
||||||
$currentorgstring = '¤torg='.$currentorg;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!empty($_POST["mode"])) {
|
if (!empty($_POST["mode"])) {
|
||||||
$mode = $_POST["mode"];
|
$mode = $_POST["mode"];
|
||||||
$modestring = '&mode='.$mode;
|
$modestring = '&mode='.$mode;
|
||||||
|
@ -91,30 +77,22 @@
|
||||||
$currentorg = $_POST['currentorg'];
|
$currentorg = $_POST['currentorg'];
|
||||||
$currentorgstring = '¤torg='.$currentorg;
|
$currentorgstring = '¤torg='.$currentorg;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (($frameset == "top") || ($scorm->popup != "")) {
|
|
||||||
add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id");
|
add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id");
|
||||||
//
|
//
|
||||||
// Print the page header
|
// Print the page header
|
||||||
//
|
//
|
||||||
$bodyscripts = "";
|
|
||||||
if ($scorm->popup != "") {
|
|
||||||
$bodyscripts = "onUnload='SCOFinish(); closeMain();'";
|
$bodyscripts = "onUnload='SCOFinish(); closeMain();'";
|
||||||
}
|
|
||||||
print_header($pagetitle, "$course->fullname",
|
print_header($pagetitle, "$course->fullname",
|
||||||
"$navigation <a target=\"{$CFG->framename}\" href=\"view.php?id=$cm->id\">$scorm->name</a>",
|
"$navigation <a target=\"{$CFG->framename}\" href=\"view.php?id=$cm->id\">$scorm->name</a>",
|
||||||
"", "", true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts);
|
"", "", true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts);
|
||||||
echo "<table width=\"100%\">\n <tr><td align=\"center\">".text_to_html($scorm->summary, true, false)."</td>\n";
|
|
||||||
if ($mode == "browse")
|
|
||||||
echo "<td align=\"right\" width=\"10%\" nowrap>".get_string("browsemode","scorm")."</td>\n";
|
|
||||||
echo " </tr>\n</table>\n";
|
|
||||||
|
|
||||||
if ($scorm->popup != "") {
|
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"request.js\"></script>\n";
|
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"api.php?id=$cm->id\"></script>\n";
|
|
||||||
?>
|
?>
|
||||||
<br />
|
<style type="text/css">
|
||||||
|
.scormlist {
|
||||||
|
list-style-type:none;
|
||||||
|
text-indent:-4ex;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script language="Javascript">
|
<script language="Javascript">
|
||||||
<!--
|
<!--
|
||||||
function playSCO(scoid) {
|
function playSCO(scoid) {
|
||||||
|
@ -139,14 +117,19 @@
|
||||||
}
|
}
|
||||||
-->
|
-->
|
||||||
</script>
|
</script>
|
||||||
<style type="text/css">
|
|
||||||
.scormlist { list-style-type:none; }
|
<script language="JavaScript" type="text/javascript" src="request.js"></script>
|
||||||
</style>
|
<script language="JavaScript" type="text/javascript" src="api.php?id=<?php echo $cm->id ?>"></script>
|
||||||
|
<table width="100%">
|
||||||
|
<tr><td valign="top">
|
||||||
|
<p><?php echo text_to_html($scorm->summary, false, false) ?></p>
|
||||||
|
<p><?php echo $mode == "browse" ? get_string("browsemode","scorm") : ' '; ?></p>
|
||||||
|
<?php print_simple_box_start(); ?>
|
||||||
|
<table>
|
||||||
|
<tr><th><?php print_string("coursestruct","scorm") ?></th></tr>
|
||||||
|
<tr><td nowrap>
|
||||||
|
<ul class="scormlist">
|
||||||
<?php
|
<?php
|
||||||
print_simple_box_start("CENTER");
|
|
||||||
echo "<table>\n";
|
|
||||||
echo " <tr><th>".get_string("coursestruct","scorm")."</th></tr>\n";
|
|
||||||
echo " <tr><td nowrap>\n<ul class=\"scormlist\">\n";
|
|
||||||
$incomplete = false;
|
$incomplete = false;
|
||||||
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){
|
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){
|
||||||
$level=0;
|
$level=0;
|
||||||
|
@ -155,17 +138,17 @@
|
||||||
foreach ($scoes as $sco) {
|
foreach ($scoes as $sco) {
|
||||||
if ($parents[$level]!=$sco->parent) {
|
if ($parents[$level]!=$sco->parent) {
|
||||||
if ($level>0 && $parents[$level-1]==$sco->parent) {
|
if ($level>0 && $parents[$level-1]==$sco->parent) {
|
||||||
echo " </ul></li>\n";
|
echo "\t\t</ul></li>\n";
|
||||||
$level--;
|
$level--;
|
||||||
} else {
|
} else {
|
||||||
$i = $level;
|
$i = $level;
|
||||||
$closelist = "";
|
$closelist = "";
|
||||||
while (($i > 0) && ($parents[$level] != $sco->parent)) {
|
while (($i > 0) && ($parents[$level] != $sco->parent)) {
|
||||||
$closelist .= " </ul></li>\n";
|
$closelist .= "\t\t</ul></li>\n";
|
||||||
$i--;
|
$i--;
|
||||||
}
|
}
|
||||||
if (($i == 0) && ($sco->parent != $currentorg)) {
|
if (($i == 0) && ($sco->parent != $currentorg)) {
|
||||||
echo " <li><ul id='".$sublist."' class=\"scormlist\"'>\n";
|
echo "\t\t<li><ul id='".$sublist."' class=\"scormlist\"'>\n";
|
||||||
$level++;
|
$level++;
|
||||||
} else {
|
} else {
|
||||||
echo $closelist;
|
echo $closelist;
|
||||||
|
@ -174,13 +157,13 @@
|
||||||
$parents[$level]=$sco->parent;
|
$parents[$level]=$sco->parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo " <li>\n";
|
echo "\t\t<li>";
|
||||||
$nextsco = next($scoes);
|
$nextsco = next($scoes);
|
||||||
if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
|
if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
|
||||||
$sublist++;
|
$sublist++;
|
||||||
echo " <img src=\"pix/minus.gif\" onClick='expandCollide(this,".$sublist.");'/>\n";
|
echo "<img id='img".$sublist."' src=\"pix/minus.gif\" onClick='expandCollide(this,".$sublist.");'/>";
|
||||||
} else {
|
} else {
|
||||||
echo " <img src=\"pix/spacer.gif\" />\n";
|
echo "<img src=\"pix/spacer.gif\" />";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sco->launch) {
|
if ($sco->launch) {
|
||||||
|
@ -220,84 +203,42 @@
|
||||||
echo "<img src=\"pix/asset.gif\" alt=\"".get_string("asset","scorm")."\" />";
|
echo "<img src=\"pix/asset.gif\" alt=\"".get_string("asset","scorm")."\" />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo " $startbold<a href=\"javascript:playSCO(".$sco->id.");\">$sco->title</a> $score$endbold\n </li>\n";
|
echo " $startbold<a href=\"javascript:playSCO(".$sco->id.");\">$sco->title</a> $score$endbold</li>\n";
|
||||||
} else {
|
} else {
|
||||||
echo " $sco->title\n </li>\n";
|
echo " $sco->title</li>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for ($i=0;$i<$level;$i++) {
|
for ($i=0;$i<$level;$i++) {
|
||||||
echo " </ul></li>\n";
|
echo "\t\t</ul></li>\n";
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "</ul></td></tr>\n";
|
|
||||||
echo "</table>\n";
|
|
||||||
print_simple_box_end();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<table width=\"100%\">\n <tr>\n";
|
|
||||||
echo " <td align=\"center\" nowrap>
|
|
||||||
<!--<iframe name=\"cmi\" width=\"1\" height=\"1\" src=\"cmi.php?id=$cm->id\" style=\"visibility: hidden\"></iframe> -->
|
|
||||||
<form name=\"navform\" method=\"POST\" action=\"playscorm.php?id=$cm->id\" target=\"_top\">
|
|
||||||
<input name=\"scoid\" type=\"hidden\" />
|
|
||||||
<input name=\"currentorg\" type=\"hidden\" value=\"$currentorg\" />
|
|
||||||
<input name=\"mode\" type=\"hidden\" value=\"".$mode."\" />
|
|
||||||
<input name=\"prev\" type=\"button\" value=\"".get_string("prev","scorm")."\" onClick=\"top.changeSco('previous');\" /> \n";
|
|
||||||
|
|
||||||
if ($scorm->popup == "") {
|
|
||||||
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){
|
|
||||||
$level=0;
|
|
||||||
$parents[$level]="/";
|
|
||||||
foreach ($scoes as $sco) {
|
|
||||||
if ($parents[$level]!=$sco->parent) {
|
|
||||||
if ($level>0 && $parents[$level-1]==$sco->parent) {
|
|
||||||
$level--;
|
|
||||||
} else {
|
|
||||||
$i = $level;
|
|
||||||
while (($i > 0) && ($parents[$level] != $sco->parent)) {
|
|
||||||
$i--;
|
|
||||||
}
|
|
||||||
if (($i == 0) && ($sco->parent != $currentorg)) {
|
|
||||||
$level++;
|
|
||||||
} else {
|
|
||||||
$level = $i;
|
|
||||||
}
|
|
||||||
$parents[$level]=$sco->parent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$indenting = "";
|
|
||||||
for ($i=0;$i<$level;$i++) {
|
|
||||||
$indenting .= "-";
|
|
||||||
}
|
|
||||||
$options[$sco->id] = $indenting."> ".$sco->title;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
choose_from_menu($options, "courseStructure", $scoid, "", "document.navform.scoid.value=document.navform.courseStructure.options[document.navform.courseStructure.selectedIndex].value;document.navform.submit();");
|
|
||||||
}
|
|
||||||
echo " <input name=\"next\" type=\"button\" value=\"".get_string("next","scorm")."\" onClick=\"top.changeSco('continue')\" />\n";
|
|
||||||
echo " </form>
|
|
||||||
</td>\n";
|
|
||||||
|
|
||||||
echo "</tr>\n</table>\n";
|
|
||||||
if ($scorm->popup == "") {
|
|
||||||
echo "</body>\n</html>\n";
|
|
||||||
} else {
|
|
||||||
print_footer($course);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($scorm->popup == "") {
|
|
||||||
//
|
|
||||||
// Frameset
|
|
||||||
//
|
|
||||||
echo "<html>\n";
|
|
||||||
echo "<head><title>$course->shortname: $scorm->name</title></head>\n";
|
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"request.js\"></script>\n";
|
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"api.php?id=$cm->id\"></script>\n";
|
|
||||||
echo "<frameset rows=\"$CFG->scorm_framesize,*\" onUnload=\"SCOFinish();\">\n";
|
|
||||||
echo "\t <frame name=\"navigation\" src=\"playscorm.php?id=$cm->id".$modestring.$currentorgstring.$scoidstring."&frameset=top\">\n";
|
|
||||||
echo "\t <frame name=\"main\" src=\"loadSCO.php?id=$cm->id$scoidstring\">\n";
|
|
||||||
echo "</frameset>\n";
|
|
||||||
echo "</html>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</ul>
|
||||||
|
</td></tr>
|
||||||
|
<tr><td align="center">
|
||||||
|
<form name="navform" method="post" action="playscorm.php?id=<?php echo $cm->id ?>" target="_top">
|
||||||
|
<input name="scoid" type="hidden" />
|
||||||
|
<input name="currentorg" type="hidden" value="<?php echo $currentorg ?>" />
|
||||||
|
<input name="mode" type="hidden" value="<?php echo $mode ?>" />
|
||||||
|
<input name="prev" type="button" value="<?php print_string('prev','scorm') ?>" onClick="top.changeSco('previous');" />
|
||||||
|
<input name="next" type="button" value="<?php print_string('next','scorm') ?>" onClick="top.changeSco('continue')" />
|
||||||
|
</form>
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
<?php print_simple_box_end(); ?>
|
||||||
|
</td>
|
||||||
|
<td width="100%">
|
||||||
|
<iframe name="main" height="500" width="100%" src="loadSCO.php?id=<?php echo $cm->id.$scoidstring ?>"></iframe>
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
|
/*$popuplocation = '';
|
||||||
|
if (isset($_COOKIE["SCORMpopup"])) {
|
||||||
|
$popuplocation = $_COOKIE["SCORMpopup"];
|
||||||
|
}
|
||||||
|
echo "<script language=\"javascript\">\n";
|
||||||
|
echo "\t top.main = window.open('loadSCO.php?id=$cm->id".$scoidstring."','main','$scorm->popup$popuplocation');\n";
|
||||||
|
echo "</script>\n"; */
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue