18 require_once SQ_LIB_PATH.
'/config/prefs.inc';
19 require_once SQ_ATTRIBUTES_PATH.
'/css_dimension/css_dimension.inc';
35 var $pref_vars = Array (
36 'SQ_RAW_HTML_SIZE' => Array(
37 'name' =>
'cms_ct_raw_html_pref_editor_size',
38 'description' =>
'This preference allows you to change the size of the Raw HTML editor',
39 'default' => Array(
'width' =>
'70em',
'height' =>
'20em'),
43 var $css_dimension_width;
44 var $css_dimension_height;
53 $this->
Prefs($pref_file);
72 $is_root = $GLOBALS[
'SQ_SYSTEM']->userRoot();
73 $is_admin = ($is_root || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin());
74 if (is_null($pref) || $pref ==
'SQ_RAW_HTML_SIZE') {
76 $o->openField(translate($this->pref_vars[
'SQ_RAW_HTML_SIZE'][
'name']));
78 $html_size = $this->pref_vars[
'SQ_RAW_HTML_SIZE'][
'default'];
80 <table
class=
"sq-backend-table" style=
"width: 350px;">
82 <td
class=
"sq-backend-table-header" nowrap=
"nowrap"><?php echo translate(
'width') ?></td>
83 <td
class=
"sq-backend-table-cell" style=
"width: 100%;">
85 if ($have_lock && $is_admin) {
86 $this->css_dimension_width->paint(
'width', $have_lock, $html_size[
'width']);
88 echo $html_size[
'width'];
94 <td
class=
"sq-backend-table-header" nowrap=
"nowrap"><?php echo translate(
'height') ?></td>
95 <td
class=
"sq-backend-table-cell" style=
"width: 100%;">
97 if ($have_lock && $is_admin) {
98 $this->css_dimension_height->paint(
'height', $have_lock, $html_size[
'height']);
100 echo $html_size[
'height'];
107 if (is_null($pref)) $o->closeField();
127 $is_root = $GLOBALS[
'SQ_SYSTEM']->userRoot();
128 $is_admin = ($is_root || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin());
129 if (!$is_admin)
return FALSE;
131 if (isset($_POST[
'width']) && isset($_POST[
'height'])) {
132 $this->css_dimension_width->process(
'width');
133 $this->css_dimension_height->process(
'height');
134 $this->pref_vars[
'SQ_RAW_HTML_SIZE'][
'default'][
'width'] = $this->css_dimension_width->getContent();
135 $this->pref_vars[
'SQ_RAW_HTML_SIZE'][
'default'][
'height'] = $this->css_dimension_height->getContent();