$checkpass = optional_param('checkpass', '', PARAM_ALPHA); // mot de passe fourni $action = optional_param('action', '', PARAM_ALPHANUMEXT); $edit = optional_param('edit', -1, PARAM_INT); if (!($course = $DB->get_record('course', array('id' => $courseid)))) { print_error('invalidcourse', 'block_referentiel', $courseid); } $courseurl = new moodle_url('/course/view.php', array('id' => $courseid)); // url avec pass active $viewurl = new moodle_url('/blocks/referentiel/view.php', array('blockid' => $blockid, 'courseid' => $courseid, 'occurrenceid' => $occurrenceid)); $baseurl = new moodle_url('/blocks/referentiel/config.php', array('blockid' => $blockid, 'courseid' => $courseid, 'occurrenceid' => $occurrenceid, 'pass' => $pass)); require_login($course); $currenttab = $mode; // Occurrence $params = array("blockid" => $blockid, "courseid" => $courseid, "occurrenceid" => $occurrenceid); $occurrence_object = new occurrence($params); //print_object($occurrence_object->referentiel); $role = $occurrence_object->roles(); $isadmin = $role->is_admin; $isauthor = $occurrence_object->is_author(); if (isset($SESSION->modform)) { // Variables are stored in the session $form = $SESSION->modform; unset($SESSION->modform); } else { $form = (object) $_POST; } // variable d'action if (!empty($form->cancel) && $form->cancel == get_string("quit", "referentiel")) { // Abandonner redirect($viewurl);
$occurrenceid = optional_param('occurrenceid', 0, PARAM_INT); $mode = optional_param('mode', 'list', PARAM_ALPHANUMEXT); // Force the browse mode ('list') $edit = optional_param('edit', -1, PARAM_INT); $approve = optional_param('approve', 0, PARAM_INT); //approval recordid $delete = optional_param('delete', 0, PARAM_INT); //delete recordid if (!($course = $DB->get_record('course', array('id' => $courseid)))) { print_error('invalidcourse', 'block_referentiel', $courseid); } $contextcourse = context_course::instance($course->id); $context = context_block::instance($blockid); require_login($course); $params = array("blockid" => $blockid, "courseid" => $courseid, "occurrenceid" => $occurrenceid); $occurrence_object = new occurrence($params); $currenttab = 'list'; if ($mode == 'edit') { $currenttab = 'edit'; } $pagetitle = get_string('occurrence', 'block_referentiel', $occurrence_object->referentiel->code_referentiel); $PAGE->set_url('/blocks/referentiel/view.php', array('blockid' => $blockid, 'courseid' => $courseid, 'occurrenceid' => $occurrenceid, 'mode' => $mode)); $PAGE->requires->css('/mod/referentiel/referentiel.css'); $PAGE->requires->js('/mod/referentiel/functions.js'); $PAGE->set_pagelayout('standard'); $PAGE->set_heading($course->fullname); $PAGE->set_title($pagetitle); $PAGE->navbar->add($occurrence_object->referentiel->code_referentiel); //$settingsnode = $PAGE->settingsnav->add(get_string('displayoccurrence', 'block_referentiel')); //$site = get_site(); echo $OUTPUT->header();
$mode = optional_param('mode', 'add', PARAM_ALPHANUMEXT); // Force the browse mode ('list') $action = optional_param('action', '', PARAM_ALPHANUMEXT); $format = optional_param('format', '', PARAM_FILE); // http://localhost/moodle25/blocks/referentiel/edit.php?blockid=65&courseid=2&occurrenceid=2&deleteid=217&action=modifieritem&delete=Supprimer&pass=&sesskey=pLZgTzHQUJ if (!($course = $DB->get_record('course', array('id' => $courseid)))) { print_error('invalidcourse', 'block_referentiel', $courseid); } $courseurl = new moodle_url('/course/view.php', array('id' => $courseid)); require_login($course); $context = context_block::instance($blockid); require_capability('mod/referentiel:import', $context); // Traitements // Occurrence $params = array("blockid" => $blockid, "courseid" => $courseid); $occurrence_object = new occurrence($params); //print_object($occurrence_object->referentiel); //exit; $role = $occurrence_object->roles(); $isadmin = $role->is_admin; // affichage $icon = $OUTPUT->pix_url('icon', 'referentiel'); $pagetitle = get_string('import', 'block_referentiel'); $PAGE->set_url('/blocks/referentiel/import.php', array('blockid' => $blockid, 'courseid' => $courseid)); $PAGE->requires->css('/mod/referentiel/referentiel.css'); // $PAGE->requires->js('/mod/referentiel/functions.js'); $PAGE->set_pagelayout('standard'); $PAGE->set_heading($course->fullname); $PAGE->set_title($pagetitle); $PAGE->navbar->add($occurrence_object->referentiel->code_referentiel); //$settingsnode = $PAGE->settingsnav->add(get_string('displayoccurrence', 'block_referentiel'));