From: Iain Patterson Date: Thu, 7 Nov 2013 16:31:05 +0000 (-0500) Subject: Added get_small_link_with_id() function. X-Git-Tag: 2013-11-07~2 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=3d5b79f8ac44a4964253d7d6d4d251db03498ce5;p=readifood.git Added get_small_link_with_id() function. The get_small_link_with_id() function behaves the same as get_small_link() except that the returned tag includes an ID suitable for use with jQuery. --- diff --git a/lib/functions.php b/lib/functions.php index eb48c4b..f1e7145 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -536,12 +536,21 @@ } } - function get_small_link() { - /* Args are , , [ ...] */ + function get_small_link_with_id() { + /* Args are , , , [ ...] */ $args = func_get_args(); + $id = array_shift($args); + if (isset($id)) $id = " id=\"$id\""; $html = htmlspecialchars(array_shift($args)); $url = array_shift($args); - return vsprintf("$html\n", $args); + return vsprintf("$html\n", $args); + } + + function get_small_link() { + /* Args are , , [ ...] */ + $args = func_get_args(); + array_unshift($args, null); + return call_user_func_array("get_small_link_with_id", $args); } function small_link() {