Skip to content

Commit

Permalink
BRANCH MERGE
Browse files Browse the repository at this point in the history
These are the changes from MOODLE_13_STABLE, merged into trunk

The tag MOODLE_13_MERGED on the MOODLE_13_STABLE branch now refers to this point

The biggest changes here are the fixes for HTML editor in all standard modules
  • Loading branch information
moodler committed Jun 4, 2004
1 parent 308214e commit 7613890
Show file tree
Hide file tree
Showing 49 changed files with 175 additions and 198 deletions.
6 changes: 3 additions & 3 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
if ($primaryadmin->id == $admin->id){
print_spacer(10, 9, false);
} else {
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$admin->id\"
echo "<a href=\"admin.php?remove=$admin->id\"
title=\"$strremoveadmin\"><img src=\"../pix/t/right.gif\"
border=0></A>";
}
Expand Down Expand Up @@ -136,14 +136,14 @@
}

foreach ($users as $user) {
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
echo "<p align=left><a href=\"admin.php?add=$user->id\"".
"title=\"$straddadmin\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;".fullname($user).", $user->email";
}
}

if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<form action=admin.php method=post>";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
Expand Down
6 changes: 3 additions & 3 deletions admin/creators.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
foreach ($creators as $creator) {
$creatorarray[] = $creator->id;
echo "<p align=right>".fullname($creator, true).", $creator->email &nbsp;&nbsp; ";
echo "<a href=\"{$_SERVER['PHP_SELF']}?remove=$creator->id\"
echo "<a href=\"creators.php?remove=$creator->id\"
title=\"$strremovecreator\"><img src=\"../pix/t/right.gif\"
border=0></a>";
echo "</p>";
Expand Down Expand Up @@ -128,14 +128,14 @@

foreach ($users as $user) {
$fullname = fullname($user, TRUE);
echo "<p align=left><a href=\"{$_SERVER['PHP_SELF']}?add=$user->id\"".
echo "<p align=left><a href=\"creators.php?add=$user->id\"".
"title=\"$straddcreator\"><img src=\"../pix/t/left.gif\"".
"border=0></a>&nbsp;&nbsp;$fullname, $user->email";
}
}

if ($search or $usercount > MAX_USERS_PER_PAGE) {
echo "<form action={$_SERVER['PHP_SELF']} method=post>";
echo "<form action=creators.php method=post>";
echo "<input type=text name=search size=20>";
echo "<input type=submit value=\"$searchstring\">";
echo "</form>";
Expand Down
7 changes: 4 additions & 3 deletions calendar/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@
print_header(get_string('calendar', 'calendar').': '.$title, $site->fullname, $nav.' -> '.$title,
$focus, '', true, '', '<p class="logininfo">'.user_login_string($site).'</p>');

echo calendar_overlib_html();

echo '<table border="0" cellpadding="3" cellspacing="0" width="100%"><tr valign="top">';
echo '<td valign="top" width="100%">';

Expand Down Expand Up @@ -281,7 +283,7 @@
include('event_edit.html');
print_side_block_end();
if ($usehtmleditor) {
use_html_editor();
use_html_editor("description");
}
break;

Expand Down Expand Up @@ -425,7 +427,7 @@
else {
include('event_new.html');
if ($usehtmleditor) {
use_html_editor();
use_html_editor("description");
}
}
print_side_block_end();
Expand All @@ -437,7 +439,6 @@
echo '<td style="vertical-align: top; width: 180px;">';

$defaultcourses = calendar_get_default_courses();
echo calendar_overlib_html();
calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);

print_side_block_start(get_string('monthlyview', 'calendar'));
Expand Down
2 changes: 1 addition & 1 deletion calendar/event_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</td>
<td>
<?php
print_textarea($usehtmleditor, 10, 65, 630, 400, "description", $form->description);
print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
if (isset($err['description'])) formerr($err['description']);
?>
</td>
Expand Down
2 changes: 1 addition & 1 deletion calendar/event_new.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</td>
<td>
<?php
print_textarea($usehtmleditor, 10, 65, 630, 200, "description", $form->description);
print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
if (isset($err['description'])) formerr($err['description']);
?>
</td>
Expand Down
2 changes: 1 addition & 1 deletion course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
print_footer($course);

if ($usehtmleditor) {
use_html_editor();
use_html_editor("summary");
}

exit;
Expand Down
2 changes: 1 addition & 1 deletion course/editsection.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
print_simple_box_end();

if ($usehtmleditor) {
use_html_editor();
use_html_editor("summary");
}
print_footer($course);

Expand Down
2 changes: 1 addition & 1 deletion course/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
include('group-edit.html');

