From 4bc990f9c0a5da9e42f5ed58917cf051e1eacc0f Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 26 Jun 2015 12:06:21 +0200 Subject: Split out code to generate action links Add (and use) two new helper functions html_account_link() and html_account_form() to generate the links in the package actions box. Signed-off-by: Lukas Fleischer --- web/lib/aur.inc.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'web/lib') diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index 7f923d75..95f72cef 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -221,6 +221,43 @@ function html_format_maintainers($maintainer, $comaintainers) { return $code; } +/** + * Format a link in the package actions box + * + * @param string $uri The link target + * @param string $desc The link label + * + * @return string The generated HTML code for the action link + */ +function html_action_link($uri, $desc) { + $code = ''; + $code .= htmlspecialchars($desc) . ''; + + return $code; +} + +/** + * Format a form in the package actions box + * + * @param string $uri The link target + * @param string $action The action name (passed as HTTP POST parameter) + * @param string $desc The link label + * + * @return string The generated HTML code for the action link + */ +function html_action_form($uri, $action, $desc) { + $code = '
'; + $code .= ''; + $code .= '
'; + + return $code; +} + /** * Determine the user's e-mail address in the database using a session ID * -- cgit v1.2.3-24-g4f1b