Example #1
0
     $occurrence_object->tabs($mode, $currenttab);
     echo '<div align="center"><h2><img src="' . $icon . '" border="0" title="" alt="" /> ' . get_string('newbaremes', 'referentiel') . ' ' . $OUTPUT->help_icon('baremeh', 'referentiel') . '</h2></div>' . "\n";
     echo $OUTPUT->box_start('generalbox  boxaligncenter');
     echo $OUTPUT->confirm(get_string('confirmexchange', 'referentiel') . ' ' . $OUTPUT->help_icon('baremeechangeh', 'referentiel'), 'bareme.php?blockid=' . $blockid . '&amp;courseid=' . $courseid . '&amp;occurrenceid=' . $occurrenceid . '&amp;baremeid=' . $baremeid . '&amp;mode=echangebareme&amp;confirm=1&amp;sesskey=' . sesskey(), 'bareme.php?blockid=' . $blockid . '&amp;courseid=' . $courseid . '&amp;occurrenceid=' . $occurrenceid . '&amp;mode=bareme&amp;confirm=0&amp;sesskey=' . sesskey());
     echo $OUTPUT->box_end();
     echo $OUTPUT->footer();
     die;
 } else {
     if ($mode == 'echangebareme' && confirm_sesskey()) {
         if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
             referentiel_echange_bareme_occurrence($baremeid, $occurrence_object->referentiel->id);
         }
     } else {
         if ($mode == 'confirmdeletebareme' && confirm_sesskey()) {
             if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
                 referentiel_delete_bareme_occurrence($baremeid, $occurrence_object->referentiel->id);
             }
         } else {
             if ($mode == 'deletebareme') {
                 echo $OUTPUT->header();
                 $occurrence_object->tabs($mode, $currenttab);
                 echo '<div align="center"><h2><img src="' . $icon . '" border="0" title="" alt="" /> ' . get_string('newbaremes', 'referentiel') . ' ' . $OUTPUT->help_icon('baremeh', 'referentiel') . '</h2></div>' . "\n";
                 echo $OUTPUT->box_start('generalbox  boxaligncenter');
                 echo $OUTPUT->confirm(get_string('confirmdelete', 'referentiel') . ' ' . $OUTPUT->help_icon('deletescaleh', 'referentiel'), 'bareme.php?blockid=' . $blockid . '&amp;courseid=' . $courseid . '&amp;occurrenceid=' . $occurrenceid . '&amp;baremeid=' . $baremeid . '&amp;mode=confirmdeletebareme&amp;confirm=1&amp;sesskey=' . sesskey(), 'bareme.php?blockid=' . $blockid . '&amp;courseid=' . $courseid . '&amp;occurrenceid=' . $occurrenceid . '&amp;mode=bareme&amp;confirm=0&amp;sesskey=' . sesskey());
                 echo $OUTPUT->box_end();
                 echo $OUTPUT->footer();
                 die;
             }
         }
     }
 }
         }
     } else {
         if ($mode == 'echangebareme' && confirm_sesskey()) {
             if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
                 referentiel_echange_bareme_occurrence($scaleid, $referentiel_referentiel->id);
             }
         } else {
             if ($mode == 'selectbareme') {
                 echo $OUTPUT->confirm(get_string('confirmexchange', 'referentiel') . ' ' . $OUTPUT->help_icon('baremeechangeh', 'referentiel'), 'bareme.php?id=' . $cm->id . '&amp;scaleid=' . $scaleid . '&amp;mode=echangebareme&amp;confirm=1&amp;sesskey=' . sesskey(), 'bareme.php?id=' . $cm->id . '&amp;mode=bareme&amp;confirm=0&amp;sesskey=' . sesskey());
                 echo $OUTPUT->box_end();
                 echo $OUTPUT->footer();
                 die;
             } else {
                 if ($mode == 'confirmdeletebareme' && confirm_sesskey()) {
                     if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
                         referentiel_delete_bareme_occurrence($scaleid, $referentiel_referentiel->id);
                     }
                 } else {
                     if ($mode == 'deletebareme') {
                         echo $OUTPUT->confirm(get_string('confirmdelete', 'referentiel') . ' ' . $OUTPUT->help_icon('deletescaleh', 'referentiel'), 'bareme.php?id=' . $cm->id . '&amp;scaleid=' . $scaleid . '&amp;mode=confirmdeletebareme&amp;confirm=1&amp;sesskey=' . sesskey(), 'bareme.php?id=' . $cm->id . '&amp;mode=bareme&amp;confirm=0&amp;sesskey=' . sesskey());
                         echo $OUTPUT->box_end();
                         echo $OUTPUT->footer();
                         die;
                     }
                 }
             }
         }
     }
 }
 $roles = referentiel_roles_in_instance($referentiel->id);
 $idbareme = referentiel_affiche_bareme_occurrence($referentiel->ref_referentiel, $course, $cm, $context, $roles);