diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 4cce0a4d0..fd3028279 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -8780,29 +8780,48 @@ class e_admin_form_ui extends e_form break; case 'method': - $method = $key; - $list = call_user_func_array(array($this, $method), array('', $type, $parms)); - if(is_array($list)) + $method = !empty($val['method']) ? $val['method'] : $key; // Use the method attribute if specified, otherwise fall back to the field key + + if(strpos($method, '::') !== false) { - //check for single option - if(isset($list['singleOption'])) + list($className, $methodName) = explode('::', $method); + $cls = new $className(); + } + else + { + $cls = $this; + $methodName = $method; + } + + if(method_exists($cls, $methodName)) + { + $list = call_user_func_array(array($cls, $methodName), array('', $type, $parms)); + if(is_array($list)) { - $textsingle .= $list['singleOption']; + // Check for single option + if(isset($list['singleOption'])) + { + $textsingle .= $list['singleOption']; + continue 2; + } + // options array + foreach($list as $k => $name) + { + $option[$key . '__' . $k] = $name; + } + } + elseif(!empty($list)) + { + $text .= $list; continue 2; } - // non rendered options array - foreach($list as $k => $name) - { - $option[$key.'__'.$k] = $name; - } } - elseif(!empty($list)) //optgroup, continue + else { - $text .= $list; - continue 2; + e107::getDebug()->log('Missing Method: ' . get_class($cls) . '::' . $methodName); } - break; + break; case 'user': // TODO - User Filter diff --git a/e107_plugins/_blank/e_event.php b/e107_plugins/_blank/e_event.php index b3fbfb884..9ef3d3298 100644 --- a/e107_plugins/_blank/e_event.php +++ b/e107_plugins/_blank/e_event.php @@ -61,12 +61,12 @@ class _blank_event // plugin-folder + '_event' } - function myfunction($data) // the method to run. + function myfunction($data, $event) // the method to run. { // var_dump($data); } - function anotherfunction($data) // the method to run. + function anotherfunction($data, $event) // the method to run. { // var_dump($data); }