18 require_once SQ_CORE_PACKAGE_PATH.
'/content_type/content_type.inc';
43 $this->_ser_attrs = TRUE;
44 parent::__construct($assetid);
60 $classes = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs($this->
type(),
'SQ_STRUCTURE_TREE_NODE_CLASSES');
62 $tree_data = $this->
attr(
'structure');
63 $current_trailers = Array();
65 for ($treecount=0; $treecount < count($tree_data); $treecount++) {
66 $data = $tree_data[$treecount];
68 for ($i = 0; $i < $data[
'indent']; $i++) {
69 if ($i == ($data[
'indent'] - 1)) {
71 if (($treecount == count($tree_data) - 1) || ($tree_data[$treecount + 1][
'indent'] != $data[
'indent'])) {
73 <span
class=
"<?php echo $classes['node_branches']; ?>" style=
"margin-left: 10px;">|_</span>
77 <span
class=
"<?php echo $classes['node_branches']; ?>" style=
"margin-left: 10px;">|_</span>
81 $span_text =
' ';
83 if ($show_trailers && isset($current_trailers[$i])) {
85 $class_text =
'class="'.$classes[
'node_branches'].
'" ';
88 <span <?php echo $class_text; ?>style=
"margin-left: 10px;"><?php echo $span_text; ?></span>
95 if ($data[
'bold'] !=
'0') {
96 if ($style_text ==
'') $style_text =
' style="';
97 $style_text .=
'font-weight: bold;';
99 if ($data[
'italic'] !=
'0') {
100 if ($style_text ==
'') $style_text =
' style="';
101 $style_text .=
'font-style: italic;';
103 if ($data[
'underline'] !=
'0') {
104 if ($style_text ==
'') $style_text =
' style="';
105 $style_text .=
'text-decoration: underline;';
107 if ($style_text !=
'') $style_text .=
'"';
109 <span
class=
"<?php echo $classes['node_text']; ?>" <?php echo $style_text; ?>><?php echo $data[
'content']; ?></span><br />
112 if ($show_trailers) {
113 unset($current_trailers[$data[
'indent'] - 1]);
115 if (isset($tree_data[$treecount + 1]) && ($tree_data[$treecount + 1][
'indent'] > $data[
'indent'])) {
116 for ($ja = $treecount + 2; $ja < count($tree_data); $ja++) {
117 $next_data = $tree_data[$ja];
118 if ($next_data[
'indent'] < $data[
'indent'])
break;
119 if ($next_data[
'indent'] == $data[
'indent']) {
120 $current_trailers[$data[
'indent'] - 1] =
'true';
126 $tree_string = ob_get_contents();