Removing old editor scripts. These are found at /lib/editor/htmlarea from now on.

This commit is contained in:
julmis 2006-03-06 07:57:41 +00:00
parent 515e6eccbe
commit 127907098c
107 changed files with 0 additions and 11377 deletions

View File

@ -1,821 +0,0 @@
<?php // $Id$
// Manage all uploaded files in a course file area
// This file is a hack to files/index.php that removes
// the headers and adds some controls so that images
// can be selected within the Richtext editor.
// All the Moodle-specific stuff is in this top section
// Configuration and access control occurs here.
// Must define: USER, basedir, baseweb, html_header and html_footer
// USER is a persistent variable using sessions
require("../../config.php");
require_once($CFG->libdir.'/filelib.php');
$id = required_param('id', PARAM_INT);
$file = optional_param('file', '', PARAM_PATH);
$wdir = optional_param('wdir', '', PARAM_PATH);
$action = optional_param('action', '', PARAM_ACTION);
$name = optional_param('name', '', PARAM_FILE);
$oldname = optional_param('oldname', '', PARAM_FILE);
$usecheckboxes = optional_param('usecheckboxes', 1, PARAM_INT);
if (! $course = get_record("course", "id", $id) ) {
error("That's an invalid course id");
}
require_login($course->id);
if (! isteacheredit($course->id) ) {
error("Only teachers can edit files");
}
function html_footer() {
echo "\n\n</body>\n</html>";
}
function html_header($course, $wdir, $formfield=""){
global $CFG;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<title>coursefiles</title>
<script language="javscript" type="text/javascript">
<!--
function set_value(params) {
/// function's argument is an object containing necessary values
/// to export parent window (url,isize,itype,iwidth,iheight, imodified)
/// set values when user click's an image name.
var upper = window.parent;
var insimg = upper.document.getElementById('f_url');
try {
if(insimg != null) {
if(params.itype.indexOf("image/gif") == -1 && params.itype.indexOf("image/jpeg") == -1 && params.itype.indexOf("image/png") == -1) {
alert("<?php print_string("notimage","editor");?>");
return false;
}
for(field in params) {
var value = params[field];
switch(field) {
case "url" : upper.document.getElementById('f_url').value = value;
upper.ipreview.location.replace('popups/preview.php?id='+ <?php print($course->id);?> +'&imageurl='+ value);
break;
case "isize" : upper.document.getElementById('isize').value = value; break;
case "itype" : upper.document.getElementById('itype').value = value; break;
case "iwidth": upper.document.getElementById('f_width').value = value; break;
case "iheight": upper.document.getElementById('f_height').value = value; break;
}
}
} else {
for(field in params) {
var value = params[field];
switch(field) {
case "url" :
//upper.document.getElementById('f_href').value = value;
upper.opener.document.getElementById('f_href').value = value;
upper.close();
break;
//case "imodified" : upper.document.getElementById('imodified').value = value; break;
//case "isize" : upper.document.getElementById('isize').value = value; break;
//case "itype" : upper.document.getElementById('itype').value = value; break;
}
}
}
} catch(e) {
alert("Something odd just occurred!!!");
}
return false;
}
function set_dir(strdir) {
// sets wdir values
var upper = window.parent.document;
if(upper) {
for(var i = 0; i < upper.forms.length; i++) {
var f = upper.forms[i];
try {
f.wdir.value = strdir;
} catch (e) {
}
}
}
}
function set_rename(strfile) {
if(window.parent.document.irename != null) {
window.parent.document.irename.file.value = strfile;
}
return true;
}
function reset_value() {
var upper = window.parent.document;
for(var i = 0; i < upper.forms.length; i++) {
var f = upper.forms[i];
for(var j = 0; j < f.elements.length; j++) {
var e = f.elements[j];
if(e.type != "submit" && e.type != "button" && e.type != "hidden") {
try {
e.value = "";
} catch (e) {
}
}
}
}
var ren = upper.getElementById('irename');
if(ren != null) {
upper.irename.file.value = "";
}
var prev = window.parent.ipreview;
if(prev != null) {
prev.location.replace('about:blank');
}
var uploader = window.parent.document.forms['uploader'];
if(uploader != null) {
uploader.reset();
}
set_dir('<?php print(!empty($_REQUEST['wdir'])) ? $_REQUEST['wdir'] : "";?>');
return true;
}
-->
</script>
<style type="text/css">
<!--
body {
background-color: white;
margin-top: 2px;
margin-left: 4px;
margin-right: 4px;
}
body,p,table,td,input,select,a {
font-family: Tahoma, sans-serif;
font-size: 11px;
}
select {
position: absolute;
top: -20px;
left: 0px;
}
-->
</style>
</head>
<body onload="reset_value();">
<?php
}
if (! $basedir = make_upload_directory("$course->id")) {
error("The site administrator needs to fix the file permissions");
}
$baseweb = $CFG->wwwroot;
// End of configuration and access control
if (!$wdir) {
$wdir="/";
}
if (($wdir != '/' and detect_munged_arguments($wdir, 0))
or ($file != '' and detect_munged_arguments($file, 0))) {
$message = "Error: Directories can not contain \"..\"";
$wdir = "/";
$action = "";
}
switch ($action) {
case "upload":
html_header($course, $wdir);
require_once($CFG->dirroot.'/lib/uploadlib.php');
if (!empty($save) and confirm_sesskey()) {
$um = new upload_manager('userfile',false,false,$course,false,0);
$dir = "$basedir$wdir";
if ($um->process_file_uploads($dir)) {
notify(get_string('uploadedfile'));
}
// um will take care of error reporting.
displaydir($wdir);
} else {
$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
$filesize = display_size($upload_max_filesize);
$struploadafile = get_string("uploadafile");
$struploadthisfile = get_string("uploadthisfile");
$strmaxsize = get_string("maxsize", "", $filesize);
$strcancel = get_string("cancel");
echo "<p>$struploadafile ($strmaxsize) --> <strong>$wdir</strong>";
echo "<table border=\"0\"><tr><td colspan=\"2\">\n";
echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"coursefiles.php\">\n";
upload_print_form_fragment(1,array('userfile'),null,false,null,$course->maxbytes,0,false);
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"upload\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
echo " </td><tr><td align=\"right\">";
echo " <input type=\"submit\" name=\"save\" value=\"$struploadthisfile\" />\n";
echo "</form>\n";
echo "</td>\n<td>\n";
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"$strcancel\" />\n";
echo "</form>\n";
echo "</td>\n</tr>\n</table>\n";
}
html_footer();
break;
case "delete":
if (!empty($confirm) and confirm_sesskey()) {
html_header($course, $wdir);
foreach ($USER->filelist as $file) {
$fullfile = $basedir.$file;
if (! fulldelete($fullfile)) {
echo "<br />Error: Could not delete: $fullfile";
}
}
clearfilelist();
displaydir($wdir);
html_footer();
} else {
html_header($course, $wdir);
if (setfilelist($_POST)) {
echo "<p align=center>".get_string("deletecheckwarning").":</p>";
print_simple_box_start("center");
printfilelist($USER->filelist);
print_simple_box_end();
echo "<br />";
$frameold = $CFG->framename;
$CFG->framename = "ibrowser";
notice_yesno (get_string("deletecheckfiles"),
"coursefiles.php?id=$id&amp;wdir=$wdir&amp;action=delete&amp;confirm=1&amp;sesskey=$USER->sesskey",
"coursefiles.php?id=$id&amp;wdir=$wdir&amp;action=cancel");
$CFG->framename = $frameold;
} else {
displaydir($wdir);
}
html_footer();
}
break;
case "move":
html_header($course, $wdir);
if ($count = setfilelist($_POST) and confirm_sesskey()) {
$USER->fileop = $action;
$USER->filesource = $wdir;
echo "<p align=\"center\">";
print_string("selectednowmove", "moodle", $count);
echo "</p>";
}
displaydir($wdir);
html_footer();
break;
case "paste":
html_header($course, $wdir);
if (isset($USER->fileop) and $USER->fileop == "move" and confirm_sesskey()) {
foreach ($USER->filelist as $file) {
$shortfile = basename($file);
$oldfile = $basedir.$file;
$newfile = $basedir.$wdir."/".$shortfile;
if (!rename($oldfile, $newfile)) {
echo "<p>Error: $shortfile not moved";
}
}
}
clearfilelist();
displaydir($wdir);
html_footer();
break;
case "rename":
if (!empty($name) and confirm_sesskey()) {
html_header($course, $wdir);
$name = clean_filename($name);
$oldname = clean_filename($oldname);
if (file_exists($basedir.$wdir."/".$name)) {
echo "Error: $name already exists!";
} else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {
echo "Error: could not rename $oldname to $name";
}
displaydir($wdir);
} else {
$strrename = get_string("rename");
$strcancel = get_string("cancel");
$strrenamefileto = get_string("renamefileto", "moodle", $file);
html_header($course, $wdir, "form.name");
echo "<p>$strrenamefileto:";
echo "<table border=\"0\">\n<tr>\n<td>\n";
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"rename\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
echo " <input type=\"hidden\" name=oldname value=\"$file\" />\n";
echo " <input type=\"text\" name=\"name\" size=\"35\" value=\"$file\" />\n";
echo " <input type=\"submit\" value=\"$strrename\" />\n";
echo "</form>\n";
echo "</td><td>\n";
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"$strcancel\" />\n";
echo "</form>";
echo "</td></tr>\n</table>\n";
}
html_footer();
break;
case "mkdir":
if (!empty($name) and confirm_sesskey()) {
html_header($course, $wdir);
$name = clean_filename($name);
if (file_exists("$basedir$wdir/$name")) {
echo "Error: $name already exists!";
} else if (! make_upload_directory("$course->id/$wdir/$name")) {
echo "Error: could not create $name";
}
displaydir($wdir);
} else {
$strcreate = get_string("create");
$strcancel = get_string("cancel");
$strcreatefolder = get_string("createfolder", "moodle", $wdir);
html_header($course, $wdir, "form.name");
echo "<p>$strcreatefolder:";
echo "<table border=\"0\">\n<tr><td>\n";
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"mkdir\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
echo " <input type=\"text\" name=\"name\" size=\"35\" />\n";
echo " <input type=\"submit\" value=\"$strcreate\" />\n";
echo "</form>\n";
echo "</td><td>\n";
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"$strcancel\" />\n";
echo "</form>\n";
echo "</td>\n</tr>\n</table>\n";
}
html_footer();
break;
case "edit":
html_header($course, $wdir);
if (isset($text) and confirm_sesskey()) {
$fileptr = fopen($basedir.$file,"w");
fputs($fileptr, stripslashes($text));
fclose($fileptr);
displaydir($wdir);
} else {
$streditfile = get_string("edit", "", "<strong>$file</strong>");
$fileptr = fopen($basedir.$file, "r");
$contents = fread($fileptr, filesize($basedir.$file));
fclose($fileptr);
print_heading("$streditfile");
echo "<table><tr><td colspan=\"2\">\n";
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\" $onsubmit>\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=file value=\"$file\" />";
echo " <input type=\"hidden\" name=\"action\" value=\"edit\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
print_textarea(false, 25, 80, 680, 400, "text", $contents);
echo "</td>\n</tr>\n<tr>\n<td>\n";
echo " <input type=\"submit\" value=\"".get_string("savechanges")."\" />\n";
echo "</form>\n";
echo "</td>\n<td>\n";
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />\n";
echo "</form>\n";
echo "</td></tr></table>\n";
if ($usehtmleditor) {
print_richedit_javascript("form", "text", "yes");
}
}
html_footer();
break;
case "zip":
if (!empty($name) and confirm_sesskey()) {
html_header($course, $wdir);
$name = clean_filename($name);
$files = array();
foreach ($USER->filelist as $file) {
$files[] = "$basedir/$file";
}
if (!zip_files($files,"$basedir/$wdir/$name")) {
error(get_string("zipfileserror","error"));
}
clearfilelist();
displaydir($wdir);
} else {
html_header($course, $wdir, "form.name");
if (setfilelist($_POST)) {
echo "<p align=\"center\">".get_string("youareabouttocreatezip").":</p>";
print_simple_box_start("center");
printfilelist($USER->filelist);
print_simple_box_end();
echo "<br />";
echo "<p align=\"center\">".get_string("whattocallzip");
echo "<table border=\"0\">\n<tr>\n<td>\n";
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"zip\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
echo " <INPUT TYPE=text name=name SIZE=35 value=\"new.zip\" />\n";
echo " <input type=\"submit\" value=\"".get_string("createziparchive")."\" />";
echo "</form>\n";
echo "</td>\n<td>\n";
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"".get_string("cancel")."\" />\n";
echo "</form>\n";
echo "</td>\n</tr>\n</table>\n";
} else {
displaydir($wdir);
clearfilelist();
}
}
html_footer();
break;
case "unzip":
html_header($course, $wdir);
if (!empty($file) and confirm_sesskey()) {
$strok = get_string("ok");
$strunpacking = get_string("unpacking", "", $file);
echo "<p align=\"center\">$strunpacking:</p>";
$file = basename($file);
if (!unzip_file("$basedir/$wdir/$file")) {
error(get_string("unzipfileserror","error"));
}
echo "<center><form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"$strok\" />\n";
echo "</form>\n";
echo "</center>\n";
} else {
displaydir($wdir);
}
html_footer();
break;
case "listzip":
html_header($course, $wdir);
if (!empty($file) and confirm_sesskey()) {
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$strok = get_string("ok");
$strlistfiles = get_string("listfiles", "", $file);
echo "<p align=\"center\">$strlistfiles:</p>";
$file = basename($file);
include_once('../pclzip/pclzip.lib.php');
$archive = new PclZip("$basedir/$wdir/$file");
if (!$list = $archive->listContent("$basedir/$wdir")) {
notify($archive->errorInfo(true));
} else {
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\">\n";
echo "<tr>\n<th align=\"left\">$strname</th><th align=\"right\">$strsize</th><th align=\"right\">$strmodified</th></tr>";
foreach ($list as $item) {
echo "<tr>";
print_cell("left", $item['filename']);
if (! $item['folder']) {
print_cell("right", display_size($item['size']));
} else {
echo "<td>&nbsp;</td>\n";
}
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
print_cell("right", $filedate);
echo "</tr>\n";
}
echo "</table>\n";
}
echo "<br /><center><form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
echo " <input type=\"submit\" value=\"$strok\" />\n";
echo "</form>\n";
echo "</center>\n";
} else {
displaydir($wdir);
}
html_footer();
break;
case "cancel":
clearfilelist();
default:
html_header($course, $wdir);
displaydir($wdir);
html_footer();
break;
}
/// FILE FUNCTIONS ///////////////////////////////////////////////////////////
function setfilelist($VARS) {
global $USER;
$USER->filelist = array ();
$USER->fileop = "";
$count = 0;
foreach ($VARS as $key => $val) {
if (substr($key,0,4) == "file") {
$count++;
$val = rawurldecode($val);
if (!detect_munged_arguments($val, 0)) {
$USER->filelist[] = $val;
}
}
}
return $count;
}
function clearfilelist() {
global $USER;
$USER->filelist = array ();
$USER->fileop = "";
}
function printfilelist($filelist) {
global $basedir, $CFG;
foreach ($filelist as $file) {
if (is_dir($basedir.$file)) {
echo "<img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" alt=\"\" /> $file<br />";
$subfilelist = array();
$currdir = opendir($basedir.$file);
while (false !== ($subfile = readdir($currdir))) {
if ($subfile <> ".." && $subfile <> ".") {
$subfilelist[] = $file."/".$subfile;
}
}
printfilelist($subfilelist);
} else {
$icon = mimeinfo("icon", $file);
echo "<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"\" /> $file<br />";
}
}
}
function print_cell($alignment="center", $text="&nbsp;") {
echo "<td align=\"$alignment\" nowrap=\"nowrap\">\n";
echo "$text";
echo "</td>\n";
}
function get_image_size($filepath) {
/// This function get's the image size
/// Check if file exists
if(!file_exists($filepath)) {
return false;
} else {
/// Get the mime type so it really an image.
if(mimeinfo("icon", basename($filepath)) != "image.gif") {
return false;
} else {
$array_size = getimagesize($filepath);
return $array_size;
}
}
unset($filepath,$array_size);
}
function displaydir ($wdir) {
// $wdir == / or /a or /a/b/c/d etc
global $basedir;
global $usecheckboxes;
global $id;
global $USER, $CFG;
$fullpath = $basedir.$wdir;
$directory = opendir($fullpath); // Find all files
while (false !== ($file = readdir($directory))) {
if ($file == "." || $file == "..") {
continue;
}
if (is_dir($fullpath."/".$file)) {
$dirlist[] = $file;
} else {
$filelist[] = $file;
}
}
closedir($directory);
$strfile = get_string("file");
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");
$straction = get_string("action");
$strmakeafolder = get_string("makeafolder");
$struploadafile = get_string("uploadafile");
$strwithchosenfiles = get_string("withchosenfiles");
$strmovetoanotherfolder = get_string("movetoanotherfolder");
$strmovefilestohere = get_string("movefilestohere");
$strdeletecompletely = get_string("deletecompletely");
$strcreateziparchive = get_string("createziparchive");
$strrename = get_string("rename");
$stredit = get_string("edit");
$strunzip = get_string("unzip");
$strlist = get_string("list");
$strchoose = get_string("choose");
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"dirform\">\n";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
if ($wdir == "/") {
$wdir = "";
} else {
$bdir = str_replace("/".basename($wdir),"",$wdir);
if($bdir == "/") {
$bdir = "";
}
print "<tr>\n<td colspan=\"5\">";
print "<a href=\"coursefiles.php?id=$id&amp;wdir=$bdir&amp;usecheckboxes=$usecheckboxes\" onclick=\"return reset_value();\">";
print "<img src=\"$CFG->wwwroot/lib/editor/images/folderup.gif\" height=\"14\" width=\"24\" border=\"0\" alt=\"Move up\" />";
print "</a></td>\n</tr>\n";
}
$count = 0;
if (!empty($dirlist)) {
asort($dirlist);
foreach ($dirlist as $dir) {
$count++;
$filename = $fullpath."/".$dir;
$fileurl = rawurlencode($wdir."/".$dir);
$filesafe = rawurlencode($dir);
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
echo "<tr>";
if ($usecheckboxes) {
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" onclick=\"return set_rename('$filesafe');\" />");
}
print_cell("left", "<a href=\"coursefiles.php?id=$id&amp;wdir=$fileurl\" onclick=\"return reset_value();\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"folder\" /></a> <a href=\"coursefiles.php?id=$id&amp;wdir=$fileurl&amp;usecheckboxes=$usecheckboxes\" onclick=\"return reset_value();\">".htmlspecialchars($dir)."</a>");
print_cell("right", "&nbsp;");
print_cell("right", $filedate);
echo "</tr>";
}
}
if (!empty($filelist)) {
asort($filelist);
foreach ($filelist as $file) {
$icon = mimeinfo("icon", $file);
$imgtype = mimeinfo("type",$file);
$count++;
$filename = $fullpath."/".$file;
$fileurl = "$wdir/$file";
$filesafe = rawurlencode($file);
$fileurlsafe = rawurlencode($fileurl);
$filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
$dimensions = get_image_size($filename);
if($dimensions) {
$imgwidth = $dimensions[0];
$imgheight = $dimensions[1];
} else {
$imgwidth = "Unknown";
$imgheight = "Unknown";
}
unset($dimensions);
echo "<tr>\n";
if ($usecheckboxes) {
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" onclick=\"return set_rename('$filesafe');\" />");
}
echo "<td align=\"left\" nowrap=\"nowrap\">";
if ($CFG->slasharguments) {
$ffurl = "/file.php/$id$fileurl";
} else {
$ffurl = "/file.php?file=/$id$fileurl";
}
link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" align=\"middle\" alt=\"$strfile\" />",
480, 640);
$file_size = filesize($filename);
echo "<a onclick=\"return set_value(info = {url: '".$CFG->wwwroot.$ffurl."',";
echo " isize: '".$file_size."', itype: '".$imgtype."', iwidth: '".$imgwidth."',";
echo " iheight: '".$imgheight."', imodified: '".$filedate."' })\" href=\"#\">$file</a>";
echo "</td>\n";
if ($icon == "zip.gif") {
$edittext = "<a href=\"coursefiles.php?id=$id&amp;wdir=$wdir&amp;file=$fileurl&amp;action=unzip&amp;sesskey=$USER->sesskey\">$strunzip</a>&nbsp;";
$edittext .= "<a href=\"coursefiles.php?id=$id&amp;wdir=$wdir&amp;file=$fileurl&amp;action=listzip&amp;sesskey=$USER->sesskey\">$strlist</a> ";
} else {
$edittext = "&nbsp;";
}
print_cell("right", "$edittext ");
print_cell("right", $filedate);
echo "</tr>\n";
}
}
echo "</table>\n";
if (empty($wdir)) {
$wdir = "/";
}
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">\n";
echo "<tr>\n<td>";
echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo "<input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
$options = array (
"move" => "$strmovetoanotherfolder",
"delete" => "$strdeletecompletely",
"zip" => "$strcreateziparchive"
);
if (!empty($count)) {
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
}
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"paste\" />\n";
echo " <input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />\n";
echo " <input type=\"submit\" value=\"$strmovefilestohere\" />\n";
echo "</form>";
}
echo "</td></tr>\n";
echo "</table>\n";
echo "</form>\n";
}
?>

