cvs: pearweb /include pear-format-html.php

From: Date: Sun, 22 Apr 2007 05:44:23 +0000
Subject: cvs: pearweb /include pear-format-html.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-46102@lists.php.net to get a copy of this message
dufuz Sun Apr 22 05:44:23 2007 UTC Modified files: /pearweb/include pear-format-html.php Log: Add the ability to have the title attribute in make_link http://cvs.php.net/viewvc.cgi/pearweb/include/pear-format-html.php?r1=1.201&r2=1.202&diff_format=u Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.201 pearweb/include/pear-format-html.php:1.202 --- pearweb/include/pear-format-html.php:1.201 Sat Mar 31 03:59:01 2007 +++ pearweb/include/pear-format-html.php Sun Apr 22 05:44:23 2007 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: pear-format-html.php,v 1.201 2007/03/31 03:59:01 cellog Exp $ + $Id: pear-format-html.php,v 1.202 2007/04/22 05:44:23 dufuz Exp $ */ PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); @@ -327,16 +327,16 @@ <?php echo htmlspecialchars($GLOBALS['ONLOAD']); ?> } -function addEvent(obj, eventType, functionCall){ - if (obj.addEventListener){ - obj.addEventListener(eventType, functionCall, false); - return true; - } else if (obj.attachEvent){ - var r = obj.attachEvent("on"+eventType, functionCall); - return r; - } else { - return false; - } +function addEvent(obj, eventType, functionCall){ + if (obj.addEventListener){ + obj.addEventListener(eventType, functionCall, false); + return true; + } else if (obj.attachEvent){ + var r = obj.attachEvent("on"+eventType, functionCall); + return r; + } else { + return false; + } } addEvent(window, 'load', makeFocus); </script> @@ -842,12 +842,13 @@ /** * Returns a hyperlink to something */ -function make_link($url, $linktext = '', $target = '', $extras = '') +function make_link($url, $linktext = '', $target = '', $extras = '', $title = '') { - return sprintf('<a href="%s"%s%s>%s</a>', + return sprintf('<a href="%s"%s%s%s>%s</a>', $url, ($target ? ' target="'.$target.'"' : ''), ($extras ? ' '.$extras : ''), + ($title ? ' title="'.$title.'"' : ''), ($linktext != '' ? $linktext : $url) ); }

« previous php.pear.cvs (#46102) next »