1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 00:54:49 +02:00

Issue #3695 e_admin addon - list mode with custom methods fixed.

This commit is contained in:
Cameron
2019-03-04 12:41:10 -08:00
parent 037c7c67ff
commit b5032c2477
4 changed files with 55 additions and 40 deletions

View File

@@ -5559,15 +5559,25 @@ var_dump($select_options);*/
$meth = (!empty($attributes['method'])) ? $attributes['method'] : $method;
if(method_exists($this,$meth))
if(strpos($meth,'::')!==false)
{
$parms['field'] = $field;
$mode = (!empty($attributes['mode'])) ? $attributes['mode'] :'read';
$value = call_user_func_array(array($this, $meth), array($value, $mode, $parms));
list($className,$meth) = explode('::', $meth);
$cls = new $className();
}
else
{
$className = get_class($this);
$cls = $this;
}
if(method_exists($cls,$meth))
{
$parms['field'] = $field;
$mode = (!empty($attributes['mode'])) ? $attributes['mode'] :'read';
$value = call_user_func_array(array($cls, $meth), array($value, $mode, $parms));
}
else
{
$className = get_class($cls);
e107::getDebug()->log("Missing Method: ".$className."::".$meth." ".print_a($attributes,true));
return "<span class='label label-important label-danger'>Missing Method</span>";
}