View File

@ -1,80 +0,0 @@
// $Id$
// Though "Dialog" looks like an object, it isn't really an object. Instead
// it's just namespace for protecting global symbols.
function Dialog(url, action, init) {
if (typeof init == "undefined") {
init = window; // pass this window object by default
}
Dialog._geckoOpenModal(url, action, init);
};
Dialog._parentEvent = function(ev) {
if (Dialog._modal && !Dialog._modal.closed) {
Dialog._modal.focus();
HTMLArea._stopEvent(ev);
}
};
// should be a function, the return handler of the currently opened dialog.
Dialog._return = null;
// constant, the currently opened dialog
Dialog._modal = null;
// the dialog will read it's args from this variable
Dialog._arguments = null;
Dialog._geckoOpenModal = function(url, action, init) {
var file = url.substring(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
var x,y;
switch(file) {
case "insert_image": x = 730; y = 560; break;
case "dlg_ins_smile": x = 330; y = 320; break;
case "dlg_ins_char": x = 480; y = 290; break;
case "select_color": x = 238; y = 195; break;
case "insert_table": x = 420; y = 250; break;
case "link_std": x = 420; y = 230; break;
case "insert_image_std": x = 450; y = 240; break;
case "createanchor": x = 300; y = 140; break;
case "searchandreplace": x = 400; y = 250; break;
default: x = 50; y = 50;
}
var lx = (screen.width - x) / 2;
var tx = (screen.height - y) / 2;
var dlg = window.open(url, "ha_dialog", "toolbar=no,menubar=no,personalbar=no, width="+ x +",height="+ y +",scrollbars=no,resizable=no, left="+ lx +", top="+ tx +"");
Dialog._modal = dlg;
Dialog._arguments = init;
// capture some window's events
function capwin(w) {
HTMLArea._addEvent(w, "click", Dialog._parentEvent);
HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
};
// release the captured events
function relwin(w) {
HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
};
capwin(window);
// capture other frames
if(document.all) {
for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
}
// make up a function to be called when the Dialog ends.
Dialog._return = function (val) {
relwin(window);
// capture other frames
if(document.all) {
for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
}
if (val && action) {
action(val);
}
Dialog._modal = null;
};
};

View File

@ -1,180 +0,0 @@
.htmlarea { background: #fff; }
.htmlarea .toolbar {
cursor: default;
background: ButtonFace;
padding: 1px 1px 2px 1px;
border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
}
.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
.htmlarea .toolbar img { border: none; }
.htmlarea .toolbar .label { padding: 0px 3px; }
.htmlarea .toolbar .button {
background: ButtonFace;
color: ButtonText;
border: 1px solid ButtonFace;
padding: 1px;
margin: 0px;
}
.htmlarea .toolbar .buttonHover {
border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
}
.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
padding: 2px 0px 0px 2px;
border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
}
.htmlarea .toolbar .buttonPressed {
background: ButtonHighlight;
}
.htmlarea .toolbar .indicator {
padding: 0px 3px;
overflow: hidden;
width: 20px;
text-align: center;
cursor: default;
border: 1px solid ButtonShadow;
}
.htmlarea .toolbar .buttonDisabled { background-color: #aaa; }
.htmlarea .toolbar .buttonDisabled img {
filter: alpha(opacity = 25);
-moz-opacity: 25%;
}
.htmlarea .toolbar .separator {
position: relative;
margin: 3px;
border-left: 1px solid ButtonShadow;
border-right: 1px solid ButtonHighlight;
width: 0px;
height: 16px;
padding: 0px;
}
.htmlarea .toolbar .space { width: 5px; }
.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
.htmlarea .toolbar select,
.htmlarea .toolbar select:hover,
.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
.htmlarea .statusBar {
border: 1px solid;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
padding: 2px 4px;
background-color: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
}
.htmlarea .statusBar .statusBarTree a {
padding: 2px 5px;
color: #00f;
}
.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
.htmlarea .statusBar .statusBarTree a:hover {
background-color: Highlight;
color: HighlightText;
padding: 1px 4px;
border: 1px solid HighlightText;
}
/* Hidden DIV popup dialogs (PopupDiv) */
.dialog {
color: ButtonText;
background: ButtonFace;
}
.dialog .content { padding: 2px; }
.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
font: 11px Tahoma,Verdana,sans-serif;
}
.dialog table { border-collapse: collapse; }
.dialog .title {
background: #008;
color: #ff8;
border-bottom: 1px solid #000;
padding: 1px 0px 2px 5px;
font-size: 12px;
font-weight: bold;
cursor: default;
}
.dialog .title .button {
float: right;
border: 1px solid #66a;
padding: 0px 1px 0px 2px;
margin-right: 1px;
color: #fff;
text-align: center;
}
.dialog .title .button-hilite { border-color: #88f; background: #44c; }
.dialog button {
width: 5em;
padding: 0px;
}
.dialog .buttonColor {
padding: 1px;
cursor: default;
border: 1px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
}
.dialog .buttonColor-hilite {
border-color: #000;
}
.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
height: 0.6em;
border: 1px solid;
padding: 0px 1em;
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
}
.dialog .buttonColor .nocolor { padding: 0px; }
.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
.dialog .label { text-align: right; width: 6em; }
.dialog .value input { width: 100%; }
.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
.dialog legend { font-weight: bold; }
.dialog fieldset table { margin: 2px 0px; }
.popupdiv {
border: 2px solid;
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
}
.popupwin {
padding: 0px;
margin: 0px;
}
.popupwin .title {
background: #fff;
color: #000;
font-weight: bold;
font-size: 120%;
padding: 3px 10px;
margin-bottom: 10px;
border-bottom: 1px solid black;
letter-spacing: 2px;
}
form { margin: 0px; border: none; }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

View File

@ -1,69 +0,0 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
<?php
include("../../../config.php");
?>
HTMLArea.I18N = {
// the following should be the filename without .js extension
// it will be used for automatically load plugin language.
lang: "en",
tooltips: {
bold: "<?php print_string("bold","editor") ?>",
italic: "<?php print_string("italic","editor") ?>",
underline: "<?php print_string("underline","editor") ?>",
strikethrough: "<?php print_string("strikethrough","editor") ?>",
subscript: "<?php print_string("subscript","editor") ?>",
superscript: "<?php print_string("superscript","editor") ?>",
justifyleft: "<?php print_string("justifyleft","editor") ?>",
justifycenter: "<?php print_string("justifycenter","editor") ?>",
justifyright: "<?php print_string("justifyright","editor") ?>",
justifyfull: "<?php print_string("justifyfull","editor") ?>",
insertorderedlist: "<?php print_string("orderedlist","editor") ?>",
insertunorderedlist: "<?php print_string("unorderedlist","editor") ?>",
outdent: "<?php print_string("outdent","editor") ?>",
indent: "<?php print_string("indent","editor") ?>",
forecolor: "<?php print_string("forecolor","editor") ?>",
hilitecolor: "<?php print_string("hilitecolor","editor") ?>",
inserthorizontalrule: "<?php print_string("horizontalrule","editor") ?>",
createlink: "<?php print_string("createlink","editor") ?>",
insertimage: "<?php print_string("insertimage","editor") ?>",
inserttable: "<?php print_string("inserttable","editor") ?>",
htmlmode: "<?php print_string("htmlmode","editor") ?>",
popupeditor: "<?php print_string("popupeditor","editor") ?>",
about: "<?php print_string("about","editor") ?>",
showhelp: "<?php print_string("showhelp","editor") ?>",
textindicator: "<?php print_string("textindicator","editor") ?>",
undo: "<?php print_string("undo","editor") ?>",
redo: "<?php print_string("redo","editor") ?>",
cut: "<?php print_string("cut","editor") ?>",
copy: "<?php print_string("copy","editor") ?>",
paste: "<?php print_string("paste","editor") ?>",
insertsmile: "<?php print_string("insertsmile","editor") ?>",
insertchar: "<?php print_string("insertchar","editor") ?>"
},
buttons: {
"ok": "<?php print_string("ok","editor") ?>",
"cancel": "<?php print_string("cancel","editor") ?>",
"browse": "<?php print_string("browse","editor") ?>"
},
msg: {
"Path": "<?php print_string("path","editor") ?>",
"TEXT_MODE": "<?php print_string("textmode","editor") ?>"
}
};

View File

@ -1,63 +0,0 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
HTMLArea.I18N = {
// the following should be the filename without .js extension
// it will be used for automatically load plugin language.
lang: "en",
tooltips: {
bold: "Bold",
italic: "Italic",
underline: "Underline",
strikethrough: "Strikethrough",
subscript: "Subscript",
superscript: "Superscript",
justifyleft: "Justify Left",
justifycenter: "Justify Center",
justifyright: "Justify Right",
justifyfull: "Justify Full",
orderedlist: "Ordered List",
unorderedlist: "Bulleted List",
outdent: "Decrease Indent",
indent: "Increase Indent",
forecolor: "Font Color",
hilitecolor: "Background Color",
horizontalrule: "Horizontal Rule",
createlink: "Insert Web Link",
insertimage: "Insert Image",
inserttable: "Insert Table",
htmlmode: "Toggle HTML Source",
popupeditor: "Enlarge Editor",
about: "About this editor",
showhelp: "Help using editor",
textindicator: "Current style",
undo: "Undoes your last action",
redo: "Redoes your last action",
cut: "Cut selection",
copy: "Copy selection",
paste: "Paste from clipboard"
},
buttons: {
"ok": "OK",
"cancel": "Cancel"
},
msg: {
"Path": "Path",
"TEXT_MODE": "You are in TEXT MODE. Use the [<>] button to switch back to WYSIWIG."
}
};

View File

@ -1,88 +0,0 @@
<?php // $Id$
include("../../../config.php");
$lastmodified = filemtime("en.php");
$lifetime = 1800;
if ( function_exists('ob_gzhandler') ) {
ob_start("ob_gzhandler");
}
$charset = get_string('thischarset');
header("Content-type: application/x-javascript; charset: $charset"); // Correct MIME type
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT");
// See Bug #2387
header("Cache-control: max_age = -1");
header("Pragma: no-cache");
?>
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
HTMLArea.I18N = {
// the following should be the filename without .js extension
// it will be used for automatically load plugin language.
lang: "en",
tooltips: {
bold: "<?php print_string("bold","editor") ?>",
italic: "<?php print_string("italic","editor") ?>",
underline: "<?php print_string("underline","editor") ?>",
strikethrough: "<?php print_string("strikethrough","editor") ?>",
subscript: "<?php print_string("subscript","editor") ?>",
superscript: "<?php print_string("superscript","editor") ?>",
justifyleft: "<?php print_string("justifyleft","editor") ?>",
justifycenter: "<?php print_string("justifycenter","editor") ?>",
justifyright: "<?php print_string("justifyright","editor") ?>",
justifyfull: "<?php print_string("justifyfull","editor") ?>",
insertorderedlist: "<?php print_string("orderedlist","editor") ?>",
insertunorderedlist: "<?php print_string("unorderedlist","editor") ?>",
outdent: "<?php print_string("outdent","editor") ?>",
indent: "<?php print_string("indent","editor") ?>",
forecolor: "<?php print_string("forecolor","editor") ?>",
hilitecolor: "<?php print_string("hilitecolor","editor") ?>",
inserthorizontalrule: "<?php print_string("horizontalrule","editor") ?>",
createlink: "<?php print_string("createlink","editor") ?>",
unlink: "<?php print_string("removelink","editor") ?>",
nolink: "<?php print_string("nolink","editor") ?>",
insertimage: "<?php print_string("insertimage","editor") ?>",
inserttable: "<?php print_string("inserttable","editor") ?>",
htmlmode: "<?php print_string("htmlmode","editor") ?>",
popupeditor: "<?php print_string("popupeditor","editor") ?>",
about: "<?php print_string("about","editor") ?>",
showhelp: "<?php print_string("showhelp","editor") ?>",
textindicator: "<?php print_string("textindicator","editor") ?>",
undo: "<?php print_string("undo","editor") ?>",
redo: "<?php print_string("redo","editor") ?>",
cut: "<?php print_string("cut","editor") ?>",
copy: "<?php print_string("copy","editor") ?>",
paste: "<?php print_string("paste","editor") ?>",
insertsmile: "<?php print_string("insertsmile","editor") ?>",
insertchar: "<?php print_string("insertchar","editor") ?>",
clean: "<?php print_string("wordclean","editor") ?>",
lefttoright: "<?php print_string("lefttoright","editor");?>",
righttoleft: "<?php print_string("righttoleft","editor");?>"
},
buttons: {
"ok": "<?php print_string("ok","editor") ?>",
"cancel": "<?php print_string("cancel","editor") ?>",
"browse": "<?php print_string("browse","editor") ?>"
},
msg: {
"Path": "<?php print_string("path","editor") ?>",
"TEXT_MODE": "<?php print_string("textmode","editor") ?>"
}
};

View File

@ -1,13 +0,0 @@
htmlArea License (based on BSD license)
Copyright (c) 2002, interactivetools.com, inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3) Neither the name of interactivetools.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

