From cfc80f9413917721e47eaf1e9bf7bb5cb0ff42a2 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 18 Jul 2015 20:30:29 +0300 Subject: [PATCH] allow post method links in object tools --- ipf/admin/component.php | 14 +++++++++++++- ipf/admin/templates/admin/change.html | 10 ++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ipf/admin/component.php b/ipf/admin/component.php index b69bd46..6986d0a 100644 --- a/ipf/admin/component.php +++ b/ipf/admin/component.php @@ -247,7 +247,19 @@ abstract class IPF_Admin_Component $this->_setupEditForm($form); } - $objecttools = $this->objectTools($object); + $objecttools = array(); + foreach ($this->objectTools($object) as $title => $action) { + if (!is_array($action)) { + $action = array( + 'url' => $action, + ); + } + $action['title'] = $title; + if (!array_key_exists('method', $action)) + $action['method'] = 'GET'; + $objecttools[] = $action; + } + $extraMedia = $this->extraMedia($form); return $this->fullContext(array( diff --git a/ipf/admin/templates/admin/change.html b/ipf/admin/templates/admin/change.html index df21503..a8482dd 100644 --- a/ipf/admin/templates/admin/change.html +++ b/ipf/admin/templates/admin/change.html @@ -21,8 +21,14 @@
-- 2.49.0