2004-01-23 08:51:17 +00:00
|
|
|
<script language="JavaScript" type="text/javascript"
|
|
|
|
src="<?php echo "$CFG->wwwroot/lib/overlib.js" ?>"></script>
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2003-05-15 14:02:13 +00:00
|
|
|
<script language="JavaScript">
|
2001-11-22 06:23:56 +00:00
|
|
|
<!-- //hide
|
2002-10-12 04:09:51 +00:00
|
|
|
|
|
|
|
function popUpProperties(inobj) {
|
|
|
|
op = window.open();
|
|
|
|
op.document.open('text/plain');
|
|
|
|
for (objprop in inobj) {
|
|
|
|
op.document.write(objprop + ' => ' + inobj[objprop] + '\n');
|
|
|
|
}
|
|
|
|
op.document.close();
|
|
|
|
}
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
function fillmessagebox(text) {
|
2002-10-12 04:09:51 +00:00
|
|
|
document.form.message.value = text;
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
2003-07-20 13:53:31 +00:00
|
|
|
function openpopup(url,name,options,fullscreen) {
|
2003-05-15 14:02:13 +00:00
|
|
|
fullurl = "<?php echo $CFG->wwwroot ?>" + url;
|
2003-07-20 13:53:31 +00:00
|
|
|
windowobj = window.open(fullurl,name,options);
|
|
|
|
if (fullscreen) {
|
|
|
|
windowobj.moveTo(0,0);
|
|
|
|
windowobj.resizeTo(screen.availWidth,screen.availHeight);
|
|
|
|
}
|
2002-10-12 04:09:51 +00:00
|
|
|
windowobj.focus();
|
2003-07-20 13:53:31 +00:00
|
|
|
return false;
|
2002-10-10 07:26:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function copyrichtext(textname) {
|
2003-11-03 15:17:21 +00:00
|
|
|
/// Legacy stub for old editor - to be removed soon
|
2002-10-12 04:09:51 +00:00
|
|
|
return true;
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
2003-02-17 17:02:56 +00:00
|
|
|
function checkall() {
|
|
|
|
void(d=document);
|
|
|
|
void(el=d.getElementsByTagName('INPUT'));
|
|
|
|
for(i=0;i<el.length;i++)
|
|
|
|
void(el[i].checked=1)
|
|
|
|
}
|
|
|
|
|
2003-05-08 16:09:30 +00:00
|
|
|
function inserttext(text) {
|
2003-05-15 14:02:13 +00:00
|
|
|
<?php
|
2003-05-08 16:09:30 +00:00
|
|
|
if (!empty($SESSION->inserttextform)) {
|
|
|
|
$insertfield = "opener.document.forms['$SESSION->inserttextform'].$SESSION->inserttextfield";
|
|
|
|
} else {
|
|
|
|
$insertfield = "opener.document.forms['theform'].message";
|
|
|
|
}
|
|
|
|
echo " text = ' ' + text + ' ';\n";
|
|
|
|
echo " if ( $insertfield.createTextRange && $insertfield.caretPos) {\n";
|
2003-07-20 13:53:31 +00:00
|
|
|
echo " var caretPos = $insertfield.caretPos;\n";
|
|
|
|
echo " caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;\n";
|
2003-05-08 16:09:30 +00:00
|
|
|
echo " } else {\n";
|
2003-07-20 13:53:31 +00:00
|
|
|
echo " $insertfield.value += text;\n";
|
2003-05-08 16:09:30 +00:00
|
|
|
echo " }\n";
|
|
|
|
echo " $insertfield.focus();\n";
|
|
|
|
?>
|
|
|
|
}
|
|
|
|
|
2003-07-20 13:53:31 +00:00
|
|
|
function lockoptions(form, master, subitems) {
|
|
|
|
// subitems is an array of names of sub items
|
|
|
|
// requires that each item in subitems has a
|
|
|
|
// companion hidden item in the form with the
|
|
|
|
// same name but prefixed by "h"
|
|
|
|
if (eval("document."+form+"."+master+".checked")) {
|
|
|
|
for (i=0; i<subitems.length; i++) {
|
|
|
|
unlockoption(form, subitems[i]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (i=0; i<subitems.length; i++) {
|
|
|
|
lockoption(form, subitems[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return(true);
|
|
|
|
}
|
|
|
|
function lockoption(form,item) {
|
|
|
|
eval("document."+form+"."+item+".disabled=true");/* IE thing */
|
|
|
|
eval("document."+form+".h"+item+".value=1");
|
|
|
|
}
|
|
|
|
function unlockoption(form,item) {
|
|
|
|
eval("document."+form+"."+item+".disabled=false");/* IE thing */
|
|
|
|
eval("document."+form+".h"+item+".value=0");
|
|
|
|
}
|
|
|
|
|
2003-05-15 14:02:13 +00:00
|
|
|
<?php if ($focus) { echo "function setfocus() { document.$focus.focus() }\n"; } ?>
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
// done hiding -->
|
2003-05-15 14:02:13 +00:00
|
|
|
</script>
|
2001-11-22 06:23:56 +00:00
|
|
|
|