From 5b187e1d5d9c00431c9feac2b352ed7534b5b238 Mon Sep 17 00:00:00 2001 From: Dominik Schmelz Date: Sun, 8 Jun 2014 13:50:36 +0200 Subject: [PATCH] Update TinyMCEHelper.php 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) {...}') --- View/Helper/TinyMCEHelper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/View/Helper/TinyMCEHelper.php b/View/Helper/TinyMCEHelper.php index d08ff51..ed55921 100644 --- a/View/Helper/TinyMCEHelper.php +++ b/View/Helper/TinyMCEHelper.php @@ -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