コード例 #1
0
//get the id of the course that is currently being used
$course_id = $PARSER->optional_param('course_id', NULL, PARAM_INT);
//get the id of the state selectors reportfield
$reportfield_id = $PARSER->required_param('reportfield_id', PARAM_INT);
//get the id of the state selectors entry
$entry_id = $PARSER->required_param('entry_id', PARAM_INT);
//get the id of the state selectors entry
$item_id = $PARSER->required_param('item_id', PARAM_INT);
//get the selectedtab param if present
$selectedtab = $PARSER->optional_param('selectedtab', NULL, PARAM_INT);
//get the tabitem param if present
$tabitem = $PARSER->optional_param('tabitem', NULL, PARAM_INT);
// instantiate the db
$dbc = new ilp_db();
//get the reportfield
$reportfield = $dbc->get_reportfield_by_id($reportfield_id);
//get the report
$report = !empty($reportfield) ? $dbc->get_report_by_id($reportfield->report_id) : false;
//if the report is not found throw an error of if the report has a status of disabled
if (empty($report) || empty($report->status) || !empty($report->deleted)) {
    print_error('reportnotfouund', 'block_ilp');
}
/*
if ($USER->id != $user_id)	{
		//the user doesnt have the capability to edit this type of report entry
		print_error('userdoesnothaveeditcapability','block_ilp');	
}	
*/
$stateplugin = $dbc->get_plugin_by_name('block_ilp_plugin', 'ilp_element_plugin_state');
$resulttext = get_string('statenotchanged', 'block_ilp');
if ($stateplugin) {