if ($usehtmleditor) {
use_html_editor();
use_html_editor("description");
}

print_footer();
Expand Down
10 changes: 10 additions & 0 deletions course/mod.php
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,23 @@

if (file_exists($modform)) {

if ($usehtmleditor = can_use_html_editor()) {
$defaultformat = FORMAT_HTML;
} else {
$defaultformat = FORMAT_MOODLE;
}

$icon = "<img align=absmiddle height=16 width=16 src=\"$CFG->modpixpath/$module->name/icon.gif\">&nbsp;";

print_heading_with_help($pageheading, "mods", $module->name, $icon);
print_simple_box_start("center", "", "$THEME->cellheading");
include_once($modform);
print_simple_box_end();

if ($usehtmleditor and empty($nohtmleditorneeded)) {
use_html_editor();
}

} else {
notice("This module cannot be added to this course yet! (No file found at: $modform)", "$CFG->wwwroot/course/view.php?id=$course->id");
}
Expand Down
6 changes: 3 additions & 3 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1654,11 +1654,11 @@ function use_html_editor($name="") {

echo "<script language=\"javascript\" type=\"text/javascript\" defer=\"1\">\n";
if (empty($name)) {
echo "HTMLArea.replaceAll();";
echo "HTMLArea.replaceAll();\n";
} else {
echo "HTMLArea.replace('$name')";
echo "HTMLArea.replace('$name');\n";
}
echo "</script>";
echo "</script>\n";
}


Expand Down
62 changes: 27 additions & 35 deletions mod/assignment/mod.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<?php
if ($usehtmleditor = can_use_richtext_editor()) {
$defaultformat = FORMAT_HTML;
} else {
$defaultformat = FORMAT_MOODLE;
}
if (empty($form->name)) {
$form->name = "";
}
Expand All @@ -30,15 +25,15 @@
}
?>

<form name="form" method="post" <?php echo $onsubmit ?> action="mod.php">
<table cellpadding=5>
<tr valign=top>
<form name="form" method="post" action="mod.php">
<table cellpadding="5">
<tr valign="top">
<td align=right><p><b><?php print_string("assignmentname", "assignment") ?>:</b></p></td>
<td>
<input type="text" name="name" size=60 value="<?php p($form->name) ?>">
</td>
</tr>
<tr valign=top>
<tr valign="top">
<td align=right><p><b><?php print_string("description", "assignment") ?>:</b></p>
<font size="1">
<?php
Expand All @@ -59,23 +54,27 @@
<?php
print_textarea($usehtmleditor, 20, 60, 680, 400, "description", $form->description);

