diff --git a/mod/journal/edit.html b/mod/journal/edit.html index d4f60e739ef..84561c3d286 100644 --- a/mod/journal/edit.html +++ b/mod/journal/edit.html @@ -1,38 +1,34 @@
- "; - helpbutton("writing", get_string("helpwriting"), "moodle", true, true); - echo "
"; + helpbutton('reading', get_string('helpreading'), 'moodle', true, true); + echo '
'; + helpbutton('writing', get_string('helpwriting'), 'moodle', true, true); + echo '
'; if ($usehtmleditor) { - helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); + helpbutton('richtext', get_string('helprichtext'), 'moodle', true, true); } else { - emoticonhelpbutton("theform", "text"); + emoticonhelpbutton('theform', 'text'); } + echo '
'; ?> -
-
text); ?>
format, ""); - echo ""; - helpbutton("textformat", get_string("helpformatting")); - echo ""; + print_string('formattexttype'); + echo ': '; + choose_from_menu(format_text_menu(), 'format', $entry->format, ''); + helpbutton('textformat', get_string('helpformatting')); ?>
-" /> -" /> + +
diff --git a/mod/journal/lib.php b/mod/journal/lib.php index f4bb8a0d419..ac44f3aaedb 100644 --- a/mod/journal/lib.php +++ b/mod/journal/lib.php @@ -516,35 +516,39 @@ function journal_delete_instance($id) { function journal_print_feedback($course, $entry, $grades) { global $CFG, $THEME; - if (! $teacher = get_record("user", "id", $entry->teacher)) { - error("Weird journal error"); + if (! $teacher = get_record('user', 'id', $entry->teacher)) { + error('Weird journal error'); } - echo "\n
"; - echo "\n"; +// echo "\n
"; + echo '
"; - echo "\n'; + echo '"; - echo ""; + echo ''; + echo ''; - echo "\n'; + echo ''; + echo '
body\" width=\"35\" valign=\"top\">"; + echo '
'; print_user_picture($teacher->id, $course->id, $teacher->picture); - echo "cellheading\">".fullname($teacher); - echo "  ".userdate($entry->timemarked).""; - echo "
'; +// echo "cellheading\">"; + echo ''.fullname($teacher).''; + echo '  '.userdate($entry->timemarked).''; + echo '
cellcontent\">"; + echo '
 '; - echo "

"; - if ($grades[$entry->rating]) { - echo get_string("grade").": "; + echo '

'; + + if (!empty($entry->rating) and !empty($grades[$entry->rating])) { + echo get_string('grade').': '; echo $grades[$entry->rating]; } else { - print_string("nograde"); + print_string('nograde'); } - echo "

"; + echo '
'; echo format_text($entry->comment); - echo "
"; - echo "
"; + echo ''; } ?> diff --git a/mod/journal/mod.html b/mod/journal/mod.html index 24300fca8bd..270e098b838 100644 --- a/mod/journal/mod.html +++ b/mod/journal/mod.html @@ -1,18 +1,18 @@ name)) { - $form->name = ""; + $form->name = ''; } if (!isset($form->intro)) { - $form->intro = ""; + $form->intro = ''; } if (!isset($form->assessed)) { - $form->assessed = "0"; + $form->assessed = '0'; } if (!isset($form->days)) { - if ($course->format == "weeks") { - $form->days = "7"; + if ($course->format == 'weeks') { + $form->days = '7'; } else { - $form->days = "0"; + $form->days = '0'; } } ?> @@ -20,44 +20,43 @@
- + - - + - +

:

: - +

:

- +
: "; - helpbutton("questions", get_string("helpquestions"), "moodle", true, true); - echo "
"; + echo '
'; + helpbutton('writing', get_string('helpwriting'), 'moodle', true, true); + echo '
'; + helpbutton('questions', get_string('helpquestions'), 'moodle', true, true); + echo '
'; if ($usehtmleditor) { - helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); + helpbutton('richtext', get_string('helprichtext'), 'moodle', true, true); } else { - emoticonhelpbutton("form", "intro"); + emoticonhelpbutton('form', 'intro'); } + echo '
'; ?> -
-
intro); + print_textarea($usehtmleditor, 20, 60, 680, 400, 'intro', $form->intro); if ($usehtmleditor) { echo ''; } else { - echo "

"; - helpbutton("textformat", get_string("formattexttype")); - print_string("formattexttype"); - echo ": "; + echo '

'; + helpbutton('textformat', get_string('formattexttype')); + print_string('formattexttype'); + echo ': '; if (!$form->introformat) { $form->introformat = $defaultformat; } - choose_from_menu(format_text_menu(), "introformat", $form->introformat, ""); + choose_from_menu(format_text_menu(), 'introformat', $form->introformat, ''); echo "

"; } ?> @@ -66,43 +65,43 @@

:

: id, "assessed", "$form->assessed"); + print_grade_menu($course->id, 'assessed', "$form->assessed"); ?>

:

: days"); + $options[365] = get_string('numweeks', '', 52); + choose_from_menu($options, 'days', "$form->days"); ?>
- - + + - - - - - -" /> -" /> - + + + + + + +
+ diff --git a/mod/journal/view.php b/mod/journal/view.php index acb932cc896..8a5b80d6c99 100644 --- a/mod/journal/view.php +++ b/mod/journal/view.php @@ -43,13 +43,13 @@ $entrycount = journal_count_entries($journal, $currentgroup); echo "

id\">". - get_string("viewallentries","journal", $entrycount)."$groupname

"; + get_string('viewallentries','journal', $entrycount)."$groupname

"; } else if (!$cm->visible) { - notice(get_string("activityiscurrentlyhidden")); + notice(get_string('activityiscurrentlyhidden')); } - echo "
\n"; + echo '
'; $journal->intro = trim($journal->intro); @@ -57,11 +57,11 @@ print_simple_box( format_text($journal->intro, $journal->introformat), 'center', '70%', '', 5, 'generalbox', 'intro'); } - echo "
"; + echo '
'; $timenow = time(); - if ($course->format == "weeks" and $journal->days) { + if ($course->format == 'weeks' and $journal->days) { $timestart = $course->startdate + (($cw->section - 1) * 604800); if ($journal->days) { $timefinish = $timestart + (3600 * 24 * $journal->days); @@ -77,60 +77,62 @@ if ($timenow > $timestart) { - print_simple_box_start("center"); + print_simple_box_start('center'); if ($timenow < $timefinish) { - $options = array ("id" => "$cm->id"); - echo "
"; + $options = array ('id' => "$cm->id"); + echo '
'; if (!isguest()) { - print_single_button("edit.php", $options, get_string("startoredit","journal")); + print_single_button('edit.php', $options, get_string('startoredit','journal')); } - echo "
"; + echo '
'; } - if ($entry = get_record("journal_entries", "userid", $USER->id, "journal", $journal->id)) { + if ($entry = get_record('journal_entries', 'userid', $USER->id, 'journal', $journal->id)) { if (empty($entry->text)) { - echo "

".get_string("blankentry","journal")."

"; + echo '

'.get_string('blankentry','journal').'

'; } else { echo format_text($entry->text, $entry->format); } } else { - echo "".get_string("notstarted","journal").""; + echo ''.get_string('notstarted','journal').''; } print_simple_box_end(); if ($timenow < $timefinish) { if ($entry->modified) { - echo "

".get_string("lastedited").": "; + echo '

'.get_string('lastedited').': '; echo userdate($entry->modified); - echo " (".get_string("numwords", "", count_words($entry->text)).")"; - echo "

"; + echo ' ('.get_string('numwords', '', count_words($entry->text)).')'; + echo "
"; } if ($journal->days) { - echo "

".get_string("editingends", "journal").": "; - echo userdate($timefinish)."

"; + echo '
'.get_string('editingends', 'journal').': '; + echo userdate($timefinish).'
'; } } else { - echo "

".get_string("editingended", "journal").": "; - echo userdate($timefinish)."

"; + echo '
'.get_string('editingended', 'journal').': '; + echo userdate($timefinish).'
'; } if ($entry->comment or $entry->rating) { $grades = make_grades_menu($journal->assessed); - print_heading(get_string("feedback")); + print_heading(get_string('feedback')); journal_print_feedback($course, $entry, $grades); } } else { - echo "

".get_string("notopenuntil", "journal").": "; - echo userdate($timestart)."

"; + echo '
'.get_string('notopenuntil', 'journal').': '; + echo userdate($timestart).'
'; } + echo '
'; + print_footer($course); ?>