From 3d5b79f8ac44a4964253d7d6d4d251db03498ce5 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 7 Nov 2013 11:31:05 -0500 Subject: [PATCH] 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. --- lib/functions.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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() { -- 2.7.4