MODx Manager does not give TVs specific permanent identifiers, so it would be rather difficult to target any one TVThat statement is just plain wrong!!
tinymce.init({ mode : "exact", selector : "#tv12.modx-richtext, #tv13.modx-richtext", //where 12 and 13 are the IDs of your Question TV and Answer TV ...})
tinymce.init({ selector : "#tv12.modx-richtext", ...}) tinymce.init({ selector : " #tv13.modx-richtext", ...})
/** * Invokes a specified Event with an optional array of parameters. * * @todo refactor this completely, yuck!! * * @access public * @param string $eventName Name of an event to invoke. * @param array $params Optional params provided to the elements registered with an event. * @return bool|array */ public function invokeEvent($eventName, array $params= array ()) { if (!$eventName) return false; if ($this->eventMap === null && $this->context instanceof modContext) $this->_initEventMap($this->context->get('key')); if (!isset ($this->eventMap[$eventName])) { //$this->log(modX::LOG_LEVEL_DEBUG,'System event '.$eventName.' was executed but does not exist.'); return false; } $oldEventName = $this->event->name;//store current eventname $results= array (); if (count($this->eventMap[$eventName])) { $this->event= new modSystemEvent(); foreach ($this->eventMap[$eventName] as $pluginId => $pluginPropset) { $plugin= null; $this->Event= & $this->event; $this->event->resetEventObject(); $this->event->name= $eventName; if (isset ($this->pluginCache[$pluginId])) { $plugin= $this->newObject('modPlugin'); $plugin->fromArray($this->pluginCache[$pluginId], '', true, true); $plugin->_processed = false; if ($plugin->get('disabled')) { $plugin= null; } } else { $plugin= $this->getObject('modPlugin', array ('id' => intval($pluginId), 'disabled' => '0'), true); } if ($plugin && !$plugin->get('disabled')) { $this->event->activated= true; $this->event->activePlugin= $plugin->get('name'); $this->event->propertySet= (($pspos = strpos($pluginPropset, ':')) >= 1) ? substr($pluginPropset, $pspos + 1) : ''; /* merge in plugin properties */ $eventParams = array_merge($plugin->getProperties(),$params); $msg= $plugin->process($eventParams); $results[]= $this->event->_output; if ($msg && is_string($msg)) { $this->log(modX::LOG_LEVEL_ERROR, '[' . $this->event->name . ']' . $msg); } elseif ($msg === false) { $this->log(modX::LOG_LEVEL_ERROR, '[' . $this->event->name . '] Plugin failed!'); } $this->event->activePlugin= ''; $this->event->propertySet= ''; if (!$this->event->isPropagatable()) { break; } } } } $this->event->name= $oldEventName;//get eventname back after looping return $results; }
tinymce.init({ mode: "exact", elements: "tv[[+tv_id]]", [[$TinymceWrapperCommonCode]] plugins:"autoresize,preview,paste,contextmenu,image,wordcount,fullscreen,code,link,charmap,searchreplace,textpattern,emoticons,insertdatetime", paste_word_valid_elements: "a,div,b,strong,i,em,h1,h2,h3,p,blockquote,ol,ul,pre", valid_elements: "iframe[*],object[*],audio[*],-span[!title|!class<test test2],a[href|target|class|rel|title|data-ajax|data-iframe],strong,b,-p[class<text-align-left?text-align-center?text-align-right],br,-h1[class|data-ajax|data-iframe],-h2[class|data-ajax|data-iframe],-h3[class|data-ajax|data-iframe],-img[!src|!alt|!class=round_img|data-ajax|data-iframe],em,-blockquote,pre[class],-ol,-ul,-li,-code[class]", valid_children: "-li[ul],-li[ol],-li[div],-strong[*],-em[*],-h1[*],-h2[*],-h3[*],-a[strong|em|h1|h2|h3|p|div],blockquote[p|ol|ul],pre,div", resize:true, autoresize_min_height:100, autoresize_max_height:400, toolbar: "newdocument | fullscreen preview | undo redo | blockquote | bold | italic | aligncenter | bullist numlist | link unlink | image | styleselect | charmap emoticons insertdatetime | searchreplace", contextmenu: "removeformat | link | image | code", setup: function(editor) { editor.on('mouseleave', function(evt) { tinyMCE.activeEditor.save(); //console.log("saved");//debug stuff }); } });
[[+commonTinyMCECode]]
[[$TinymceWrapperCommonCode]]
Costello: I don't even know what I'm talking about!https://www.youtube.com/watch?v=kTcRRaXV-fg
tinymce.init({ mode: "exact", elements: "tv[[+tv_id]]", [[$TinymceWrapperCommonCode]]...
public function invokeEvent($eventName, array $params= array ()) { if (!$eventName)
IT SEEMS YOU DON'T HAVE PERMISSION TO USE THIS COOL MANAGER
if ($modx->user->isMember(array('Administrator','xxxxx'))){