1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: class cTinymce4Configuration {
19: private $_perm = false;
20: private $_configErrors = array();
21:
22: 23: 24: 25:
26: public function __construct() {
27:
28: $this->_perm = ('sysadmin' === cRegistry::getAuth()->getPerms());
29: }
30:
31: 32: 33: 34: 35: 36: 37: 38:
39: private function _addLabelWithTextarea($description, $name, $value = '', $width = 75) {
40: $label = new cHTMLLabel($description, $name);
41: $label->setClass("sys_config_txt_lbl");
42: $label->setStyle('width:' . $width . 'px; vertical-align: top;');
43:
44: $textarea = new cHTMLTextarea($name);
45: $textarea->setValue($value);
46: $textarea->setAttribute('style', 'box-sizing: border-box; width: 600px;');
47: if (false === $this->_perm) {
48: $textarea->updateAttribute('disabled', 'disabled');
49: }
50: $div = new cHTMLDiv($label . $textarea, 'systemSetting');
51:
52: return $div;
53: }
54:
55: 56: 57: 58: 59: 60: 61: 62:
63: private function _addLabelWithCheckbox($description, $name, $value, $checked) {
64: $checkBox = new cHTMLCheckbox($name, $value, str_replace('[]', '_', $name . $value), (true === $checked));
65: $checkBox->setLabelText($description);
66:
67: if (false === $this->_perm) {
68: $checkBox->updateAttribute('disabled', 'disabled');
69: }
70:
71: return $checkBox;
72: }
73:
74: 75: 76: 77: 78: 79:
80: private function _checkType($type, $value) {
81: if (true === empty($value)) {
82: return true;
83: }
84: if (true === isset($value)) {
85:
86:
87: return (1 === preg_match($type, $value));
88: }
89:
90: return false;
91: }
92:
93: private function _checkIsset(array $haystack, array $needles) {
94: if (count($haystack) !== count($needles)) {
95: return false;
96: }
97: foreach ($needles as $needle) {
98: if (false === isset($haystack[$needle])) {
99: return false;
100: }
101: }
102:
103: return true;
104: }
105:
106: 107: 108: 109: 110:
111: private function _listExternalPlugins($cmsType) {
112:
113: $externalPlugins = static::get(array(), 'raw', $cmsType, 'externalplugins');
114:
115:
116: $table = new cHTMLTable();
117: $table->setClass('generic');
118:
119:
120: $headrow = new cHTMLTableRow();
121:
122:
123: $col = new cHTMLTableHead();
124: $col->appendContent(i18n('Name'));
125: $headrow->appendContent($col);
126:
127:
128: $col = new cHTMLTableHead();
129: $col->appendContent(i18n('URL'));
130: $headrow->appendContent($col);
131:
132:
133: $col = new cHTMLTableHead();
134: $col->appendContent(i18n('Action'));
135: $headrow->appendContent($col);
136:
137:
138: $table->appendContent($headrow);
139:
140:
141: $tbody = new cHTMLTableBody();
142: $i = 0;
143: $n = count($externalPlugins);
144: for ($i; $i < $n; $i++) {
145:
146: $row = new cHTMLTableRow();
147:
148:
149: $td = new cHTMLTableData();
150: $td->appendContent($externalPlugins[$i]['name']);
151:
152:
153: $input = new cHTMLFormElement();
154: $input->setAttribute('type', 'hidden');
155: $input->setAttribute('name', $cmsType . '[externalplugins][' . $i . '][name]');
156: $input->setAttribute('value', $externalPlugins[$i]['name']);
157: $td->appendContent($input);
158:
159:
160: $row->appendContent($td);
161:
162:
163: $td = new cHTMLTableData();
164: $td->appendContent($externalPlugins[$i]['url']);
165:
166:
167: $input = new cHTMLFormElement();
168: $input->setAttribute('type', 'hidden');
169: $input->setAttribute('name', $cmsType . '[externalplugins][' . $i . '][url]');
170: $input->setAttribute('value', $externalPlugins[$i]['url']);
171: $td->appendContent($input);
172:
173:
174: $row->appendContent($td);
175:
176:
177: $td = new cHTMLTableData();
178: if (true === $this->_perm) {
179:
180: $oLinkDelete = new cHTMLLink();
181: $oLinkDelete->setCLink(cRegistry::getArea(), cRegistry::getFrame(), "system_wysiwyg_tinymce4_delete_item");
182: $oLinkDelete->setCustom("external_plugin_idx", urlencode($i));
183: $oLinkDelete->setCustom('cmstype', $cmsType);
184: $img = new cHTMLImage(cRegistry::getBackendUrl() . cRegistry::getConfigValue('path', 'images') . 'delete.gif');
185: $img->setAttribute('alt', i18n("Delete"));
186: $img->setAttribute('title', i18n("Delete"));
187: $oLinkDelete->appendContent($img);
188: $td->appendContent($oLinkDelete);
189: }
190:
191:
192: $row->appendContent($td);
193:
194:
195: $tbody->appendContent($row);
196: }
197:
198: $row = new cHTMLTableRow();
199:
200:
201: $td = new cHTMLTableData();
202: $input = new cHTMLFormElement($cmsType . '[externalplugins][' . $i . '][name]');
203: $td->appendContent($input);
204: $row->appendContent($td);
205:
206:
207: $td = new cHTMLTableData();
208: $input = new cHTMLFormElement($cmsType . '[externalplugins][' . $i . '][url]');
209: $td->appendContent($input);
210: $row->appendContent($td);
211:
212:
213: $td = new cHTMLTableData();
214: $row->appendContent($td);
215:
216:
217: $tbody->appendContent($row);
218:
219:
220:
221: $table->appendContent($tbody);
222:
223:
224: return $table->render();
225: }
226:
227: 228: 229: 230: 231:
232: private function _validateToolbarN($toolbarData) {
233:
234: if (false === $this->_checkType('/^[a-zA-Z0-9 \-\|_]*$/', $toolbarData)
235: || false !== strpos($toolbarData, '||')) {
236: return false;
237: }
238:
239: return true;
240: }
241:
242: 243: 244: 245: 246:
247: public static function get($default) {
248: $cfg = cRegistry::getConfig();
249: if (false === isset($cfg['wysiwyg'])
250: || false === isset($cfg['wysiwyg']['tinymce4'])) {
251: $configPath = cRegistry::getConfigValue('path', 'contenido_config') . 'config.wysiwyg_tinymce4.php';
252:
253: if (true !== cFileHandler::exists($configPath)) {
254: return $default;
255: }
256:
257: if (true !== cFileHandler::readable($configPath)) {
258: return $default;
259: }
260:
261: require_once($configPath);
262: }
263:
264:
265: $numargs = func_num_args();
266: if (0 === $numargs) {
267: return $default;
268: }
269:
270:
271: $result = cRegistry::getConfig();
272:
273:
274: if (false === isset($result['wysiwyg'])) {
275: return $default;
276: }
277: if (false === $result['wysiwyg']['tinymce4']) {
278: return $default;
279: }
280: $result = $result['wysiwyg']['tinymce4'];
281:
282: for ($i = 0; $i < $numargs -1; $i++) {
283: if (false === isset($result[func_get_arg(1 + $i)])) {
284: return $default;
285: }
286:
287: $result = $result[func_get_arg(1 + $i)];
288: }
289:
290: return $result;
291: }
292:
293: 294: 295: 296: 297:
298: public function validateForm($config) {
299:
300:
301:
302: if ('sysadmin' !== cRegistry::getAuth()->getPerms()) {
303: return false;
304: }
305:
306:
307: unset($config['area']);
308:
309: unset($config['frame']);
310:
311: unset($config['contenido']);
312:
313:
314: unset($config['submit_x']);
315: unset($config['submit_y']);
316:
317:
318:
319: if (isset($_POST['reset'])) {
320: $noti = new cGuiNotification();
321:
322:
323: $configPath = cRegistry::getConfigValue('path', 'contenido_config');
324: $configPath .= 'config.wysiwyg_tinymce4.php';
325: if (cFileHandler::exists($configPath)
326: && cFileHandler::writeable($configPath)) {
327: cFileHandler::remove($configPath);
328: $noti->displayNotification(cGuiNotification::LEVEL_INFO, i18n('TinyMCE 4 configuration got reset back to default'));
329: } else {
330:
331: $noti->displayNotification(cGuiNotification::LEVEL_ERROR, i18n('Can not delete config file'));
332: }
333:
334:
335: return false;
336: }
337:
338:
339:
340: $shouldArrayStructure = array (
341: 'tinymce4_full' =>
342: array (
343: 'toolbar1',
344: 'toolbar2',
345: 'toolbar3',
346: 'plugins'
347: ),
348: 'tinymce4_fullscreen' =>
349: array (
350: 'toolbar1',
351: 'toolbar2',
352: 'toolbar3',
353: 'plugins'
354: ),
355: 'contenido_lists',
356: 'contenido_gzip',
357: 'custom',
358: 'externalplugins'
359: );
360:
361: reset($config);
362: $key = key($config);
363:
364: if (false === $this->_checkIsset($config[$key]['tinymce4_full'], $shouldArrayStructure['tinymce4_full'])) {
365: $this->_configErrors[] = i18n('Fullscreen config of inline editor is erroneous.');
366: return false;
367: }
368: if (false === $this->_checkIsset($config[$key]['tinymce4_fullscreen'], $shouldArrayStructure['tinymce4_fullscreen'])) {
369: $this->_configErrors[] = i18n('Config of editor on separate editor page is erroneous.');
370: return false;
371: }
372: if (false === isset($config[$key]['custom'])) {
373: $this->_configErrors[] = i18n('Custom configuration of tinyMCE 4 is not set.');
374: return false;
375: }
376:
377:
378: if (false === $this->_validateToolbarN($config[$key]['tinymce4_full']['toolbar1'])
379: || false === $this->_validateToolbarN($config[$key]['tinymce4_full']['toolbar2'])
380: || false === $this->_validateToolbarN($config[$key]['tinymce4_full']['toolbar3'])
381: || false === $this->_validateToolbarN($config[$key]['tinymce4_fullscreen']['toolbar1'])
382: || false === $this->_validateToolbarN($config[$key]['tinymce4_fullscreen']['toolbar2'])
383: || false === $this->_validateToolbarN($config[$key]['tinymce4_fullscreen']['toolbar3'])) {
384: $this->_configErrors[] = i18n('Toolbar(s) of editor contain erroneous data.');
385: return false;
386: }
387:
388:
389: $lastExternalPlugin = $config[$key]['externalplugins'][count($config[$key]['externalplugins']) -1];
390: if ('' === $lastExternalPlugin['name']
391: && '' === $lastExternalPlugin['url']) {
392: unset($config[$key]['externalplugins'][count($config[$key]['externalplugins']) -1]);
393: }
394:
395:
396: if (cRegistry::getConfigValue('simulate_magic_quotes') === true) {
397: $config[$key]['custom'] = stripslashes($config[$key]['custom']);
398: }
399:
400:
401: $customConfig = (array) json_decode($config[$key]['custom'], true);
402: switch(json_last_error()) {
403: case JSON_ERROR_DEPTH:
404: $this->_configErrors[] = i18n('Maximum stack depth exceeded while decoding json');
405: return false;
406: case JSON_ERROR_CTRL_CHAR:
407: $this->_configErrors[] = i18n('Unexpected control character found');
408: return false;
409: case JSON_ERROR_SYNTAX:
410: $this->_configErrors[] = i18n('Syntax error, malformed JSON');
411: return false;
412: }
413:
414:
415: $origConfig = static::get(array(), 'raw');
416: $config['raw'] = array_merge($origConfig, $config);
417:
418:
419:
420: if (JSON_ERROR_NONE === json_last_error()) {
421: $config[$key] = array_merge($config[$key], $customConfig);
422: }
423: unset($config[$key]['custom']);
424:
425:
426:
427: $origConfig = static::get(array(), 'tinymce4');
428: $config = array_merge($origConfig, $config);
429: $res = array('tinymce4' => array('tinymce4' =>$config));
430:
431: $res['tinymce4']['raw'] = $res['tinymce4']['tinymce4']['raw'];
432: unset($res['tinymce4']['tinymce4']['raw']);
433:
434:
435: return $res;
436: }
437:
438: 439: 440: 441:
442: public function removeExternalPluginLoad($form) {
443:
444: if (false === $this->_perm) {
445: return;
446: }
447:
448: $pluginToRemoveIdx = (int) $form['external_plugin_idx'];
449:
450:
451: $settings = static::get(false);
452:
453:
454: if (false === $settings
455: || false === isset($settings['raw']['externalplugins'])
456: || false === isset($settings['raw']['externalplugins'])
457: || false === isset($settings['raw']['externalplugins'][$pluginToRemoveIdx])) {
458: return;
459: }
460:
461:
462: unset($settings['raw']['externalplugins'][$pluginToRemoveIdx]);
463:
464: $settings['raw']['externalplugins'] = array_values($settings['raw']['externalplugins']);
465:
466:
467: $settings['tinymce4']['externalplugins'] = $settings['raw']['externalplugins'];
468:
469:
470: global $cfg;
471: $cfg['wysiwyg']['tinymce4'] = $settings;
472:
473:
474: cTinyMCE4Editor::safeConfig(array('tinymce4' => $settings));
475: }
476:
477: 478: 479:
480: public function showConfigurationForm() {
481: $page = new cGuiPage('system_wysiwyg_tinymce4', '', '5');
482: $auth = cRegistry::getAuth();
483: $frame = cRegistry::getFrame();
484: $area = cRegistry::getArea();
485:
486:
487: if (false === cRegistry::getPerm()->have_perm_area_action($area, 'edit_system_wysiwyg_tinymce4')) {
488: $page->displayCriticalError(i18n('Access denied'));
489: $page->render();
490: return;
491: }
492:
493: if (count($this->_configErrors) > 0) {
494: $errorMessage = i18n('The following errors occurred when trying to verify configuration:') . '<ul>';
495: foreach ($this->_configErrors as $error) {
496: $errorMessage .= '<li>' . $error . '</li>';
497: }
498: $errorMessage .= '</ul>';
499: $page->displayError($errorMessage);
500: }
501:
502: $page->displayInfo(i18n('Currently active WYSIWYG editor: ' . cWYSIWYGEditor::getCurrentWysiwygEditorName()));
503:
504:
505: $oTypeColl = new cApiTypeCollection();
506: $oTypeColl->select();
507: $result = '';
508: while (false !== ($typeEntry = $oTypeColl->next())) {
509:
510: $curType = $typeEntry->get('type');
511:
512: $contentTypeClassName = cTypeGenerator::getContentTypeClassName($curType);
513: if (false === class_exists($contentTypeClassName)) {
514: continue;
515: }
516: $cContentType = new $contentTypeClassName(null, 0, array());
517: if (false === $cContentType->isWysiwygCompatible()) {
518: continue;
519: }
520:
521:
522: $form = new cGuiTableForm('system_wysiwyg_tinymce4_' . strtolower($curType));
523: $form->setAcceptCharset('UTF-8');
524:
525: $form->addHeader(i18n('TinyMCE 4 configuration for ') . $curType);
526:
527: $form->setVar('area', $area);
528: $form->setVar('frame', $frame);
529: $form->setVar('action', 'edit_tinymce4');
530:
531:
532: $containerDiv = new cHTMLDiv();
533: if ('CMS_HTMLHEAD' === $curType) {
534: $defaultToolbar1 = static::get('undo redo | consave conclose', 'raw','tinymce4_full', 'toolbar1');
535: $defaultToolbar2 = static::get('', 'raw','tinymce4_full', 'toolbar2');
536: $defaultToolbar3 = static::get('', 'raw','tinymce4_full', 'toolbar3');
537: $defaultPlugins = static::get('conclose', 'raw','tinymce4_full', 'plugins');
538: } else {
539: $defaultToolbar1 = static::get('cut copy paste pastetext | searchreplace | undo redo | bold italic underline strikethrough subscript superscript | insertdatetime preview | visualchars nonbreaking template pagebreak | help | fullscreen', 'raw','tinymce4_full', 'toolbar1');
540: $defaultToolbar2 = static::get('link unlink anchor image media hr | bullist numlist | outdent indent blockquote | alignleft aligncenter alignright alignfull removeformat | forecolor backcolor | ltr rtl | charmap | code', 'raw','tinymce4_full', 'toolbar2');
541: $defaultToolbar3 = static::get('table | formatselect fontselect fontsizeselect | consave conclose', 'raw','tinymce4_full', 'toolbar3');
542: $defaultPlugins = static::get('charmap code table conclose hr image link pagebreak layer insertdatetime preview anchor media searchreplace print contextmenu paste directionality fullscreen visualchars nonbreaking template textcolor', 'raw','tinymce4_full', 'plugins');
543: }
544: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 1:', $curType . '[tinymce4_full][toolbar1]', $defaultToolbar1));
545: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 2:', $curType . '[tinymce4_full][toolbar2]', $defaultToolbar2));
546: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 3:', $curType . '[tinymce4_full][toolbar3]', $defaultToolbar3));
547: $containerDiv->appendContent($this->_addLabelWithTextarea('Plugins:', $curType . '[tinymce4_full][plugins]', $defaultPlugins));
548: $form->add(i18n('Settings of editor in separate editor page'), $containerDiv->render());
549:
550: $containerDiv = new cHTMLDiv();
551: if ('CMS_HTMLHEAD' === $curType) {
552: $defaultToolbar1 = static::get('undo redo | consave conclose', 'raw','tinymce4_inline', 'toolbar1');
553: $defaultToolbar2 = static::get('', 'raw','tinymce4_inline', 'toolbar2');
554: $defaultToolbar3 = static::get('', 'raw','tinymce4_inline', 'toolbar3');
555: $defaultPlugins = static::get('conclose', 'raw','tinymce4_inline', 'plugins');
556: } else {
557: $defaultToolbar1 = static::get('bold italic underline strikethrough | undo redo | bullist numlist separator forecolor backcolor | alignleft aligncenter alignright | confullscreen | consave conclose', 'raw', 'tinymce4_inline', 'toolbar1');
558: $defaultToolbar2 = static::get('', 'raw', 'tinymce4_inline', 'toolbar2');
559: $defaultToolbar3 = static::get('', 'raw', 'tinymce4_inline', 'toolbar3');
560: $defaultPlugins = static::get('conclose confullscreen media table textcolor', 'raw', 'tinymce4_inline', 'plugins');
561: }
562: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 1:', $curType . '[tinymce4_inline][toolbar1]', $defaultToolbar1));
563: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 2:', $curType . '[tinymce4_inline][toolbar2]', $defaultToolbar2));
564: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 3:', $curType . '[tinymce4_inline][toolbar3]', $defaultToolbar3));
565: $containerDiv->appendContent($this->_addLabelWithTextarea('Plugins:', $curType . '[tinymce4_inline][plugins]', $defaultPlugins));
566: $form->add(i18n('Settings of inline editor in inline mode'), $containerDiv->render());
567:
568: $containerDiv = new cHTMLDiv();
569: if ('CMS_HTMLHEAD' === $curType) {
570: $defaultToolbar1 = static::get('undo redo | consave conclose', 'raw','tinymce4_fullscreen', 'toolbar1');
571: $defaultToolbar2 = static::get('', 'raw','tinymce4_fullscreen', 'toolbar2');
572: $defaultToolbar3 = static::get('', 'raw','tinymce4_fullscreen', 'toolbar3');
573: $defaultPlugins = static::get('conclose', 'raw','tinymce4_fullscreen', 'plugins');
574: } else {
575: $defaultToolbar1 = static::get('cut copy paste pastetext | searchreplace | undo redo | bold italic underline strikethrough subscript superscript | insertdatetime preview | visualchars nonbreaking template pagebreak | help | fullscreen', 'raw', 'tinymce4_fullscreen', 'toolbar1');
576: $defaultToolbar2 = static::get('link unlink anchor image media | bullist numlist | outdent indent blockquote | alignleft aligncenter alignright alignfull removeformat | forecolor backcolor | ltr rtl | charmap | code', 'raw', 'tinymce4_fullscreen', 'toolbar2');
577: $defaultToolbar3 = static::get('table | formatselect fontselect fontsizeselect | consave conclose', 'raw','tinymce4_fullscreen', 'toolbar3');
578: $defaultPlugins = static::get('charmap code conclose table hr image link pagebreak layer insertdatetime preview anchor media searchreplace print contextmenu paste directionality fullscreen visualchars nonbreaking template textcolor', 'raw', 'tinymce4_fullscreen', 'plugins');
579: }
580: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 1:', $curType . '[tinymce4_fullscreen][toolbar1]', $defaultToolbar1));
581: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 2:', $curType . '[tinymce4_fullscreen][toolbar2]', $defaultToolbar2));
582: $containerDiv->appendContent($this->_addLabelWithTextarea('Toolbar 3:', $curType . '[tinymce4_fullscreen][toolbar3]', $defaultToolbar3));
583: $containerDiv->appendContent($this->_addLabelWithTextarea('Plugins:', $curType . '[tinymce4_fullscreen][plugins]', $defaultPlugins));
584: $form->add(i18n('Settings of inline editor in fullscreen mode'), $containerDiv->render());
585:
586:
587: $containerDiv = new cHTMLDiv();
588: $checked = 'contenido_gzip' === static::get(false, 'raw', $curType, 'contenido_gzip');
589: $containerDiv->appendContent($this->_addLabelWithCheckbox(i18n('GZIP TinyMCE (only activate if server does not compress content already)'), $curType . '[contenido_gzip]', 'contenido_gzip', $checked));
590: $form->add(i18n('contenido_gzip'), $containerDiv->render());
591:
592:
593: $containerDiv = new cHTMLDiv();
594: $checked = true === ('image' === static::get(false, 'raw', $curType, 'contenido_lists', 'image'));
595: $containerDiv->appendContent($this->_addLabelWithCheckbox(i18n('Provide jump lists in image insertion dialog'), $curType . '[contenido_lists][image]', 'image', $checked));
596: $checked = true === ('link' === static::get(false, 'raw', $curType, 'contenido_lists', 'link'));
597: $containerDiv->appendContent($this->_addLabelWithCheckbox(i18n('Provide jump lists in link insertion dialog'), $curType . '[contenido_lists][link]', 'link', $checked));
598: $form->add(i18n('contenido_lists'), $containerDiv->render());
599:
600:
601: $containerDiv = new cHTMLDiv();
602: $containerDiv->appendContent($this->_listExternalPlugins($curType));
603: $form->add(i18n('External plugins to load'), $containerDiv);
604:
605:
606: $textarea = new cHTMLTextarea($curType . '[custom]');
607: $textarea->setAttribute('style', 'width: 99%;');
608: $defaultParams = '';
609: if ('CMS_HTMLHEAD' === $curType) {
610: $defaultParams = '{' . PHP_EOL . '"inline": true,' . PHP_EOL . '"menubar": false' . PHP_EOL . '}';
611: }
612: $textarea->setValue(static::get($defaultParams, 'raw', $curType, 'custom'));
613: $form->add(i18n('Additional parameters (JSON passed to tinymce constructor)'), $textarea->render());
614:
615:
616: if (false === $this->_perm) {
617: $form->setActionButton('submit', cRegistry::getBackendUrl() . 'images/but_ok_off.gif', i18n("You are not sysadmin. You can't change these settings."), 's');
618: }
619: $result .= '<p>' . $form->render() . '</p>';
620: }
621:
622: $configPath = cRegistry::getConfigValue('path', 'contenido_config');
623: $configPath .= 'config.wysiwyg_tinymce4.php';
624: if (cFileHandler::exists($configPath)
625: && cFileHandler::writeable($configPath)) {
626: $resetForm = new cHTMLForm('system_wysiwyg_tinymce4_general_options', 'main.php', 'post');
627: $resetForm->setVar('area', $area);
628: $resetForm->setVar('frame', $frame);
629: $resetForm->setVar('action', 'edit_tinymce4');
630: $oResetButton = new cHTMLButton('reset', i18n('Reset configuration back to default'));
631: $oResetButton->setAttribute('value', i18n('Reset Configuration'));
632:
633: $resetForm = $resetForm->appendContent($oResetButton);
634: $result .= $resetForm->render();
635: }
636:
637:
638: $page->set('s', 'FORM', $result);
639: $page->set('s', 'RELOAD_HEADER', (false) ? 'true' : 'false');
640: $page->render();
641: }
642: }
643: