14 include_once
RMCPATH.
'/class/fields/formelement.class.php';
15 include_once
RMCPATH.
'/class/fields/text.class.php';
16 include_once
RMCPATH.
'/class/fields/select.class.php';
17 include_once
RMCPATH.
'/class/fields/file.class.php';
18 include_once
RMCPATH.
'/class/fields/hidden.class.php';
19 include_once
RMCPATH.
'/class/fields/button.class.php';
20 include_once
RMCPATH.
'/class/fields/editor.class.php';
21 include_once
RMCPATH.
'/class/fields/groups.class.php';
22 include_once
RMCPATH.
'/class/fields/checks.class.php';
23 include_once
RMCPATH.
'/class/fields/formuser.class.php';
24 include_once
RMCPATH.
'/class/fields/theme.class.php';
25 include_once
RMCPATH.
'/class/fields/language.class.php';
26 include_once
RMCPATH.
'/class/fields/modules.class.php';
27 include_once
RMCPATH.
'/class/fields/timezone.class.php';
28 include_once
RMCPATH.
'/class/fields/cachemod.class.php';
29 include_once
RMCPATH.
'/class/fields/avatar.class.php';
30 include_once
RMCPATH.
'/class/fields/textoptions.class.php';
31 include_once
RMCPATH.
'/class/fields/formuser.class.php';
32 include_once
RMCPATH.
'/class/fields/date.class.php';
33 include_once
RMCPATH.
'/class/fields/formimage.class.php';
34 include_once
RMCPATH.
'/api/editors/tinymce/tinyeditor.php';
36 $rmEvents->run_event(
"rmcommon.form.loader");
42 $tiny->configuration = array(
'mode'=>
'exact',
45 'inlinepopups_skin'=>
'exm',
47 'plugins' =>
$rmEvents->run_event(
'rmcommon.tiny.plugins.editor',
"exmsystem,autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template"),
48 'theme_advanced_buttons1'=>
RMEvents::get()->run_event(
'rmcommon.tinybuttons.toolbar1',
"bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,image,fullscreen,|,exm_more,exm_adv"),
49 'theme_advanced_buttons2'=>
RMEvents::get()->run_event(
'rmcommon.tinybuttons.toolbar2',
"underline,justifyfull,forecolor,|,removeformat,|,media,charmap,|,outdent,indent,|,undo,redo,|,exm_page,exm_img,exm_icons"),
50 'theme_advanced_buttons3'=>
RMEvents::get()->run_event(
'rmcommon.tinybuttons.toolbar3',
"styleselect,formatselect,insertimage,|,tablecontrols"),
51 'theme_advanced_buttons4'=>
RMEvents::get()->run_event(
'rmcommon.tinybuttons.toolbar4',
""),
52 'spellchecker_languages'=>
"+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv",
53 'theme_advanced_toolbar_location'=>
"top",
54 'theme_advanced_toolbar_align'=>
"left",
55 'theme_advanced_statusbar_location'=>
"bottom",
56 'theme_advanced_resizing'=>
"1",
57 'theme_advanced_resize_horizontal'=>
"",
58 'dialog_type'=>
"modal",
60 'remove_script_host'=>
"",
62 'apply_source_formatting'=>
"",
63 'remove_linebreaks'=>
"1",
64 'paste_convert_middot_lists'=>
"1",
65 'paste_remove_spans'=>
"1",
66 'paste_remove_styles'=>
"1",
67 'gecko_spellcheck'=>
"1",
68 'entities'=>
"38,amp,60,lt,62,gt",
69 'accessibility_focus'=>
"1",
70 'tab_focus'=>
"'=>prev,'=>next",
71 'save_callback'=>
"switchEditors.saveCallback",
108 private $tiny_valid_tags =
'a[name|href|target|title|onclick],code[class,id],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|longdesc|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]';
124 $this->_name = $name;
126 $this->_method = $method;
127 $this->_title = $title;
128 $this->_addtoken = $addtoken;
145 $this->_title = $value;
162 $this->_extra = $extra;
177 if ($method ==
'post' || $method ==
'get'){
178 $this->_method = $method;
189 $this->_name = trim($name);
225 if (isset($this->_fields[
$field])) unset($this->_fields[$field]);
228 $this->_fields = array();
242 public function addElement(&$element, $required=
false, $css_type=
''){
243 $element->setForm($this->_name);
244 $ret[
'field'] = $element;
245 $ret[
'class'] = get_class($element);
246 if (get_class($element)==
'RMFormEditor'){
247 if ($element->getType()==
'tiny') $this->editores[] = $element->getName();
251 $element->addClass(
'required');
254 $element->addClass($css_type);
256 if ($element->getName()!=
''){
257 $this->_fields[$element->getName()] =
$ret;
259 $this->_fields[] =
$ret;
271 if (isset($this->_fields[$name])){
272 return $this->_fields[$name][
'field'];
284 if ($value!=
'') $this->_tableClass = $value;
291 if ($value!=
'') $this->_thClass = $value;
298 if ($value!=
'') $this->_headClass = $value;
305 if ($value!=
'') $this->_evenClass = $value;
312 if ($value!=
'') $this->_oddClass = $value;
319 if (trim($value)!=
'') $this->_footClass = $value;
330 $this->_oddStyle=$style;
333 $this->_evenStyle=$style;
336 $this->_headStyle=$style;
339 $this->_thStyle=$style;
342 $this->_footStyle=$style;
345 $this->_oddSpanStyle = $style;
356 if ($name==
'')
return;
357 if ($text==
'')
return;
359 $this->_othervalidates = ($this->_othervalidates==
'' ?
"" :
",").
"$name|$type|$required|$text";
371 return $tiny->configuration[
'content_css'];
382 $this->row_extras[
$id] = $extra;
398 return ob_get_clean();
414 foreach ($this->_fields as
$field){
416 $element = $field[
'field'];
417 $form[
'fields'][] = array(
418 'type'=>get_class($element),
419 'content'=>$element->render(),
420 'caption'=>$element->getCaption(),
421 'desc'=>$element->getDescription(),
422 'name'=>$element->getName()
425 if (is_a($element,
'RMFormEditor')){
426 if ($element->getType()==
'tiny'){
427 $callmethod =
'tinyMCE.triggerSave(); ';
433 if ($this->_addtoken){
434 $form[
'fields'][] = array(
'type'=>
'RMFormHidden',
'content'=>
$GLOBALS[
'xoopsSecurity']->getTokenHTML(),
435 'caption'=>
'',
'desc'=>
'');
438 $req .= $req==
'' ? ($this->_othervalidates!=
'' ? $this->_othervalidates :
'') : ($this->_othervalidates!=
'' ?
','.$this->_othervalidates :
'');
440 $rtn =
"<form name='".$this->_name.
"' id='".$this->_name.
"' action='".$this->_action.
"' method='".$this->_method.
"'";
442 $rtn .=
" onsubmit=\"".$callmethod.
"rmValidateForm(this, '$req');return document.rmValidateReturnValue;\"";
444 if ($this->_extra !=
''){
445 $rtn .=
" ".$this->_extra;
450 $form[
'lang_req'] =
__(
'Fields marked with (*) are required.',
'rmcommon');
469 return "range".str_replace(
"Range",
"",
$type);
471 return "difto".str_replace(
"Select",
"",
$type);
490 $tiny->configuration[
'extended_valid_elements'] = $tags;
494 return $tiny->configuration[
'extended_valid_elements'];