Example #1
0
 function process_actions($left, $right, $moveup, $movedown, $moveupcontext, $movedowncontext, $tocontext)
 {
     global $CFG;
     //parent::procces_actions redirects after any action
     parent::process_actions($left, $right, $moveup, $movedown);
     if ($tocontext == $this->context->id) {
         //only called on toplevel list
         if ($moveupcontext) {
             $cattomove = $moveupcontext;
             $totop = 0;
         } elseif ($movedowncontext) {
             $cattomove = $movedowncontext;
             $totop = 1;
         }
         $toparent = "0,{$this->context->id}";
         redirect($CFG->wwwroot . '/question/contextmove.php?' . $this->pageurl->get_query_string(compact('cattomove', 'totop', 'toparent')));
     }
 }