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

From: Date: Sun, 10 Feb 2008 18:27:52 +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-50958@lists.php.net to get a copy of this message
dufuz Sun Feb 10 18:27:52 2008 UTC Modified files: /pearweb/include pear-format-html.php Log: Making user_link a lot more readable http://cvs.php.net/viewvc.cgi/pearweb/include/pear-format-html.php?r1=1.255&r2=1.256&diff_format=u Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.255 pearweb/include/pear-format-html.php:1.256 --- pearweb/include/pear-format-html.php:1.255 Tue Feb 5 18:19:59 2008 +++ pearweb/include/pear-format-html.php Sun Feb 10 18:27:51 2008 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: pear-format-html.php,v 1.255 2008/02/05 18:19:59 dufuz Exp $ + $Id: pear-format-html.php,v 1.256 2008/02/10 18:27:51 dufuz Exp $ */ PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); @@ -46,7 +46,7 @@ $in_manual = false; if (substr($self, 0, 7) == '/manual') { - if (substr($self, 7, 10) != "/index.php") { + if (substr($self, 7, 10) != '/index.php') { $in_manual = true; } @@ -644,11 +644,15 @@ return false; } - return sprintf("<a href=\"/user/%s\">%s</a>&nbsp;%s\n", - $handle, - $row['name'], - ($row['wishlist'] != "" && $compact == false ? '['.make_link('http://' . htmlspecialchars($_SERVER['HTTP_HOST']) . '/wishlist.php/' . $handle, 'Wishlist').']' : '') - ); + if ($row['wishlist'] != '' && $compact === false) { + $host = htmlspecialchars($_SERVER['HTTP_HOST']); + $link = make_link('http://' . $host . '/wishlist.php/' . $handle, 'Wishlist'); + $wish = '[' . $link . ']'; + } else { + $wish = ''; + } + + return sprintf('<a href="/user/%s">%s</a>&nbsp;%s\n', $handle, $row['name'], $wish); } /**

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