mirror of
https://github.com/e107inc/e107.git
synced 2025-08-20 13:21:54 +02:00
Event hooks now allows for multiple form elements.
Also added $frm->renderHooks($data).
This commit is contained in:
@@ -1551,6 +1551,47 @@ class e_form
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render Table cells from hooks.
|
||||
* @param array $data
|
||||
* @return string
|
||||
*/
|
||||
function renderHooks($data)
|
||||
{
|
||||
$hooks = e107::getEvent()->triggerHook($data);
|
||||
|
||||
$text = "";
|
||||
|
||||
if(!empty($hooks))
|
||||
{
|
||||
foreach($hooks as $plugin => $hk)
|
||||
{
|
||||
$text .= "\n\n<!-- Hook : {$plugin} -->\n";
|
||||
|
||||
if(!empty($hk))
|
||||
{
|
||||
foreach($hk as $hook)
|
||||
{
|
||||
$text .= "\t\t\t<tr>\n";
|
||||
$text .= "\t\t\t<td>".$hook['caption']."</td>\n";
|
||||
$text .= "\t\t\t<td>".$hook['html']."";
|
||||
$text .= (varset($hook['help'])) ? "\n<span class='field-help'>".$hook['help']."</span>" : "";
|
||||
$text .= "</td>\n\t\t\t</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Render Table cells from field listing.
|
||||
* @param array $fieldarray - eg. $this->fields
|
||||
|
Reference in New Issue
Block a user