'LinkDialog', 'insertImage' => 'LinkDialog', 'fontName' => 'FontChoice', 'fontSize' => 'FontChoice', 'formatBlock' => 'FontChoice', 'foreColor' => 'TextColor', 'hiliteColor' => 'TextColor' ); /** * JSON-encoded parameters * @var array */ protected $_jsonParams = array('captureEvents', 'events', 'plugins'); /** * dijit.Editor * * @param string $id * @param string $value * @param array $params * @param array $attribs * @return string */ public function editor($id, $value = null, $params = array(), $attribs = array()) { if (isset($params['plugins'])) { foreach ($this->_getRequiredModules($params['plugins']) as $module) { $this->dojo->requireModule($module); } } // Use a
by default, but allow degradation to \n"; } else { $html .= '_htmlAttribs($attribs) . '>' . $value . "
\n"; } return $html; } /** * Generates the list of required modules to include, if any is needed. * * @param array $plugins plugins to include * @return array */ protected function _getRequiredModules(array $plugins) { $modules = array(); foreach ($plugins as $commandName) { if (isset($this->_pluginsModules[$commandName])) { $pluginName = $this->_pluginsModules[$commandName]; $modules[] = 'dijit._editor.plugins.' . $pluginName; } } return array_unique($modules); } /** * Normalize editor element name * * @param string $name * @return string */ protected function _normalizeEditorName($name) { if ('[]' == substr($name, -2)) { $name = substr($name, 0, strlen($name) - 2); $name .= '[Editor][]'; } else { $name .= '[Editor]'; } return $name; } /** * Create onSubmit binding for element * * @param string $hiddenId * @param string $editorId * @return void */ protected function _createEditorOnSubmit($hiddenId, $editorId) { $this->dojo->onLoadCaptureStart(); echo <<dojo->onLoadCaptureEnd(); } }