Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Support using closures as DCA callbacks (see #5772)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Sep 20, 2013
1 parent 0cde71e commit c696161
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions contao/dca/tl_faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,15 @@ public function toggleVisibility($intId, $blnVisible)
{
foreach ($GLOBALS['TL_DCA']['tl_faq']['fields']['published']['save_callback'] as $callback)
{
$this->import($callback[0]);
$blnVisible = $this->$callback[0]->$callback[1]($blnVisible, $this);
if (is_array($callback))
{
$this->import($callback[0]);
$blnVisible = $this->$callback[0]->$callback[1]($blnVisible, $this);
}
elseif (is_callable($callback))
{
$blnVisible = $callback($blnVisible, $this);
}
}
}

Expand Down

0 comments on commit c696161

Please sign in to comment.