@@ -148,21 +148,19 @@ public function initialize() {
148
148
$ this ->modx ->getVersionData ();
149
149
$ inRevo20 = (boolean )version_compare ($ this ->modx ->version ['full_version ' ],'2.1.0-rc1 ' ,'< ' );
150
150
151
- $ this ->modx ->regClientStartupScript ($ this ->config ['assetsUrl ' ].'jscripts/tiny_mce/ ' .$ scriptFile );
152
- $ this ->modx ->regClientStartupScript ($ this ->config ['assetsUrl ' ].'xconfig.js ' );
151
+ $ this ->modx ->controller -> addJavascript ($ this ->config ['assetsUrl ' ].'jscripts/tiny_mce/ ' .$ scriptFile );
152
+ $ this ->modx ->controller -> addJavascript ($ this ->config ['assetsUrl ' ].'xconfig.js ' );
153
153
if ($ compressJs ) {
154
- $ this ->modx ->regClientStartupScript ($ this ->config ['assetsUrl ' ].'tiny.min.js ' );
154
+ $ this ->modx ->controller -> addJavascript ($ this ->config ['assetsUrl ' ].'tiny.min.js ' );
155
155
} else {
156
- $ this ->modx ->regClientStartupScript ($ this ->config ['assetsUrl ' ].'tiny.js ' );
156
+ $ this ->modx ->controller -> addJavascript ($ this ->config ['assetsUrl ' ].'tiny.js ' );
157
157
}
158
158
159
159
$ source = $ this ->context ->getOption ('default_media_source ' ,1 );
160
- $ this ->modx ->regClientStartupHTMLBlock ('<script type="text/javascript"> ' . "\n//<![CDATA[ " . "\nvar inRevo20 = " .($ inRevo20 ? 1 : 0 ).";MODx.source = ' " .$ source ."';Tiny.lang = " . $ this ->modx ->toJSON ($ lang ). '; ' . "\n//]]> " . "\n</script> " );
160
+ $ this ->modx ->controller -> addHtml ('<script type="text/javascript"> ' . "\n//<![CDATA[ " . "\nvar inRevo20 = " .($ inRevo20 ? 1 : 0 ).";MODx.source = ' " .$ source ."';Tiny.lang = " . $ this ->modx ->toJSON ($ lang ). '; ' . "\n//]]> " . "\n</script> " );
161
161
if (!$ compressJs ) {
162
- $ this ->modx ->regClientStartupScript ($ this ->config ['assetsUrl ' ].'tinymce.panel.js ' );
162
+ $ this ->modx ->controller -> addJavascript ($ this ->config ['assetsUrl ' ].'tinymce.panel.js ' );
163
163
}
164
-
165
-
166
164
$ this ->jsLoaded = true ;
167
165
}
168
166
return $ this ->getScript ();
@@ -228,21 +226,17 @@ public function getScript() {
228
226
unset($ this ->properties ['elements ' ]);
229
227
$ richtextResource = false ; /* workaround for modx ui bug with rte tvs */
230
228
}
231
- $ this ->config ['resource ' ] = $ this ->config ['resource ' ]->toArray ();
232
229
}
233
230
$ templates = $ this ->getTemplateList ();
234
231
235
- /* get formats */
236
- //$this->properties['formats'] = $this->getFormats();
237
232
/* get JS */
238
233
unset($ this ->properties ['resource ' ]);
239
234
ob_start ();
240
235
include_once dirname (__FILE__ ).'/templates/script.tpl ' ;
241
236
$ script = ob_get_contents ();
242
237
ob_end_clean ();
243
238
244
- /* will need to do $this->modx->controller->addHtml() for Revo 2.2+ */
245
- $ this ->modx ->regClientStartupHTMLBlock ($ script );
239
+ $ this ->modx ->controller ->addHtml ($ script );
246
240
return '' ;
247
241
}
248
242
@@ -354,4 +348,4 @@ public function getFormats() {
354
348
),
355
349
),
356
350
);
357
- */
351
+ */
0 commit comments