Revision 1274
Added by Dietmar over 14 years ago
wb_wrapper_edit_area.php | ||
---|---|---|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
if (!function_exists('registerEditArea')) { |
64 |
function registerEditArea($id = 'code_area', $syntax = 'php', $syntax_selection = true |
|
65 |
, $allow_resize = 'both', $allow_toggle = true, $start_highlight = true |
|
66 |
, $min_width = 600, $min_height = 300, $toolbar = 'default') |
|
64 |
function registerEditArea( |
|
65 |
$id = 'code_area', |
|
66 |
$syntax = 'php', |
|
67 |
$syntax_selection = true, |
|
68 |
$allow_resize = 'both', |
|
69 |
$allow_toggle = true, |
|
70 |
$start_highlight = true, |
|
71 |
$min_width = 600, |
|
72 |
$min_height = 300, |
|
73 |
$toolbar = 'default' |
|
74 |
) |
|
67 | 75 |
{ |
68 | 76 |
|
69 | 77 |
// set default toolbar if no user defined was specified |
... | ... | |
74 | 82 |
|
75 | 83 |
// check if used Website Baker backend language is supported by EditArea |
76 | 84 |
$language = 'en'; |
77 |
if (defined('LANGUAGE') && file_exists(dirname(__FILE__) . '/langs/' . strtolower(LANGUAGE) . '.js')) { |
|
85 |
if (defined('LANGUAGE') && file_exists(dirname(__FILE__) . '/langs/' . strtolower(LANGUAGE) . '.js')) |
|
86 |
{ |
|
78 | 87 |
$language = strtolower(LANGUAGE); |
79 | 88 |
} |
80 | 89 |
|
... | ... | |
84 | 93 |
// check if resize option is supported by edit_area |
85 | 94 |
$allow_resize = in_array($allow_resize, array('no', 'both', 'x', 'y')) ? $allow_resize : 'no'; |
86 | 95 |
|
87 |
loader_help(); |
|
88 | 96 |
// return the Javascript code |
89 | 97 |
$result = <<< EOT |
90 | 98 |
<script type="text/javascript"> |
91 | 99 |
editAreaLoader.init({ |
92 |
id: '$id' |
|
93 |
,start_highlight: $start_highlight
|
|
94 |
,syntax: '$syntax'
|
|
95 |
,min_width: $min_width
|
|
96 |
,min_height: $min_height
|
|
97 |
,allow_resize: '$allow_resize'
|
|
98 |
,allow_toggle: $allow_toggle
|
|
99 |
,toolbar: '$toolbar'
|
|
100 |
,language: '$language'
|
|
100 |
id: '$id',
|
|
101 |
start_highlight: $start_highlight,
|
|
102 |
syntax: '$syntax',
|
|
103 |
min_width: $min_width,
|
|
104 |
min_height: $min_height,
|
|
105 |
allow_resize: '$allow_resize',
|
|
106 |
allow_toggle: $allow_toggle,
|
|
107 |
toolbar: '$toolbar',
|
|
108 |
language: '$language' |
|
101 | 109 |
}); |
102 | 110 |
</script> |
103 | 111 |
EOT; |
Also available in: Unified diff
Ticket #921 fix issues in IE by using EditArea framework