示例#1
0
 public function test_mod_icon_url()
 {
     global $CFG;
     $if = new pix_icon_finder(new theme_config());
     $this->assertEqual($CFG->httpswwwroot . '/mod/quiz/icon.gif', $if->mod_icon_url('icon', 'quiz'));
 }
示例#2
0
 /**
  * Implement interface method.
  * @param string $iconname the name of the icon.
  * @param string $module the module the icon belongs to.
  * @return string the URL for that icon.
  */
 public function mod_icon_url($iconname, $module)
 {
     foreach ($this->places as $dirroot => $urlroot) {
         if (file_exists($dirroot . 'mod/' . $iconname . '.png')) {
             return $dirroot . 'mod/' . $iconname . '.png';
         } else {
             if (file_exists($dirroot . 'mod/' . $iconname . '.gif')) {
                 return $dirroot . 'mod/' . $iconname . '.gif';
             }
         }
     }
     return parent::old_icon_url($iconname, $module);
 }