From ccfcf2a086b4008e96b171e842a1b6d16f386489 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 16 Dec 2021 14:43:33 -0700 Subject: [PATCH] Add a hook for before get_rows is called --- api/src/Etemplate/Widget/Nextmatch.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/src/Etemplate/Widget/Nextmatch.php b/api/src/Etemplate/Widget/Nextmatch.php index 10004d276e..897f79ab78 100644 --- a/api/src/Etemplate/Widget/Nextmatch.php +++ b/api/src/Etemplate/Widget/Nextmatch.php @@ -602,6 +602,19 @@ class Nextmatch extends Etemplate\Widget } $raw_rows = array(); if (!is_array($readonlys)) $readonlys = array(); + + // allow other apps to mess with query + Api\Hooks::process( + array( + 'hook_location' => 'etemplate2_before_get_rows', + 'get_rows' => $method, + 'value' => &$value, + 'rows' => &$rows, + 'readonlys' => &$readonlys, + 'total' => &$total, + ), array(), true + ); + if(is_callable($method)) // php5.2.3+ static call (value is always a var param!) { $total = call_user_func_array($method,array(&$value,&$raw_rows,&$readonlys));