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 1862137 commit 0c1ed0b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Resources/contao/dca/tl_calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,15 @@ public function toggleVisibility($intId, $blnVisible)
{
foreach ($GLOBALS['TL_DCA']['tl_calendar_events']['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 0c1ed0b

Please sign in to comment.