From: moodler Date: Tue, 27 Apr 2004 17:01:48 +0000 (+0000) Subject: Some changes to event editing. HTML editor now supported, plus some X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f7d617820c246f9729988a6b3332a85096053893;p=moodle.git Some changes to event editing. HTML editor now supported, plus some other reformatting ... more to come. :o) --- diff --git a/calendar/event.php b/calendar/event.php index c35c4e3e07..80aefeb253 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -64,11 +64,11 @@ calendar_session_vars(); $now = usergetdate(time()); $nav = calendar_get_link_tag(get_string('calendar', 'calendar'), CALENDAR_URL.'view.php?view=upcoming&', $now['mday'], $now['mon'], $now['year']); + $day = intval($now['mday']); + $mon = intval($now['mon']); + $yr = intval($now['year']); - // Minor hack to default to FORMAT_MOODLE and no html editor for now - // maybe in the future... - - if ($usehtmleditor = can_use_richtext_editor() && false) { + if ($usehtmleditor = can_use_richtext_editor()) { $defaultformat = FORMAT_HTML; } else { $defaultformat = FORMAT_MOODLE; @@ -99,8 +99,7 @@ if($form = data_submitted()) { $form->name = strip_tags($form->name); // Strip all tags - $form->description = strip_tags($form->description); // Strip all tags - //$form->description = clean_text($form->description , $form->format); // Clean up any bad tags + $form->description = clean_text($form->description , $form->format); // Clean up any bad tags $form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin); if($form->duration == 1) { @@ -137,8 +136,7 @@ if(!empty($form) && $form->type == 'defined') { $form->name = strip_tags($form->name); // Strip all tags - $form->description = strip_tags($form->description); // Strip all tags - //$form->description = clean_text($form->description , $form->format); // Clean up any bad tags + $form->description = clean_text($form->description , $form->format); // Clean up any bad tags $form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin); if($form->duration == 1) { @@ -189,53 +187,7 @@ /// Layout the whole page as three big columns. echo ''; - - $sections = get_all_sections($site->id); - - if ($site->newsitems > 0 or $sections[0]->sequence or isediting($site->id) or isadmin()) { - echo "'; - echo '
"; - $firstcolumn=true; - - if ($sections[0]->sequence or isediting($site->id)) { - get_all_mods($site->id, $mods, $modnames, $modnamesplural, $modnamesused); - print_section_block(get_string("mainmenu"), $site, $sections[0], - $mods, $modnames, $modnamesused, true, $side); - } - - print_courses_sideblock(0, $side); - if ($site->newsitems) { - if ($news = forum_get_course_forum($site->id, "news")) { - print_side_block_start(get_string("latestnews"), $side, "sideblocklatestnews"); - echo ""; - forum_print_latest_discussions($news->id, $site->newsitems, "minimal", "", false); - echo ""; - print_side_block_end(); - } - } - print_spacer(1,$side); - } - - if (iscreator()) { - if (!$firstcolumn) { - echo ""; - $firstcolumn=true; - } - print_admin_links($site->id, $side); - } - - if ($firstcolumn) { - echo ''; - } - else { - echo ''; - } - - $text = '
'.get_string('calendarheading', 'calendar', strip_tags($site->shortname)).'
'; - $text.= calendar_get_preferences_menu(); - $text.= '
'; - print_heading_block($text); - print_spacer(8, 1); + echo '
'; switch($_REQUEST['action']) { case 'delete': @@ -423,9 +375,29 @@ print_side_block_end(); break; } - - - echo '
'; + echo ''; + + // START: Last column (3-month display) + echo ''; + print_side_block_start(get_string('monthlyview', 'calendar'), '', 'sideblockmain'); + list($prevmon, $prevyr) = calendar_sub_month($mon, $yr); + list($nextmon, $nextyr) = calendar_add_month($mon, $yr); + echo calendar_filter_controls($_GET['view']); + echo '

'; + echo calendar_top_controls('display', array('m' => $prevmon, 'y' => $prevyr)); + echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr); + echo '

'; + echo calendar_top_controls('display', array('m' => $mon, 'y' => $yr)); + echo calendar_get_mini($courses, $groups, $users, $mon, $yr); + echo '

'; + echo calendar_top_controls('display', array('m' => $nextmon, 'y' => $nextyr)); + echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr); + echo '

'; + print_side_block_end(); + print_spacer(1, $side); + echo ''; + + echo ''; if ($usehtmleditor) { use_html_editor(); diff --git a/calendar/event_edit.html b/calendar/event_edit.html index 4560b2c4b7..d5e41bc302 100644 --- a/calendar/event_edit.html +++ b/calendar/event_edit.html @@ -1,5 +1,5 @@
- +
@@ -7,8 +7,10 @@ @@ -25,14 +27,13 @@ - - +
:
: -
- + description); + if (isset($err['description'])) formerr($err['description']); + ?>
 

- +

diff --git a/calendar/event_new.html b/calendar/event_new.html index bc6222e6d1..0ffab15a9e 100644 --- a/calendar/event_new.html +++ b/calendar/event_new.html @@ -1,5 +1,5 @@
- +
@@ -7,8 +7,10 @@ @@ -25,8 +27,7 @@ - - +
:
: -
- + description); + if (isset($err['description'])) formerr($err['description']); + ?>
 

@@ -36,7 +37,7 @@ - +