From 712c25b10bf40b5bc17cc785fb3d4d7ded3930b8 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 11 Aug 2006 10:33:29 +0000 Subject: [PATCH] Tidy up code flow in helpbutton. --- lib/weblib.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 632f548b77..e9f705c963 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4307,6 +4307,7 @@ function print_error ($errorcode, $module='', $link='', $a=NULL) { * 'Help with' (or the language equivalent) will be prefixed and '...' will be stripped. * @param string $module Which module is the page defined in * @param mixed $image Use a help image for the link? (true/false/"both") + * @param boolean $linktext If true, display the title next to the help icon. * @param string $text If defined then this text is used in the page, and * the $page variable is ignored. * @param boolean $return If true then the output is returned as a string, if false it is printed to the current page. @@ -4330,15 +4331,16 @@ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext= $linkobject = ''; if ($image) { - if ($imagetext == '') { - $imagetext = ''.$tooltip.''; - } if ($linktext) { $linkobject .= $title.' '; } - $linkobject .= $imagetext; + if ($imagetext) { + $linkobject .= $imagetext; + } else { + $linkobject .= ''.$tooltip.''; + } } else { $linkobject .= $tooltip; -- 2.39.5