diff --git a/mod/data/templates.php b/mod/data/templates.php index 11241600903..19df48b98dd 100755 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -72,15 +72,22 @@ $strdata = get_string('modulenameplural','data'); + // For the javascript for inserting template tags: initialise the default textarea to + // 'edit_template' - it is always present in all different possible views. + $bodytag = 'onload="'; + $bodytag .= 'currEditor = edit_template; '; + $bodytag .= 'currTextarea = document.tempform.template;'; + $bodytag .= '" '; + print_header_simple($data->name, '', "$strdata -> $data->name", - '', '', true, '', navmenu($course, $cm), '', ''); + '', '', true, '', navmenu($course, $cm), '', $bodytag); print_heading(format_string($data->name)); - ///processing submitted data, i.e updating form + /// Processing submitted data, i.e updating form. if (($mytemplate = data_submitted($CFG->wwwroot.'/mod/data/templates.php')) && confirm_sesskey()){ - //generate default template + // Generate default template. if (!empty($mytemplate->defaultform)){ data_generate_default_form($data->id, $mode); } @@ -103,7 +110,7 @@ $newtemplate->listtemplatefooter = $mytemplate->listtemplatefooter; } - //check for multiple tags, only need to check for add template + // Check for multiple tags, only need to check for add template. if ($mode != 'addtemplate' or data_tags_check($data->id, $newtemplate->{$mode})){ update_record('data',$newtemplate); } @@ -111,17 +118,17 @@ } } -/// Print the tabs +/// Print the tabs. $currenttab = 'templates'; include('tabs.php'); -/// Print the browsing interface +/// Print the browsing interface. echo '