echo "<p align=right>";
helpbutton("textformat", get_string("formattexttype"));
print_string("formattexttype");
echo ":&nbsp;";
if (!$form->format) {
$form->format = $defaultformat;
if ($usehtmleditor) {
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
} else {
echo '<p align="right">';
helpbutton("textformat", get_string("formattexttype"));
print_string("formattexttype");
echo ':&nbsp;';
if (!$form->format) {
$form->format = $defaultformat;
}
choose_from_menu(format_text_menu(), "format", $form->format, "");
echo '</p>';
}
choose_from_menu(format_text_menu(), "format", $form->format, "");
echo "</p>";
?>
</td>
</tr>
<tr valign=top>
<tr valign="top">
<td align=right><p><b><?php print_string("assignmenttype", "assignment") ?>:</b></p></td>
<td>
<?php
require("$CFG->dirroot/mod/assignment/lib.php");
require_once("$CFG->dirroot/mod/assignment/lib.php");
asort($ASSIGNMENT_TYPE);
choose_from_menu($ASSIGNMENT_TYPE, "type", $form->type, "");
helpbutton("assignmenttype", get_string("assignmenttype", "assignment"), "assignment");
Expand Down Expand Up @@ -119,21 +118,14 @@
</table>
<br />
<center>
<input type="hidden" name=course value="<?php p($form->course) ?>">
<input type="hidden" name=coursemodule value="<?php p($form->coursemodule) ?>">
<input type="hidden" name=section value="<?php p($form->section) ?>">
<input type="hidden" name=module value="<?php p($form->module) ?>">
<input type="hidden" name=modulename value="<?php p($form->modulename) ?>">
<input type="hidden" name=instance value="<?php p($form->instance) ?>">
<input type="hidden" name=mode value="<?php p($form->mode) ?>">
<input type="submit" value="<?php print_string("savechanges") ?>">
<input type="submit" name=cancel value="<?php print_string("cancel") ?>">
<input type="hidden" name=course value="<?php p($form->course) ?>" />
<input type="hidden" name=coursemodule value="<?php p($form->coursemodule) ?>" />
<input type="hidden" name=section value="<?php p($form->section) ?>" />
<input type="hidden" name=module value="<?php p($form->module) ?>" />
<input type="hidden" name=modulename value="<?php p($form->modulename) ?>" />
<input type="hidden" name=instance value="<?php p($form->instance) ?>" />
<input type="hidden" name=mode value="<?php p($form->mode) ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" name=cancel value="<?php print_string("cancel") ?>" />
</center>
</form>

<?php
if ($usehtmleditor) {
print_richedit_javascript("form", "description", "yes");
}
?>

2 changes: 1 addition & 1 deletion mod/assignment/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
////////////////////////////////////////////////////////////////////////////////

$module->version = 2004040100;
$module->requires = 2004013101; // Requires this Moodle version
$module->requires = 2004052501; // Requires this Moodle version
$module->cron = 60;

?>
11 changes: 6 additions & 5 deletions mod/attendance/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ function attendance_add_instance($attendance) {
$attendance->day = make_timestamp($attendance->theyear,
$attendance->themonth, $attendance->theday);
}
$attendance->notes = $attendance->name;
$attendance->name=userdate($attendance->day, get_string("strftimedate"));
if (isset($attendance->notes)) {
$attendance->name = $attendance->name . " - " . $attendance->notes;
}
if ($attendance->notes) {
$attendance->name = $attendance->name . " - " . $attendance->notes;
}
$attendance->edited = 0;
if ($attendance->dynsection) {
if ($mod->course) {
Expand Down Expand Up @@ -78,10 +79,10 @@ function attendance_update_instance($attendance) {

$attendance->day = make_timestamp($attendance->theyear,
$attendance->themonth, $attendance->theday);
$attendance->notes = $attendance->name;
$attendance->name=userdate($attendance->day, get_string("strftimedate"));
if ($attendance->notes) {
$attendance->name = $attendance->name . " - " .
$attendance->notes;
$attendance->name = $attendance->name . " - " . $attendance->notes;
}
if ($attendance->dynsection) {
//get info about the course
Expand Down
7 changes: 3 additions & 4 deletions mod/attendance/mod.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!-- RJJ I'm using inline CSS styles for some stuff in this page because I want to centralize -->
<!-- the logic and styles in a single directory -->
<?php @include_once("$CFG->dirroot/mod/attendance/lib.php");
$nohtmleditorneeded = true;
//require_once("lib.php")

// error_reporting(E_ALL);
Expand All @@ -20,8 +21,6 @@
?>
<FORM name="form" method="post" action="<?php echo $ME ?>">
<CENTER>
<INPUT type="submit" value="<?php print_string("savechanges") ?>">
<INPUT type="submit" name="cancel" value="<?php print_string("cancel") ?>">
<TABLE cellpadding=5>

<!-- <?php $options[0] = get_string("no"); $options[1] = get_string("yes"); ?> -->
Expand All @@ -30,9 +29,9 @@
<!-- <TD align=left><?php choose_from_menu($options, "roll", $form->roll, "") ?></td> -->
<!-- </tr> -->
<tr valign=top>
<td align=right><p><b><?php print_string("notes", "attendance") ?>:</b></p></td>
<td align=right><p><b><?php print_string("name") ?>:</b></p></td>
<td colspan="3">
<input type="text" name="notes" size=60 value="<?php p($form->notes)?>">
<input type="text" name="name" size=60 value="<?php p($form->notes)?>">
</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion mod/attendance/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/////////////////////////////////////////////////////////////////////////////////

$module->version = 2004050301; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2004013101; // Requires this Moodle version
$module->requires = 2004052501; // Requires this Moodle version
$module->cron = 3600; // Period for cron to check this module (secs)

?>
4 changes: 2 additions & 2 deletions mod/chat/mod.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$form->studentlogs = 0;
}
?>
<form name="form" method="post" <?php echo $onsubmit ?> action="mod.php">
<form name="form" method="post" action="mod.php">
<table cellpadding=5>
<tr>
<tr valign=top>
Expand All @@ -35,7 +35,7 @@
</font>
</td>
<td>
<textarea name="intro" rows=4 cols=50 wrap="virtual"><?php p($form->intro) ?></textarea>
<?php print_textarea($usehtmleditor, 20, 50, 680, 400, "intro", $form->intro); ?>
</td>
</tr>
<tr valign=top>
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/////////////////////////////////////////////////////////////////////////////////

$module->version = 2004043000; // The (date) version of this module
$module->requires = 2004013101; // Requires this Moodle version
$module->requires = 2004052501; // Requires this Moodle version
$module->cron = 300; // How often should cron check this module (seconds)?
?>
Loading

0 comments on commit 7613890

Please sign in to comment.