From 3a4aea45d5662425aad88e557cf3370cd404d925 Mon Sep 17 00:00:00 2001 From: "green-ponies (jgen)" Date: Fri, 12 Aug 2011 21:56:48 -0400 Subject: [PATCH] Small addition for giving forms unique IDs. Mainly so that javascript has something to hook onto. --- core/util.inc.php | 5 +++-- ext/image/theme.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/util.inc.php b/core/util.inc.php index 358dbeb0..7b51be91 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -218,13 +218,14 @@ function make_http($link) { /** * Make a form tag with relevant auth token and stuff + * (Added optional Form ID field for helping jquery.) * * @retval string */ -function make_form($target, $method="POST", $multipart=False) { +function make_form($target, $method="POST", $multipart=False, $form_id="") { global $user; $auth = $user->get_auth_html(); - $extra = ""; + $extra = empty($form_id) ? '' : " id='$form_id'"; if($multipart) { $extra .= " enctype='multipart/form-data'"; } diff --git a/ext/image/theme.php b/ext/image/theme.php index e1554af4..c42ff5c5 100644 --- a/ext/image/theme.php +++ b/ext/image/theme.php @@ -10,7 +10,7 @@ class ImageIOTheme { $i_image_id = int_escape($image_id); $html = " - ".make_form(make_link("image_admin/delete"))." + ".make_form(make_link("image_admin/delete"),'POST',false,'delete_image')."