]> git.mjollnir.org Git - moodle.git/commitdiff
Fixing the rendering of remove icon
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 17:55:13 +0000 (17:55 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 17:55:13 +0000 (17:55 +0000)
mod/workshop/allocation/manual/renderer.php

index 4205551cc59bb552ff2b90adaacefbb1045efe31..20cb6cf3b279a6af1cf795ec8645ff5d6825f35e 100644 (file)
@@ -154,8 +154,9 @@ class moodle_mod_workshop_allocation_manual_renderer extends moodle_renderer_bas
             $o .= $this->output->user_picture($userpic);
             $o .= fullname($peers[$reviewerid]);
 
-            $handler = $this->page->url->out_action(array('mode' => 'del', 'what' => $assessmentid));
-            $o .= $this->output->output_tag('a', array('href' => $handler), ' X ');
+            // delete icon
+            $handler = new moodle_url($this->page->url, array('mode' => 'del', 'what' => $assessmentid, 'sesskey' => sesskey()));
+            $o .= $this->remove_allocation_icon($handler);
 
             $o .= $this->output->output_end_tag('li');
         }
@@ -199,9 +200,9 @@ class moodle_mod_workshop_allocation_manual_renderer extends moodle_renderer_bas
             $o .= $this->output->user_picture($userpic, $this->page->course->id);
             $o .= fullname($peers[$authorid]);
 
-            // delete
-            $handler = $this->page->url->out_action(array('mode' => 'del', 'what' => $assessmentid));
-            $o .= $this->output->output_tag('a', array('href' => $handler), ' X ');
+            // delete icon
+            $handler = new moodle_url($this->page->url, array('mode' => 'del', 'what' => $assessmentid, 'sesskey' => sesskey()));
+            $o .= $this->remove_allocation_icon($handler);
 
             $o .= $this->output->output_end_tag('li');
         }
@@ -225,4 +226,21 @@ class moodle_mod_workshop_allocation_manual_renderer extends moodle_renderer_bas
         return $options;
     }
 
+    /**
+     * Generates an icon link to remove the allocation
+     *
+     * @param moodle_url $link to the action
+     * @return html code to be displayed
+     */
+    protected function remove_allocation_icon($link) {
+        $icon = new moodle_action_icon();
+        $icon->image->src = $this->old_icon_url('i/cross_red_big');
+        $icon->image->alt = 'X';
+        $icon->link->url = $link;
+
+        return $this->output->action_icon($icon);
+
+    }
+
+
 }