18 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
21 define(
'SQ_BO_MSG_NOTICE', 1);
23 define(
'SQ_BO_MSG_WARNING', 2);
25 define(
'SQ_BO_MSG_ERROR', 4);
44 var $_messages = Array();
48 var $_redirect_target =
'';
51 var $_on_load_calls = Array();
54 var $_refreshing_assets = Array();
60 var $_persistant_get_vars = Array();
66 var $_page_title =
'';
68 var $_heading_icon =
'';
69 var $_sub_heading =
'';
72 var $_css_includes = Array();
75 var $_js_includes = Array();
78 var $_on_submit_calls = Array();
81 var $_hidden_fields = Array();
84 var $_screens = Array();
85 var $_static_screens = Array();
88 var $_contents = Array();
91 var $_img_button_count = 0;
95 var $_preload_imgs = Array();
99 var $_raw_opened = FALSE;
101 var $_section_stack = Array();
102 var $_current_field = NULL;
104 var $_section_count = 0;
105 var $_field_count = 0;
113 var $_buffering = TRUE;
119 var $_is_open_section = FALSE;
125 var $_is_open_field = FALSE;
131 var $_current_field_type =
'';
137 var $_current_field_note =
'';
143 var $_nb_section_count = 0;
155 if (!empty($_SESSION[
'backend_outputter_msgs'])) {
156 $this->_messages = $_SESSION[
'backend_outputter_msgs'];
157 $_SESSION[
'backend_outputter_msgs'] = Array();
160 $this->_files_path = sq_web_path(
'lib').
'/web';
161 $this->_action = $_SERVER[
'PHP_SELF'];
164 $em = $GLOBALS[
'SQ_SYSTEM']->getEventManager();
166 $em->addEventListener($this, Array(
189 $this->_buffering = (bool) $buffer;
208 foreach ($this->_persistant_get_vars as $name => $value) {
209 $link_extras .=
'&'.rawurlencode($name).
'='.rawurlencode($value);
211 $link_extras = trim($link_extras,
' &');
212 if (!empty($link_extras)) {
213 $link .= ((strstr($link,
'?')) ?
'&' :
'?').$link_extras;
216 $this->_redirect = trim($link);
217 $this->_redirect_target = trim($target);
232 $this->_on_load_calls[] = $call;
249 if (FALSE === strpos($this->_action,
'?')) {
250 $url = $this->_action;
253 list($url, $query) = explode(
'?', $this->_action);
255 $this->_action = replace_query_string_vars(Array($name => rawurlencode($value)), $url, $query);
257 $this->_persistant_get_vars[$name] = $value;
271 return $this->_action;
286 $anchor = trim($anchor);
287 $this->_anchor = ($anchor) ?
'//'.rawurlencode($anchor) :
'';
300 $this->_page_title = trim($title);
316 $this->_heading = trim($heading);
317 $this->_heading_icon = $icon;
333 $this->_sub_heading = trim($heading);
352 $this->_messages[] = Array(
'type' => $type,
'msg' => $msg);
368 if (in_array($file, $this->_css_includes))
return;
369 $this->_css_includes[] = $file;
384 if (in_array($file, $this->_js_includes))
return;
385 $this->_js_includes[] = $file;
400 $this->_on_submit_calls[] = $call;
416 $this->_hidden_fields[$name] = $value;
432 if (empty($url))
return;
433 if (in_array($name, $this->_screens)) {
434 trigger_localised_error(
'SYS0202', E_USER_ERROR, $name);
436 $this->_screens[$url] = $name;
452 if (empty($url))
return;
453 if (in_array($name, $this->_static_screens)) {
454 trigger_localised_error(
'SYS0207', E_USER_ERROR, $name);
456 $this->_static_screens[$url] = $name;
471 $this->_preload_imgs[] = $file;
486 $this->_charset = $charset;
500 'area_type' =>
'section',
507 $this->_raw_opened = TRUE;
521 if (!$this->_raw_opened)
return;
522 $stack_i = count($this->_section_stack) - 1;
523 $this->_section_stack[$stack_i][
'contents'] = ob_get_contents();
525 $this->_raw_opened = FALSE;
543 'area_type' =>
'section',
545 'heading' => $heading,
562 if (!is_null($this->_current_field)) {
566 if ($this->_buffering) {
570 $this->_nb_section_count--;
571 if ($this->_nb_section_count == 0) {
572 $this->_is_open_section = FALSE;
589 if ($this->_is_open_field) $this->
closeField();
591 if ($this->_buffering) {
592 if (!is_null($this->_current_field)) {
595 if ($this->_raw_opened) $this->
closeRaw();
597 $this->_section_count++;
598 $init_arr[
'section_count'] = $this->_section_count;
601 if (empty($this->_section_stack)) {
602 $j = count($this->_contents);
603 $this->_contents[$j] = $init_arr;
604 $this->_section_stack[] =& $this->_contents[$j];
606 $i = count($this->_section_stack) - 1;
607 $j = count($this->_section_stack[$i][
'areas']);
608 $this->_section_stack[$i][
'areas'][$j] = $init_arr;
609 $this->_section_stack[] =& $this->_section_stack[$i][
'areas'][$j];
612 return 'section_'.$this->_section_count;
631 if ($this->_nb_section_count > 0) echo
'<tr><td>';
633 $this->_nb_section_count++;
636 <a name=
"section_<?php echo $this->_nb_section_count; ?>"></a>
637 <table
class=
"sq-backend-section-table">
639 if (isset($init_arr[
'heading']) && $init_arr[
'heading']) {
640 if ($this->_is_open_section) {
644 <td
class=
"sq-backend-section-subheading"><?php echo $init_arr[
'heading'];?></td>
648 $this->_is_open_section = TRUE;
651 <tr
class=
"sq-backend-section-heading-container">
653 <table border=
"0" cellspacing=
"0" cellpadding=
"0">
655 <td
class=
"sq-backend-section-heading"><?php echo $init_arr[
'heading'];?></td>
656 <td><img src=
"<?php echo $this->filesPath('images/section_icon.gif');?>" width=
"27" height=
"21" /></td>
668 <table
class=
"sq-backend-section-table-inner">
683 if ($this->_buffering) {
684 array_pop($this->_section_stack);
700 if ($this->_nb_section_count > 0) echo
'</td></tr>';
724 function openField($name, $format=
'', $note=
'', $hidden=FALSE, $id_name=
'')
726 if ($this->_buffering) {
727 if (!is_null($this->_current_field)) {
730 if (empty($this->_section_stack)) $this->
openSection();
731 if (!trim($name)) $name =
' ';
733 $this->_field_count++;
735 $stack_i = count($this->_section_stack) - 1;
736 $i = count($this->_section_stack[$stack_i][
'areas']);
737 $this->_section_stack[$stack_i][
'areas'][$i] = Array(
738 'area_type' =>
'field',
740 'field_count' => $this->_field_count,
746 'id_name' => $id_name,
749 $this->_current_field =& $this->_section_stack[$stack_i][
'areas'][$i];
752 return 'field_'.$this->_field_count;
775 if ($this->_is_open_field) $this->
closeField();
776 $this->_is_open_field = TRUE;
779 $this->_current_field_type = $format;
780 $this->_current_field_note = $note;
785 <tr <?php
if ($hidden) echo
'style="display: none"'; ?>>
786 <td
class=
"sq-backend-field sq-backend-field-newline" colspan=
"2">
787 <a name=
"field_<?php echo $this->_field_count; ?>"></a>
791 <tr <?php
if ($hidden) echo
'style="display: none"'; ?>>
792 <td
class=
"sq-backend-data sq-backend-data-newline" colspan=
"2">
798 <tr <?php
if ($hidden) echo
'style="display: none"'; ?>>
799 <td
class=
"sq-backend-data" style=
"text-align: right;" colspan=
"2">
809 <tr <?php
if ($hidden) echo
'style="display: none"'; ?>>
810 <td
class=
"sq-backend-field">
811 <a name=
"field_<?php echo $this->_field_count; ?>"></a>
814 <td
class=
"sq-backend-data">
830 if ($this->_buffering) {
831 if (is_null($this->_current_field))
return;
832 $this->_current_field[
'contents'] = ob_get_contents();
835 unset($this->_current_field);
836 $this->_current_field = NULL;
852 $this->_is_open_field = FALSE;
856 switch ($this->_current_field_type) {
863 if ($this->_current_field_note) {
864 $this->
note($this->_current_field_note);
885 if ($file && substr($file, 0, 1) !=
'/') {
888 return $this->_files_path.$file;
901 if ($this->_raw_opened) $this->
closeRaw();
903 while (!empty($this->_section_stack)) {
907 if ($this->_redirect) {
909 $_SESSION[
'backend_outputter_msgs'] = $this->_messages;
910 $this->
addOnLoad($this->_redirect_target.
'.location = "'.addslashes($this->_redirect).
'";');
915 if (!$this->_redirect) {
916 for ($i = 0; $i < count($this->_contents); $i++) {
936 $str = ob_get_contents();
952 if (!headers_sent()) {
953 if ($this->_charset) {
954 header(
'Content-type: text/html; charset='.$this->_charset);
956 header(
'Content-type: text/html; charset='.SQ_CONF_DEFAULT_CHARACTER_SET);
962 <title><?php echo htmlspecialchars(str_replace(
' ',
' ', $this->_page_title)); ?></title>
965 if (!empty($_REQUEST[
'print_view'])) {
970 foreach ($this->_css_includes as $file) {
975 if ((array_get_index($_GET,
'SQ_BACKEND_PAGE') ==
'main') && SQ_IN_BACKEND && $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_COMMIT_BUTTON_POS')) {
980 if (!isset($_REQUEST[
'print_view'])) {
983 <link href=
"<?php echo $this->filesPath('css/edit_ie6.css') ?>" type=
"text/css" rel=
"stylesheet" />
990 foreach ($GLOBALS[
'SQ_SYSTEM']->lm->getJavascriptIncludes() as $js_include) {
995 $this->
addJsInclude(sq_web_path(
'lib').
'/html_form/html_form.js');
996 $this->
addJsInclude(sq_web_path(
'lib').
'/js/general.js');
997 $this->
addJsInclude(sq_web_path(
'lib').
'/js/backend_search.js');
1000 $this->
addJsInclude(sq_web_path(
'lib').
'/js/state.js');
1001 $this->
addJsInclude(sq_web_path(
'lib').
'/js/tooltip.js');
1002 $this->
addOnLoad(
'fixIcons(\''.sq_web_path(
'lib').
'/web/images/blank.gif\');');
1005 foreach ($this->_js_includes as $file) {
1009 <script type=
"text/javascript"><!--
1011 var SQ_DOCUMENT_LOADED =
false;
1012 function page_on_load()
1015 if (isset($_SESSION[
'backend_outputter_msgs'])) {
1016 $this->_messages = array_merge($this->_messages, $_SESSION[
'backend_outputter_msgs']);
1017 $_SESSION[
'backend_outputter_msgs'] = Array();
1019 if (count($this->_messages)) {
1020 require_once
'XML/Tree.php';
1021 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
1023 $msgs_root = $msgs->addRoot(
'messages');
1024 foreach ($this->_messages as $data) {
1025 $msg_body =
'<p>'.htmlentities(nl2br($data[
'msg']), ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET).
'</p>';
1026 $msg_body .=
'<span style="color: #333333">'.$GLOBALS[
'SQ_SYSTEM']->datetime().
'<span>';
1027 $msgs_root->addChild(
'message', $msg_body, Array(
'type' => get_bit_names(
'SQ_BO_MSG_', $data[
'type'])));
1030 if (parent.frames[
"sq_sidenav"] && parent.frames[
"sq_sidenav"].add_messages) {
1031 parent.frames[
"sq_sidenav"].add_messages(
"<?php echo str_replace(Array("\r\n
", "\n
", "\r
"), "\\n
", addslashes($msgs->get())); ?>");
1037 if (window.self.name ==
'sq_main') {
1042 foreach ($this->_on_load_calls as $call) {
1048 SQ_DOCUMENT_LOADED =
true;
1052 if (document.getElementById(
'sq-commit-button-div')) {
1053 commit_div = document.getElementById(
'sq-commit-button-div');
1054 if (commit_div.currentStyle && (commit_div.currentStyle.position ==
'absolute')) {
1055 document.body.style.paddingBottom = (commit_div.clientHeight + 2) +
"px";
1059 if (document.getElementById(
'sq-commit-button-div')) {
1060 document.getElementById(
'sq-commit-button-spacer').style.height = (document.getElementById(
'sq-commit-button-div').clientHeight + 2) +
"px";
1066 document.forms[0][
'state'].value = saveState();
1071 function page_on_unload()
1073 if (parent.frames[
'sq_sidenav'] && window.self.name ==
'sq_main' && parent.frames[
'sq_sidenav'].asset_finder_onunload) {
1074 parent.frames[
'sq_sidenav'].asset_finder_onunload();
1080 var SQ_FORM_SUBMITTED =
false;
1081 var SQ_FORM_ERROR_CONTAINED =
false;
1082 function form_on_submit()
1084 if (SQ_FORM_SUBMITTED) {
1085 alert(js_translate(
'form_already_submitted'));
1090 foreach ($this->_on_submit_calls as $call) {
1096 if (SQ_FORM_ERROR_CONTAINED) {
1097 alert(js_translate(
'form_contains_error'));
1102 SQ_FORM_SUBMITTED =
true;
1107 if (
self.name ==
'sq_header') {
1109 if (
self.document.getElementById(
"asset_search").value !=
'') {
1110 top.frames[
"sq_main"].document.getElementById(
"sq-search-wait-popup").style.display =
"block";
1113 screenMenu = top.frames[
"sq_main"].document.getElementById(
"sq_screen_menu");
1114 screenMenuFiller = top.frames[
"sq_main"].document.getElementById(
"sq_screen_menu_filler");
1117 if (window.navigator.userAgent.indexOf(
'MSIE') > 0) {
1118 screenMenuFiller.style.width = screenMenu.offsetWidth;
1119 screenMenuFiller.style.height = screenMenu.offsetHeight;
1120 screenMenuFiller.style.display =
"block";
1121 screenMenu.style.display =
"none";
1123 screenMenu.style.MozOpacity =
"0";
1126 if (reload_timeout) {
1127 clearTimeout(reload_timeout);
1142 foreach ($this->_preload_imgs as $file) {
1144 preload_image(
'<?php echo $file;?>');
1152 <body onload=
"page_on_load();" onunload=
"page_on_unload();">
1153 <div
id=
"sq-search-wait-popup"><div
id=
"sq-search-wait-popup-titlebar"><div
id=
"sq-search-wait-popup-close">[ <a href=
"#" onclick=
"document.getElementById('sq-search-wait-popup').style.display = 'none'; return false;">x</a> ]</div><span
id=
"sq-search-wait-popup-title">Search in Progress</span></div>
1154 <div
id=
"sq-search-wait-popup-details">Your search is being processed, please wait...</div>
1156 <form style=
"display: inline" action=
"<?php echo $this->_action.$this->_anchor;?>" id=
"main_form" name=
"main_form" method=
"post" enctype=
"multipart/form-data" onclick=
"changesMade();" onkeypress=
"changesMade();" onsubmit=
"return form_on_submit();">
1158 if (!empty($_REQUEST[
'print_view'])) {
1160 <div
id=
"matrix-print-logo">
1165 <div
id=
"sq-content">
1167 hidden_field(
'process_form',
'1');
1168 hidden_field(
'changes',
'0');
1169 hidden_field(
'state',
'');
1170 hidden_field(
'allowconfirm', !defined(
'SQ_CONF_CONFIRM_SAVE_CHANGES') ?
'1' : SQ_CONF_CONFIRM_SAVE_CHANGES);
1172 hidden_field(
'token', get_unique_token());
1174 foreach ($this->_hidden_fields as $name => $value) {
1175 hidden_field($name, $value);
1178 if ($this->_heading || count($this->_screens) || count($this->_static_screens)) {
1180 <table
class=
"sq-backend-main-headings">
1183 if ($this->_heading_icon) {
1185 <td
class=
"sq-backend-heading-icon"><?php echo $this->_heading_icon; ?></td>
1189 <td
class=
"sq-backend-main-heading">
1191 echo $this->_heading;
1192 if ($this->_sub_heading) {
1193 echo
'<br /><span class="sq-backend-sub-heading">'.$this->_sub_heading.
'</span>';
1198 if (empty($_REQUEST[
'print_view'])) {
1200 <td
class=
"sq-backend-screen-menu">
1201 <div
id=
"sq_screen_menu_filler" style=
"display: none"></div>
1202 <div
id=
"sq_screen_menu">
1206 sq_print_icon(sq_web_path(
'lib').
'/web/images/icons/printer.png', 16, 16, translate(
'print_this_page'), NULL,
'onclick="showPrintPopup()" class="clickable" style="margin-bottom: -2px; margin-right: 4px"');
1217 if (isset($_SESSION[
'sq_nav_history']) && empty($_REQUEST[
'print_view'])) {
1219 <table
class=
"sq-backend-nav-history-container">
1221 <td
class=
"sq-backend-nav-history-title">
1222 <?php sq_print_icon($this->
filesPath(
'images/icons/history.png'), 20, 20,
'Navigation History'); ?>
1223 <?php echo translate(
'back_to'); ?>:
1225 <td
class=
"sq-backend-nav-history">
1227 $nav_count = count($_SESSION[
'sq_nav_history']);
1228 if ($nav_count < 5) {
1231 $start = $nav_count - 5;
1234 for ($i = $start; $i < $nav_count; $i++) {
1235 if (!isset($_SESSION[
'sq_nav_history'][$i]))
continue;
1236 $nav_details = $_SESSION[
'sq_nav_history'][$i];
1238 $nav_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($nav_details[
'assetid'],
'', TRUE);
1239 if (is_null($nav_asset)) {
1240 array_splice($_SESSION[
'sq_nav_history'], $i, 1);
1244 <a href=
"<?php echo $nav_asset->getBackendHref($nav_details['screen']); ?>&sq_nav_goback=<?php echo $i; ?>">
1246 sq_print_icon($GLOBALS[
'SQ_SYSTEM']->am->getAssetIconURL($nav_asset->type()), 16, 16, htmlspecialchars($nav_asset->short_name));
1247 echo htmlspecialchars($nav_asset->short_name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET);
1249 <span> [<?php echo ($i + 1); ?>]</span>
1252 if ($i < ($nav_count -1)) {
1253 ?> <span
class=
"divider">+</span> <?php
1256 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($nav_asset);
1282 if ($section[
'type'] ==
'raw') {
1283 echo $section[
'contents'];
1286 <a name=
"section_<?php echo $section['section_count']; ?>"></a>
1287 <table
class=
"sq-backend-section-table" id=
"backend_section_<?php echo $section['section_count']; ?>">
1289 if ($section[
'heading'] !=
'') {
1294 <td
class=
"sq-backend-section-subheading"><?php echo $section[
'heading'];?></td>
1300 <tr
class=
"sq-backend-section-heading-container">
1302 <table border=
"0" cellspacing=
"0" cellpadding=
"0">
1304 <td
class=
"sq-backend-section-heading"><?php echo $section[
'heading'];?></td>
1305 <td><img src=
"<?php echo $this->filesPath('images/section_icon.gif');?>" width=
"27" height=
"21" alt=
"" /></td>
1316 <table
class=
"sq-backend-section-table-inner" cellspacing=
"0" cellpadding=
"0" border=
"0">
1318 for ($j = 0; $j < count($section[
'areas']); $j++) {
1319 switch ($section[
'areas'][$j][
'area_type']) {
1333 $field = $section[
'areas'][$j];
1334 switch ($field[
'format']) {
1338 if ($field[
'hidden']) echo
'style="display: none"';
1339 if ($field[
'id_name']) {
1340 echo
'id="'.$field[
'id_name'].
'"';
1343 <td
class=
"sq-backend-field sq-backend-field-newline" colspan=
"2">
1344 <a name=
"field_<?php echo $field['field_count']; ?>"></a>
1345 <?php echo $field[
'name'];?>
1348 <tr <?php
if ($field[
'hidden']) echo
'style="display: none"'; ?>>
1349 <td
class=
"sq-backend-data sq-backend-data-newline" colspan=
"2">
1351 echo $field[
'contents'];
1352 if ($field[
'note']) $this->
note($field[
'note']);
1362 if ($field[
'hidden']) echo
'style="display: none"';
1363 if ($field[
'id_name']) {
1364 echo
'id="'.$field[
'id_name'].
'"';
1367 <td
class=
"sq-backend-data sq-backend-commit" colspan=
"2">
1369 echo $field[
'contents'];
1370 if ($field[
'note']) $this->
note($field[
'note']);
1384 if ($field[
'hidden']) echo
'style="display: none"';
1386 if ($field[
'id_name']) {
1387 echo
'id="'.$field[
'id_name'].
'"';
1390 <td
class=
"sq-backend-field">
1391 <a name=
"field_<?php echo $field['field_count']; ?>"></a>
1392 <?php echo $field[
'name'];?>
1394 <td
class=
"sq-backend-data">
1396 echo $field[
'contents'];
1397 if ($field[
'note']) $this->
note($field[
'note']);
1407 trigger_localised_error(
'SYS0257', E_USER_ERROR, $section[
'areas'][$j][
'area_type']);
1413 if (isset($section[
'note'])) {
1458 <link rel=
"stylesheet" type=
"text/css" href=
"<?php echo $file;?>" />
1475 <script type=
"text/javascript" src=
"<?php echo $file;?>"></script>
1491 echo
'<div class="sq-backend-smallprint">'.$str.
'</div>';
1508 if ($this->_buffering) {
1509 $stack_i = count($this->_section_stack) - 1;
1510 $this->_section_stack[$stack_i][
'note'] = $str;
1537 <div
class=
"sq-backend-section-note"><strong><?php echo translate(
'note'); ?>: </strong><?php echo $str ?></div>
1554 function commitButton($value=
'', $release_lock=TRUE, $include_section=TRUE)
1557 if (empty($value)) {
1558 $value = !defined(
'SQ_CONF_COMMIT_BUTTON_TEXT') ?
'Commit' : SQ_CONF_COMMIT_BUTTON_TEXT;
1560 $release_lock = (int) $release_lock;
1561 if ($include_section) {
1563 if (SQ_IN_BACKEND && $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_COMMIT_BUTTON_POS')) {
1565 ?></div><div
id=
"sq-commit-button-spacer"></div><div
id=
"sq-commit-button-div"><div
id=
"sq-commit-button-div-inside"><?php
1571 hidden_field(
'sq_lock_release', $release_lock);
1572 normal_button(
'sq_commit_button', $value,
'if (submit_form) { submit_form(this.form); } else { this.form.submit(); this.disabled = \'disabled\'; } ',
'accesskey="s"');
1573 if ($include_section) {
1574 if (SQ_IN_BACKEND && $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_COMMIT_BUTTON_POS')) {
1596 if (empty($this->_screens) && empty($this->_static_screens)) {
1599 if (!empty($this->_screens)) {
1600 $this->_screens = array_reverse($this->_screens);
1601 $this->_screens[
'#'] =
'------';
1602 foreach (array_reverse($this->_static_screens) as $url => $code) {
1603 $this->_screens[$url] = $code;
1605 $this->_screens = array_reverse($this->_screens);
1607 $this->_screens = $this->_static_screens;
1609 combo_box(
'screen_menu', $this->_screens, FALSE, $this->_action, 1,
'id="screen_menu" onchange="self.location = this.value"');
1611 normal_button(
'screen_menu_go',
' '.translate(
'go').
' ',
'self.location = get_form_element_value("screen_menu");');
1630 $contexts = $GLOBALS[
'SQ_SYSTEM']->getAllContexts();
1631 $current_context = $GLOBALS[
'SQ_SYSTEM']->getContextId();
1632 if (count($contexts) > 1) {
1634 <span
id=
"sq_context_switcher_current">
1635 Context: <strong><?php echo $contexts[$current_context][
'name'] ?></strong> [ <a href=
"#" onclick=
"this.parentNode.nextSibling.style.display = 'inline'; this.parentNode.style.display = 'none'; return false;">Change</a> ]
1636 </span><span
id=
"sq_context_switcher_change">Change Context: <?php
1656 list($current_loc_base, $current_loc_query) = explode(
'?', $current_location);
1657 $default_url = NULL;
1659 $contexts = $GLOBALS[
'SQ_SYSTEM']->getAllContexts();
1660 $current_context = $GLOBALS[
'SQ_SYSTEM']->getContextId();
1661 if (count($contexts) > 1) {
1663 $context_list = Array();
1664 foreach ($contexts as $context_item_id => $context_item) {
1665 $url = replace_query_string_vars(Array(
'SQ_ACTION' =>
'set_backend_context',
'SQ_CONTEXT_NAME' => rawurlencode($context_item[
'name'])), $current_loc_base, $current_loc_query);
1666 if ((
int)$current_context === (
int)$context_item_id) {
1667 $default_url = $url;
1670 $context_list[$url] = $context_item[
'name'];
1672 combo_box(
'sq_context_switcher', $context_list, FALSE, Array($default_url), 1,
' onchange="self.location = this.value;"');
1690 $this->
addMessage($event_data[
'type'], $event_data[
'message']);
1706 if (!is_null($broadcaster) && isset($broadcaster->id)) {
1707 if (!in_array($broadcaster->id, $this->_refreshing_assets)) {
1708 $this->
addOnLoad(
'if (parent.frames["sq_sidenav"] && parent.frames["sq_sidenav"].reload_asset) parent.frames["sq_sidenav"].reload_asset("'.$broadcaster->id.
'");');
1709 $this->_refreshing_assets[] = $broadcaster->id;
1727 if (!($broadcaster instanceof
Asset))
return;
1728 if (!in_array($broadcaster->id, $this->_refreshing_assets)) {
1729 $this->
addOnLoad(
'if (parent.frames["sq_sidenav"] && parent.frames["sq_sidenav"].reload_asset) parent.frames["sq_sidenav"].reload_asset("'.$broadcaster->id.
'");');
1730 $this->_refreshing_assets[] = $broadcaster->id;
1747 if (!($broadcaster instanceof
Asset))
return;
1748 if (!in_array($broadcaster->id, $this->_refreshing_assets)) {
1749 $this->
addOnLoad(
'if (parent.frames["sq_sidenav"] && parent.frames["sq_sidenav"].reload_asset) parent.frames["sq_sidenav"].reload_asset("'.$broadcaster->id.
'");');
1750 $this->_refreshing_assets[] = $broadcaster->id;
1767 if (!($broadcaster instanceof
Asset))
return;
1768 if (!in_array($broadcaster->id, $this->_refreshing_assets)) {
1769 if ($event_data[
'old_type'] != $event_data[
'new_type']) {
1770 $this->
addOnLoad(
'if (parent.frames["sq_sidenav"] && parent.frames["sq_sidenav"].reload_asset) parent.frames["sq_sidenav"].reload_asset("'.$broadcaster->id.
'");');
1771 $this->_refreshing_assets[] = $broadcaster->id;
1789 if (!($broadcaster instanceof
Asset))
return;
1790 if (!in_array($broadcaster->id, $this->_refreshing_assets)) {
1791 if ($event_data[
'old_status'] != $event_data[
'new_status']) {
1792 $this->
addOnLoad(
'if (parent.frames["sq_sidenav"] && parent.frames["sq_sidenav"].reload_asset) parent.frames["sq_sidenav"].reload_asset("'.$broadcaster->id.
'");');
1793 $this->_refreshing_assets[] = $broadcaster->id;
1808 return $this->_section_count;