From 90fec28d2cde64885807c0a0c5e28318131c0d02 Mon Sep 17 00:00:00 2001 From: bMancone Date: Tue, 8 Nov 2011 13:41:11 +0000 Subject: [PATCH] // It is now possible to add customs params when using ajax call with the 'details' action --- .../themes/template/helper/list/list_action_details.tpl | 7 +++++-- classes/AdminController.php | 1 + classes/HelperList.php | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/template/helper/list/list_action_details.tpl b/admin-dev/themes/template/helper/list/list_action_details.tpl index 4a10924d8..6cf349ce7 100644 --- a/admin-dev/themes/template/helper/list/list_action_details.tpl +++ b/admin-dev/themes/template/helper/list/list_action_details.tpl @@ -34,7 +34,10 @@ $(document).ready(function() { controller: '{$controller}', token: '{$token}', action: '{$action}', - ajax: true + ajax: true, + {foreach $params as $key => $param} + {$key}: {$param}, + {/foreach} }, context: document.body, dataType: 'json', @@ -122,4 +125,4 @@ $(document).ready(function() { {$action} - \ No newline at end of file + diff --git a/classes/AdminController.php b/classes/AdminController.php index caeb0cf0c..09a6b53b9 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -1388,6 +1388,7 @@ class AdminControllerCore extends Controller $helper->no_link = $this->list_no_link; $helper->colorOnBackground = $this->colorOnBackground; $helper->no_back = isset($this->no_back) ? $this->no_back : true; + $helper->ajax_params = $this->ajax_params; // For each action, try to add the corresponding skip elements list $helper->list_skip_actions = $this->list_skip_actions; diff --git a/classes/HelperList.php b/classes/HelperList.php index 4fde49395..e05349252 100644 --- a/classes/HelperList.php +++ b/classes/HelperList.php @@ -115,6 +115,8 @@ class HelperListCore extends Helper */ public $no_back = true; + public $ajax_params = array(); + public function __construct() { $this->base_folder = 'helper/list/'; @@ -393,6 +395,7 @@ class HelperListCore extends Helper 'controller' => str_replace('Controller', '', get_class($this->context->controller)), 'token' => $this->token, 'action' => self::$cache_lang['Details'], + 'params' => $this->ajax_params )); return $tpl->fetch(); }