I'd like to write a local plugin that can override a renderer that is not plugin_renderer_base. Specifically I'd like to define an image using pix_url() and have it overwrite any other instances of that image in output. Looking at the pix_url() function in outputrenderers it's just a call to a pix_url method in the theme class. The comments say specifically that themes override plugins, can I change that?
/** * Return the moodle_url for an image. * * The exact image location and extension is determined * automatically by searching for gif|png|jpg|jpeg, please * note there can not be diferent images with the different * extension. The imagename is for historical reasons * a relative path name, it may be changed later for core * images. It is recommended to not use subdirectories * in plugin and theme pix directories. * * There are three types of images: * 1/ theme images - stored in theme/mytheme/pix/, * use component 'theme' * 2/ core images - stored in /pix/, * overridden via theme/mytheme/pix_core/ * 3/ plugin images - stored in mod/mymodule/pix, * overridden via theme/mytheme/pix_plugins/mod/mymodule/, * example: pix_url('comment', 'mod_glossary') * * @param string $imagename the pathname of the image * @param string $component full plugin name (aka component) or 'theme' * @return moodle_url */ public function pix_url($imagename, $component = 'moodle') { return $this->page->theme->pix_url($imagename, $component); }