From 088598ba28432acefb8384345e9863ccd16878a4 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 7 Apr 2017 17:22:06 +0800 Subject: [PATCH] MDL-58538 core: Set proper PHP Documentation for pix_url() Add @deprecated tag for theme_config::pix_url(). Add PHPDoc block for renderer_base::pix_url(). --- lib/outputlib.php | 3 ++- lib/outputrenderers.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 77ee70ea0e0..5fe61d348db 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1646,12 +1646,13 @@ class theme_config { * * Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template. * + * @deprecated since Moodle 3.3 * @param string $imagename the name of the icon. * @param string $component specification of one plugin like in get_string() * @return moodle_url */ public function pix_url($imagename, $component) { - debugging('pix_url is deprecated. Use image_url for images and pix_icon for icons.'); + debugging('pix_url is deprecated. Use image_url for images and pix_icon for icons.', DEBUG_DEVELOPER); return $this->image_url($imagename, $component); } diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index c57bb73bec3..7406646d05b 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -253,8 +253,18 @@ class renderer_base { return $classes; } + /** + * Return the direct URL for an image from the pix folder. + * + * Use this function sparingly and never for icons. For icons use pix_icon or the pix helper in a mustache template. + * + * @deprecated since Moodle 3.3 + * @param string $imagename the name of the icon. + * @param string $component specification of one plugin like in get_string() + * @return moodle_url + */ public function pix_url($imagename, $component = 'moodle') { - debugging('pix_url is deprecated. Use image_url for images and pix_icon for icons.'); + debugging('pix_url is deprecated. Use image_url for images and pix_icon for icons.', DEBUG_DEVELOPER); return $this->page->theme->image_url($imagename, $component); }