From 5f292f800ee600cf6a77609b66feb31011766a16 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 30 May 2014 16:03:12 -0700 Subject: [PATCH] Smarty - Add tag {crmCrudLink} --- .../Smarty/plugins/function.crmCrudLink.php | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 CRM/Core/Smarty/plugins/function.crmCrudLink.php diff --git a/CRM/Core/Smarty/plugins/function.crmCrudLink.php b/CRM/Core/Smarty/plugins/function.crmCrudLink.php new file mode 100644 index 0000000000..a39812e370 --- /dev/null +++ b/CRM/Core/Smarty/plugins/function.crmCrudLink.php @@ -0,0 +1,68 @@ + constant('CRM_Core_Action::' . $params['action']), + 'entity_table' => $params['table'], + 'entity_id' => $params['id'], + )); + + if ($link) { + return sprintf('%s', + htmlspecialchars($link['url']), + htmlspecialchars(CRM_Utils_Array::value('title', $params, $link['title'])) + ); + } + else { + return sprintf('[%s, %s]', $params['table'], $params['id']); + } +} -- 2.25.1