* @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');
}
$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());
print_error('unknowaction');
}
-// Add filter params for return url
$entry->modid = $modid;
$entry->courseid = $courseid;
$mform =& $this->_form;
$existing = $this->_customdata['existing'];
+ $entryid = $this->_customdata['id'];
$summaryoptions = $this->_customdata['textfieldoptions'];
if (!empty($this->_customdata['assignmentdata'])) {
$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);
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'] ||