View File

@ -1,37 +0,0 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
SpellChecker.I18N = {
"CONFIRM_LINK_CLICK" : "Please confirm that you want to open this link",
"Cancel" : "Cancel",
"Dictionary" : "Dictionary",
"Finished list of mispelled words" : "Finished list of mispelled words",
"I will open it in a new page." : "I will open it in a new page.",
"Ignore all" : "Ignore all",
"Ignore" : "Ignore",
"NO_ERRORS" : "No mispelled words found with the selected dictionary.",
"NO_ERRORS_CLOSING" : "Spell check complete, didn't find any mispelled words. Closing now...",
"OK" : "OK",
"Original word" : "Original word",
"Please wait. Calling spell checker." : "Please wait. Calling spell checker.",
"Please wait: changing dictionary to" : "Please wait: changing dictionary to",
"QUIT_CONFIRMATION" : "This will drop changes and quit spell checker. Please confirm.",
"Re-check" : "Re-check",
"Replace all" : "Replace all",
"Replace with" : "Replace with",
"Replace" : "Replace",
"SC-spell-check" : "Spell-check",
"Suggestions" : "Suggestions",
"pliz weit ;-)" : "pliz weit ;-)"
};

View File

@ -1,37 +0,0 @@
// I18N constants
// LANG: "ro", ENCODING: UTF-8
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
SpellChecker.I18N = {
"CONFIRM_LINK_CLICK" : "Vă rog confirmaţi că vreţi să deschideţi acest link",
"Cancel" : "Anulează",
"Dictionary" : "Dicţionar",
"Finished list of mispelled words" : "Am terminat lista de cuvinte greşite",
"I will open it in a new page." : "O voi deschide într-o altă fereastră.",
"Ignore all" : "Ignoră toate",
"Ignore" : "Ignoră",
"NO_ERRORS" : "Nu am găsit nici un cuvânt greşit cu acest dicţionar.",
"NO_ERRORS_CLOSING" : "Am terminat, nu am detectat nici o greşeală. Acum închid fereastra...",
"OK" : "OK",
"Original word" : "Cuvântul original",
"Please wait. Calling spell checker." : "Vă rog aşteptaţi. Apelez spell-checker-ul.",
"Please wait: changing dictionary to" : "Vă rog aşteptaţi. Schimb dicţionarul cu",
"QUIT_CONFIRMATION" : "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?",
"Re-check" : "Scanează",
"Replace all" : "Înlocuieşte toate",
"Replace with" : "Înlocuieşte cu",
"Replace" : "Înlocuieşte",
"SC-spell-check" : "Detectează greşeli",
"Suggestions" : "Sugestii",
"pliz weit ;-)" : "va rog ashteptatzi ;-)"
};

View File

@ -1,115 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
<html>
<head>
<title>HTMLArea Spell Checker</title>
</head>
<body>
<h1>HTMLArea Spell Checker</h1>
<p>The HTMLArea Spell Checker subsystem consists of the following
files:</p>
<ul>
<li>spell-checker.js &mdash; the spell checker plugin interface for
HTMLArea</li>
<li>spell-checker-ui.html &mdash; the HTML code for the user
interface</li>
<li>spell-checker-ui.js &mdash; functionality of the user
interface</li>
<li>spell-checker-logic.cgi &mdash; Perl CGI script that checks a text
given through POST for spelling errors</li>
<li>spell-checker-style.css &mdash; style for mispelled words</li>
<li>lang/en.js &mdash; main language file (English).</li>
</ul>
<h2>Process overview</h2>
<p>
When an end-user clicks the "spell-check" button in the HTMLArea
editor, a new window is opened with the URL of "spell-check-ui.html".
This window initializes itself with the text found in the editor (uses
<tt>window.opener.SpellChecker.editor</tt> global variable) and it
submits the text to the server-side script "spell-check-logic.cgi".
The target of the FORM is an inline frame which is used both to
display the text and correcting.
</p>
<p>
Further, spell-check-logic.cgi calls Aspell for each portion of plain
text found in the given HTML. It rebuilds an HTML file that contains
clear marks of which words are incorrect, along with suggestions for
each of them. This file is then loaded in the inline frame. Upon
loading, a JavaScript function from "spell-check-ui.js" is called.
This function will retrieve all mispelled words from the HTML of the
iframe and will setup the user interface so that it allows correction.
</p>
<h2>The server-side script (spell-check-logic.cgi)</h2>
<p>
<strong>Unicode safety</strong> &mdash; the program <em>is</em>
Unicode safe. HTML entities are expanded into their corresponding
Unicode characters. These characters will be matched as part of the
word passed to Aspell. All texts passed to Aspell are in Unicode
(when appropriate). However, Aspell seems to not support Unicode
yet (<a
href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</a>).
This mean that words containing Unicode
characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.
</p>
<p>
I digged the Net for a couple of hours today and I can't seem to find
any open-source spell checker that has Unicode support. For this
reason we keep using Aspell, because it also seems to have the
best suggestions engine. Unicode support will eventually be
implemented in Aspell. <a href="mailto:kevin@atkinson.dhs.org">Email
Kevin Atkinson</a> (Aspell author and maintainer) about this ;-)
</p>
<p>
The Perl Unicode manual (man perluniintro) states:
</p>
<blockquote>
<em>
Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
natively. Perl 5.8.0, however, is the first recommended release for
serious Unicode work. The maintenance release 5.6.1 fixed many of the
problems of the initial Unicode implementation, but for example regular
expressions still do not work with Unicode in 5.6.1.
</em>
</blockquote>
<p>In other words, do <em>not</em> assume that this script is
Unicode-safe on Perl interpreters older than 5.8.0.</p>
<p>The following Perl modules are required:</p>
<ul>
<li><a href="http://search.cpan.org/search?query=Text%3A%3AAspell&mode=all" target="_blank">Text::Aspell</a></li>
<li><a href="http://search.cpan.org/search?query=HTML%3A%3AParser&mode=all" target="_blank">HTML::Parser</a></li>
<li><a href="http://search.cpan.org/search?query=HTML%3A%3AEntities&mode=all" target="_blank">HTML::Entities</a></li>
<li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
</ul>
<p>Of these, only Text::Aspell might need to be installed manually. The
others are likely to be available by default in most Perl distributions.</p>
<hr />
<address><a href="http://students.infoiasi.ro/~mishoo/">Mihai Bazon</a></address>
<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
<!-- hhmts start -->
Last modified on Sun Aug 10 12:28:24 2003
<!-- hhmts end -->
<!-- doc-lang: English -->
</body>
</html>

View File

