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_STRUCTURE_TREE_FORMATTING' => Array(
37 'name' =>
'structure_tree_title',
38 'description' =>
'This preference allows you to change the text options that are displayed',
45 'connections' => TRUE,
49 'SQ_STRUCTURE_TREE_NODE_CLASSES' => Array(
50 'name' =>
'tree_class_title',
51 'description' =>
'This preference allows you to change the class used for each Node',
53 'node_text' =>
'tree_node_text',
54 'node_branches' =>
'tree_node_branches',
67 $this->
Prefs($pref_file);
84 $is_root = $GLOBALS[
'SQ_SYSTEM']->userRoot();
85 $is_admin = ($is_root || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin());
86 if (is_null($pref) || $pref ==
'SQ_STRUCTURE_TREE_FORMATTING') {
88 $o->openField(translate($this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'name']));
90 $format_options = $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'];
92 <table
class=
"sq-backend-table" style=
"width: 350px;">
94 <td
class=
"sq-backend-table-header" nowrap=
"nowrap"><?php echo translate(
'tree_formatting_options'); ?></td>
95 <td
class=
"sq-backend-table-cell" style=
"width: 100%;">
97 if ($have_lock && $is_admin) {
98 check_box(
'SQ_STRUCTURE_SHOW_BOLD',
'1', $format_options[
'bold']);
99 echo translate(
'tree_bold').
'<br />';
100 check_box(
'SQ_STRUCTURE_SHOW_UNDERLINE',
'1', $format_options[
'underline']);
101 echo translate(
'tree_underline').
'<br />';
102 check_box(
'SQ_STRUCTURE_SHOW_ITALIC',
'1', $format_options[
'italic']);
103 echo translate(
'tree_italic').
'<br />';
104 check_box(
'SQ_STRUCTURE_SHOW_DELETE',
'1', $format_options[
'delete']);
105 echo translate(
'delete').
'<br />';
106 check_box(
'SQ_STRUCTURE_SHOW_INSERT',
'1', $format_options[
'delete']);
107 echo translate(
'insert').
'<br />';
108 check_box(
'SQ_STRUCTURE_SHOW_CONNECTIONS',
'1', $format_options[
'connections']);
109 echo translate(
'tree_connections').
'<br />';
111 $tick =
'<img src="'.sq_web_path(
'lib').
'/web/images/tick.gif" alt="Yes" style="position: relative; right: 0px;"/>';
112 $cross =
'<img src="'.sq_web_path(
'lib').
'/web/images/cross.gif" alt="Yes" />';
117 <?php echo translate(
'tree_bold'); ?>
121 echo ($format_options[
'bold'] == TRUE) ? $tick : $cross;
127 <?php echo translate(
'tree_underline'); ?>
131 echo ($format_options[
'underline'] == TRUE) ? $tick : $cross;
137 <?php echo translate(
'tree_italic'); ?>
141 echo ($format_options[
'italic'] == TRUE) ? $tick : $cross;
147 <?php echo translate(
'delete'); ?>
151 echo ($format_options[
'delete'] == TRUE) ? $tick : $cross;
157 <?php echo translate(
'insert'); ?>
161 echo ($format_options[
'insert'] == TRUE) ? $tick : $cross;
167 <?php echo translate(
'tree_connections'); ?>
171 echo ($format_options[
'connections'] == TRUE) ? $tick : $cross;
183 if (is_null($pref)) $o->closeField();
185 if (is_null($pref) || $pref ==
'SQ_STRUCTURE_TREE_NODE_CLASSES') {
186 if (is_null($pref)) {
187 $o->openField(translate($this->pref_vars[
'SQ_STRUCTURE_TREE_NODE_CLASSES'][
'name']));
189 $classes = $this->pref_vars[
'SQ_STRUCTURE_TREE_NODE_CLASSES'][
'default'];
191 <table
class=
"sq-backend-table" style=
"width: 350px;">
193 foreach ($classes as $name => $class) {
196 <td
class=
"sq-backend-table-header" nowrap=
"nowrap"><?php echo translate($name); ?></td>
197 <td
class=
"sq-backend-table-cell" style=
"width: 100%;">
199 if ($have_lock && $is_admin) {
200 text_box(
'SQ_STRUCTURE_TREE_NODE_CLASSES['.$name.
']', $class,
'20');
212 if (is_null($pref)) $o->closeField();
232 $is_root = $GLOBALS[
'SQ_SYSTEM']->userRoot();
233 $is_admin = ($is_root || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin());
234 if (!$is_admin)
return FALSE;
236 if (is_null($pref) || $pref ==
'SQ_STRUCTURE_TREE_FORMATTING') {
237 $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'][
'bold'] = isset($_POST[
'SQ_STRUCTURE_SHOW_BOLD']);
238 $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'][
'underline'] = isset($_POST[
'SQ_STRUCTURE_SHOW_UNDERLINE']);
239 $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'][
'italic'] = isset($_POST[
'SQ_STRUCTURE_SHOW_ITALIC']);
240 $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'][
'delete'] = isset($_POST[
'SQ_STRUCTURE_SHOW_DELETE']);
241 $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'][
'insert'] = isset($_POST[
'SQ_STRUCTURE_SHOW_INSERT']);
242 $this->pref_vars[
'SQ_STRUCTURE_TREE_FORMATTING'][
'default'][
'connections'] = isset($_POST[
'SQ_STRUCTURE_SHOW_CONNECTIONS']);
244 if (is_null($pref) || $pref ==
'SQ_STRUCTURE_TREE_NODE_CLASSES') {
245 $this->pref_vars[
'SQ_STRUCTURE_TREE_NODE_CLASSES'][
'default'] = $_POST[
'SQ_STRUCTURE_TREE_NODE_CLASSES'];