| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php // $Id: editsection.php,v 1.25 2007/08/17 19:09:11 nicolasconnault Exp $ 2 // Edit the introduction of a section 3 4 require_once("../config.php"); 5 require_once ("lib.php"); 6 7 $id = required_param('id',PARAM_INT); // Week ID 8 9 if (! $section = get_record("course_sections", "id", $id)) { 10 error("Course section is incorrect"); 11 } 12 13 if (! $course = get_record("course", "id", $section->course)) { 14 error("Could not find the course!"); 15 } 16 17 require_login($course->id); 18 19 require_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id)); 20 21 /// If data submitted, then process and store. 22 23 if ($form = data_submitted() and confirm_sesskey()) { 24 25 $timenow = time(); 26 27 if (! set_field("course_sections", "summary", $form->summary, "id", $section->id)) { 28 error("Could not update the summary!"); 29 } 30 31 add_to_log($course->id, "course", "editsection", "editsection.php?id=$section->id", "$section->section"); 32 33 redirect("view.php?id=$course->id"); 34 exit; 35 } 36 37 /// Otherwise fill and print the form. 38 39 if (empty($form)) { 40 $form = $section; 41 } else { 42 $form = stripslashes_safe($form); 43 } 44 45 // !! no db access using data from $form beyond this point !! 46 47 $usehtmleditor = can_use_html_editor(); 48 49 /// Inelegant hack for bug 3408 50 if ($course->format == 'site') { 51 $sectionname = get_string('site'); 52 $stredit = get_string('edit', '', " $sectionname"); 53 $strsummaryof = get_string('summaryof', '', " $sectionname"); 54 } else { 55 $sectionname = get_string("name$course->format"); 56 $stredit = get_string('edit', '', " $sectionname $section->section"); 57 $strsummaryof = get_string('summaryof', '', " $sectionname $form->section"); 58 } 59 60 print_header_simple($stredit, '', build_navigation(array(array('name' => $stredit, 'link' => null, 'type' => 'misc'))), 'theform.summary' ); 61 62 print_heading($strsummaryof); 63 print_simple_box_start('center'); 64 include ('editsection.html'); 65 print_simple_box_end(); 66 67 if ($usehtmleditor) { 68 use_html_editor("summary"); 69 } 70 print_footer($course); 71 72 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |