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_MARKDOWN_SIZE' => Array(
37 'name' =>
'cms_ct_markdown_pref_editor_size',
38 'description' =>
'This preference allows you to change the size of the Markdown 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_MARKDOWN_SIZE') {
76 $o->openField(translate($this->pref_vars[
'SQ_MARKDOWN_SIZE'][
'name']));
78 $markdown_size = $this->pref_vars[
'SQ_MARKDOWN_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(
'markdown_width', $have_lock, $markdown_size[
'width']);
88 echo $markdown_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(
'markdown_height', $have_lock, $markdown_size[
'height']);
100 echo $markdown_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[
'markdown_width']) && isset($_POST[
'markdown_height'])) {
132 $this->css_dimension_width->process(
'markdown_width');
133 $this->css_dimension_height->process(
'markdown_height');
134 $this->pref_vars[
'SQ_MARKDOWN_SIZE'][
'default'][
'width'] = $this->css_dimension_width->getContent();
135 $this->pref_vars[
'SQ_MARKDOWN_SIZE'][
'default'][
'height'] = $this->css_dimension_height->getContent();