18 require_once SQ_FUDGE_PATH.
'/general/general.inc';
65 return current_url().
'?SQ_BACKEND_PAGE='.$target;
79 header(
'Content-Type: text/html; charset='.SQ_CONF_DEFAULT_CHARACTER_SET);
82 if (!isset($_REQUEST[
'limbo_assetid'])) {
83 if (isset($_REQUEST[
'assetid'])) {
84 $_REQUEST[
'limbo_assetid'] = $_REQUEST[
'assetid'];
86 $limbo_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAssetFromURL();
87 if (is_null($limbo_asset))
return;
88 $_REQUEST[
'limbo_assetid'] = $limbo_asset->id;
92 if (!isset($_REQUEST[
'assetid'])) {
93 $_REQUEST[
'assetid'] = $_REQUEST[
'limbo_assetid'];
101 if (!isset($_REQUEST[
'assetid']) && isset($_REQUEST[
'a'])) {
102 $_REQUEST[
'assetid'] = $_REQUEST[
'a'];
104 if (isset($_REQUEST[
'assetid'])) {
105 $printing_assetid = (SQ_IN_LIMBO) ? $_REQUEST[
'limbo_assetid'] : $_REQUEST[
'assetid'];
106 $printing_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($printing_assetid);
107 if (is_null($printing_asset)) {
108 trigger_localised_error(
'SYS0195', E_USER_WARNING, $printing_assetid);
112 if (!$printing_asset->backendAccess()) {
113 $GLOBALS[
'SQ_SYSTEM']->paintLogin(translate(
'login'), translate(
'cannot_access_asset', $printing_asset->name));
119 if (!$GLOBALS[
'SQ_SYSTEM']->user->canAccessBackend()) {
120 $GLOBALS[
'SQ_SYSTEM']->paintLogin(
'Login', translate(
'must_be_backend_user'));
125 if (isset($_REQUEST[
'a'])) {
126 $frontend_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($_REQUEST[
'a']);
127 if (is_null($frontend_asset)) {
128 trigger_localised_error(
'SYS0195', E_USER_WARNING, $_REQUEST[
'a']);
131 $frontend_asset->printFrontend();
137 if (empty($_REQUEST[
'SQ_BACKEND_PAGE']) && isset($_REQUEST[
'ignore_frames']) && $_REQUEST[
'ignore_frames'] ==
'1') {
139 $_REQUEST[
'SQ_BACKEND_PAGE'] =
'main';
142 if (isset($_REQUEST[
'asset_ei_screen'])) {
147 if (SQ_IN_LIMBO && !isset($_REQUEST[
'SQ_BACKEND_PAGE'])) {
148 $_REQUEST[
'SQ_BACKEND_PAGE'] =
'main';
153 if (SQ_DESIGN_NO_FRAME && SQ_IN_LIMBO) {
154 $_REQUEST[
'SQ_BACKEND_PAGE'] =
'main';
157 if (empty($_REQUEST[
'SQ_BACKEND_PAGE']) || $_REQUEST[
'SQ_BACKEND_PAGE'] ==
'frames') {
160 }
else if ($_REQUEST[
'SQ_BACKEND_PAGE'] ==
'asset_map_request') {
161 require_once SQ_LIB_PATH.
'/asset_map/asset_map.inc';
163 $asset_map->process($this);
168 if (SQ_IN_LIMBO && (($_REQUEST[
'SQ_BACKEND_PAGE'] ==
'main') && (array_get_index($_REQUEST,
'am_section',
'') !=
'forceably_acquire_lock'))) {
170 require_once SQ_INCLUDE_PATH.
'/limbo_outputter.inc';
174 require_once SQ_INCLUDE_PATH.
'/backend_outputter.inc';
178 if (isset($_REQUEST[
'SQ_BACKEND_PAGE'])) {
180 $this->out->addFormActionGetVar(
'SQ_BACKEND_PAGE', $_REQUEST[
'SQ_BACKEND_PAGE'], TRUE);
184 switch ($_REQUEST[
'SQ_BACKEND_PAGE']) {
190 $this->_printSideNav();
198 $this->_printNavResizer();
202 trigger_localised_error(
'SYS0097', E_USER_ERROR, $_REQUEST[
'SQ_BACKEND_PAGE']);
206 if (!SQ_IN_LIMBO || (($_REQUEST[
'SQ_BACKEND_PAGE'] !=
'main') || (array_get_index($_REQUEST,
'am_section',
'') ==
'forceably_acquire_lock'))) {
227 if (!isset($_REQUEST[
'assetid'])) {
228 $url_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAssetFromURL(current_protocol(), NULL, TRUE, TRUE);
229 if (!is_null($url_asset)) {
230 $main_extras =
'&assetid='.$url_asset->id.
'&sq_from_frontend=1';
234 $query_vars = Array();
235 parse_str($_SERVER[
'QUERY_STRING'], $query_vars);
236 if (!empty($query_vars)) {
240 if (isset($query_vars[
'SQ_BACKEND_PAGE'])) {
241 unset($query_vars[
'SQ_BACKEND_PAGE']);
246 foreach ($query_vars as $key => $value) {
247 if ($key ==
'SQ_ACTION')
continue;
248 $main_extras .=
'&'.urlencode($key).
'='.urlencode($value);
252 $main_url = strip_url($_SERVER[
'PHP_SELF']).
'?SQ_BACKEND_PAGE=main'.$main_extras;
255 'header' => $_SERVER[
'PHP_SELF'].
'?SQ_BACKEND_PAGE=header',
257 'sidenav' => $_SERVER[
'PHP_SELF'].
'?SQ_BACKEND_PAGE=sidenav',
258 'resizer' => $_SERVER[
'PHP_SELF'].
'?SQ_BACKEND_PAGE=resizer',
260 $limbo_hipo = SQ_IN_LIMBO && (strpos($main_url,
'SQ_ACTION=hipo') !== FALSE);
263 $limbo_hide_frames = SQ_IN_LIMBO && $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_LIMBO_HIDE_FRAMES');
266 if (isset($_GET[
'hide_frames'])) {
267 $limbo_hide_frames = $limbo_hide_frames && $_GET[
'hide_frames'];
272 $page_title = translate(
'page_title_simple_edit_interface', SQ_SYSTEM_LONG_NAME);
274 $page_title = translate(
'page_title_admin_interface', SQ_SYSTEM_LONG_NAME);
280 <title><?php echo $page_title; ?></title>
281 <meta http-equiv=
"Content-Type" content=
"text/html; charset=<?php echo SQ_CONF_DEFAULT_CHARACTER_SET; ?>">
282 <link rel=
"shortcut icon" href=<?php echo
'"'.sq_web_path(
'lib').
'/web/images/icons/favicon.ico"'; ?>/>
286 <script language=
"Javascript" type=
"text/javascript">
287 document.location =
"<?php echo $main_url; ?>";
298 $header_height = $limbo_hide_frames ? 0 : 28;
299 $am_width = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_ASSET_MAP_WIDTH');
300 $sidenav_width = SQ_IN_LIMBO ? 0 : ($am_width+5);
301 $resizer_width = $limbo_hide_frames ? 0 : 10;
302 $frameset_cols = $sidenav_width.
','.$resizer_width.
',*';
304 <frameset rows=
"<?php echo $header_height; ?>,*" frameborder=
"0" border=
"0">
305 <frame src=
"<?php echo $frame_urls['header']; ?>" name=
"sq_header" scrolling=
"no" marginwidth=
"0" marginheight=
"0">
306 <frameset cols=
"<?php echo $frameset_cols; ?>" frameborder=
"0" border=
"0" id =
"main_frameset">
307 <frame src=
"<?php echo $frame_urls['sidenav']; ?>" name=
"sq_sidenav" scrolling=
"no" marginwidth=
"0" marginheight=
"0">
308 <frame src=
"<?php echo $frame_urls['resizer']; ?>" name=
"sq_resizer" scrolling=
"no" marginwidth=
"0" marginheight=
"0">
309 <frame src=
"<?php echo $frame_urls['main']; ?>" name=
"sq_main" marginwidth=
"0" marginheight=
"0" scrolling=
"yes">
329 if (isset($_GET[
'sq_popups_blocked'])) {
330 $_SESSION[
'sq_popups_blocked'] = (int) $_GET[
'sq_popups_blocked'];
332 $popups_blocked = (!isset($_SESSION[
'sq_popups_blocked']) || $_SESSION[
'sq_popups_blocked']);
333 $dhtml_messages = Array();
335 if ($GLOBALS[
'SQ_SYSTEM']->am->installed(
'search_manager')) {
336 $asset_search_default = translate(
'asset_search_default_keyword');
338 $asset_search_default = translate(
'asset_search_default');
341 $this->out->openRaw();
343 <script language=
"JavaScript" type=
"text/javascript" src=
"<?php echo sq_web_path('lib') ?>/js/general.js"></script>
344 <script language=
"JavaScript" type=
"text/javascript">
346 var REFRESH_UPDATE = <?php echo max(10, (
int) SQ_CONF_REFRESH_INTERVAL); ?>;
347 var MAX_UPDATE = <?php echo max(10, (
int) SQ_CONF_LOCK_LENGTH - 60); ?>;
349 var popups_blocked =
'<?php echo (int) $popups_blocked; ?>';
353 var delay_header =
false;
356 var header_delayed = 0;
366 function reloadHeader(force) {
367 if (arguments.length == 0) force =
false;
369 var current_assetid =
'';
373 msgDiv = parent.frames[
"sq_main"].document.getElementById(
"new_message_popup");
379 delay_header =
false;
382 if (!msgDiv || msgDiv.style.display ==
"none") {
383 delay_header =
false;
387 header_delayed =
true;
390 reload_timeout = setTimeout(
"reloadHeader()", 10 * 1000);
394 if (parent.frames[
"sq_main"] && parent.frames[
"sq_main"].get_form_element_value && parent.frames[
"sq_main"].SQ_DOCUMENT_LOADED) {
395 current_assetid = parent.frames[
"sq_main"].get_form_element_value(
'backend_assetid');
396 lock_type = parent.frames[
"sq_main"].get_form_element_value(
'sq_lock_type');
400 limbo_lock_type = parent.frames[
"sq_main"].get_form_element_value(
'sq_limbo_lock_type');
405 var url =
'<?php echo $this->getBackendUrl('header
'); ?>'
406 +
'¤t_assetid=' + current_assetid
407 +
'&sq_lock_type=' + lock_type
411 +
'&sq_limbo_lock_type=' + limbo_lock_type
415 +
'&sq_popups_blocked=' + popups_blocked;
416 document.location = url;
420 $this->out->addOnLoad(
'reload_timeout = setTimeout("reloadHeader()", REFRESH_UPDATE * 1000);');
421 $this->out->addOnLoad(
'reload_force_timeout = setTimeout("reloadHeader(true)", MAX_UPDATE * 1000);');
423 if (!SQ_IN_LIMBO && isset($_SESSION[
'backend_header_last_refresh'])) {
426 $where =
'updated > '.$date;
427 $where = $GLOBALS[
'SQ_SYSTEM']->constructRollbackWhereClause($where);
428 $sql =
'SELECT assetid FROM '.SQ_TABLE_RUNNING_PREFIX.
'ast '.$where;
434 }
catch (Exception $e) {
435 throw new Exception(
'Unable to get updated assetids in _printHeader due to database error: '.$e->getMessage());
438 if (!empty($updated_assetids)) {
439 $this->out->addOnLoad(
'
440 if (parent.frames["sq_sidenav"] && parent.frames["sq_sidenav"].reload_assets) {
441 parent.frames["sq_sidenav"].reload_assets("'.addslashes(implode(
',', $updated_assetids)).
'");
449 if (!empty($_GET[
'current_assetid']) && !empty($_GET[
'sq_lock_type'])) {
450 $GLOBALS[
'SQ_SYSTEM']->am->updateLock($_GET[
'current_assetid'], $_GET[
'sq_lock_type']);
453 if (SQ_IN_LIMBO && !empty($_GET[
'sq_limbo_lock_type'])) {
454 foreach (@unserialize(urldecode($_GET[
'sq_limbo_lock_type'])) as $limbo_lock_types) {
455 if ($limbo_lock_types != $_GET[
'sq_lock_type']) {
456 $GLOBALS[
'SQ_SYSTEM']->am->updateLock($_GET[
'current_assetid'], $limbo_lock_types);
466 if (!empty($_POST[
'asset_search']) && $_POST[
'asset_search'] != $asset_search_default) {
467 include_once SQ_LIB_PATH.
'/backend_search/backend_search.inc';
469 $_POST[
'asset_search'] = trim($_POST[
'asset_search']);
471 $assetid_match = FALSE;
475 $searched_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAssetFromURL(NULL, strip_url($_POST[
'asset_search'], TRUE), TRUE, TRUE);
476 if (is_null($searched_asset) && assert_valid_assetid($_POST[
'asset_search'],
'', TRUE, FALSE)) {
478 $searched_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($_POST[
'asset_search'],
'', TRUE);
479 if (!is_null($searched_asset)) $assetid_match = TRUE;
484 $result_list = Array();
485 if (!is_null($searched_asset)) {
486 $this->out->addOnLoad(
'
487 if (parent.frames["sq_main"]) {
488 parent.frames["sq_main"].location = "'.$_SERVER[
'PHP_SELF'].
'?SQ_BACKEND_PAGE=main&backend_section=am&am_section=edit_asset&assetid='.urlencode($searched_asset->id).
'";
492 $search_terms = $_POST[
'asset_search'];
495 }
catch (Exception $e) {
496 $error_msg = $e->getMessage();
497 log_error(
'Search for "'.$_POST[
'asset_search'].
'" failed due to error: '.$error_msg, E_USER_WARNING);
503 if (empty($results)) {
504 $msg = (!empty($error_msg)) ?
'failed_searching_for_error' :
'failed_searching_for';
505 $html = $this->_getDHTMLMessage(translate(
'search_failed'), translate($msg, addslashes($_POST[
'asset_search'])),
'search-failed',
'info');
506 $dhtml_messages[
'search_failed'] = Array(
'html' => str_replace(
"\n",
'', $html),
'width' =>
'400',
'timeout' => 6.0);
508 $detail_lines[] =
'<strong>'.
'Matched on Keyword ('.count($results).
' asset'.(count($results) == 1 ?
'' :
's').
'):'.
'</strong>';
511 foreach ($results as $result_assetid => $result_detail) {
512 $this_detail = Array();
514 foreach ($result_detail as $result_component_name => $result_component) {
515 foreach ($result_component as $name => $value) {
518 switch ($result_component_name) {
520 $name_detail =
'Asset Contents';
524 $name_detail = ($result_component_name ==
'schema' ?
'Default ' :
'').
'Metadata: ';
528 $attr_values = $GLOBALS[
'SQ_SYSTEM']->am->getAttributeValuesByName(
'friendly_name',
'metadata_field', Array($name));
529 if (empty($attr_values)) {
530 $name_detail .= $value[
'name'];
532 $name_detail .= $attr_values[$name];
535 $value = $value[0][
'value'];
538 $name_detail = ($result_component_name ==
'schema' ?
'Default ' :
'').
'Metadata: ';
542 $attr_values = $GLOBALS[
'SQ_SYSTEM']->am->getAttributeValuesByName(
'friendly_name',
'metadata_field', Array($name));
543 if (empty($attr_values)) {
544 $name_detail .= $value[
'name'];
546 $name_detail .= $attr_values[$name];
549 $value = $value[
'value'];
553 $name_detail =
'Attribute: '.ucwords(str_replace(
'_',
' ', $name));
557 $words = preg_split(
'/[\r\n\t \|\&\~\/]+/', $search_terms);
558 $value = strip_tags($value);
560 preg_match_all(
'/('.addslashes(implode(
'|', $words)).
')/i', $value, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
562 if (count($matches) > 0) {
570 if ($matches[count($matches) - 1][0][1] < strlen($value) - 15) {
571 $value = substr_replace($value,
'...', $matches[count($matches) - 1][0][1] + 15);
574 for ($i = count($matches) - 1; $i > 0; $i--) {
575 $previous_match = $matches[$i - 1][0];
576 $this_match = $matches[$i][0];
578 $prev_pos = $previous_match[1] + strlen($previous_match[0]);
579 $next_pos = $this_match[1];
581 if (($next_pos - $prev_pos) > 30) {
582 $value = substr_replace($value,
'...', $prev_pos + 15, ($next_pos - $prev_pos) - 30);
587 if ($matches[0][0][1] > 15) {
588 $value = substr_replace($value,
'...', 0, $matches[0][0][1] - 15);
592 $value = ellipsisize($value, 120);
594 $value = preg_replace(
'/('.addslashes(implode(
'|', $words)).
')/i',
'<span class="sq-backend-search-results-highlight">$1</span>', $value);
597 $this_detail[] = $name_detail.
'<br/><em>'.str_replace(
"\r",
'', str_replace(
"\n",
'<br/>', $value)).
'</em>';
602 $result_list[] = Array(
603 'tag_line' => get_asset_tag_line($result_assetid,
'details'),
604 'detail' => implode($this_detail,
'<br/>'),
609 $keyword_match_line = Array();
611 if (!empty($result_list)) {
612 $results_per_page = min(count($result_list), $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'search_manager',
'SQ_SEARCH_BACKEND_PAGE_SIZE'));
614 if (count($result_list) > $results_per_page) {
615 $keyword_match_line[] =
'<div align="center">
616 <a href="" onclick="jumpToSearchResults(current = 0); return false;" title="Go back to first page"><<</a>
617 <a href="" onclick="jumpToSearchResults(current = Math.max(current - '.$results_per_page.
', 0)); return false;" title="Go back one page"><</a>
618 <strong>( <span id="sq-search-results-page-start">1</span> - <span id="sq-search-results-page-end">'.min(count($result_list), $results_per_page).
'</span> )</strong>
619 <a href="" onclick="jumpToSearchResults(current = Math.min(current + '.$results_per_page.
', Math.floor((parent.frames['.
"'sq_main'".
'].keyword_search_results.length - 1) / '.$results_per_page.
') * '.$results_per_page.
')); return false;" title="Go forward one page">></a>
620 <a href="" onclick="jumpToSearchResults(current = Math.floor((parent.frames['.
"'sq_main'".
'].keyword_search_results.length - 1) / '.$results_per_page.
') * '.$results_per_page.
'); return false;" title="Go forward to last page">>></a></a></div>';
624 $js_code .=
'with (parent.frames["sq_main"]) { current = 0; results_per_page = '.$results_per_page.
'; keyword_search_results = [];';
626 foreach ($result_list as $result) {
628 if ($i <= $results_per_page) {
629 $this_line =
'<div><div id="sq-search-results-expand-'.$i.
'" class="sq-search-results-expand-div"><a href="#" id="sq-search-results-expand-link-'.$i.
'" class="sq-search-results-expand-link" onclick="if (this.innerHTML == \'+\') {document.getElementById(\'sq-search-results-detail-'.$i.
'\').style.display = \
'block\'; this.innerHTML = \'-\';} else {document.getElementById(\'sq-search-results-detail-'.$i.
'\').style.display = \
'none\'; this.innerHTML = \'+\';} return false;">+</a></div>';
630 $this_line .=
'<div id="sq-search-results-entry-'.$i.
'" class="sq-search-results-entry">';
631 $this_line .= $result[
'tag_line'].
'<br/><div id="sq-search-results-detail-'.$i.
'" class="sq-search-results-detail">'.$result[
'detail'].
'</div></div></div>';
632 $keyword_match_line[] = $this_line;
635 $js_code .=
"\n".
'keyword_search_results['.($i-1).
'] = "'.addslashes(trim($result[
'tag_line'].
'<br/><div id=\'sq-search-results-detail-'.((($i-1) % $results_per_page) + 1).
'\' style=\
'display:none\'>'.$result[
'detail'])).
'</div>";';
641 $detail_lines[] = implode(
'', $keyword_match_line);
643 $html = $this->_getDHTMLMessage(translate(
'search_results'), $detail_lines,
'search-results');
644 $dhtml_messages[
'search_results'] = Array(
'html' => str_replace(
"\n",
'', preg_replace(
'|<script.*</script>|U',
'', $html)),
'width' =>
'300',
'timeout' => 0);
658 if ($popups_blocked) {
659 $html = $this->_getDHTMLMessage(translate(
'popups_blocked'), translate(
'disable_popup_blocking'),
'popups-blocked',
'stop', 32, 32);
660 $dhtml_messages[
'popups_blocked'] = Array(
'html' => str_replace(
"\n",
'', $html),
'width' =>
'400',
'timeout' => 6.0);
667 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
669 $alljobs = @$hh->getJobsForUser($GLOBALS[
'SQ_SYSTEM']->user->id);
674 for ($i = 0; $i < count($alljobs); $i++) {
675 $job_last_updated = $alljobs[$i][
'last_updated'];
676 $job_last_updated_timestamp = strtotime($job_last_updated);
677 if (($now - $job_last_updated_timestamp) >= 300) {
682 if ($stalledjobs != 0) {
683 $html = $this->_getDHTMLMessage(translate(
'hipo_jobs_stalled'), translate(
'hipo_jobs_count', $GLOBALS[
'SQ_SYSTEM']->user->name, $stalledjobs),
'new-message',
'stop', 32, 32);
684 $dhtml_messages[
'hipo_jobs_stalled'] = Array(
'html' => str_replace(
"\n",
'', $html),
'width' =>
'400',
'timeout' => 6.0);
690 $ms = $GLOBALS[
'SQ_SYSTEM']->getMessagingService();
692 $msgs_from = (isset($_SESSION[
'backend_header_last_refresh'])) ? $_SESSION[
'backend_header_last_refresh'] : NULL;
693 $from = time() - 28800;
694 $loading_start = time();
695 $read_messages = $ms->getMessages($GLOBALS[
'SQ_SYSTEM']->user->id, NULL, Array(SQ_MSG_READ), Array(), $from, NULL, NULL, Array(), 0, TRUE);
696 $messages = $ms->getMessages($GLOBALS[
'SQ_SYSTEM']->user->id, NULL, Array(SQ_MSG_UNREAD), Array(), NULL, NULL, NULL, Array(), 0, TRUE);
697 $loading_time = time() - $loading_start;
700 if($loading_time >= 30) {
701 $html = $this->_getDHTMLMessage(
'Too slow to load messages',
'The Internal Messages is taking too long to load. Try running the <a href="http://manuals.matrix.squizsuite.net/server-administrator/chapters/remove-internal-messages-script" target="_blank">Remove Internal Message Script</a> to clean up internal messages within your system.',
'new-message',
'stop', 48, 48);
702 $dhtml_messages[
'warning_messsage'] = Array(
'html' =>str_replace(
"\n",
'', $html),
'width' =>
'400',
'timeout' => 12.0);
706 if (!empty($messages)) {
707 $html = $this->_getDHTMLMessage(translate(
'new_messages'), translate(
'new_messages_count', htmlspecialchars($GLOBALS[
'SQ_SYSTEM']->user->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET), $messages),
'new-message',
'mail', 31, 37);
708 $dhtml_messages[
'new_messages'] = Array(
'html' => str_replace(
"\n",
'', $html),
'width' =>
'220',
'timeout' => 6.0);
715 if (!empty($dhtml_messages)) {
717 <script language=
"Javascript" type=
"text/javascript">
723 if (parent.frames[
"sq_sidenav"] != null && parent.frames[
"sq_sidenav"].document.getElementById(
'sq_messages_text') != null) {
724 parent.frames[
"sq_sidenav"].document.getElementById(
'sq_messages_text').innerHTML=
"<?php echo translate('inbox_new_messages', $messages, ($read_messages+$messages)); ?>";
731 var screenMenu = null;
732 var screenMenuFiller = null;
737 var messageIndex = 0;
746 var currentTimeout = 0;
751 to_move = Math.max(Math.min(Math.abs(divTop) * 0.08, 10), 2);
753 msgDiv.style.top = (divTop + parent.frames[
"sq_main"].document.body.scrollTop) +
"px";
754 if (divTop >= -0.1 && myTimer != null) {
755 clearInterval(myTimer);
757 if (currentTimeout != 0) {
758 setTimeout(
"cancelMsgDiv()", currentTimeout);
763 function showMsgDiv() {
765 if (window.navigator.userAgent.indexOf(
'MSIE') > 0) {
766 screenMenuFiller.style.width = screenMenu.offsetWidth;
767 screenMenuFiller.style.height = screenMenu.offsetHeight;
768 screenMenuFiller.style.display =
"block";
769 screenMenu.style.display =
"none";
771 screenMenu.style.MozOpacity =
"0";
774 msgDiv.style.visibility =
"hidden";
775 msgDiv.style.display =
"block";
776 counter = msgDiv.offsetHeight;
778 divTop = (counter * -1);
779 msgDiv.style.top = divTop +
"px";
780 msgDiv.style.visibility =
"visible";
782 myTimer = setInterval(
"moveIt()", delay);
785 function cancelMsgDiv() {
786 clearInterval(myTimer);
787 msgDiv.style.display =
"none";
789 if (window.navigator.userAgent.indexOf(
'MSIE') > 0) {
790 screenMenu.style.display =
"block";
791 screenMenuFiller.width =
"0px";
792 screenMenuFiller.height =
"0px";
793 screenMenuFiller.style.display =
"none";
795 screenMenu.style.MozOpacity =
"1";
800 function showNextMessage() {
801 if (!popupContents[messageIndex]) {
802 delay_header =
false;
803 if (header_delayed) reloadHeader();
809 msgDiv.innerHTML = popupContents[messageIndex][
'html'];
810 currentTimeout = popupContents[messageIndex][
'timeout'];
811 msgDiv.style.width = popupContents[messageIndex][
'width'] +
"px";
812 msgDiv.style.right =
"10px";
814 setTimeout(
"showMsgDiv()", 500);
818 top.frames[
"sq_main"].document.getElementById(
"sq-search-wait-popup").style.display =
"none";
821 var popupContents =
new Array();
824 foreach ($dhtml_messages as $code => $message) {
825 if ($code ==
'popups_blocked')
continue;
827 popupContents[<?php echo $i; ?>] = Array();
828 popupContents[<?php echo $i; ?>][
'html'] =
'<?php echo addslashes($message['html
']); ?>';
829 popupContents[<?php echo $i; ?>][
'width'] =
'<?php echo addslashes($message['width
']); ?>';
830 popupContents[<?php echo $i; ?>][
'timeout'] =
'<?php echo addslashes(array_get_index($message, 'timeout
', 0) * 1000); ?>';
836 if (parent.frames[
"sq_main"].document.body && parent.frames[
"sq_main"].SQ_DOCUMENT_LOADED) {
838 msgDiv = parent.frames[
"sq_main"].document.getElementById(
"new_message_popup");
839 screenMenu = parent.frames[
"sq_main"].document.getElementById(
"sq_screen_menu");
840 screenMenuFiller = parent.frames[
"sq_main"].document.getElementById(
"sq_screen_menu_filler");
841 if (msgDiv == null) {
842 msgDiv = parent.frames[
"sq_main"].document.createElement(
"div");
843 msgDiv.id =
"new_message_popup";
844 msgDiv.style.position =
"absolute";
845 msgDiv.style.display =
"block";
846 msgDiv.style.top =
"-1000px";
847 msgDiv.style.right =
"-1000px";
848 msgDiv.style.zIndex =
"10";
849 parent.frames[
"sq_main"].document.body.appendChild(msgDiv);
854 if (!empty($js_code)) {
855 echo str_replace(
"\n",
' ', $js_code);
858 if (isset($dhtml_messages[
'popups_blocked'])) {
860 var popup = window.open(
'',
'sq_popup_test',
'width=1px,height=1px,top=0,left=0');
862 msgDiv.innerHTML =
'<?php echo addslashes($dhtml_messages['popups_blocked
']['html
']); ?>';
863 setTimeout(
"showMsgDiv()", 500);
864 divLeft = parent.frames[
"sq_main"].document.body.offsetWidth + parent.frames[
"sq_main"].document.body.scrollLeft - <?php echo $dhtml_messages[
'popups_blocked'][
'width']; ?> - 20;
865 msgDiv.style.width =
"<?php echo addslashes($dhtml_messages['popups_blocked']['width']); ?>px";
866 msgDiv.style.right =
"10px";
870 popups_blocked =
'0';
887 if (SQ_ROLLBACK_VIEW) {
888 $now = strtotime($_SESSION[
'sq_rollback_view'][
'rollback_time']);
894 <style type=
"text/css">
895 body { background: #342939; }
897 <table cellpadding=
"1" border=
"0" cellspacing=
"1" width=
"100%">
899 <td nowrap
class=
"sq-backend-header-item" valign=
"middle">
900 <img src=
"<?php echo sq_web_path('lib'); ?>/web/images/blank.gif" width=
"5" height=
"1" />
901 <a href=
"#" onclick=
"Javascript: reloadHeader(); return false;"><?php echo translate(
'logged_in_as', htmlspecialchars($GLOBALS[
'SQ_SYSTEM']->user->name, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET)); ?></a> -
904 if (defined(
'SQ_LICENCE_WARRANTY_KEY')) {
905 $wkey_snippet = substr(base64_decode(SQ_LICENCE_WARRANTY_KEY), 0, 6);
906 $ikey_snippet = substr(SQ_LICENCE_INSTALL_KEY, 0, 6);
908 $expiry_date = substr(base64_decode(SQ_LICENCE_WARRANTY_KEY), 14);
909 $current_date = date(
'Ymd');
910 if ((SQ_LICENCE_WARRANTY_KEY ===
'') || ($current_date > $expiry_date) || ($wkey_snippet !== $ikey_snippet)) {
911 $message = translate(
'licence_type_no_warranty');
913 $message = translate(
'licence_type_warranty_valid');
917 $message = translate(
'licence_type_no_warranty');
922 <td nowrap
class=
"sq-backend-header-item" valign=
"middle" align=
"right">
924 if (!isset($_SESSION[
'login_as_invoker_username']) && ($GLOBALS[
'SQ_SYSTEM']->userRoot() || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin())) {
926 <table cellpadding=
"0" border=
"0" cellspacing=
"0" id=
"login_as_form" style=
"display: none; height: 23px;" align=
"right">
928 <td nowrap valign=
"middle">
930 function submit_login_as()
932 var login_as_user = document.getElementById(
'user').value;
933 if ((login_as_user.length > 0) && (login_as_user !=
'root') && (login_as_user !=
'<?php htmlentities($GLOBALS['SQ_SYSTEM
']->user->attr('username
'), ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET); ?>')) {
934 top.location =
'./?SQ_ACTION=login_as&user='+login_as_user;
938 function show_login_as_form()
940 document.getElementById(
'login_as_form').style.display =
'block';
941 document.getElementById(
'tool_buttons').style.display =
'none';
944 function hide_login_as_form()
946 document.getElementById(
'login_as_form').style.display =
'none';
947 document.getElementById(
'tool_buttons').style.display =
'block';
951 echo
'<span class="sq-backend-header-item">'.translate(
'login_as').
'</span>';
952 text_box(
'user',
'', 22, 0, TRUE,
'class="sq-backend-header-search-box" onkeypress="if (event.keyCode == 13) submit_login_as();"');
954 <input type=
"button" style=
"height: 20px;" value=
"Login" onclick=
"submit_login_as();" />
955 <input type=
"button" style=
"height: 20px;" value=
"Cancel" onclick=
"hide_login_as_form();" />
962 <table cellpadding=
"0" border=
"0" cellspacing=
"0" id=
"tool_buttons" align=
"right">
964 <td nowrap valign=
"middle">
966 echo
'<span class="sq-backend-header-item">'.translate(
'quick_search').
'</span>';
967 text_box(
'asset_search', (!empty($_POST[
'asset_search'])) ? $_POST[
'asset_search'] : $asset_search_default, 30, 0, empty($_POST[
'asset_search']),
'class="sq-backend-header-search-box" onkeypress="if (event.keyCode == 13) form.submit();"');
969 echo
'<input type="image" class="sq-backend-header-search-button" alt="Go" src="'.sq_web_path(
'lib').
'/web/images/icons/header/search.png" onClick="form.submit();">';
976 if ($GLOBALS[
'SQ_SYSTEM']->userRoot() || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin()) {
978 'url' => $this->
getBackendUrl(
'main').
'&backend_section=config',
979 'target' =>
'sq_main',
980 'title' => translate(
'system_configuration'),
981 'icon' =>
'system_config.png',
986 'url' => $this->
getBackendUrl(
'main').
'&backend_section=tools',
987 'target' =>
'sq_main',
988 'title' => translate(
'tools'),
989 'icon' =>
'whereami.png',
993 'url' => $this->
getBackendUrl(
'main').
'&backend_section=hipo_herder',
994 'target' =>
'sq_main',
995 'title' => translate(
'hipo_herder'),
996 'icon' =>
'hipo_herder.png',
999 if ($GLOBALS[
'SQ_SYSTEM']->userRoot() || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin()) {
1001 'url' => $this->
getBackendUrl(
'main').
'&backend_section=sys_maintenance',
1002 'target' =>
'sq_main',
1003 'title' => translate(
'system_maintenance'),
1004 'icon' =>
'system_maintenance.png',
1009 'url' => $this->
getBackendUrl(
'main').
'&backend_section=am',
1010 'target' =>
'sq_main',
1011 'title' => translate(
'asset_tree'),
1012 'icon' =>
'asset_tree.png',
1015 if (!isset($_SESSION[
'login_as_invoker_username']) && ($GLOBALS[
'SQ_SYSTEM']->userRoot() || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin())) {
1018 'title' => translate(
'login_as'),
1019 'icon' =>
'login_as.png',
1020 'onclick' =>
'document.getElementById("tool_buttons").style.display = "none"; document.getElementById("login_as_form").style.display = "block"; document.getElementById("user").focus();',
1024 $logout_button_tooltip = translate(
'logout');
1025 $logout_icon =
'logout.png';
1028 if (isset($_SESSION[
'login_as_invoker_username'])) {
1029 $logout_button_tooltip = translate(
'logout_and_resume', htmlentities($_SESSION[
'login_as_invoker_username'], ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET));
1030 $logout_icon =
'logout_and_resume.png';
1034 'url' => $_SERVER[
'PHP_SELF'].
'?SQ_ACTION=logout',
1036 'title' => $logout_button_tooltip,
1037 'icon' => $logout_icon,
1042 if (!isset($_SESSION[
'login_as_invoker_username']) && ($GLOBALS[
'SQ_SYSTEM']->userRoot() || $GLOBALS[
'SQ_SYSTEM']->userSystemAdmin())) {
1045 'title' => translate(
'login_as'),
1046 'icon' =>
'login_as.png',
1047 'onclick' =>
'show_login_as_form();',
1051 if (isset($_SESSION[
'login_as_invoker_username'])) {
1054 'title' => translate(
'logout_and_resume', $_SESSION[
'login_as_invoker_username']),
1055 'icon' =>
'logout_and_resume.png',
1060 'url' => current_url(TRUE, TRUE),
1062 'title' =>
'Exit Editing Mode',
1063 'icon' =>
'exit_limbo.png',
1068 foreach ($options as $option) {
1069 if (isset($option[
'url'])) {
1070 ?><a href=
"<?php echo $option['url'];?>"<?php
1074 class=
"sq-backend-header-item"
1075 title=
"<?php echo htmlspecialchars($option['title']);?>"
1076 onMouseOver=
"window.status = '<?php echo htmlspecialchars($option['title']);?>'; return true;"
1077 onMouseOut =
"window.status = ''; return true;"
1078 style=
"cursor: pointer;"
1079 <?php echo (isset($option[
'target'])) ?
'target="'.$option[
'target'].
'"' :
''; ?>
1080 <?php echo (isset($option[
'onclick'])) ?
'onClick="'.htmlspecialchars($option[
'onclick']).
'"' :
''; ?>
1081 <?php echo (isset($option[
'extras'])) ? $option[
'extras'] :
''; ?>
1083 ><script language=
"JavaScript" type=
"text/javascript">sq_print_icon(
"<?php echo $this->out->filesPath('/images/icons/header/'.$option['icon']); ?>",
"20",
"20",
"<?php echo htmlspecialchars($option['title']);?>");</script></a>
1095 $this->out->closeRaw();
1097 $_SESSION[
'backend_header_last_refresh'] = time();
1108 function _printSideNav()
1110 $this->out->openRaw();
1111 $include_list = $GLOBALS[
'SQ_SYSTEM']->lm->getJavascriptIncludes();
1112 $include_list[] = sq_web_path(
'lib').
'/js/general.js';
1113 foreach ($include_list as $link) {
1114 echo
'<script type="text/javascript" src="'.$link.
'"></script>'.
"\n";
1117 <style type=
"text/css">
1119 background: #342939;
1123 .sidenav-tab-start {
1124 background: url(
"<?php echo sq_web_path('lib'); ?>/web/images/sidenav_tab_start.png") no-repeat;
1126 .sidenav-tab-start-active {
1127 background: url(
"<?php echo sq_web_path('lib'); ?>/web/images/sidenav_active_tab_start.png") no-repeat;
1129 .sidenav-tab, .sidenav-tab-icon {
1130 background: url(
"<?php echo sq_web_path('lib'); ?>/web/images/sidenav_tab_bg.png");
1132 .sidenav-tab-active, .sidenav-tab-icon-active {
1133 background: url(
"<?php echo sq_web_path('lib'); ?>/web/images/sidenav_active_tab_bg.png");
1136 background: url(
"<?php echo sq_web_path('lib'); ?>/web/images/sidenav_tab_end.png") no-repeat;
1138 .sidenav-tab-end-active {
1139 background: url(
"<?php echo sq_web_path('lib'); ?>/web/images/sidenav_active_tab_end.png") no-repeat;
1142 .sidenav-tab-icon, .sidenav-tab-icon-active {
1146 .sidenav-tab a, .sidenav-tab-active a {
1152 text-decoration: none;
1157 border: 1px solid #342939;
1164 background-color: #FFFFFF;
1167 border: 1px solid #FFFFFF;
1170 background-color: #FFFFFF;
1171 border: 1px solid #A2A2A2;
1175 .myspace-section td, .myspace-section a {
1179 text-decoration: none;
1181 .myspace-section-header, .myspace-section-header a {
1184 text-decoration: none;
1187 <script type=
"text/javascript">
1188 var oldTabName =
'asset_map';
1189 var tabNames = Array(
'asset_map',
'my_space');
1191 function switchSideNav(tabName)
1193 var tabElement = null;
1196 for (var i=0; i < tabNames.length; i++) {
1197 if (tabNames[i] != tabName) {
1198 tabElement = document.getElementById(tabNames[i]);
1199 tabElement.style.visibility =
'hidden';
1203 tabElement = document.getElementById(tabName);
1204 tabElement.style.visibility =
'visible';
1207 var tabStart = document.getElementById(oldTabName +
'_tab_start');
1208 tabStart.className =
'sidenav-tab-start';
1209 var tabEnd = document.getElementById(oldTabName +
'_tab_end');
1210 tabEnd.className =
'sidenav-tab-end';
1211 var tabIcon = document.getElementById(oldTabName +
'_tab_icon');
1212 tabIcon.className =
'sidenav-tab-icon';
1213 var tab = document.getElementById(oldTabName +
'_tab');
1214 tab.className =
'sidenav-tab';
1216 tabStart = document.getElementById(tabName +
'_tab_start');
1217 tabStart.className =
'sidenav-tab-start-active';
1218 tabEnd = document.getElementById(tabName +
'_tab_end');
1219 tabEnd.className =
'sidenav-tab-end-active';
1220 tabIcon = document.getElementById(tabName +
'_tab_icon');
1221 tabIcon.className =
'sidenav-tab-icon-active';
1222 tab = document.getElementById(tabName +
'_tab');
1223 tab.className =
'sidenav-tab-active';
1226 oldTabName = tabName;
1234 <table cellspacing=
"0" cellpadding=
"0" border=
"0" width=
"100%" height=
"100%">
1236 <td
class=
"sq-backend-header-item" style=
"width: 100%;"><img style=
"margin-left: 21px; margin-bottom: 5px;" src=
"<?php echo sq_web_path('lib'); ?>/web/images/icons/asset_map/matrix_logo.gif" alt=
"MySource Matrix" /></td>
1239 <td height=
"100%" valign=
"top"> </td>
1242 <td
class=
"sq-backend-header-item" style=
"padding-bottom: 5px;">
1243 <a href=
"<?php echo SQ_SYSTEM_URL;?>" class=
"sq-backend-header-item" target=
"_blank" style=
"text-decoration:none;"><?php echo SQ_SYSTEM_LONG_NAME;?></a>
1247 <div
id=
"asset_map" style=
"position: absolute; top: 27px; left: 6px; visibility: visible; border-top: 0px none; border-left: 0px none;">
1249 require_once SQ_LIB_PATH.
'/asset_map/asset_map.inc';
1251 $am_width = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_ASSET_MAP_WIDTH');
1252 $asset_map->embedAssetMap(
'simple', $am_width);
1259 <table cellspacing=
"0" cellpadding=
"0" border=
"0" width=
"100%" height=
"100%">
1261 <td
class=
"sq-backend-header-item" style=
"width: 100%;"><img style=
"margin-left: 21px; margin-bottom: 5px;" src=
"<?php echo sq_web_path('lib'); ?>/web/images/icons/asset_map/matrix_logo.gif" alt=
"MySource Matrix" /></td>
1264 <td height=
"100%" valign=
"top">
1265 <table cellspacing=
"0" cellpadding=
"0">
1267 <td><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/blank.gif" width=
"24" height=
"1" /></td>
1269 <td
class=
"sidenav-tab-start-active" id=
"asset_map_tab_start"><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/blank.gif" width=
"2" height=
"20" /></td>
1270 <td
class=
"sidenav-tab-icon-active" id=
"asset_map_tab_icon"><script language=
"JavaScript" type=
"text/javascript">sq_print_icon(
"<?php echo sq_web_path('lib'); ?>/web/images/icons/asset_map/tree.png",
"14",
"14",
"");</script></td>
1271 <td
class=
"sidenav-tab-active" id=
"asset_map_tab"><a href=
"#" onClick=
"Javascript: switchSideNav('asset_map'); return false;"><?php echo translate(
'asset_map'); ?></a></td>
1272 <td
class=
"sidenav-tab-end-active" id=
"asset_map_tab_end"><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/blank.gif" width=
"3" height=
"20" /></td>
1274 <td
class=
"sidenav-tab-start" id=
"my_space_tab_start"><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/blank.gif" width=
"2" height=
"20" /></td>
1275 <td
class=
"sidenav-tab-icon" id=
"my_space_tab_icon"><script language=
"JavaScript" type=
"text/javascript">sq_print_icon(
"<?php echo sq_web_path('lib'); ?>/web/images/icons/asset_map/myspace.png",
"14",
"14",
"");</script></td>
1276 <td
class=
"sidenav-tab" id=
"my_space_tab"><a href=
"#" onClick=
"Javascript: switchSideNav('my_space'); return false;"><?php echo translate(
'my_space'); ?></a></td>
1277 <td
class=
"sidenav-tab-end" id=
"my_space_tab_end"><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/blank.gif" width=
"3" height=
"20" /></td>
1283 <td
class=
"sq-backend-header-item" style=
"padding-bottom: 5px;">
1284 <a href=
"<?php echo SQ_SYSTEM_URL;?>" class=
"sq-backend-header-item" target=
"_blank" style=
"text-decoration:none;" <?php
1285 if (defined(
'SQ_LICENCE_INSTALL_KEY')) {
1286 echo
' title="Install Key: '.SQ_LICENCE_INSTALL_KEY.
'"';
1288 ?>><?php echo SQ_SYSTEM_LONG_NAME;?></a>
1293 <div
id=
"asset_map" style=
"position: absolute; top: 47px; left: 6px; visibility: visible; border-top: 0px none; border-left: 0px none;">
1295 require_once SQ_LIB_PATH.
'/asset_map/asset_map.inc';
1297 $am_width = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_ASSET_MAP_WIDTH');
1298 $asset_map->embedAssetMap(
'complex', $am_width);
1301 <div
id=
"my_space" style=
"position: absolute; top: 44px; left: 0px; visibility: hidden;">
1303 $user = $GLOBALS[
'SQ_SYSTEM']->user;
1304 $inbox_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($user->id, SQ_LINK_TYPE_2,
'inbox', TRUE, NULL,
'major',
'1');
1306 if (empty($inbox_link)) {
1309 $inbox_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($inbox_link[
'minorid'], $inbox_link[
'minor_type_code']);
1310 $inbox_url = $inbox_asset->getBackendHref(
'details');
1311 $new_message_url = $inbox_asset->getBackendHref(
'new_message');
1312 $sent_url = $inbox_asset->getBackendHref(
'sent');
1313 $trash_url = $inbox_asset->getBackendHref(
'trash');
1316 $details_url = $user->getBackendHref(
'details');
1319 if (!empty($inbox_url)) {
1320 $ms = $GLOBALS[
'SQ_SYSTEM']->getMessagingService();
1321 $from = time() - 28800;
1322 $read_messages = $ms->getMessages($GLOBALS[
'SQ_SYSTEM']->currentUserId(), NULL, Array(SQ_MSG_READ), Array(), $from, NULL,
'short_name', Array(), 0, TRUE);
1323 $unread_messages = $ms->getMessages($GLOBALS[
'SQ_SYSTEM']->currentUserId(), NULL, Array(SQ_MSG_UNREAD), Array(), NULL, NULL,
'short_name', Array(), 0, TRUE);
1325 $messages = $read_messages + $unread_messages;
1327 <table
class=
"myspace-section">
1329 <td valign=
"top"><a href=
"<?php echo $_SERVER['PHP_SELF'].$inbox_url; ?>" target=
"sq_main"><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/icons/asset_map/inbox_icon.png" align=
"left" border=
"0" /></a></td>
1331 <p><a href=
"<?php echo $_SERVER['PHP_SELF'].$inbox_url; ?>" target=
"sq_main"><span
class=
"myspace-section-header"><?php echo translate(
'my_inbox'); ?></span><br /><span
id=
"sq_messages_text"><?php echo translate(
'inbox_new_messages', $unread_messages, $messages); ?></span></a></p>
1332 <p><a href=
"<?php echo $_SERVER['PHP_SELF'].$inbox_url; ?>" target=
"sq_main"><span
class=
"myspace-section-header"><?php echo translate(
'inbox_actions'); ?></span><br />
1333 <a href=
"<?php echo $_SERVER['PHP_SELF'].$inbox_url; ?>" target=
"sq_main">+ <?php echo translate(
'inbox_view'); ?></a><br />
1334 <a href=
"<?php echo $_SERVER['PHP_SELF'].$new_message_url; ?>" target=
"sq_main">+ <?php echo translate(
'inbox_send'); ?></a><br />
1335 <a href=
"<?php echo $_SERVER['PHP_SELF'].$sent_url; ?>" target=
"sq_main">+ <?php echo translate(
'inbox_view_sent'); ?></a><br />
1336 <a href=
"<?php echo $_SERVER['PHP_SELF'].$trash_url; ?>" target=
"sq_main">+ <?php echo translate(
'inbox_view_trash'); ?></a></p>
1344 <table
class=
"myspace-section">
1346 <td valign=
"top"><a href=
"<?php echo $_SERVER['PHP_SELF'].$details_url; ?>" target=
"sq_main"><img src=
"<?php echo sq_web_path('lib'); ?>/web/images/icons/asset_map/mydetails_icon.png" align=
"left" border=
"0" /></a></td>
1348 <span
class=
"myspace-section-header"><a href=
"<?php echo $_SERVER['PHP_SELF'].$details_url; ?>" target=
"sq_main"><?php echo translate(
'my_details'); ?></span><br /><?php echo translate(
'details_edit'); ?></a>
1356 $this->out->closeRaw();
1367 function _printNavResizer()
1369 $this->out->openRaw();
1374 background: #342939;
1379 <script language=
"Javascript" type=
"text/javascript">
1381 var fset = top.document.getElementById(
'main_frameset');
1382 hidden = <?php var_export(SQ_IN_LIMBO); ?>;
1383 <?php $am_width = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'user',
'SQ_USER_ASSET_MAP_WIDTH') + 5; ?>
1385 function toggleFrame() {
1386 if (hidden ==
false) {
1387 if (fset.cols ==
"<?php echo $am_width; ?>,10,*") {
1388 fset.cols =
"0,10,*";
1389 }
else if (fset.cols ==
"<?php echo $am_width; ?>,0,*") {
1390 fset.cols =
"0,0,*";
1394 if (fset.cols ==
"0,10,*") {
1395 fset.cols =
"<?php echo $am_width; ?>,10,*";
1396 }
else if (fset.cols ==
"0,0,*") {
1397 fset.cols =
"<?php echo $am_width; ?>,0,*";
1404 <table border=
"0" cellspacing=
"0" cellpadding=
"0" width=
"100%" height=
"100%" background=
"<?php echo $this->out->filesPath('/images/flash_resizer/background.gif'); ?>">
1406 <td valign=
"top"><img src=
"<?php echo $this->out->filesPath('/images/flash_resizer/top.gif'); ?>" width=
"9" height=
"25" border=
"0" alt=
"" /></td>
1409 <td valign=
"middle"><a
class=
"sq-backend-header-item" style=
"padding: 0px;" href=
"#" onClick=
"Javascript: toggleFrame()"><img src=
"<?php echo $this->out->filesPath('/images/flash_resizer/bar.gif'); ?>" width=
"9" height=
"72" border=
"0" alt=
"<<" /></a></td>
1413 <script language=
"Javascript" type=
"text/javascript">
1414 document.main_form.style.width =
"100%";
1415 document.main_form.style.height =
"100%";
1419 $this->out->closeRaw();
1430 function _printMain()
1434 if((SQ_IN_BACKEND || SQ_IN_LIMBO) && isset($_POST[
'process_form'])) {
1435 if(!isset($_POST[
'token'])) {
1436 trigger_error(
'Security token not found');
1439 $token = get_unique_token();
1440 if($_POST[
'token'] !== $token) {
1441 trigger_error(
'Invalid security token');
1447 if (empty($_REQUEST[
'backend_section'])) {
1448 $_REQUEST[
'backend_section'] =
'am';
1450 if (empty($_REQUEST[
'assetid'])) {
1451 $_REQUEST[
'assetid'] =
'';
1454 $this->out->addFormActionGetVar(
'backend_section', $_REQUEST[
'backend_section']);
1457 if (SQ_ROLLBACK_VIEW) {
1458 $this->out->openRaw();
1459 $GLOBALS[
'SQ_SYSTEM']->printRollbackWarning();
1460 $this->out->closeRaw();
1465 if (empty($_REQUEST[
'ignore_frames'])) {
1467 $hide_frames = (isset($_REQUEST[
'hide_frames']) && $_REQUEST[
'hide_frames']) ?
'hide_frames=1&' :
'';
1469 $limbo_assetid = (isset($_GET[
'limbo_assetid'])) ?
'limbo_assetid='.rawurlencode($_GET[
'limbo_assetid']).
'&' :
'';
1470 }
else if (SQ_IN_BACKEND) {
1471 $limbo_assetid = (isset($_GET[
'assetid'])) ?
'assetid='.rawurlencode($_GET[
'assetid']).
'&' :
'';
1475 $asset_ei_screen = (isset($_GET[
'asset_ei_screen'])) ?
'asset_ei_screen='.rawurlencode($_GET[
'asset_ei_screen'] ):
'';
1477 $asset_ei_screen .=
'&SQ_BACKEND_PAGE=frames';
1479 $extra =
'/?'.$hide_frames.$limbo_assetid.$asset_ei_screen;
1481 if(isset($_GET[
'backend_section'])) $extra .=
'&backend_section='.rawurlencode($_GET[
'backend_section']);
1483 if(isset($_GET[
'am_section'])) $extra .=
'&am_section='.rawurlencode($_GET[
'am_section']);
1485 if(isset($_GET[
'backend_section'])) $extra .=
'&backend_section='.rawurlencode($_GET[
'backend_section']);
1487 $redirect_url = strip_url(current_url()).$extra;
1490 if (!SQ_DESIGN_NO_FRAME || strpos($redirect_url ,SQ_CONF_BACKEND_SUFFIX) !== FALSE) {
1491 $this->out->addOnLoad(
'if (!parent.frames["sq_header"]) { sq_redirect("'.$redirect_url.
'"); }');
1495 switch ($_REQUEST[
'backend_section']) {
1497 require_once SQ_INCLUDE_PATH.
'/system_config_edit_interface.inc';
1499 $cfg_ei->paint($this);
1503 require_once SQ_INCLUDE_PATH.
'/tools.inc';
1504 $tools =
new Tools();
1505 $tools->paintBackend($this);
1509 require_once SQ_SYSTEM_ROOT.
'/core/maps/maps.inc';
1511 $maps->paintBackend($this);
1514 case 'hipo_herder' :
1515 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
1519 case 'sys_maintenance' :
1520 require_once SQ_INCLUDE_PATH.
'/system_maintenance.inc';
1522 $sys_maintenance->paintBackend($this);
1526 $GLOBALS[
'SQ_SYSTEM']->am->paintBackend($this);
1530 trigger_localised_error(
'SYS0098', E_USER_ERROR, $_REQUEST[
'backend_section']);
1555 function _getDHTMLMessage($title, $detail, $style=
'new-message', $icon=
'', $icon_width=16, $icon_height=16)
1557 if (!is_array($detail)) $detail = Array($detail);
1560 <table class="sq-backend-'.$style.
'-table">
1563 if (!empty($icon)) {
1564 $html .=
' <td rowspan="'.(1 + count($detail)).
'" width="'.$icon_width.
'" valign="middle" class="sq-backend-'.$style.
'-heading">'.sq_get_icon(sq_web_path(
'lib').
'/web/images/icons/'.$icon.
'.png', $icon_width, $icon_height,
'',
'',
'align="absmiddle"').
'</td>';
1567 <td class="sq-backend-'.$style.
'-heading" nowrap="nowrap">'.$title.
'</td>
1568 <td class="sq-backend-'.$style.
'-heading" align="right">[<a class="sq-backend-'.$style.
'-heading" href="#" onClick="Javascript: parent.frames[\'sq_header\'].cancelMsgDiv(); return false;">x</a>]</td>
1572 foreach ($detail as $detail_line) {
1575 <td class="sq-backend-'.$style.
'-body" colspan="2">'.$detail_line.
'</td>
1578 $html .=
'</table>';