]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19792 Changed param id to entryid so that the navigation is built consistently...
authornicolasconnault <nicolasconnault>
Tue, 8 Sep 2009 05:36:45 +0000 (05:36 +0000)
committernicolasconnault <nicolasconnault>
Tue, 8 Sep 2009 05:36:45 +0000 (05:36 +0000)
blog/edit.php
blog/edit_form.php

index 51ad4feaa2d1f9846bdc71066fc3401fb777fc33..e76e6f9f27001a00f060a90ef40b925f9cdc32e8 100755 (executable)
@@ -24,7 +24,7 @@
  * @copyright  2009 Nicolas Connault
  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
-require_once('../config.php');
+require_once(dirname(dirname(__FILE__)).'/config.php');
 include_once('lib.php');
 include_once('locallib.php');
 include_once($CFG->dirroot.'/tag/lib.php');
@@ -141,7 +141,7 @@ if (!empty($existing)) {
 }
 
 $textfieldoptions = array('trusttext'=>true, 'subdirs'=>true);
-$blogeditform = new blog_edit_form(null, compact('existing', 'sitecontext', 'assignmentdata', 'textfieldoptions'));
+$blogeditform = new blog_edit_form(null, compact('existing', 'sitecontext', 'assignmentdata', 'textfieldoptions', 'id'));
 
 $existing = file_prepare_standard_editor($existing, 'summary', $textfieldoptions, $PAGE->get_context());
 
@@ -219,7 +219,6 @@ switch ($action) {
         print_error('unknowaction');
 }
 
-// Add filter params for return url
 $entry->modid = $modid;
 $entry->courseid = $courseid;
 
index 00b82f6650908d030e85b89d02c67a0070352e49..34df8ec8fcd5ea102037bfeab560a4c0072119e7 100644 (file)
@@ -26,6 +26,7 @@ class blog_edit_form extends moodleform {
         $mform    =& $this->_form;
 
         $existing       = $this->_customdata['existing'];
+        $entryid        = $this->_customdata['id'];
         $summaryoptions = $this->_customdata['textfieldoptions'];
 
         if (!empty($this->_customdata['assignmentdata'])) {
@@ -145,9 +146,9 @@ class blog_edit_form extends moodleform {
         $mform->addElement('hidden', 'courseid');
         $mform->setType('courseid', PARAM_INT);
 
-        $mform->addElement('hidden', 'id');
-        $mform->setType('id', PARAM_INT);
-        $mform->setDefault('id', 0);
+        $mform->addElement('hidden', 'entryid');
+        $mform->setType('entryid', PARAM_INT);
+        $mform->setDefault('entryid', $entryid);
 
         $mform->addElement('hidden', 'modid');
         $mform->setType('modid', PARAM_INT);
@@ -185,9 +186,9 @@ class blog_edit_form extends moodleform {
         if ($blogassignment = $DB->get_record_sql('SELECT a.timedue, a.preventlate, a.emailteachers, a.var2, asub.grade
                                           FROM {assignment} a, {assignment_submissions} as asub WHERE
                                           a.id = asub.assignment AND userid = '.$USER->id.' AND a.assignmenttype = \'blog\'
-                                          AND asub.data1 = \''.$data['id'].'\'')) {
+                                          AND asub.data1 = \''.$data['entryid'].'\'')) {
 
-            $original = $DB->get_record('post', array('id' => $data['id']));
+            $original = $DB->get_record('post', array('id' => $data['entryid']));
             //don't allow updates of the summary, subject, or attachment
             $changed = ($original->summary != $data['summary'] ||
                         $original->subject != $data['subject'] ||