@ -1,155 +0,0 @@
#! /usr/bin/perl -w
# Spell Checker Plugin for HTMLArea-3.0
# Implementation by Mihai Bazon. Sponsored by www.americanbible.org
#
# htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
# This notice MUST stay intact for use (see license.txt).
#
# A free WYSIWYG editor replacement for <textarea> fields.
# For full source code and docs, visit http://www.interactivetools.com/
#
# Version 3.0 developed by Mihai Bazon for InteractiveTools.
# http://students.infoiasi.ro/~mishoo
#
# $Id$
use strict;
use utf8;
use Encode;
use Text::Aspell;
use HTML::Parser;
use HTML::Entities;
use CGI;
my $debug = 0;
open (DEBUG, '>:encoding(UTF-8)', '> /tmp/spell-check-debug.log') if $debug;
# use Data::Dumper; # for debug only
my $speller = new Text::Aspell;
my $cgi = new CGI;
# FIXME: report a nice error...
die "Can't create speller!" unless $speller;
# add configurable option for this
my $dict = $cgi->param('dictionary') || 'en_US';
$speller->set_option('lang', $dict);
# ultra, fast, normal, bad-spellers
# bad-spellers seems to cause segmentation fault
$speller->set_option('sug-mode', 'ultra');
my @replacements = ();
sub text_handler {
my ($offset, $length, $text, $is_cdata) = @_;
if ($is_cdata or $text =~ /^\s*$/) {
return 0;
}
# print STDERR "*** OFFSET: $offset, LENGTH: $length, $text\n";
$text = decode_entities($text);
$text =~ s/&#([0-9]+);/chr($1)/eg;
$text =~ s/&#x([0-9a-fA-F]+);/chr(hex $1)/eg;
my $repl = spellcheck($text);
if ($repl) {
push(@replacements, [ $offset, $length, $repl ]);
}
}
my $p = HTML::Parser->new
(api_version => 3,
handlers => { start => [ sub {
my ($self, $tagname, $attrs) = @_;
# print STDERR "\033[1;31m parsing tag: $tagname\033[0m\n";
# following we skip words that have already been marked as "fixed".
if ($tagname eq "span" and $attrs->{class} =~ /HA-spellcheck-fixed/) {
$self->handler(text => undef);
}
}, "self, tagname, attr"
],
end => [ sub {
my ($self, $tagname) = @_;
# print STDERR "\033[1;32m END tag: $tagname\033[0m\n";
$self->handler(text => \&text_handler, 'offset, length, dtext, is_cdata');
}, "self, tagname"
]
}
);
$p->handler(text => \&text_handler, 'offset, length, dtext, is_cdata');
$p->case_sensitive(1);
my $file_content = $cgi->param('content');
if ($debug) {
open (FOO, '>:encoding(UTF-8)', '/tmp/spell-check-before');
print FOO $file_content, "\n";
close(FOO);
}
$p->parse($file_content);
$p->eof();
foreach (reverse @replacements) {
substr($file_content, $_->[0], $_->[1], $_->[2]);
}
# we output UTF-8
binmode(STDOUT, ':encoding(UTF-8)'); # apparently, this sucks.
print "Content-type: text/html; charset: utf-8\n\n";
print qq^
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" />
</head>
<body onload="window.parent.finishedSpellChecking();">^;
print $file_content;
if ($cgi->param('init') eq '1') {
my @dicts = $speller->dictionary_info();
my $dictionaries = '';
foreach my $i (@dicts) {
$dictionaries .= ',' . $i->{name} unless $i->{jargon};
}
$dictionaries =~ s/^,//;
print qq^
<div id="HA-spellcheck-dictionaries"
>$dictionaries</div>
^;
}
if ($debug) {
open (FOO, '>:encoding(UTF-8)', '/tmp/spell-check-after');
print FOO $file_content, "\n";
close(FOO);
}
print '</body></html>';
# Perl is beautiful.
sub spellcheck {
my $text = shift;
sub check { # called for each word in the text
# input is in UTF-8
my $U_word = shift;
my $word = encode($speller->get_option('encoding'), $U_word);
print DEBUG "*$U_word* ----> |$word|\n" if $debug;
if ($speller->check($word)) {
return $U_word; # we return the word in UTF-8
} else {
# we should have suggestions; give them back to browser in UTF-8
my $suggestions = decode($speller->get_option('encoding'), join(',', $speller->suggest($word)));
my $ret = '<span class="HA-spellcheck-error">'.$U_word.'</span><span class="HA-spellcheck-suggestions">'.$suggestions.'</span>';
return $ret;
}
}
$text =~ s/([[:word:]']+)/check($1)/egs;
# $text =~ s/(\w+)/check($1)/egs;
# the following is definitely what we want to use; too bad it sucks most.
# $text =~ s/(\p{IsWord}+)/check($1)/egs;
return $text;
}

View File

@ -1,10 +0,0 @@
.HA-spellcheck-error { border-bottom: 2px dotted #f00; cursor: default; }
.HA-spellcheck-same { background-color: #ff8; color: #000; }
.HA-spellcheck-hover { background-color: #433; color: white; }
.HA-spellcheck-fixed { border-bottom: 1px dotted #0b8; }
.HA-spellcheck-current { background-color: #7be; color: #000; }
.HA-spellcheck-suggestions { display: none; }
#HA-spellcheck-dictionaries { display: none; }
a:link, a:visited { color: #55e; }

View File

@ -1,119 +0,0 @@
<!--
Strangely, IE sucks with or without the DOCTYPE switch.
I thought it would only suck without it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Spell Checker Plugin for HTMLArea-3.0
Implementation by Mihai Bazon. Sponsored by www.americanbible.org
htmlArea v3.0 - Copyright (c) 2003 interactivetools.com, inc.
This notice MUST stay intact for use (see license.txt).
A free WYSIWYG editor replacement for <textarea> fields.
For full source code and docs, visit http://www.interactivetools.com/
Version 3.0 developed by Mihai Bazon for InteractiveTools.
http://students.infoiasi.ro/~mishoo
$Id$
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Spell Checker</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="spell-check-ui.js"></script>
<style type="text/css">
html, body { height: 100%; margin: 0px; padding: 0px; background-color: #fff;
color: #000; }
a:link, a:visited { color: #00f; text-decoration: none; }
a:hover { color: #f00; text-decoration: underline; }
table { background-color: ButtonFace; color: ButtonText;
font-family: tahoma,verdana,sans-serif; font-size: 11px; }
iframe { background-color: #fff; color: #000; }
.controls { width: 13em; }
.controls .sectitle { /* background-color: #736c6c; color: #fff;
border-top: 1px solid #000; border-bottom: 1px solid #fff; */
text-align: center;
font-weight: bold; padding: 2px 4px; }
.controls .secbody { margin-bottom: 10px; }
button, select { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
button { width: 6em; padding: 0px; }
input, select { font-family: fixed,"andale mono",monospace; }
#v_currentWord { color: #f00; font-weight: bold; font-size: 120%; }
#statusbar { padding: 7px 0px 0px 5px; }
#status { font-weight: bold; }
</style>
</head>
<body onload="initDocument()">
<form style="display: none;" action="spell-check-logic.cgi"
method="post" target="framecontent"
accept-charset="utf-8"
><input type="hidden" name="content" id="f_content"
/><input type="hidden" name="dictionary" id="f_dictionary"
/><input type="hidden" name="init" id="f_init" value="1"
/></form>
<table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" style="height: 1em; padding: 2px;">
<div style="float: right; padding: 2px;"><span>Dictionary</span>
<select id="v_dictionaries" style="width: 10em"></select>
<button id="b_recheck">Re-check</button>
</div>
<span id="status">Please wait. Calling spell checker.</span>
</td>
</tr>
<tr>
<td valign="top" class="controls">
<div class="sectitle">Original word</div>
<div class="secbody" id="v_currentWord" style="text-align: center">pliz weit ;-)</div>
<div class="sectitle">Replace with</div>
<div class="secbody">
<input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />
<div style="text-align: center; margin-top: 2px;">
<button id="b_replace">Replace</button><button
id="b_replall">Replace all</button><br /><button
id="b_ignore">Ignore</button><button
id="b_ignall">Ignore all</button>
</div>
</div>
<div class="sectitle">Suggestions</div>
<div class="secbody">
<select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
</div>
</td>
<td>
<iframe src="about:blank" width="100%" height="100%"
id="i_framecontent" name="framecontent"></iframe>
</td>
</tr>
<tr>
<td style="height: 1em;" colspan="2">
<div style="padding: 4px 2px 2px 2px; float: right;">
<button id="b_ok">OK</button>
<button id="b_cancel">Cancel</button>
</div>
<div id="statusbar"></div>
</td>
</tr>
</table>
</body>
</html>

View File

@ -1,334 +0,0 @@
// Spell Checker Plugin for HTMLArea-3.0
// Implementation by Mihai Bazon. Sponsored by www.americanbible.org
//
// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
// This notice MUST stay intact for use (see license.txt).
//
// A free WYSIWYG editor replacement for <textarea> fields.
// For full source code and docs, visit http://www.interactivetools.com/
//
// Version 3.0 developed by Mihai Bazon for InteractiveTools.
// http://students.infoiasi.ro/~mishoo
//
// $Id$
// internationalization file was already loaded in parent ;-)
var SpellChecker = window.opener.SpellChecker;
var i18n = SpellChecker.I18N;
var is_ie = window.opener.HTMLArea.is_ie;
var editor = SpellChecker.editor;
var frame = null;
var currentElement = null;
var wrongWords = null;
var modified = false;
var allWords = {};
function makeCleanDoc(leaveFixed) {
// document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
for (var i in wrongWords) {
var el = wrongWords[i];
if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
el.parentNode.insertBefore(el.firstChild, el);
el.parentNode.removeChild(el.nextSibling);
el.parentNode.removeChild(el);
} else {
el.className = "HA-spellcheck-fixed";
el.parentNode.removeChild(el.nextSibling);
}
}
// we should use innerHTML here, but IE6's implementation fucks up the
// HTML to such extent that our poor Perl parser doesn't understand it
// anymore.
return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, leaveFixed);
};
function recheckClicked() {
document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".';
var field = document.getElementById("f_content");
field.value = makeCleanDoc(true);
field.form.submit();
};
function saveClicked() {
if (modified) {
editor.setHTML(makeCleanDoc(false));
}
window.close();
return false;
};
function cancelClicked() {
var ok = true;
if (modified) {
ok = confirm(i18n["QUIT_CONFIRMATION"]);
}
if (ok) {
window.close();
}
return false;
};
function replaceWord(el) {
var replacement = document.getElementById("v_replacement").value;
modified = (el.innerHTML != replacement);
if (el) {
el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " ");
}
el.className += " HA-spellcheck-fixed";
el.__msh_fixed = true;
if (!modified) {
return false;
}
el.innerHTML = replacement;
};
function replaceClicked() {
replaceWord(currentElement);
var start = currentElement.__msh_id;
var index = start;
do {
++index;
if (index == wrongWords.length) {
index = 0;
}
} while ((index != start) && wrongWords[index].__msh_fixed);
if (index == start) {
index = 0;
alert(i18n["Finished list of mispelled words"]);
}
wrongWords[index].onclick();
return false;
};
function replaceAllClicked() {
var replacement = document.getElementById("v_replacement").value;
var ok = true;
var spans = allWords[currentElement.__msh_origWord];
if (spans.length == 0) {
alert("An impossible condition just happened. Call FBI. ;-)");
} else if (spans.length == 1) {
replaceClicked();
return false;
}
/*
var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n";
if (replacement == currentElement.__msh_origWord) {
ok = confirm(message + "Ignore all occurrences?");
} else {
ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?");
}
*/
if (ok) {
for (var i in spans) {
if (spans[i] != currentElement) {
replaceWord(spans[i]);
}
}
// replace current element the last, so that we jump to the next word ;-)
replaceClicked();
}
return false;
};
function ignoreClicked() {
document.getElementById("v_replacement").value = currentElement.__msh_origWord;
replaceClicked();
return false;
};
function ignoreAllClicked() {
document.getElementById("v_replacement").value = currentElement.__msh_origWord;
replaceAllClicked();
return false;
};
function learnClicked() {
alert("Not [yet] implemented");
return false;
};
function internationalizeWindow() {
var types = ["div", "span", "button"];
for (var i in types) {
var tag = types[i];
var els = document.getElementsByTagName(tag);
for (var j = els.length; --j >= 0;) {
var el = els[j];
if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) {
var txt = el.innerHTML;
if (typeof i18n[txt] != "undefined") {
el.innerHTML = i18n[txt];
}
}
}
}
};
function initDocument() {
internationalizeWindow();
modified = false;
frame = document.getElementById("i_framecontent");
var field = document.getElementById("f_content");
field.value = editor.getHTML();
field.form.submit();
document.getElementById("f_init").value = "0";
// assign some global event handlers
var select = document.getElementById("v_suggestions");
select.onchange = function() {
document.getElementById("v_replacement").value = this.value;
};
if (is_ie) {
select.attachEvent("ondblclick", replaceClicked);
} else {
select.addEventListener("dblclick", replaceClicked, true);
}
document.getElementById("b_replace").onclick = replaceClicked;
// document.getElementById("b_learn").onclick = learnClicked;
document.getElementById("b_replall").onclick = replaceAllClicked;
document.getElementById("b_ignore").onclick = ignoreClicked;
document.getElementById("b_ignall").onclick = ignoreAllClicked;
document.getElementById("b_recheck").onclick = recheckClicked;
document.getElementById("b_ok").onclick = saveClicked;
document.getElementById("b_cancel").onclick = cancelClicked;
select = document.getElementById("v_dictionaries");
select.onchange = function() {
document.getElementById("f_dictionary").value = this.value;
};
};
function wordClicked() {
if (currentElement) {
var a = allWords[currentElement.__msh_origWord];
currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
for (var i in a) {
var el = a[i];
if (el != currentElement) {
el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
}
}
}
currentElement = this;
this.className += " HA-spellcheck-current";
var a = allWords[currentElement.__msh_origWord];
for (var i in a) {
var el = a[i];
if (el != currentElement) {
el.className += " HA-spellcheck-same";
}
}
document.getElementById("b_replall").disabled = (a.length <= 1);
document.getElementById("b_ignall").disabled = (a.length <= 1);
var txt;
if (a.length == 1) {
txt = "one occurrence";
} else if (a.length == 2) {
txt = "two occurrences";
} else {
txt = a.length + " occurrences";
}
document.getElementById("statusbar").innerHTML = "Found " + txt +
' for word "<b>' + currentElement.__msh_origWord + '</b>"';
var select = document.getElementById("v_suggestions");
for (var i = select.length; --i >= 0;) {
select.remove(i);
}
var suggestions;
suggestions = this.nextSibling.firstChild.data.split(/,/);
for (var i = 0; i < suggestions.length; ++i) {
var txt = suggestions[i];
var option = document.createElement("option");
option.value = txt;
option.appendChild(document.createTextNode(txt));
select.appendChild(option);
}
document.getElementById("v_currentWord").innerHTML = this.__msh_origWord;
if (suggestions.length > 0) {
select.selectedIndex = 0;
select.onchange();
} else {
document.getElementById("v_replacement").value = this.innerHTML;
}
return false;
};
function wordMouseOver() {
this.className += " HA-spellcheck-hover";
};
function wordMouseOut() {
this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
};
function finishedSpellChecking() {
// initialization of global variables
currentElement = null;
wrongWords = null;
allWords = {};
document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
var doc = frame.contentWindow.document;
var spans = doc.getElementsByTagName("span");
var sps = [];
var id = 0;
for (var i = 0; i < spans.length; ++i) {
var el = spans[i];
if (/HA-spellcheck-error/.test(el.className)) {
sps.push(el);
el.onclick = wordClicked;
el.onmouseover = wordMouseOver;
el.onmouseout = wordMouseOut;
el.__msh_id = id++;
var txt = (el.__msh_origWord = el.firstChild.data);
el.__msh_fixed = false;
if (typeof allWords[txt] == "undefined") {
allWords[txt] = [el];
} else {
allWords[txt].push(el);
}
}
}
wrongWords = sps;
if (sps.length == 0) {
if (!modified) {
alert(i18n["NO_ERRORS_CLOSING"]);
window.close();
} else {
alert(i18n["NO_ERRORS"]);
}
return false;
}
(currentElement = sps[0]).onclick();
var as = doc.getElementsByTagName("a");
for (var i = as.length; --i >= 0;) {
var a = as[i];
a.onclick = function() {
if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" +
this.href + "\n" + i18n["I will open it in a new page."])) {
window.open(this.href);
}
return false;
};
}
var dicts = doc.getElementById("HA-spellcheck-dictionaries");
if (dicts) {
dicts.parentNode.removeChild(dicts);
dicts = dicts.innerHTML.split(/,/);
var select = document.getElementById("v_dictionaries");
for (var i = select.length; --i >= 0;) {
select.remove(i);
}
for (var i = 0; i < dicts.length; ++i) {
var txt = dicts[i];
var option = document.createElement("option");
option.value = txt;
option.appendChild(document.createTextNode(txt));
select.appendChild(option);
}
}
};

View File

@ -1,72 +0,0 @@
// Spell Checker Plugin for HTMLArea-3.0
// Implementation by Mihai Bazon. Sponsored by www.americanbible.org
//
// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
// This notice MUST stay intact for use (see license.txt).
//
// A free WYSIWYG editor replacement for <textarea> fields.
// For full source code and docs, visit http://www.interactivetools.com/
//
// Version 3.0 developed by Mihai Bazon for InteractiveTools.
// http://students.infoiasi.ro/~mishoo
//
// $Id$
function SpellChecker(editor) {
this.editor = editor;
var cfg = editor.config;
var tt = SpellChecker.I18N;
var bl = SpellChecker.btnList;
var self = this;
// register the toolbar buttons provided by this plugin
var toolbar = [];
for (var i in bl) {
var btn = bl[i];
if (!btn) {
toolbar.push("separator");
} else {
var id = "SC-" + btn[0];
cfg.registerButton(id, tt[id], "plugins/SpellChecker/img/" + btn[0] + ".gif", false,
function(editor, id) {
// dispatch button press event
self.buttonPress(editor, id);
}, btn[1]);
toolbar.push(id);
}
}
for (var i in toolbar) {
cfg.toolbar[0].push(toolbar[i]);
}
};
SpellChecker.btnList = [
null, // separator
["spell-check"]
];
SpellChecker.prototype.buttonPress = function(editor, id) {
switch (id) {
case "SC-spell-check":
SpellChecker.editor = editor;
SpellChecker.init = true;
var uiurl = editor.config.editorURL + "plugins/SpellChecker/spell-check-ui.html";
var win;
if (HTMLArea.is_ie) {
win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,location=no,directories=no,status=no,menubar=no," +
"scrollbars=no,resizable=yes,width=600,height=400");
} else {
win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,menubar=no,personalbar=no,width=600,height=400," +
"scrollbars=no,resizable=yes");
}
win.focus();
break;
}
};
// this needs to be global, it's accessed from spell-check-ui.html
SpellChecker.editor = null;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

View File

@ -1,90 +0,0 @@
// I18N constants
// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
TableOperations.I18N = {
"Align": "Align",
"All four sides": "All four sides",
"Background": "Background",
"Baseline": "Baseline",
"Border": "Border",
"Borders": "Borders",
"Bottom": "Bottom",
"CSS Style": "Style [CSS]",
"Caption": "Caption",
"Cell Properties": "Cell Properties",
"Center": "Center",
"Char": "Char",
"Collapsed borders": "Collapsed borders",
"Color": "Color",
"Description": "Description",
"FG Color": "FG Color",
"Float": "Float",
"Frames": "Frames",
"Height": "Height",
"How many columns would you like to merge?": "How many columns would you like to merge?",
"How many rows would you like to merge?": "How many rows would you like to merge?",
"Image URL": "Image URL",
"Justify": "Justify",
"Layout": "Layout",
"Left": "Left",
"Margin": "Margin",
"Middle": "Middle",
"No rules": "No rules",
"No sides": "No sides",
"None": "None",
"Padding": "Padding",
"Please click into some cell": "Please click into some cell",
"Right": "Right",
"Row Properties": "Row Properties",
"Rules will appear between all rows and columns": "Rules will appear between all rows and columns",
"Rules will appear between columns only": "Rules will appear between columns only",
"Rules will appear between rows only": "Rules will appear between rows only",
"Rules": "Rules",
"Spacing and padding": "Spacing and padding",
"Spacing": "Spacing",
"Summary": "Summary",
"TO-cell-delete": "Delete cell",
"TO-cell-insert-after": "Insert cell after",
"TO-cell-insert-before": "Insert cell before",
"TO-cell-merge": "Merge cells",
"TO-cell-prop": "Cell properties",
"TO-cell-split": "Split cell",
"TO-col-delete": "Delete column",
"TO-col-insert-after": "Insert column after",
"TO-col-insert-before": "Insert column before",
"TO-col-split": "Split column",
"TO-row-delete": "Delete row",
"TO-row-insert-above": "Insert row before",
"TO-row-insert-under": "Insert row after",
"TO-row-prop": "Row properties",
"TO-row-split": "Split row",
"TO-table-prop": "Table properties",
"Table Properties": "Table Properties",
"Text align": "Text align",
"The bottom side only": "The bottom side only",
"The left-hand side only": "The left-hand side only",
"The right and left sides only": "The right and left sides only",
"The right-hand side only": "The right-hand side only",
"The top and bottom sides only": "The top and bottom sides only",
"The top side only": "The top side only",
"Top": "Top",
"Unset color": "Unset color",
"Vertical align": "Vertical align",
"Width": "Width",
"not-del-last-cell": "HTMLArea cowardly refuses to delete the last cell in row.",
"not-del-last-col": "HTMLArea cowardly refuses to delete the last column in table.",
"not-del-last-row": "HTMLArea cowardly refuses to delete the last row in table.",
"percent": "percent",
"pixels": "pixels"
};

View File

@ -1,66 +0,0 @@
TableOperations.I18N = {
"Align": "Kohdistus",
"All four sides": "Kaikki neljä sivua",
"Background": "Tausta",
"Baseline": "Takaraja",
"Border": "Reuna",
"Borders": "Reunat",
"Bottom": "Alle",
"CSS Style": "Tyyli [CSS]",
"Caption": "Otsikko",
"Cell Properties": "Solun asetukset",
"Center": "Keskelle",
"Char": "Merkki",
"Collapsed borders": "Luhistetut reunat",
"Color": "Väri",
"Description": "Kuvaus",
"FG Color": "FG Väri",
"Frames": "Kehykset",
"Image URL": "Kuvan osoite",
"Layout": "Sommittelu",
"Left": "Vasen",
"Margin": "Marginaali",
"Middle": "Keskelle",
"No rules": "Ei viivoja",
"No sides": "Ei sivuja",
"Padding": "Palstantäyte",
"Right": "Oikea",
"Row Properties": "Rivin asetukset",
"Rules will appear between all rows and columns": "Viivat jokaisen rivin ja sarakkeen välillä",
"Rules will appear between columns only": "Viivat ainoastaan sarakkeiden välillä",
"Rules will appear between rows only": "Viivat ainoastaan rivien välillä",
"Rules": "Viivat",
"Spacing": "Palstatila",
"Summary": "Yhteenveto",
"TO-cell-delete": "Poista solu",
"TO-cell-insert-after": "Lisää solu perään",
"TO-cell-insert-before": "Lisää solu ennen",
"TO-cell-merge": "Yhdistä solut",
"TO-cell-prop": "Solun asetukset",
"TO-cell-split": "Jaa solu",
"TO-col-delete": "Poista sarake",
"TO-col-insert-after": "Lisää sarake perään",
"TO-col-insert-before": "Lisää sarake ennen",
"TO-col-split": "Jaa sarake",
"TO-row-delete": "Poista rivi",
"TO-row-insert-above": "Lisää rivi yläpuolelle",
"TO-row-insert-under": "Lisää rivi alapuolelle",
"TO-row-prop": "Rivin asetukset",
"TO-row-split": "Jaa rivi",
"TO-table-prop": "Taulukon asetukset",
"Top": "Ylös",
"Table Properties": "Taulukon asetukset",
"The bottom side only": "Ainoastaan alapuolelle",
"The left-hand side only": "Ainoastaan vasenreuna",
"The right and left sides only": "Oikea- ja vasenreuna",
"The right-hand side only": "Ainoastaan oikeareuna",
"The top and bottom sides only": "Ylä- ja alapuoli.",
"The top side only": "Ainoastaan yläpuoli",
"Vertical align": "Vertikaali kohdistus",
"Width": "Leveys",
"not-del-last-cell": "Ei voida poistaa viimeistä solua rivistä.",
"not-del-last-col": "Ei voida poistaa viimeistä saraketta taulusta.",
"not-del-last-row": "Ei voida poistaa viimeistä riviä taulusta.",
"percent": "prosenttia",
"pixels": "pikseliä"
};

View File

@ -1,90 +0,0 @@
// I18N constants
// LANG: "ro", ENCODING: UTF-8
// Author: Mihai Bazon, <mishoo@infoiasi.ro>
// FOR TRANSLATORS:
//
// 1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
// (at least a valid email address)
//
// 2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
// (if this is not possible, please include a comment
// that states what encoding is necessary.)
TableOperations.I18N = {
"Align": "Aliniere",
"All four sides": "Toate părţile",
"Background": "Fundal",
"Baseline": "Baseline",
"Border": "Chenar",
"Borders": "Chenare",
"Bottom": "Jos",
"CSS Style": "Stil [CSS]",
"Caption": "Titlu de tabel",
"Cell Properties": "Proprietăţile celulei",
"Center": "Centru",
"Char": "Caracter",
"Collapsed borders": "Chenare asimilate",
"Color": "Culoare",
"Description": "Descriere",
"FG Color": "Culoare text",
"Float": "Poziţie",
"Frames": "Chenare",
"Height": "Înălţimea",
"How many columns would you like to merge?": "Câte coloane vrei să uneşti?",
"How many rows would you like to merge?": "Câte linii vrei să uneşti?",
"Image URL": "URL-ul imaginii",
"Justify": "Justify",
"Layout": "Aranjament",
"Left": "Stânga",
"Margin": "Margine",
"Middle": "Mijloc",
"No rules": "Fără linii",
"No sides": "Fără părţi",
"None": "Nimic",
"Padding": "Spaţiere",
"Please click into some cell": "Vă rog să daţi click într-o celulă",
"Right": "Dreapta",
"Row Properties": "Proprietăţile liniei",
"Rules will appear between all rows and columns": "Vor apărea linii între toate rândurile şi coloanele",
"Rules will appear between columns only": "Vor apărea doar linii verticale",
"Rules will appear between rows only": "Vor apărea doar linii orizontale",
"Rules": "Linii",
"Spacing and padding": "Spaţierea",
"Spacing": "Între celule",
"Summary": "Sumar",
"TO-cell-delete": "Şterge celula",
"TO-cell-insert-after": "Inserează o celulă la dreapta",
"TO-cell-insert-before": "Inserează o celulă la stânga",
"TO-cell-merge": "Uneşte celulele",
"TO-cell-prop": "Proprietăţile celulei",
"TO-cell-split": "Împarte celula",
"TO-col-delete": "Şterge coloana",
"TO-col-insert-after": "Inserează o coloană la dreapta",
"TO-col-insert-before": "Inserează o coloană la stânga",
"TO-col-split": "Împarte coloana",
"TO-row-delete": "Şterge rândul",
"TO-row-insert-above": "Inserează un rând înainte",
"TO-row-insert-under": "Inserează un rând după",
"TO-row-prop": "Proprietăţile rândului",
"TO-row-split": "Împarte rândul",
"TO-table-prop": "Proprietăţile tabelei",
"Table Properties": "Proprietăţile tabelei",
"Text align": "Aliniere",
"The bottom side only": "Doar partea de jos",
"The left-hand side only": "Doar partea din stânga",
"The right and left sides only": "Partea din stânga şi cea din dreapta",
"The right-hand side only": "Doar partea din dreapta",
"The top and bottom sides only": "Partea de sus si cea de jos",
"The top side only": "Doar partea de sus",
"Top": "Sus",
"Unset color": "Dezactivează culoarea",
"Vertical align": "Aliniere pe verticală",
"Width": "Lăţime",
"not-del-last-cell": "HTMLArea refuză cu laşitate să şteargă ultima celulă din rând.",
"not-del-last-col": "HTMLArea refuză cu laşitate să şteargă ultima coloamă din tabela.",
"not-del-last-row": "HTMLArea refuză cu laşitate să şteargă ultimul rând din tabela.",
"percent": "procente",
"pixels": "pixeli"
};

View File

@ -1,7 +0,0 @@
<files>
<file name="*.{js,html,cgi,css}" />
<dir name="lang" />
<dir name="img" />
</files>

File diff suppressed because it is too large Load Diff

View File

@ -1,369 +0,0 @@
/** This file is derived from PopupDiv, developed by Mihai Bazon for
* SamWare.net. Modifications were needed to make it usable in HTMLArea.
* HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com.
*
* This file does not function standalone. It is dependent of global functions
* defined in HTMLArea-3.0 (htmlarea.js).
*
* Please see file htmlarea.js for further details.
**/
var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
(navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
var is_compat = (document.compatMode == "BackCompat");
function PopupDiv(editor, titleText, handler, initFunction) {
var self = this;
this.editor = editor;
this.doc = editor._mdoc;
this.handler = handler;
var el = this.doc.createElement("div");
el.className = "content";
var popup = this.doc.createElement("div");
popup.className = "dialog popupdiv";
this.element = popup;
var s = popup.style;
s.position = "absolute";
s.left = "0px";
s.top = "0px";
var title = this.doc.createElement("div");
title.className = "title";
this.title = title;
popup.appendChild(title);
HTMLArea._addEvent(title, "mousedown", function(ev) {
self._dragStart(is_ie ? window.event : ev);
});
var button = this.doc.createElement("div");
button.className = "button";
title.appendChild(button);
button.innerHTML = "&#x00d7;";
title.appendChild(this.doc.createTextNode(titleText));
this.titleText = titleText;
button.onmouseover = function() {
this.className += " button-hilite";
};
button.onmouseout = function() {
this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
};
button.onclick = function() {
this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
self.close();
};
popup.appendChild(el);
this.content = el;
this.doc.body.appendChild(popup);
this.dragging = false;
this.onShow = null;
this.onClose = null;
this.modal = false;
initFunction(this);
};
PopupDiv.currentPopup = null;
PopupDiv.prototype.showAtElement = function(el, mode) {
this.defaultSize();
var pos, ew, eh;
var popup = this.element;
popup.style.display = "block";
var w = popup.offsetWidth;
var h = popup.offsetHeight;
popup.style.display = "none";
if (el != window) {
pos = PopupDiv.getAbsolutePos(el);
ew = el.offsetWidth;
eh = el.offsetHeight;
} else {
pos = {x:0, y:0};
var size = PopupDiv.getWindowSize();
ew = size.x;
eh = size.y;
}
var FX = false, FY = false;
if (mode.indexOf("l") != -1) {
pos.x -= w;
FX = true;
}
if (mode.indexOf("r") != -1) {
pos.x += ew;
FX = true;
}
if (mode.indexOf("t") != -1) {
pos.y -= h;
FY = true;
}
if (mode.indexOf("b") != -1) {
pos.y += eh;
FY = true;
}
if (mode.indexOf("c") != -1) {
FX || (pos.x += Math.round((ew - w) / 2));
FY || (pos.y += Math.round((eh - h) / 2));
}
this.showAt(pos.x, pos.y);
};
PopupDiv.prototype.defaultSize = function() {
var s = this.element.style;
var cs = this.element.currentStyle;
var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) +
parseInt(cs.borderRightWidth) +
parseInt(cs.paddingLeft) +
parseInt(cs.paddingRight)) : 0;
var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) +
parseInt(cs.borderBottomWidth) +
parseInt(cs.paddingTop) +
parseInt(cs.paddingBottom)) : 0;
s.display = "block";
s.width = (this.content.offsetWidth + addX) + "px";
s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px";
s.display = "none";
};
PopupDiv.prototype.showAt = function(x, y) {
this.defaultSize();
var s = this.element.style;
s.display = "block";
s.left = x + "px";
s.top = y + "px";
this.hideShowCovered();
PopupDiv.currentPopup = this;
HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
if (is_ie && this.modal) {
this.doc.body.setCapture(false);
this.doc.body.onlosecapture = function() {
(PopupDiv.currentPopup) && (this.doc.body.setCapture(false));
};
}
window.event && HTMLArea._stopEvent(window.event);
if (typeof this.onShow == "function") {
this.onShow();
} else if (typeof this.onShow == "string") {
eval(this.onShow);
}
var field = this.element.getElementsByTagName("input")[0];
if (!field) {
field = this.element.getElementsByTagName("select")[0];
}
if (!field) {
field = this.element.getElementsByTagName("textarea")[0];
}
if (field) {
field.focus();
}
};
PopupDiv.prototype.close = function() {
this.element.style.display = "none";
PopupDiv.currentPopup = null;
this.hideShowCovered();
HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
is_ie && this.modal && this.doc.body.releaseCapture();
if (typeof this.onClose == "function") {
this.onClose();
} else if (typeof this.onClose == "string") {
eval(this.onClose);
}
this.element.parentNode.removeChild(this.element);
};
PopupDiv.prototype.getForm = function() {
var forms = this.content.getElementsByTagName("form");
return (forms.length > 0) ? forms[0] : null;
};
PopupDiv.prototype.callHandler = function() {
var tags = ["input", "textarea", "select"];
var params = new Object();
for (var ti in tags) {
var tag = tags[ti];
var els = this.content.getElementsByTagName(tag);
for (var j = 0; j < els.length; ++j) {
var el = els[j];
params[el.name] = el.value;
}
}
this.handler(this, params);
return false;
};
PopupDiv.getAbsolutePos = function(el) {
var r = { x: el.offsetLeft, y: el.offsetTop };
if (el.offsetParent) {
var tmp = PopupDiv.getAbsolutePos(el.offsetParent);
r.x += tmp.x;
r.y += tmp.y;
}
return r;
};
PopupDiv.getWindowSize = function() {
if (window.innerHeight) {
return { y: window.innerHeight, x: window.innerWidth };
}
if (this.doc.body.clientHeight) {
return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth };
}
return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth };
};
PopupDiv.prototype.hideShowCovered = function () {
var self = this;
function isContained(el) {
while (el) {
if (el == self.element) {
return true;
}
el = el.parentNode;
}
return false;
};
var tags = new Array("applet", "select");
var el = this.element;
var p = PopupDiv.getAbsolutePos(el);
var EX1 = p.x;
var EX2 = el.offsetWidth + EX1;
var EY1 = p.y;
var EY2 = el.offsetHeight + EY1;
if (el.style.display == "none") {
EX1 = EX2 = EY1 = EY2 = 0;
}
for (var k = tags.length; k > 0; ) {
var ar = this.doc.getElementsByTagName(tags[--k]);
var cc = null;
for (var i = ar.length; i > 0;) {
cc = ar[--i];
if (isContained(cc)) {
cc.style.visibility = "visible";
continue;
}
p = PopupDiv.getAbsolutePos(cc);
var CX1 = p.x;
var CX2 = cc.offsetWidth + CX1;
var CY1 = p.y;
var CY2 = cc.offsetHeight + CY1;
if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
cc.style.visibility = "visible";
} else {
cc.style.visibility = "hidden";
}
}
}
};
PopupDiv.prototype._dragStart = function (ev) {
if (this.dragging) {
return false;
}
this.dragging = true;
PopupDiv.currentPopup = this;
var posX = ev.clientX;
var posY = ev.clientY;
if (is_ie) {
posY += this.doc.body.scrollTop;
posX += this.doc.body.scrollLeft;
} else {
posY += window.scrollY;
posX += window.scrollX;
}
var st = this.element.style;
this.xOffs = posX - parseInt(st.left);
this.yOffs = posY - parseInt(st.top);
HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt);
HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent);
HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd);
HTMLArea._stopEvent(ev);
};
PopupDiv.dragIt = function (ev) {
var popup = PopupDiv.currentPopup;
if (!(popup && popup.dragging)) {
return false;
}
is_ie && (ev = window.event);
var posX = ev.clientX;
var posY = ev.clientY;
if (is_ie) {
posY += this.doc.body.scrollTop;
posX += this.doc.body.scrollLeft;
} else {
posY += window.scrollY;
posX += window.scrollX;
}
popup.hideShowCovered();
var st = popup.element.style;
st.left = (posX - popup.xOffs) + "px";
st.top = (posY - popup.yOffs) + "px";
HTMLArea._stopEvent(ev);
};
PopupDiv.dragEnd = function () {
var popup = PopupDiv.currentPopup;
if (!popup) {
return false;
}
popup.dragging = false;
HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd);
HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent);
HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt);
popup.hideShowCovered();
};
PopupDiv.checkPopup = function (ev) {
is_ie && (ev = window.event);
var el = is_ie ? ev.srcElement : ev.target;
var cp = PopupDiv.currentPopup;
for (; (el != null) && (el != cp.element); el = el.parentNode);
if (el == null) {
cp.modal || ev.type == "mouseover" || cp.close();
HTMLArea._stopEvent(ev);
}
};
PopupDiv.prototype.addButtons = function() {
var self = this;
var div = this.doc.createElement("div");
this.content.appendChild(div);
div.className = "buttons";
for (var i = 0; i < arguments.length; ++i) {
var btn = arguments[i];
var button = this.doc.createElement("button");
div.appendChild(button);
button.innerHTML = HTMLArea.I18N.buttons[btn];
switch (btn) {
case "ok":
button.onclick = function() {
self.callHandler();
self.close();
};
break;
case "cancel":
button.onclick = function() {
self.close();
};
break;
}
}
};

