baseUrl/img", 'CSS', "$this->baseUrl/css/cake.generic.css", 'EditorCSS', "body{background:white; color:black;}", 'Lang', "fr", 'BackgroundColor', "#003d4c", 'IndentOutput', "true", 'ToolbarWysiwyg', "undo,redo,, ordered-list, unordered-list, definition-list,, draw-layout-table, draw-data-table, image, separator, hyperlink,, source, preview, screen-reader, help" ); //******Finished editing ;) $this->Javascript->cacheEvents(false,true); $params = ''; foreach($specific_xstandard_params as $k => $v){ $params .= "\t"."obj.appendChild( new Element('param', {name: '$k', value: '$v'}));"."\n"; } $this->Javascript->codeBlock(" function renderXstandard(textAreaId, objectId, objectWidth, objectHeight){ /*creation of the elements*/ var textArea = $(textAreaId); var obj = new Element('object', {type: 'application/x-xstandard', id: objectId, width:objectWidth, height:objectHeight}); obj.appendChild( new Element('param', {name: 'Value', value: textArea.value})); $params /*generation into the page*/ textArea.insert({before : obj}); obj.appendChild (textArea); }"); if(!is_array($textAreaId)){ $textAreaId = a($textAreaId); } $function_called = ''; foreach ($textAreaId as $id){ $this->_generate_wysiwyg($id, $objectWidth, $objectHeight); $function_called .= 'Sync'.$id.'(); '; } $this->Javascript->event($formId, 'submit', $function_called); return $this->Javascript->event('window', 'load', "\n".$this->Javascript->getCache()."\n", array('inline' => false)); } function _generate_wysiwyg($textAreaId, $objectWidth, $objectHeight){ $this->count++; $objectId = $this->objectId.$this->count; $this->Javascript->codeBlock(" /*Generated for each textarea*/ renderXstandard('$textAreaId', '$objectId', '$objectWidth', '$objectHeight'); function Sync$textAreaId() { $('$textAreaId').value = $('$objectId').value; }"); } } ?>