MDL-20204 converted action_icon
authorPetr Skoda <skodak@moodle.org>
Tue, 16 Feb 2010 16:24:49 +0000 (16:24 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 16 Feb 2010 16:24:49 +0000 (16:24 +0000)
23 files changed:
admin/filters.php
blocks/global_navigation_tree/block_global_navigation_tree.php
blocks/rss_client/managefeeds.php
blocks/settings_navigation_tree/block_settings_navigation_tree.php
blog/external_blogs.php
blog/locallib.php
course/lib.php
course/report/log/lib.php
grade/edit/tree/lib.php
grade/export/keymanager.php
grade/import/keymanager.php
grade/lib.php
grade/report/grader/lib.php
lib/navigationlib.php
lib/outputactions.php
lib/outputcomponents.php
lib/outputrenderers.php
mod/chat/lib.php
mod/workshop/allocation/manual/renderer.php
mod/workshop/renderer.php
repository/filepicker.php
user/index.php
user/portfoliologs.php

index 812fbd4..25023c1 100644 (file)
@@ -249,12 +249,12 @@ function get_table_row($filterinfo, $isfirstrow, $islastactive, $applytostrings)
     $spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
     if ($filterinfo->active != TEXTFILTER_DISABLED) {
         if (!$isfirstrow) {
-            $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), get_string('up'), 't/up');
+            $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
         } else {
             $updown .= $spacer;
         }
         if (!$islastactive) {
-            $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), get_string('down'), 't/down');
+            $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
         } else {
             $updown .= $spacer;
         }
index c2d6cff..76c63d9 100644 (file)
@@ -164,7 +164,7 @@ class block_global_navigation_tree extends block_tree {
 
         $reloadlink = new moodle_url($this->page->url, array('regenerate'=>'navigation'));
 
-        $this->content->footer .= $OUTPUT->action_icon($reloadlink, get_string('reload'), 't/reload', array('class'=>'customcommand'));
+        $this->content->footer .= $OUTPUT->action_icon($reloadlink, new pix_icon('t/reload', get_string('reload')), null, array('class'=>'customcommand'));
 
         // Set content generated to true so that we know it has been done
         $this->contentgenerated = true;
index 9eab777..218e7a9 100644 (file)
@@ -115,13 +115,12 @@ foreach($feeds as $feed) {
         '<div class="url">' . html_writer::link($feed->url, $feed->url) .'</div>' .
         '<div class="description">' . $feed->description . '</div>';
 
-    $editurl = $CFG->wwwroot .'/blocks/rss_client/editfeed.php?rssid=' . $feed->id . $extraparams;
-    $editaction = $OUTPUT->action_icon($editurl, get_string('edit'), 't/edit');
+    $editurl = new moodle_url('/blocks/rss_client/editfeed.php?rssid=' . $feed->id . $extraparams);
+    $editaction = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('edit')));
 
-    $deleteurl = $CFG->wwwroot .'/blocks/rss_client/managefeeds.php?deleterssid=' . $feed->id . '&sesskey=' . sesskey() . $extraparams;
-    $deletelink = new html_link($deleteurl);
-    $deletelink->add_confirm_action(get_string('deletefeedconfirm', 'block_rss_client'));
-    $deleteaction = $OUTPUT->action_icon($deletelink, get_string('delete'), 't/delete');
+    $deleteurl = new moodle_url('/blocks/rss_client/managefeeds.php?deleterssid=' . $feed->id . '&sesskey=' . sesskey() . $extraparams);
+    $deleteicon = new pix_icon('t/delete', get_string('delete'));
+    $deleteaction = $OUTPUT->action_icon($deleteurl, $deleteicon, new confirm_action(get_string('deletefeedconfirm', 'block_rss_client')));
 
     $feedicons = $editaction . ' ' . $deleteaction;
 
index 8949bc1..9cb9852 100644 (file)
@@ -144,7 +144,7 @@ class block_settings_navigation_tree extends block_tree {
             }
 
             $reloadlink = new moodle_url($this->page->url, array('regenerate'=>'navigation'));