View File

@ -1,55 +0,0 @@
<html style="width: 380px; height: 250px;">
<head><title>About HTMLArea</title>
<script type="text/javascript" src="popup.js"></script>
<script type="text/javascript">
function closeAbout() {
__dlg_close(null);
}
</script>
<style>
html,body,textarea { font-family: tahoma,verdana,arial; font-size: 11px;
padding: 0px; margin: 0px; }
tt { font-size: 120%; }
body { padding: 0px; background: ButtonFace; color: ButtonText; }
a:link, a:visited { color: #00f; }
a:hover { color: #f00; }
a:active { color: #f80; }
button { font: 11px tahoma,verdana,sans-serif; }
</style></head>
<body onload="__dlg_init()">
<div style="background-color: #fff; color: #000; padding: 3px; border-bottom: 1px solid #000;">
<div style="font-family: 'arial black',arial,sans-serif; font-size: 28px;
letter-spacing: -1px;">
<span style="position: relative; top: -0.2em">H</span><span
style="position: relative; top: 0.1em">T</span><span
style="position: relative; top: -0.1em">M</span><span
style="position: relative; top: 0.2em">L</span> Area
3.0 <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. beta ]</span></div>
<div style="text-align: right; font-size: 90%; margin-bottom: 1em">
Released on Aug 11, 2003 [21:30] GMT
</div>
</div>
<div style="margin: 1em">
<p>A free WYSIWYG editor replacement for <tt>&lt;textarea&gt;</tt> fields.</p>
<p>For full source code and docs, visit:<br />
<a href="http://www.interactivetools.com/products/htmlarea/" target="_blank"
>http://www.interactivetools.com/products/htmlarea/</a></p>
<p>Version 3.0 developed and maintained by <a href="http://students.infoiasi.ro/~mishoo/" target="_blank">mishoo</a>.</p>
<p>&copy; 2002, 2003 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc. All Rights Reserved.</p>
</div>
<div style="text-align: right; padding: 0px 3px 3px 0px;">
<button type="button" onclick="closeAbout()">I agree it's cool</button>
</div>
</body></html>

View File

@ -1,2 +0,0 @@
<html>
</html>

View File

@ -1,68 +0,0 @@
<?php // $Id$
include("../../../config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<title>Create anchor</title>
<script language="javascript" type="text/javascript" src="popup.js"></script>
<script language="javascript" type="text/javascript">
<!--
function Init() {
__dlg_init();
}
function onOK() {
var required = {
"f_anc": "You must enter the URL where this link points to"
};
var txt = document.forms[0].anc.value;
if (!txt) {
alert(required[f_anc]);
el.focus();
return false;
}
// pass data back to the calling window
var param = new Object();
param.anchor = txt;
__dlg_close(param);
return false;
};
function onCancel() {
__dlg_close(null);
return false;
};
// -->
</script>
<style type="text/css">
<!--
body { background: ButtonFace; font-family: Tahoma, sans-serif; }
td, button, input { font-family: Tahoma, verdana, sans-serif; font-size: 8pt; }
button { width: 70px; }
.title { background: #ddf; color: #000; font-weight: bold; font-size: 10pt; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
.note { font-size: 8pt; }
// -->
</style>
</head>
<body>
<div class="title"><?php print_string("createanchor","editor");?></div>
<form name="fie">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><?php print_string("anchorname","editor");?>: <input id="f_anc" name="anc" type="text" size="30" /></td>
</tr>
<tr>
<td align="right">
<br />
<button onclick="return onOK();" type="button"><?php print_string("ok","editor");?></button>&nbsp;<button onclick="return onCancel();" type="button"><?php print_string("cancel","editor");?></button>&nbsp;
<button type="button" onclick="javascript: void(0); alert('<?php print_string("anchorhelp","editor");?>');"><?php print_string("help");?></button></td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -1,72 +0,0 @@
/*******************************************************************************
**
** HTML Text Editing Component for hosting in Web Pages
** Copyright (C) 2001 Ramesys (Contracting Services) Limited
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library 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
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU LesserGeneral Public License
** along with this program; if not a copy can be obtained from
**
** http://www.gnu.org/copyleft/lesser.html
**
** or by writing to:
**
** Free Software Foundation, Inc.
** 59 Temple Place - Suite 330,
** Boston,
** MA 02111-1307,
** USA.
**
** Original Developer:
**
** Austin David France
** Ramesys (Contracting Services) Limited
** Mentor House
** Ainsworth Street
** Blackburn
** Lancashire
** BB1 6AY
** United Kingdom
** email: Austin.France@Ramesys.com
**
** Home Page: http://richtext.sourceforge.net/
** Support: http://richtext.sourceforge.net/
**
*******************************************************************************/
html, body {
background: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
margin: 0px;
padding: 0px;
}
body { padding: 5px; }
table {
font: 11px Tahoma,Verdana,sans-serif;
}
form p {
margin-top: 5px;
margin-bottom: 5px;
}
td.smile {
background-color: transparent;
font-family: "Courier New", courier;
font-size: 10pt;
}
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }

View File

@ -1,142 +0,0 @@
<!--
################################################################################
##
## HTML Text Editing Component for hosting in Web Pages
## Copyright (C) 2001 Ramesys (Contracting Services) Limited
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library 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
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU LesserGeneral Public License
## along with this program; if not a copy can be obtained from
##
## http://www.gnu.org/copyleft/lesser.html
##
## or by writing to:
##
## Free Software Foundation, Inc.
## 59 Temple Place - Suite 330,
## Boston,
## MA 02111-1307,
## USA.
##
## Original Developer:
##
## Austin David France
## Ramesys (Contracting Services) Limited
## Mentor House
## Ainsworth Street
## Blackburn
## Lancashire
## BB1 6AY
## United Kingdom
## email: Austin.France@Ramesys.com
##
## Home Page: http://richtext.sourceforge.net/
## Support: http://richtext.sourceforge.net/
##
################################################################################
-->
<?php
include("../../../config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<style type="text/css">
<!--
body { background: ButtonFace; color: ButtonText; font: 11px Tahoma,Verdana,sans-serif;
margin: 0px; padding: 0px; }
form p { margin-top: 5px; margin-bottom: 5px; }
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }
.title { background: #ddf; color: #000; font-weight: bold; font-size: 14px; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px; }
form { padding: 0px; margin: 0px; }
.chr { background-color: transparent; border: 1px solid #dcdcdc; font-family: "Times New Roman", times;
font-size: small; }
// -->
</style>
<script language="javascript" type="text/javascript" src="popup.js"></script>
<script language="javascript" type="text/javascript">
<!--
function Init() {
__dlg_init();
}
var chars = ["!","&quot;","#","$","%","&","'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","ƒ","","","","","ˆ","\","Š","","Œ","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","","&ndash;","&mdash;","˜","","š","","œ","Ÿ","&iexcl;","&cent;","&pound;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","­","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otilde;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;"]
function tab(w,h) {
var strtab = ["<table border='0' cellspacing='0' cellpadding='0' align='center' bordercolor='#dcdcdc' bgcolor='#C0C0C0'>"]
var k = 0;
for(var i = 0; i < w; i++) {
strtab[strtab.length] = "<tr>";
for(var j = 0; j < h; j++) {
strtab[strtab.length] = "<td class='chr' width='14' align='center' onClick='getchar(this)' onMouseOver='hover(this,true)' onMouseOut='hover(this,false)'>"+(chars[k]||'')+"</td>";
k++;
}
strtab[strtab.length]="</tr>";
}
strtab[strtab.length] = "</table>";
return strtab.join("\n");
}
function hover(obj,val) {
if (!obj.innerHTML) {
obj.style.cursor = "default";
return;
}
obj.style.border = val ? "1px solid black" : "1px solid #dcdcdc";
//obj.style.backgroundColor = val ? "black" : "#C0C0C0"
//obj.style.color = val ? "white" : "black";
}
function getchar(obj) {
if(!obj.innerHTML) return;
var sChar = obj.innerHTML || "";
__dlg_close(sChar);
return false;
}
function cancel() {
__dlg_close(null);
return false;
}
//-->
</script>
<title><?php print_string("choosechar","editor");?></title>
</head>
<body onload="Init()">
<table class="dlg" cellpadding="0" cellspacing="2">
<tr><td><table width="100%"><tr><td class="title" nowrap><?php print_string("choosechar","editor") ?></td></tr></table></td></tr>
<tr>
<td>
<table border="0" align="center" cellpadding="5">
<tr valign="top">
<td>
<script language="javascript" type="text/javascript">
<!--
document.write(tab(7,32))
//-->
</script>
</td>
</tr>
</table>
</td>
</tr>
<tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>
<tr><td align="right">
<button type="button" onclick="cancel()"><?php print_string("close","editor") ?></button></td></tr>
</table>
</body>
</body>
</html>

View File

@ -1,125 +0,0 @@
<?php
#################################################################################
##
## $Id$
##
#################################################################################
include('../../../config.php');
$pixpath = "$CFG->pixpath/s";
$fullnames = get_list_of_pixnames();
$emoticons = array ( 'smiley' => ':-)',
'biggrin' => ':-D',
'wink' => ';-)',
'mixed' => ':-/',
'thoughtful' => 'V-.',
'tongueout' => ':-P',
'cool' => 'B-)',
'approve' => '^-)',
'wideeyes' => '8-)',
'clown' => ':o)',
'sad' => ':-(',
'shy' => '8-.',
'blush' => ':-I',
'kiss' => ':-X',
'surprise' => '8-o',
'blackeye' => 'P-|',
'angry' => '8-[',
'dead' => 'xx-P',
'sleepy' => '|-.',
'evil' => '}-]' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<title><?php print_string('insertsmile', 'editor') ?></title>
<link rel="stylesheet" href="dialog.css" type="text/css" />
<script language="javascript" type="text/javascript" src="popup.js"></script>
<script language="javascript" type="text/javascript">
<!--
function Init() {
__dlg_init();
}
function attr(name, value) {
if (!value || value == "") return "";
return ' ' + name + '="' + value + '"';
}
function insert(img,text) {
if (img) {
var strImage = img;
var strAlt = text;
var imgString = "<img src=\"" + strImage +"\" alt=\"" + strAlt +"\" title=\"" + strAlt +"\" />";
}
// pass data back to the calling window
__dlg_close(imgString);
return false;
};
function cancel() {
__dlg_close(null);
return false;
};
// -->
</script>
</head>
<body onload="Init()">
<table class="dlg" cellpadding="0" cellspacing="2" width="100%">
<tr><td><table width="100%"><tr><td class="title" nowrap><?php print_string("chooseicon","editor") ?></td></tr></table></td></tr>
<tr>
<td>
<table border="0" align="center" cellpadding="5">
<tr valign="top">
<td>
<table border="0">
<?php
$list = array('smiley', 'biggrin', 'wink', 'mixed', 'thoughtful',
'tongueout', 'cool', 'approve', 'wideeyes', 'surprise');
foreach ($list as $image) {
$name = $fullnames[$image];
$icon = $emoticons[$image];
echo '<tr>';
echo "<td><img alt=\"$name\" border=\"0\" hspace=\"10\" src=\"$pixpath/$image.gif\" ".
" onclick=\"insert('$pixpath/$image.gif','$name')\" width=\"15\" height=\"15\" /></td>";
echo "<td>$name</td>";
echo "<td class=\"smile\">$icon</td>";
echo "</tr>";
}
?>
</table>
</td>
<td>
<table border="0" align="center">
<?php
$list = array('sad', 'shy', 'blush', 'kiss', 'clown', 'blackeye',
'angry', 'dead', 'sleepy', 'evil');
foreach ($list as $image) {
$name = $fullnames[$image];
$icon = $emoticons[$image];
echo '<tr>';
echo "<td><img alt=\"$name\" border=\"0\" hspace=\"10\" src=\"$pixpath/$image.gif\" ".
" onclick=\"insert('$pixpath/$image.gif','$name')\" width=\"15\" height=\"15\" /></td>";
echo "<td>$name</td>";
echo "<td class=\"smile\">$icon</td>";
echo "</tr>";
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr><td><table width="100%"><tr><td valign="middle" width="90%"><hr width="100%"></td></tr></table></td></tr>
<tr><td align="right">
<button type="button" onclick="return cancel();"><?php print_string("close","editor") ?></button></td></tr>
</table>
</body>
</html>

View File

@ -1,16 +0,0 @@
<html>
<head>
<title>Editor Help</title>
<style>
body, td, p, div { font-family: arial; font-size: x-small; }
</style>
</head>
<body>
<h2>Editor Help<hr></h2>
Todo...
</body>
</html>

View File

@ -1,175 +0,0 @@
<?php // $Id$
include("../../../config.php");
$id = optional_param('id', 0, PARAM_INT);
if ( function_exists('ob_gzhandler') ) {
ob_start("ob_gzhandler");
}
?>
<html>
<head><title><?php print_string("fullscreen","editor");?></title>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<style type="text/css">
@import url(../htmlarea.css);
html, body { margin: 0px; border: 0px; background-color: buttonface; } </style>
<script type="text/javascript" src="../htmlarea.php?id=<?php p($id); ?>"></script>
<script type="text/javascript" src="../lang/en.php"></script>
<script type="text/javascript" src="../dialog.js" charset="<?php print_string('thischarset'); ?>"></script>
<script type="text/javascript" src="../plugins/TableOperations/table-operations.js" charset="<?php print_string('thischarset'); ?>"></script>
<script type="text/javascript" src="../plugins/TableOperations/lang/en.js" charset="<?php print_string('thischarset'); ?>"></script>
<script type="text/javascript">
// load same scripts that were present in the opener page
var scripts = opener.document.getElementsByTagName("script");
var head = document.getElementsByTagName("head")[0];
for (var i = 0; i < scripts.length; ++i) {
var script = scripts[i];
if (typeof script.src != "undefined" && /\S/.test(script.src)) {
// document.write("<scr" + "ipt type=" + "\"script/javascript\"");
// document.write(" src=\"../" + script.src + "\"></scr" + "ipt>");
var new_script = document.createElement("script");
if (/^http:/i.test(script.src)) {
new_script.src = script.src;
} else {
new_script.src = "../" + script.src;
}
head.appendChild(new_script);
}
}
</script>
<script type="text/javascript">
var parent_object = null;
var editor = null; // to be initialized later [ function init() ]
/* ---------------------------------------------------------------------- *\
Function :
Description :
\* ---------------------------------------------------------------------- */
function _CloseOnEsc(ev) {
try {
if (document.all) {
// IE
ev || (ev = editor._iframe.contentWindow.event);
}
if (ev.keyCode == 27) {
// update_parent();
window.close();
return;
}
} catch(e) {}
}
/* ---------------------------------------------------------------------- *\
Function : cloneObject
Description : copy an object by value instead of by reference
Usage : var newObj = cloneObject(oldObj);
\* ---------------------------------------------------------------------- */
function cloneObject(obj) {
var newObj = new Object;
// check for array objects
if (obj.constructor.toString().indexOf("function Array(") >= 0) {
newObj = obj.constructor();
}
// check for function objects (as usual, IE is fucked up)
if (obj.constructor.toString().indexOf("function Function(") >= 0) {
newObj = obj; // just copy reference to it
} else for (var n in obj) {
var node = obj[n];
if (typeof node == 'object') { newObj[n] = cloneObject(node); }
else { newObj[n] = node; }
}
return newObj;
}
/* ---------------------------------------------------------------------- *\
Function : resize_editor
Description : resize the editor when the user resizes the popup
\* ---------------------------------------------------------------------- */
function resize_editor() { // resize editor to fix window
var newHeight;
if (document.all) {
// IE
newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;
if (newHeight < 0) { newHeight = 0; }
} else {
// Gecko
newHeight = window.innerHeight - editor._toolbar.offsetHeight;
}
if (editor.config.statusBar) {
newHeight -= editor._statusBar.offsetHeight;
}
editor._textArea.style.height = editor._iframe.style.height = newHeight + "px";
}
/* ---------------------------------------------------------------------- *\
Function : init
Description : run this code on page load
\* ---------------------------------------------------------------------- */
function init() {
parent_object = opener.HTMLArea._object;
var config = cloneObject( parent_object.config );
config.editorURL = "../";
config.width = "100%";
config.height = "auto";
// change maximize button to minimize button
config.btnList["popupeditor"] = [ "<?php print_string("minimize","editor");?>", "<?php echo $CFG->wwwroot ?>/lib/editor/images/fullscreen_minimize.gif", true,
function() { window.close(); } ];
// generate editor and resize it
editor = new HTMLArea("editor", config);
editor.registerPlugin(TableOperations);
editor.generate();
editor._iframe.style.width = "100%";
editor._textArea.style.width = "100%";
resize_editor();
// set child window contents and event handlers, after a small delay
setTimeout(function() {
editor.setHTML(parent_object.getInnerHTML());
// switch mode if needed
if (parent_object._mode == "textmode") { editor.setMode("textmode"); }
// continuously update parent editor window
setInterval(update_parent, 500);
// setup event handlers FAST FIX IS UNCOMMENT THESE, NOT WORKING!
//document.body.onkeypress = _CloseOnEsc;
//editor._doc.body.onkeypress = _CloseOnEsc;
//editor._textArea.onkeypress = _CloseOnEsc;
window.onresize = resize_editor;
}, 333); // give it some time to meet the new frame
}
/* ---------------------------------------------------------------------- *\
Function : update_parent
Description : update parent window editor field with contents from child window
\* ---------------------------------------------------------------------- */
function update_parent() {
// use the fast version
parent_object.setHTML(editor.getInnerHTML());
}
</script>
</head>
<body scroll="no" onload="init()" onunload="update_parent()">
<form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">
<textarea name="editor" id="editor" style="width:100%; height:300px">&nbsp;</textarea>
</form>
</body></html>

View File

@ -1,346 +0,0 @@
<?php // $Id$
include("../../../config.php");
$id = required_param('id', PARAM_INT);
if (!$course = get_record("course", "id", $id)) {
$course->fullname = ""; // Just to keep display happy, though browsing may fail
}
$upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<title><?php print_string("insertimage","editor");?></title>
<script language="javascript" type="text/javascript" src="popup.js"></script>
<script language="javascript" type="text/javascript">
<!--
var preview_window = null;
function Init() {
__dlg_init();
var param = window.dialogArguments;
if (param) {
var alt = param["f_url"].substring(param["f_url"].lastIndexOf('/') + 1);
document.getElementById("f_url").value = param["f_url"];
document.getElementById("f_alt").value = param["f_alt"] ? param["f_alt"] : alt;
document.getElementById("f_border").value = parseInt(param["f_border"] || 0);
document.getElementById("f_align").value = param["f_align"];
document.getElementById("f_vert").value = param["f_vert"] != -1 ? param["f_vert"] : 0;
document.getElementById("f_horiz").value = param["f_horiz"] != -1 ? param["f_horiz"] : 0;
document.getElementById("f_width").value = param["f_width"];
document.getElementById("f_height").value = param["f_height"];
window.ipreview.location.replace('preview.php?id='+ <?php print($course->id);?> +'&imageurl='+ param.f_url);
}
document.getElementById("f_url").focus();
};
function onOK() {
var required = {
"f_url": "You must enter the URL",
"f_alt": "Please enter the alternate text"
};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(required[i]);
el.focus();
return false;
}
}
// pass data back to the calling window
var fields = ["f_url", "f_alt", "f_align", "f_border",
"f_horiz", "f_vert","f_width","f_height"];
var param = new Object();
for (var i in fields) {
var id = fields[i];
var el = document.getElementById(id);
param[id] = el.value;
}
if (preview_window) {
preview_window.close();
}
__dlg_close(param);
return false;
};
function onCancel() {
if (preview_window) {
preview_window.close();
}
__dlg_close(null);
return false;
};
function onPreview() {
var f_url = document.getElementById("f_url");
var url = f_url.value;
if (!url) {
alert("You have to enter an URL first");
f_url.focus();
return false;
}
var img = new Image();
img.src = url;
var win = null;
if (!document.all) {
win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
} else {
win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
}
preview_window = win;
var doc = win.document;
var body = doc.body;
if (body) {
body.innerHTML = "";
body.style.padding = "0px";
body.style.margin = "0px";
var el = doc.createElement("img");
el.src = url;
var table = doc.createElement("table");
body.appendChild(table);
table.style.width = "100%";
table.style.height = "100%";
var tbody = doc.createElement("tbody");
table.appendChild(tbody);
var tr = doc.createElement("tr");
tbody.appendChild(tr);
var td = doc.createElement("td");
tr.appendChild(td);
td.style.textAlign = "center";
td.appendChild(el);
win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
}
win.focus();
return false;
};
function checkvalue(elm,formname) {
var el = document.getElementById(elm);
if(!el.value) {
alert("Nothing to do!");
el.focus();
return false;
}
}
function submit_form(dothis) {
if(dothis == "delete") {
window.ibrowser.document.dirform.action.value = "delete";
}
if(dothis == "move") {
window.ibrowser.document.dirform.action.value = "move";
}
if(dothis == "zip") {
window.ibrowser.document.dirform.action.value = "zip";
}
window.ibrowser.document.dirform.submit();
return false;
}
//-->
</script>
<style type="text/css">
html, body {
margin: 2px;
background-color: rgb(212,208,200);
font-family: Tahoma, Verdana, sans-serif;
font-size: 11px;
}
.title {
background-color: #ddddff;
padding: 5px;
border-bottom: 1px solid black;
font-family: Tahoma, sans-serif;
font-weight: bold;
font-size: 14px;
color: black;
}
td, input, select, button {
font-family: Tahoma, Verdana, sans-serif;
font-size: 11px;
}
button { width: 70px; }
.space { padding: 2px; }
form { margin-bottom: 0px; margin-top: 0px; }
</style>
</head>
<body onload="Init()">
<div class="title"><?php print_string("insertimage","editor");?></div>
<div class="space"></div>
<div class="space"></div>
<div class="space"></div>
<form action="" method="get" name="first" id="first">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" align="right"><?php print_string("imageurl","editor");?>:</td>
<td width="60%"><input name="f_url" type="text" id="f_url" style="width: 100%;" /></td>
<td width="23%" align="center">
<button name="btnOK" type="button" id="btnOK" onclick="return onOK();"><?php print_string("ok","editor") ?></button></td>
</tr>
<tr>
<td align="right"><?php print_string("alternatetext","editor");?>:</td>
<td><input name="f_alt" type="text" id="f_alt" style="width: 100%;" /></td>
<td align="center">
<button name="btnCancel" type="button" id="btnCancel" onclick="return onCancel();"><?php print_string("cancel","editor") ?></button></td>
</tr>
</table>
<div class="space"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32%" valign="top">
<fieldset><legend><?php print_string("layout","editor");?></legend>
<div class="space"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" align="right"><?php print_string("alignment","editor");?>:</td>
<td width="60%">
<select size="1" name="f_align" id="f_align"
title="Positioning of this image">
<option value="" ><?php print_string("notset","editor") ?></option>
<option value="left" ><?php print_string("left","editor") ?></option>
<option value="right" ><?php print_string("right","editor") ?></option>
<option value="texttop" ><?php print_string("texttop","editor") ?></option>
<option value="middle" ><?php print_string("middle","editor") ?></option>
<option value="baseline" selected="1" ><?php print_string("baseline","editor") ?></option>
<option value="absbottom" ><?php print_string("absbottom","editor") ?></option>
<option value="bottom" ><?php print_string("bottom","editor") ?></option>
<option value="middle" ><?php print_string("middle","editor") ?></option>
<option value="top" ><?php print_string("top","editor") ?></option>
</select></td>
</tr>
<tr>
<td width="40%" align="right"><?php print_string("borderthickness","editor") ?>:</td>
<td width="60%">
<input type="text" id="f_border" name="f_border" size="5" /></td>
</tr>
</table><div class="space"></div>
</fieldset>&nbsp;</td>
<td width="34%" valign="top">
<fieldset><legend><?php print_string("spacing","editor");?></legend>
<div class="space"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" align="right"><?php print_string("horizontal","editor");?>: </td>
<td width="60%">
<input name="f_horiz" type="text" id="f_horiz" size="5" />
</td>
</tr>
<tr>
<td width="40%" align="right"><?php print_string("vertical","editor");?>:</td>
<td width="60%">
<input name="f_vert" type="text" id="f_vert" size="5" /></td>
</tr>
</table><div class="space"></div></fieldset></td>
<td width="34%" valign="top">
<fieldset><legend><?php print_string("size","editor");?></legend>
<div class="space"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" align="right"><?php print_string("width","editor");?>:</td>
<td width="60%">
<input name="f_width" type="text" id="f_width" size="5" />
</td>
</tr>
<tr>
<td width="40%" align="right"><?php print_string("height","editor");?>:</td>
<td width="60%">
<input name="f_height" type="text" id="f_height" size="5" /></td>
</tr>
</table><div class="space"></div>
</fieldset></td>
</tr>
</table></form>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55%" valign="top"><?php
if(isteacher($id)) {
print_string("filebrowser","editor");
} else {
print "";
}?><br />
<?php print(isteacher($id))?
"<iframe id=\"ibrowser\" name=\"ibrowser\" src=\"".$CFG->wwwroot."/lib/editor/coursefiles.php?usecheckboxes=1&id=".$course->id."\" style=\"width: 100%; height: 200px;\"></iframe>":
"";?>
</td>
<td width="45%" valign="top"><?php print_string("preview","editor");?>:<br />
<iframe id="ipreview" name="ipreview" src="about:blank" style="width: 100%; height: 200px;"></iframe>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55%"><div class="space"></div>
<?php if(isteacher($id)) { ?>
<table border="0" cellpadding="2" cellspacing="0">
<tr><td><?php print_string("selection","editor");?>: </td>
<td><form name="idelete" id="idelete">
<input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
<td><form name="imove" id="imove">
<input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></td>
<td><form name="izip" id="izip">
<input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
<td><form name="irename" id="irename" method="post" action="../coursefiles.php" target="ibrowser">
<input type="hidden" name="id" value="<?php print($course->id);?>" />
<input type="hidden" name="wdir" value="" />
<input type="hidden" name="file" value="" />
<input type="hidden" name="action" value="rename" />
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
<input name="btnRename" type="submit" id="btnRename" value="<?php print_string("rename","editor");?>" /></form></td>
<tr></table>
<br />
<?php
} else {
print "";
} ?>
</td>
<td width="45%" rowspan="2" valign="top"><fieldset>
<legend><?php print_string("properties","editor");?></legend>
<div class="space"></div>
<div class="space"></div>
&nbsp;&nbsp;<?php print_string("size","editor");?>:
<input type="text" id="isize" name="isize" size="10" style="background: transparent; border: none;" />
<?php print_string("type","editor");?>: <input type="text" id="itype" name="itype" size="10" style="background: transparent; border: none;" />
<div class="space"></div>
<div class="space"></div>
</fieldset></td>
</tr>
<tr>
<td height="22"><?php
if(isteacher($id)) { ?>
<form name="cfolder" id="cfolder" action="../coursefiles.php" method="post" target="ibrowser">
<input type="hidden" name="id" value="<?php print($course->id);?>" />
<input type="hidden" name="wdir" value="" />
<input type="hidden" name="action" value="mkdir" />
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
<input name="name" type="text" id="foldername" size="35" />
<input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
</form>
<div class="space"></div>
<form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="ibrowser" id="uploader">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
<input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
<input type="hidden" name="wdir" value="" />
<input type="hidden" name="action" value="upload" />
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
<input type="file" name="userfile" id="userfile" size="35" />
<input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />
</form>
<?php
} else {
print "";
} ?>
</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

View File

@ -1,231 +0,0 @@
<?php // $Id$
include("../../../config.php");
$id = required_param('id', PARAM_INT);
if (!$course = get_record("course", "id", $id)) {
$course->fullname = ""; // Just to keep display happy, though browsing may fail
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<title><?php print_string("insertimage","editor");?></title>
<script language="javascript" type="text/javascript" src="popup.js"></script>
<script language="javascript" type="text/javascript">
var preview_window = null;
function Init() {
__dlg_init();
var param = window.dialogArguments;
if (param) {
var alt = param["f_url"].substring(param["f_url"].lastIndexOf('/') + 1);
document.getElementById("f_url").value = param["f_url"];
document.getElementById("f_alt").value = param["f_alt"] ? param["f_alt"] : alt;
document.getElementById("f_border").value = parseInt(param["f_border"] || 0);
document.getElementById("f_vert").value = param["f_vert"] != -1 ? param["f_vert"] : 0;
document.getElementById("f_horiz").value = param["f_horiz"] != -1 ? param["f_horiz"] : 0;
}
document.getElementById("f_url").focus();
};
function onOK() {
var required = {
"f_url": "You must enter the URL",
"f_alt": "Please enter the alternate text"
};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(required[i]);
el.focus();
return false;
}
}
// pass data back to the calling window
var fields = ["f_url", "f_alt", "f_align", "f_border",
"f_horiz", "f_vert"];
var param = new Object();
for (var i in fields) {
var id = fields[i];
var el = document.getElementById(id);
param[id] = el.value;
}
if (preview_window) {
preview_window.close();
}
__dlg_close(param);
return false;
};
function onCancel() {
if (preview_window) {
preview_window.close();
}
__dlg_close(null);
return false;
};
function onPreview() {
var f_url = document.getElementById("f_url");
var url = f_url.value;
if (!url) {
alert("You have to enter an URL first");
f_url.focus();
return false;
}
var img = new Image();
img.src = url;
var win = null;
if (!document.all) {
win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
} else {
win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
}
preview_window = win;
var doc = win.document;
var body = doc.body;
if (body) {
body.innerHTML = "";
body.style.padding = "0px";
body.style.margin = "0px";
var el = doc.createElement("img");
el.src = url;
var table = doc.createElement("table");
body.appendChild(table);
table.style.width = "100%";
table.style.height = "100%";
var tbody = doc.createElement("tbody");
table.appendChild(tbody);
var tr = doc.createElement("tr");
tbody.appendChild(tr);
var td = doc.createElement("td");
tr.appendChild(td);
td.style.textAlign = "center";
td.appendChild(el);
win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
}
win.focus();
return false;
};
</script>
<style type="text/css">
html, body {
background: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
margin: 0px;
padding: 0px;
}
body { padding: 5px; }
table {
font: 11px Tahoma,Verdana,sans-serif;
}
form p {
margin-top: 5px;
margin-bottom: 5px;
}
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
fieldset { padding: 0px 10px 5px 5px; }
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }
</style>
</head>
<body onload="Init()">
<div class="title"><?php print_string("insertimage","editor");?></div>
<form action="" method="get">
<table border="0" width="100%" style="padding: 0px; margin: 0px">
<tbody>
<tr>
<td style="width: 7em; text-align: right"><?php print_string("imageurl","editor");?>:</td>
<td><input type="text" name="url" id="f_url" style="width:75%"
title="Enter the image URL here" />
<button name="preview" onclick="return onPreview()"
title="Preview the image in a new window"><?php print_string("preview","editor");?></button>
</td>
</tr>
<tr>
<td style="width: 7em; text-align: right"><?php print_string("alternatetext","editor");?>:</td>
<td><input type="text" name="alt" id="f_alt" style="width:100%"
title="For browsers that don't support images" /></td>
</tr>
</tbody>
</table>
<p />
<fieldset style="float: left; margin-left: 5px;">
<legend><?php print_string("layout","editor");?></legend>
<div class="space"></div>
<div class="fl"><?php print_string("alignment","editor");?>:</div>
<select size="1" name="align" id="f_align"
title="Positioning of this image">
<option value="" ><?php print_string("notset","editor") ?></option>
<option value="left" ><?php print_string("left","editor") ?></option>
<option value="right" ><?php print_string("right","editor") ?></option>
<option value="texttop" ><?php print_string("texttop","editor") ?></option>
<option value="middle" ><?php print_string("middle","editor") ?></option>
<option value="baseline" selected="1" ><?php print_string("baseline","editor") ?></option>
<option value="absbottom" ><?php print_string("absbottom","editor") ?></option>
<option value="bottom" ><?php print_string("bottom","editor") ?></option>
<option value="middle" ><?php print_string("middle","editor") ?></option>
<option value="top" ><?php print_string("top","editor") ?></option>
</select>
<p />
<div class="fl"><?php print_string("borderthickness","editor");?>:</div>
<input type="text" name="border" id="f_border" size="5"
title="Leave empty for no border" />
<div class="space"></div>
</fieldset>
<fieldset style="float:right; margin-right: 5px;">
<legend><?php print_string("spacing","editor");?></legend>
<div class="space"></div>
<div class="fr"><?php print_string("horizontal","editor");?>:</div>
<input type="text" name="horiz" id="f_horiz" size="5"
title="Horizontal padding" />
<p />
<div class="fr"><?php print_string("vertical","editor");?>:</div>
<input type="text" name="vert" id="f_vert" size="5"
title="Vertical padding" />
<div class="space"></div>
</fieldset>
<div style="margin-top: 85px; text-align: right;">
<hr />
<button type="button" name="ok" onclick="return onOK();"><?php print_string("ok","editor");?></button>
<button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor");?></button>
</div>
</form>
</body>
</html>

View File

@ -1,172 +0,0 @@
<?php // $Id$
include("../../../config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?php print_string("thischarset");?>" />
<title><?php print_string("inserttable","editor");?></title>
<script language="javascript" type="text/javascript" src="popup.js"></script>
<script language="javascript" type="text/javascript">
function Init() {
__dlg_init();
document.getElementById('f_rows').focus();
};
function onOK() {
var required = {
"f_rows": "You must enter a number of rows",
"f_cols": "You must enter a number of columns"
};
for (var i in required) {
var el = document.getElementById(i);
if (!el.value) {
alert(required[i]);
el.focus();
return false;
}
}
var fields = ["f_rows", "f_cols", "f_width", "f_unit",
"f_align", "f_border", "f_spacing", "f_padding"];
var param = new Object();
for (var i in fields) {
var id = fields[i];
var el = document.getElementById(id);
param[id] = el.value;
}
__dlg_close(param);
return false;
};
function onCancel() {
__dlg_close(null);
return false;
};
</script>
<style type="text/css">
html, body {
background: ButtonFace;
color: ButtonText;
font: 11px Tahoma,Verdana,sans-serif;
margin: 0px;
padding: 0px;
}
body { padding: 5px; }
table {
font: 11px Tahoma,Verdana,sans-serif;
}
form p {
margin-top: 5px;
margin-bottom: 5px;
}
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
fieldset { padding: 0px 10px 5px 5px; }
select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
button { width: 70px; }
.space { padding: 2px; }
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
border-bottom: 1px solid black; letter-spacing: 2px;
}
form { padding: 0px; margin: 0px; }
</style>
</head>
<body onload="Init()">
<div class="title"><?php print_string("inserttable","editor") ?></div>
<form action="" method="get">
<table border="0" style="padding: 0px; margin: 0px">
<tbody>
<tr>
<td style="width: 4em; text-align: right"><?php print_string("rows","editor") ?>:</td>
<td><input type="text" name="f_rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td style="width: 4em; text-align: right"><?php print_string("cols","editor") ?>:</td>
<td><input type="text" name="f_cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
<td style="width: 4em; text-align: right"><?php print_string("width","editor") ?>:</td>
<td><input type="text" name="f_width" id="f_width" size="5" title="Width of the table" value="100" /></td>
<td><select size="1" name="f_unit" id="f_unit" title="Width unit">
<option value="%" selected="selected" ><?php print_string("percent","editor") ?></option>
<option value="px" ><?php print_string("pixels","editor") ?></option>
<option value="em" >Em</option>
</select></td>
</tr>
</tbody>
</table>
<p />
<fieldset style="float: left; margin-left: 5px;">
<legend><?php print_string("layout","editor") ?></legend>
<div class="space"></div>
<div class="fl"><?php print_string("alignment","editor") ?>:</div>
<select size="1" name="f_align" id="f_align"
title="Positioning of this image">
<option value="" selected="selected" ><?php print_string("notset","editor") ?></option>
<option value="left" ><?php print_string("left","editor") ?></option>
<option value="right" ><?php print_string("right","editor") ?></option>
<option value="texttop" ><?php print_string("texttop","editor") ?></option>
<option value="middle" ><?php print_string("middle","editor") ?></option>
<option value="baseline" ><?php print_string("baseline","editor") ?></option>
<option value="absbottom" ><?php print_string("absbottom","editor") ?></option>
<option value="bottom" ><?php print_string("bottom","editor") ?></option>
<option value="middle" ><?php print_string("middle","editor") ?></option>
<option value="top" ><?php print_string("top","editor") ?></option>
</select>
<p />
<div class="fl"><?php print_string("borderthickness","editor") ?>:</div>
<input type="text" name="f_border" id="f_border" size="5" value="1"
title="Leave empty for no border" />
<!--
<p />
<div class="fl">Collapse borders:</div>
<input type="checkbox" name="collapse" id="f_collapse" />
-->
<div class="space"></div>
</fieldset>
<fieldset style="float:right; margin-right: 5px;">
<legend><?php print_string("spacing","editor") ?></legend>
<div class="space"></div>
<div class="fr"><?php print_string("cellspacing","editor") ?>:</div>
<input type="text" name="f_spacing" id="f_spacing" size="5" value="1"
title="Space between adjacent cells" />
<p />
<div class="fr"><?php print_string("cellpadding","editor") ?>:</div>
<input type="text" name="f_padding" id="f_padding" size="5" value="1"
title="Space between content and border in cell" />
<div class="space"></div>
</fieldset>
<div style="margin-top: 85px; text-align: right;">
<hr />
<button type="button" name="ok" onclick="return onOK();"><?php print_string("ok","editor") ?></button>
<button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor") ?></button>
</div>
</form>
</body>
</html>

View File

@ -1,154 +0,0 @@
<?php // $Id$
include("../../../config.php");
$id = required_param('id', PARAM_INT);
if (!$course = get_record("course", "id", $id)) {
$course->fullname = ""; // Just to keep display happy, though browsing may fail
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><?php print_string("insertlink","editor");?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php print_string("thischarset");?>" />
<script language="javascript" type="text/javascript">
function onCancel() {
window.close();
return false;
};
function checkvalue(elm,formname) {
var el = document.getElementById(elm);
if(!el.value) {
alert("Nothing to do!");
el.focus();
return false;
}
}
function submit_form(dothis) {
if(dothis == "delete") {
window.fbrowser.document.dirform.action.value = "delete";
}
if(dothis == "move") {
window.fbrowser.document.dirform.action.value = "move";
}
if(dothis == "zip") {
window.fbrowser.document.dirform.action.value = "zip";
}
window.fbrowser.document.dirform.submit();
return false;
}
</script>
<style type="text/css">
html, body { background-color: rgb(212,208,200); }
.title {
background-color: #ddddff;
padding: 5px;
border-bottom: 1px solid black;
font-family: Tahoma, sans-serif;
font-weight: bold;
font-size: 14px;
color: black;
}
input,select { font-family: Tahoma, sans-serif; font-size: 11px; }
legend { font-family: Tahoma, sans-serif; font-size: 11px; }
p { margin-left: 10px;
background-color: transparent; font-family: Tahoma, sans-serif;
font-size: 11px; color: black; }
td { font-family: Tahoma, sans-serif; font-size: 11px; }
button { width: 70px; font-family: Tahoma, sans-serif; font-size: 11px; }
#imodified,#itype,#isize {
background-color: rgb(212,208,200);
border: none;
font-family: Tahoma, sans-serif;
font-size: 11px;
color: black;
}
.space { padding: 2px; }
form { margin-bottom: 1px; margin-top: 1px; }
</style>
</head>
<body>
<div class="title"><?php print_string("insertlink","editor");?></div>
<table width="450" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="450" valign="top"><fieldset>
<legend><?php
if(isteacher($id)) {
print_string("filebrowser","editor");
} else {
print "";
}?></legend>
<div class="space"></div>
<?php print(isteacher($id))?
"<iframe id=\"fbrowser\" name=\"fbrowser\" src=\"../coursefiles.php?id=".$course->id."\" width=\"420\" height=\"180\"></iframe>":
""; ?>
<p>
</p>
<div class="space"></div>
</fieldset>&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0">
<tr><td><?php print_string("selection","editor");?>: </td>
<td><form name="idelete" id="idelete">
<input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
<td><form name="imove" id="imove">
<input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></form></td>
<td><form name="izip" id="izip">
<input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
<td><form name="irename" id="irename" method="post" action="../coursefiles.php" target="fbrowser">
<input type="hidden" name="id" value="<?php print($course->id);?>" />
<input type="hidden" name="wdir" value="" />
<input type="hidden" name="file" value="" />
<input type="hidden" name="action" value="rename" />
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
<input name="btnRename" type="submit" id="btnRename" value="<?php print_string("rename","editor");?>" /></form></td>
</tr>
</table>
</td>
<td>
<button type="button" name="close" onclick="return onCancel();"><?php print_string("close","editor");?></button>
</td>
</tr>
</table>
<table border="0" cellpadding="1" cellspacing="1">
<tr>
<td height="22"><?php
if(isteacher($id)) { ?>
<form name="cfolder" id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
<input type="hidden" name="id" value="<?php print($course->id);?>" />
<input type="hidden" name="wdir" value="" />
<input type="hidden" name="action" value="mkdir" />
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
<input name="name" type="text" id="foldername" size="35" />
<input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
</form>
<form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="fbrowser" id="uploader">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
<input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
<input type="hidden" name="wdir" value="" />
<input type="hidden" name="action" value="upload" />
<input type="hidden" name="sesskey" value="<?php p($USER->sesskey) ?>" />
<input type="file" name="userfile" id="userfile" size="35" />
<input name="save" type="submit" id="save" onclick="return checkvalue('userfile','uploader');" value="<?php print_string("upload","editor");?>" />
</form>
<?php
} else {
print "";
} ?>
</td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More