Merge branch 'MDL-40369-master' of git://github.com/FMCorz/moodle
authorDamyon Wiese <damyon@moodle.com>
Tue, 9 Jul 2013 07:28:31 +0000 (15:28 +0800)
committerDamyon Wiese <damyon@moodle.com>
Tue, 9 Jul 2013 07:28:31 +0000 (15:28 +0800)
1  2 
badges/renderer.php

diff --combined badges/renderer.php
@@@ -527,7 -527,7 +527,7 @@@ class core_badges_renderer extends plug
              $description = $badge->description;
              $criteria = self::print_badge_criteria($badge);
              if ($badge->dateissued) {
-                 $icon = new pix_icon('i/tick_green_big',
+                 $icon = new pix_icon('i/valid',
                              get_string('dateearned', 'badges',
                                  userdate($badge->dateissued, get_string('strftimedatefullshort', 'core_langconfig'))));
                  $badgeurl = new moodle_url('/badges/badge.php', array('hash' => $badge->uniquehash));
          $paging = new paging_bar($badges->totalcount, $badges->page, $badges->perpage, $this->page->url, 'page');
  
          // New badge button.
 -        $n['type'] = $this->page->url->get_param('type');
 -        $n['id'] = $this->page->url->get_param('id');
 -        $htmlnew = $this->output->single_button(new moodle_url('newbadge.php', $n), get_string('newbadge', 'badges'));
 +        $htmlnew = '';
 +        if (has_capability('moodle/badges:createbadge', $this->page->context)) {
 +            $n['type'] = $this->page->url->get_param('type');
 +            $n['id'] = $this->page->url->get_param('id');
 +            $htmlnew = $this->output->single_button(new moodle_url('newbadge.php', $n), get_string('newbadge', 'badges'));
 +        }
  
          $htmlpagingbar = $this->render($paging);
          $table = new html_table();