-            $this->content->footer .= $OUTPUT->action_icon($reloadlink, get_string('reload'), 't/reload', array('class'=>'customcommand'));
+            $this->content->footer .= $OUTPUT->action_icon($reloadlink, new pix_icon('t/reload', get_string('reload')), null, array('class'=>'customcommand'));
 
             if (!empty($this->config->enablesidebarpopout) && $this->config->enablesidebarpopout == 'yes') {
                 user_preference_allow_ajax_update('nav_in_tab_panel_settingsnav'.block_settings_navigation_tree::$navcount, PARAM_INT);
index 22c2aec..792360f 100644 (file)
@@ -79,11 +79,11 @@ if (!empty($blogs)) {
         }
 
         $editurl = new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id));
-        $editicon = $OUTPUT->action_icon($editurl, get_string('editexternalblog', 'blog'), 't/edit');
+        $editicon = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('editexternalblog', 'blog')));
 
-        $deletelink = new html_link(new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id, 'sesskey'=>sesskey())));
-        $deletelink->add_confirm_action(get_string('externalblogdeleteconfirm', 'blog'));
-        $deleteicon = $OUTPUT->action_icon($deletelink, get_string('deleteexternalblog', 'blog'), 't/delete');
+        $deletelink = new moodle_url('/blog/external_blog_edit.php', array('id' => $blog->id, 'sesskey'=>sesskey()));
+        $action = new confirm_action(get_string('externalblogdeleteconfirm', 'blog'));
+        $deleteicon = $OUTPUT->action_icon($deletelink, new pix_icon('t/delete', get_string('deleteexternalblog', 'blog')), $action);
 
         $table->data[] = html_table_row::make(array($blog->name, $blog->url, userdate($blog->timefetched), $validicon, $editicon . $deleteicon));
     }
