Skip to content

Commit

Permalink
Update TinyMCEHelper.php
Browse files Browse the repository at this point in the history
Add feature that allows to pass a function in configuration.

This is needed for file browser callback - since it's not passed as a string anymore:
'file_browser_callback' => array('function' => 'function myBrowser (field_name, url, type, win) {...}')
  • Loading branch information
DIDoS authored and Florian Krämer committed Jul 7, 2014
1 parent 60c53a4 commit 5b187e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion View/Helper/TinyMCEHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ public function editor($options = array()) {
$lines = '';

foreach ($options as $option => $value) {
$lines .= Inflector::underscore($option) . ' : "' . $value . '",' . "\n";
if (is_array($value) && isset($value['function'])) {
$lines .= $option . ' : ' . $value['function'] . ',' . "\n";
} else {
$lines .= Inflector::underscore($option) . ' : "' . $value . '",' . "\n";
}
}

// remove last comma from lines to avoid the editor breaking in Internet Explorer
Expand Down

0 comments on commit 5b187e1

Please sign in to comment.