index c02c9e4..ec30c87 100644 (file)
@@ -239,7 +239,7 @@ class blog_entry {
                 if ($contextrec->contextlevel ==  CONTEXT_COURSE) {
                     $url = new moodle_url('/course/view.php', array('id' => $contextrec->instanceid));
                     $text = $DB->get_field('course', 'shortname', array('id' => $contextrec->instanceid)); //TODO: performance!!!!
-                    $assocstr .= $OUTPUT->action_icon($associconurl, $text, 'i/course');
+                    $assocstr .= $OUTPUT->action_icon($associconurl, new pix_icon('i/course', $text));
                     $hascourseassocs = true;
                     $assoctype = get_string('course');
                 }
@@ -260,7 +260,7 @@ class blog_entry {
 
                     $url = new moodle_url('/mod/'.$modname.'/view.php', array('id' => $modinfo->id));
                     $text = $DB->get_field($modname, 'name', array('id' => $modinfo->instance)); //TODO: performance!!!!
-                    $assocstr .= $OUTPUT->action_icon($associconurl, $text, $OUTPUT->pix_url('icon', $modname));
+                    $assocstr .= $OUTPUT->action_icon($associconurl, new pix_icon('icon', $text, $modname));
                     $assocstr .= ', ';
                     $assoctype = get_string('modulename', $modname);
 
index 3d5eab2..e88af86 100644 (file)
@@ -406,7 +406,7 @@ function print_log($course, $user=0, $date=0, $order="l.time ASC", $page=0, $per
         $link = new moodle_url("/iplookup/index.php?ip=$log->ip&user=$log->userid");
         $row[] = $OUTPUT->action_link($link, $log->ip, new popup_action('click', $link, 'iplookup', array('height' => 440, 'width' => 700)));
 
-        $row[] = html_writer::link(new moodle_url("/user/view.php?id={$log->userid}&course={$log->course}", fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)))));
+        $row[] = html_writer::link(new moodle_url("/user/view.php?id={$log->userid}&course={$log->course}"), fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id))));
 
         $displayaction="$log->module $log->action";
         if ($brokenurl) {
index 46dc3bf..336093d 100644 (file)
@@ -555,8 +555,8 @@ function log_report_extend_navigation($navigation, $course, $context) {
     }
     if (has_capability('coursereport/log:viewlive', $context)) {
         $livelogs = get_string('livelogs');
-        $link = new moodle_url('/course/report/log/live.php', array('id'=>$course->id));
-        $link->add_action(new popup_action('click', $link->url, 'livelog', array('height' => 500, 'width' => 800)));
+        $url = new moodle_url('/course/report/log/live.php', array('id'=>$course->id));
+        $link = new action_link($url, $livelogs, new popup_action('click', $url, 'livelog', array('height' => 500, 'width' => 800)));
         $navigation->add($livelogs, $link, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
     }
 }
\ No newline at end of file
index c9a8137..2573cb1 100755 (executable)
@@ -136,11 +136,11 @@ class grade_edit_tree {
         if ($element['type'] == 'item' or ($element['type'] == 'category' and $element['depth'] > 1)) {
             if ($this->element_deletable($element)) {
                 $aurl = new moodle_url('index.php', array('id' => $COURSE->id, 'action' => 'delete', 'eid' => $eid, 'sesskey' => sesskey()));
-                $actions .= $OUTPUT->action_icon($aurl, get_string('delete'), 't/delete', array('class'=>'iconsmall'));
+                $actions .= $OUTPUT->action_icon($aurl, new pix_icon('t/delete', get_string('delete')));
             }
 
             $aurl = new moodle_url('index.php', array('id' => $COURSE->id, 'action' => 'moveselect', 'eid' => $eid, 'sesskey' => sesskey()));
-            $actions .= $OUTPUT->action_icon($aurl, get_string('move'), 't/move', array('class'=>'iconsmall'));
+            $actions .= $OUTPUT->action_icon($aurl, new pix_icon('t/move', get_string('move')));
         }
 
         $actions .= $this->gtree->get_hiding_icon($element, $this->gpr);
@@ -215,7 +215,7 @@ class grade_edit_tree {
 
                     $cell = new html_table_cell();
                     $cell->colspan = 12;
-                    $cell->text = $OUTPUT->action_icon($aurl, $strmovehere, 'movehere', array('class'=>'movetarget'));
+                    $cell->text = $OUTPUT->action_icon($aurl, $strmovehere, new pix_icon(array('class'=>'movetarget'), 'movehere'));
 
                     $moveto = html_table_row::make(array($cell));
                 }
index edab2af..c678e9b 100644 (file)
@@ -58,11 +58,11 @@ if ($keys) {
             $url->param('id', $key->id);
         }
 
-        $buttons = $OUTPUT->action_icon($url, $stredit, 't/edit', array('class'=>'iconsmall'));
+        $buttons = $OUTPUT->action_icon($url, new pix_icon('t/edit', $stredit));
 
         $url->param('delete', 1);
         $url->param('sesskey', sesskey());
-        $buttons .= $OUTPUT->action_icon($url, $strdelete, 't/delete', array('class'=>'iconsmall'));
+        $buttons .= $OUTPUT->action_icon($url, new pix_icon('t/delete', $strdelete));
 
         $line[3] = $buttons;
         $data[] = $line;
index 78389be..07fb12c 100644 (file)
@@ -55,11 +55,11 @@ if ($keys = $DB->get_records_select('user_private_key', "script='grade/import' A
 
         $url = new moodle_url('key.php', array('id' => $key->id));
 
-        $buttons = $OUTPUT->action_icon($url, $stredit, 't/edit');
+        $buttons = $OUTPUT->action_icon($url, new pix_icon('t/edit', $stredit));
 
         $url->param('delete', 1);
         $url->param('sesskey', sesskey());
-        $buttons .= $OUTPUT->action_icon($url, $strdelete, 't/delete');
+        $buttons .= $OUTPUT->action_icon($url, new pix_icon('t/delete', $strdelete));
 
         $line[3] = $buttons;
         $data[] = $line;
index af2e5bb..97c9fb3 100644 (file)
@@ -1465,7 +1465,7 @@ class grade_structure {
         }
 
         if ($url) {
-            return $OUTPUT->action_icon($gpr->add_url_params($url), $stredit, 't/edit', array('class'=>'iconsmall'));
+            return $OUTPUT->action_icon($gpr->add_url_params($url), new pix_icon('t/edit', $stredit));
 
         } else {
             return '';
@@ -1508,11 +1508,11 @@ class grade_structure {
 
             $url->param('action', 'show');
 
-            $hideicon = $OUTPUT->action_icon($url, $tooltip, 't/'.$type, array('alt'=>$strshow, 'class'=>'iconsmall'));
+            $hideicon = $OUTPUT->action_icon($url, new pix_icon('t/'.$type, $tooltip, 'moodle', array('alt'=>$strshow, 'class'=>'iconsmall')));
 
         } else {
             $url->param('action', 'hide');
-            $hideicon = $OUTPUT->action_icon($url, $strhide, 't/hide', array('class'=>'iconsmall'));
+            $hideicon = $OUTPUT->action_icon($url, new pix_icon('t/hide', $strhide));
         }
 
         return $hideicon;
@@ -1559,7 +1559,7 @@ class grade_structure {
                 $action = '';
             } else {
                 $url->param('action', 'unlock');
-                $action = $OUTPUT->action_icon($url, $tooltip, 't/'.$type, array('alt'=>$strunlock, 'class'=>'smallicon'));
+                $action = $OUTPUT->action_icon($url, new pix_icon('t/'.$type, $tooltip, 'moodle', array('alt'=>$strunlock, 'class'=>'smallicon')));
             }
 
         } else {
@@ -1567,7 +1567,7 @@ class grade_structure {
                 $action = '';
             } else {
                 $url->param('action', 'lock');
-                $action = $OUTPUT->action_icon($url, $strlock, 't/lock', array('class'=>'smallicon'));
+                $action = $OUTPUT->action_icon($url, new pix_icon('t/lock', $strlock));
             }
         }
 
@@ -1608,7 +1608,7 @@ class grade_structure {
 
                 $url = new moodle_url('/grade/edit/tree/calculation.php', array('courseid' => $this->courseid, 'id' => $object->id));
                 $url = $gpr->add_url_params($url);
-                return $OUTPUT->action_icon($url, $streditcalculation, $icon, array('class'=>'smallicon')) . "\n";
+                return $OUTPUT->action_icon($url, new pix_icon($icon, $streditcalculation)) . "\n";
             }
         }
 
@@ -2236,6 +2236,6 @@ function grade_button($type, $courseid, $object) {
         $url = new moodle_url('edit.php', array('courseid' => $courseid, 'id' => $object->id));
     }
 
-    return $OUTPUT->action_icon($url, ${'str'.$type}, 't/'.$type, array('class'=>'iconsmall'));
+    return $OUTPUT->action_icon($url, new pix_icon('t/'.$type, ${'str'.$type}));
 
 }
index 10d70f7..b072beb 100644 (file)
@@ -505,7 +505,7 @@ class grade_report_grader extends grade_report {
         $aurl = clone($this->baseurl);
         $url->params(array('toggle' => $toggleaction, 'toggle_type' => $type));
 
-        $retval = $OUTPUT->container($OUTPUT->action_icon($url, $string, $imagename, array('class'=>'iconsmall'))); // TODO: this container looks wrong here
+        $retval = $OUTPUT->container($OUTPUT->action_icon($url, new pix_icon($imagename, $string))); // TODO: this container looks wrong here
 
         return $retval;
     }
@@ -611,7 +611,7 @@ class grade_report_grader extends grade_report {
                 $a->user = fullname($user);
                 $strgradesforuser = get_string('gradesforuser', 'grades', $a);
                 $url = new moodle_url('/grade/report/'.$CFG->grade_profilereport.'/index.php', array('userid' => $user->id, 'id' => $this->course->id));
-                $userreportcell->text = $OUTPUT->action_icon($url, $strgradesforuser, 't/grades', array('class'=>'iconsmall'));
+                $userreportcell->text = $OUTPUT->action_icon($url, new pix_icon('t/grades', $strgradesforuser));
                 $userrow->cells[] = $userreportcell;
             }
 
@@ -1440,16 +1440,16 @@ class grade_report_grader extends grade_report {
 
             if (in_array($element['object']->id, $this->collapsed['aggregatesonly'])) {
                 $url->param('action', 'switch_plus');
-                $icon = $OUTPUT->action_icon($url, $strswitchplus, 't/switch_plus', array('class'=>'iconsmall'));
+                $icon = $OUTPUT->action_icon($url, new pix_icon('t/switch_plus', $strswitchplus));
 
             } else if (in_array($element['object']->id, $this->collapsed['gradesonly'])) {
                 $url->param('action', 'switch_whole');
-                $icon = $OUTPUT->action_icon($url, $strswitchwhole, 't/switch_whole', array('class'=>'iconsmall'));
+                $icon = $OUTPUT->action_icon($url, new pix_icon('t/switch_whole', $strswitchwhole));
                 $contractexpandicon->image->src = $OUTPUT->pix_url('t/switch_whole');
 
             } else {
                 $url->param('action', 'switch_minus');
-                $icon = $OUTPUT->action_icon($url, $strswitchminus, 't/switch_minus', array('class'=>'iconsmall'));
+                $icon = $OUTPUT->action_icon($url, new pix_icon('t/switch_minus', $strswitchminus));
             }
         }
         return $icon;
index 9226b28..2af544f 100644 (file)
@@ -422,13 +422,13 @@ class navigation_node {
             return '';
         }
 
-        if ($this->action instanceof html_link) {
+        if ($this->action instanceof action_link) {
             //TODO: to be replaced with something else
             $link = $this->action;
             if ($this->hidden) {
                 $link->add_class('dimmed');
             }
-            $content = $OUTPUT->link($link);
+            $content = $OUTPUT->render($link);
 
         } else if ($this->action instanceof moodle_url) {
             $attributes = array();
index 84fcb74..e942716 100644 (file)
@@ -77,6 +77,17 @@ class component_action {
     }
 }
 
+
+/**
+ * Confirm action
+ */
+class confirm_action extends component_action {
+    public function __construct($message, $callback=null) {
+        parent::__construct('click', 'M.util.show_confirm_dialog', array('message' => $message, 'callback' => $callback));
+    }
+}
+
+
 /**
  * Component action for a popup window.
  *
index a9c2f56..a2ba259 100644 (file)
@@ -581,6 +581,14 @@ class action_link implements renderable {
     public function add_action(component_action $action) {
         $this->actions[] = $action;
     }
+
+    public function add_class($class) {
+        if (empty($this->atribbutes['class'])) {
+            $this->atribbutes['class'] = $class;
+        } else {
+            $this->atribbutes['class'] = $this->atribbutes['class'].' '.$class;
+        }
+    }
 }
 
 
index de4a9b2..a8d9808 100644 (file)
@@ -878,9 +878,9 @@ class core_renderer extends renderer_base {
     /**
      * Given a html_link object, outputs an <a> tag that uses the object's attributes.
      *
-     * @param mixed $link A html_link object or a string URL (text param required in second case)
-     * @param string $text A descriptive text for the link. If $link is a html_link, this is ignored.
-     * @param array $options a tag attributes and link otpions. If $link is a html_link, this is ignored.
+     * @param string|moodle_url $url
+     * @param string $text A descriptive text for the link
+     * @param array $options a tag attributes and link otpions
      * @return string HTML fragment
      */
     public function link($link_or_url, $text = null, array $options = null) {
@@ -919,7 +919,7 @@ class core_renderer extends renderer_base {
      * @param array $attributes associative array of html link attributes + disabled
      * @return HTML fragment
      */
-    public function action_link($url, $text, component_action $action, array $attributes=null) {
+    public function action_link($url, $text, component_action $action = null, array $attributes=null) {
         if (!($url instanceof moodle_url)) {
             $url = new moodle_url($url);
         }
@@ -961,6 +961,39 @@ class core_renderer extends renderer_base {
         return html_writer::tag('a', $attributes, $link->text);
     }
 
+
+    /**
+     * Similar to action_link, image is used instead of the text
+     *
+     * @param string|moodle_url $url A string URL or moodel_url
+     * @param pix_icon $pixicon
+     * @param component_action $action
+     * @param array $attributes associative array of html link attributes + disabled
+     * @param bool $linktext show title next to image in link
+     * @return string HTML fragment
+     */
+    public function action_icon($url, pix_icon $pixicon, component_action $action = null, array $attributes = null, $linktext=false) {
+        if (!($url instanceof moodle_url)) {
+            $url = new moodle_url($url);
+        }
+        $attributes = (array)$attributes;
+
+        if (empty($options['class'])) {
+            // let ppl override the class via $options
+            $attributes['class'] = 'action-icon';
+        }
+
+        $icon = $this->render($pixicon);
+
+        if ($linktext) {
+            $text = $pixicon->attributes['alt'];
+        } else {
+            $text = '';
+        }
+
+        return $this->action_link($url, $text.$icon, $action, $attributes);
+    }
+
    /**
     * Print a message along with button choices for Continue/Cancel
     *
@@ -1265,49 +1298,6 @@ class core_renderer extends renderer_base {
         return html_writer::empty_tag('img', $attributes);
     }
 
-    /**
-     * Given a moodle_action_icon object, outputs an image linking to an action (URL or AJAX).
-     *
-     * @param mixed $url_or_link A html_link object or a string URL (text param required in second case)
-     * @param string $title link title and also image alt if no alt specified in $options
-     * @param html_image|moodle_url|string $image_or_url image or url of the image,
-     *        it is also possible to use short pix name for core images
-     * @param array $options image attributes such as title, id, alt, widht, height
-     * @param bool $linktext show title next to image in link
-     * @return string HTML fragment
-     */
-    public function action_icon($url_or_link, $title, $image_or_url, array $options = null, $linktext=false) {
-        $options = (array)$options;
-        if (empty($options['class'])) {
-            // let ppl override the class via $options
-            $options['class'] = 'action-icon';
-        }
-
-        if (empty($title)) {
-            debugging('$title should not be empty in action_icon() call');
-        }
-
-        if (!$linktext) {
-            $options['alt'] = $title;
-        }
-
-        $icon = $this->image($image_or_url, $options);
-
-        if ($linktext) {
-            $icon = $icon . $title;
-        }
-
-        if ($url_or_link instanceof html_link) {
-            $link = clone($url_or_link);
-            $link->text = ($icon);
-        } else {
-            $link = new html_link($url_or_link, $icon);
-        }
-        $url = $link->url;
-
-        return $this->link($link);
-    }
-
     /*
      * Centered heading with attached help button (same title text)
      * and optional icon attached
index 8d3cbbc..6846bf1 100644 (file)
@@ -1245,23 +1245,28 @@ function chat_extend_navigation($navigation, $course, $module, $cm) {
         $links = array();
 
         if (!empty($USER->screenreader)) {
-            $links[] = html_link::make(new moodle_url($target.'gui_basic/index.php', $params), $strenterchat);
+            $url = new moodle_url($target.'gui_basic/index.php', $params);
+            $links[] = new action_link($url, $strenterchat, $action);
         } else {
-            $links[] = html_link::make(new moodle_url($target.'gui_'.$CFG->chat_method.'/index.php', $params), $strenterchat);
+            $url = new moodle_url($target.'gui_'.$CFG->chat_method.'/index.php', $params);
+            $action = new popup_action('click', $url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700));
+            $links[] = new action_link($url, $strenterchat, $action);
         }
 
         if ($CFG->enableajax) {
-            $links[] = html_link::make(new moodle_url($target.'gui_ajax/index.php', $params), get_string('ajax_gui', 'message'));
+            $url = new moodle_url($target.'gui_ajax/index.php', $params);
+            $action = new popup_action('click', $url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700));
+            $links[] = new action_link($url, get_string('ajax_gui', 'message'), $action);
         }
 
         if ($CFG->chat_method == 'header_js' && empty($USER->screenreader)) {
-            $links[] = html_link::make(new moodle_url($target.'gui_basic/index.php', $params), get_string('noframesjs', 'message'));
+            $url = new moodle_url($target.'gui_basic/index.php', $params);
+            $action = new popup_action('click', $url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700));
+            $links[] = new action_link($url, get_string('noframesjs', 'message'), $action);
         }
 
         foreach ($links as $link) {
-            $link->add_action(new popup_action('click', $link->url, 'chat'.$course->id.$cm->instance.$currentgroup, array('height' => 500, 'width' => 700)));
-            $link->title = get_string('modulename', 'chat');
-            $navigation->add($link->title, $link, navigation_node::TYPE_ACTIVITY, null ,null, new pix_icon('c/group' , ''));
+            $navigation->add($link->text, $link, navigation_node::TYPE_ACTIVITY, null ,null, new pix_icon('c/group' , ''));
         }
     }
 
index 8c907fe..a2da4d2 100644 (file)
@@ -190,6 +190,6 @@ class workshopallocation_manual_renderer extends plugin_renderer_base  {
      * @return html code to be displayed
      */
     protected function remove_allocation_icon($link) {
-        return $this->output->action_icon($link, 'X', 'i/cross_red_big');
+        return $this->output->action_icon($link, new pix_icon('i/cross_red_big', 'X'));
     }
 }
index 4bb7401..3d1c938 100644 (file)
@@ -295,7 +295,7 @@ class mod_workshop_renderer extends plugin_renderer_base {
         if ($summary->example->weight == 1) {
             $url = new moodle_url('/mod/workshop/exsubmission.php',
                                         array('cmid' => $this->page->context->instanceid, 'id' => $summary->example->id, 'edit' => 'on'));
-            $o .= $this->output->action_icon($url, get_string('edit'), 'i/edit');
+            $o .= $this->output->action_icon($url, new pix_icon('i/edit', get_string('edit')));
         }
         $o .= $this->output->container_end();
 
@@ -373,7 +373,7 @@ class mod_workshop_renderer extends plugin_renderer_base {
             foreach ($phase->actions as $action) {
                 switch ($action->type) {
                 case 'switchphase':
-                    $actions .= $this->output->action_icon($action->url, get_string('switchphase', 'workshop'), 'i/marker');
+                    $actions .= $this->output->action_icon($action->url, new pix_icon('i/marker', get_string('switchphase', 'workshop')));
                     break;
                 }
             }
@@ -597,12 +597,12 @@ class mod_workshop_renderer extends plugin_renderer_base {
             if ($sortby !== $sortid or $sorthow !== 'ASC') {
                 $url = new moodle_url($PAGE->url);
                 $url->params(array('sortby' => $sortid, 'sorthow' => 'ASC'));
-                $out .= $this->output->action_icon($url, get_string('sortasc', 'workshop'), 't/up', array('class' => 'sort asc'));
+                $out .= $this->output->action_icon($url, new pix_icon('t/up', get_string('sortasc', 'workshop')), null, array('class' => 'sort asc'));
             }
             if ($sortby !== $sortid or $sorthow !== 'DESC') {
                 $url = new moodle_url($PAGE->url);
                 $url->params(array('sortby' => $sortid, 'sorthow' => 'DESC'));
-                $out .= $this->output->action_icon($url, get_string('sortdesc', 'workshop'), 't/down', array('class' => 'sort desc'));
+                $out .= $this->output->action_icon($url, new pix_icon('t/down', get_string('sortdesc', 'workshop')), null, array('class' => 'sort desc'));
             }
         }
         return $out;
index a3cd3ee..d6777d2 100755 (executable)
@@ -314,7 +314,7 @@ case 'plugins':
         if ($env == 'filemanager' && $info->type == 'draft') {
             continue;
         }
-        echo '<li>' . $OUTPUT->action_icon($aurl, $info->name, $info->icon, array('class'=>'smallicon')) . '</li>'; // no hardcoded styles!
+        echo '<li>' . $OUTPUT->action_icon($aurl, new pix_icon($info->icon, $info->name)) . '</li>'; // no hardcoded styles!
     }
     echo '</ul>';
     echo '</div>';
index d1bc700..2aea285 100644 (file)
                 $contentheading = $group->name;
                 if (has_capability('moodle/course:managegroups', $context)) {
                     $aurl = new moodle_url('/group/group.php', array('id' => $group->id, 'courseid' => $group->courseid));
-                    $contentheading .= '&nbsp;' . $OUTPUT->action_icon($aurl, get_string('editgroupprofile'), 't/edit');
+                    $contentheading .= '&nbsp;' . $OUTPUT->action_icon($aurl, new pix_icon('t/edit', get_string('editgroupprofile')));
                 }
 
                 $group->description = file_rewrite_pluginfile_urls($group->description, 'pluginfile.php', $context->id, 'course_group_description', $group->id);
index 1cd14a2..5f82036 100644 (file)
@@ -86,10 +86,10 @@ if (count($queued) > 0) {
         $queued = $e->get('queued');
         $baseurl = new moodle_url('/portfolio/add.php', array('id'=>$q->id, 'logreturn'=>1, 'sesskey'=>sesskey()));
 
-        $iconstr = $OUTPUT->action_icon(new moodle_url($baseurl, array('cancel'=>1)), get_string('cancel'), 't/stop');
+        $iconstr = $OUTPUT->action_icon(new moodle_url($baseurl, array('cancel'=>1)), new pix_icon('t/stop', get_string('cancel')));
 
         if (!$e->get('queued') && $e->get('expirytime') > $now) {
-            $iconstr .= '&nbsp;' . $OUTPUT->action_icon($baseurl, get_string('continue'), 't/go');
+            $iconstr .= '&nbsp;' . $OUTPUT->action_icon($baseurl, new pix_icon('t/go', get_string('continue')));
         }
         $table->data[] = array(
             $e->get('caller')->display_name(),