25 require_once dirname(__FILE__).
'/../../../../core/include/init.inc';
26 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
27 require_once SQ_FUDGE_PATH.
'/var_serialise/var_serialise.inc';
29 if (empty($GLOBALS[
'SQ_SYSTEM']->user) || !($GLOBALS[
'SQ_SYSTEM']->user->canAccessBackend() || $GLOBALS[
'SQ_SYSTEM']->user->type() ==
'simple_edit_user')){
34 $pref = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'content_type_wysiwyg',
'SQ_WYSIWYG_LINK_TYPES');
36 $url_protocol_options = Array(
'' =>
'');
37 $url_protocol_combo_box = Array(
'' =>
'');
38 foreach ($pref as $pref_el) {
39 $url_protocol_options[$pref_el[
'type']] = $pref_el[
'template'];
40 $url_protocol_combo_box[$pref_el[
'type']] = $pref_el[
'type'];
43 $new_window_bool_options = Array(
44 'toolbar' =>
'Show Tool Bar',
45 'menubar' =>
'Show Menu Bars',
46 'location' =>
'Show Location Bar',
47 'status' =>
'Show Status Bar',
48 'scrollbars' =>
'Show Scroll Bars',
49 'resizable' =>
'Allow Resizing',
52 if (!isset($_GET[
'assetid'])) {
55 preg_match(
'/^([0-9A-Z:]*)/i', $_GET[
'assetid'], $matches);
56 $_GET[
'assetid'] = isset($matches[1]) ? $matches[1] : $_GET[
'assetid'];
58 if (!isset($_GET[
'url'])) $_GET[
'url'] = 0;
59 if (!isset($_GET[
'protocol'])) $_GET[
'protocol'] =
'';
60 if (!isset($_GET[
'status_text'])) {
61 $_GET[
'status_text'] =
'';
63 if (!isset($_GET[
'link_title'])) {
64 $_GET[
'link_title'] =
'';
66 if (!isset($_GET[
'target'])) $_GET[
'target'] =
'';
67 if (!isset($_GET[
'new_window'])) {
68 $_GET[
'new_window'] = 0;
70 if (!isset($_GET[
'class_name'])) {
71 $_GET[
'class_name'] =
'';
73 if (!isset($_GET[
'id_name'])) {
74 $_GET[
'id_name'] =
'';
76 if (!isset($_GET[
'show_summary'])) {
77 $_GET[
'show_summary'] = 0;
81 if (strpos($_GET[
'assetid'],
'#') !== FALSE) {
82 list($_GET[
'assetid'], $_GET[
'anchor']) = explode(
'#', $_GET[
'assetid']);
86 if (strpos($_GET[
'url'],
'#') !== FALSE) {
87 list($_GET[
'url'], $_GET[
'anchor']) = explode(
'#', $_GET[
'url']);
92 if (!isset($_GET[
'new_window'])) {
93 foreach ($new_window_bool_options as $option => $option_text) {
94 $_GET[
'new_window_options'][$options] = 0;
97 $_GET[
'new_window_options'] = var_unserialise($_GET[
'new_window_options']);
101 $option_selected =
'all_asset';
102 if (isset($_GET[
'assetid']) && $_GET[
'assetid']) {
103 $asset_linked = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($_GET[
'assetid']);
104 if (!is_null($asset_linked)) {
105 if ($asset_linked instanceof
Link) {
106 $option_selected =
'link_manager';
108 $option_selected =
'redirect';
114 <html style=
"width: 750px; height: 488px; ">
116 <title>Insert
Link</title>
119 $include_list = Array(sq_web_path(
'lib').
'/js/translation.js');
121 $locales = $GLOBALS[
'SQ_SYSTEM']->lm->getCumulativeLocaleParts($GLOBALS[
'SQ_SYSTEM']->lm->getCurrentLocale());
123 foreach ($locales as $locale) {
124 if (file_exists(SQ_DATA_PATH.
'/public/system/core/js_strings.'.$locale.
'.js')) {
125 $include_list[] = sq_web_path(
'data').
'/system/core/js_strings.'.$locale.
'.js';
129 foreach ($include_list as $link) {
130 ?><script type=
"text/javascript" src=
"<?php echo $link; ?>"></script>
134 <script type=
"text/javascript" src=
"../../core/popup.js"></script>
135 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/asset_map/javaExternalCall.js' ?>"></script>
136 <script type=
"text/javascript" src=
"<?php echo sq_web_path('fudge').'/var_serialise/var_serialise.js' ?>"></script>
137 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/html_form/html_form.js' ?>"></script>
138 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/js/general.js' ?>"></script>
139 <script type=
"text/javascript" src=
"<?php echo sq_web_path('lib').'/js/tooltip.js' ?>"></script>
141 <script type=
"text/javascript">
142 function getFocus() {
143 setTimeout(
'self.focus()',100);
146 var new_window_bool_options =
new Array(
'<?php echo implode("',
'", array_keys($new_window_bool_options))?>');
149 __dlg_init(
"matrixInsertLink");
150 enable_new_window(document.main_form, <?php echo preg_replace(
'/[\'"\(\);\[\]{}<>=]+/',
'', $_GET[
'new_window']); ?>);
153 var patterns = {<?php
154 $url_protocol_options_sorted = $url_protocol_options;
155 uasort($url_protocol_options_sorted, create_function(
'$a,$b',
'return strlen($b) - strlen($a);'));
157 foreach ($url_protocol_options_sorted as $label => $pattern) {
158 $pattern_array[] =
'\''.addslashes($label).
'\': \
''.str_replace(
'%%link%%',
'([^#]*)', addslashes($pattern)).
'\'';
161 echo implode($pattern_array,
', ');
165 for (label in patterns) {
168 e =
'^' + e +
'(#(.*))?$';
169 var re =
new RegExp(e,
'');
171 var results = re.exec(
'<?php echo str_replace("'", '%27', $_GET['url']); ?>');
178 setUrl(label, results[1]);
180 // we need to make sure that the url does not have any single quote
181 setUrl('', '<?php echo str_replace("'", '%27
', $_GET['url
']); ?>');
187 var fields = [
"url"];
188 var param =
new Object();
189 var f = document.main_form;
192 if ((form_element_value(f.url_link) ==
'') && (form_element_value(f.anchor) ==
'') &&
193 (((f.elements[
"assetid[assetid]"].value !=
'') && (f.elements[
"assetid[assetid]"].value != 0)) ||
194 ((f.elements[
"page_redirect_assetid[assetid]"].value !=
'') && (f.elements[
"page_redirect_assetid[assetid]"].value != 0)) ||
195 ((f.elements[
"link_assetid[assetid]"].value !=
'') && (f.elements[
"link_assetid[assetid]"].value != 0))
201 if ((form_element_value(f.url_link) ==
'') && (form_element_value(f.anchor) !=
'')) {
202 param[
"url"] =
'#' + form_element_value(f.anchor);
204 var patterns = {<?php
205 foreach ($url_protocol_options as $label => $pattern) {
206 $pattern_array[] =
'\''.addslashes($label).
'\': \
''.addslashes($pattern).
'\'';
209 echo implode($pattern_array,
', ');
211 if (form_element_value(f.url_protocol) ==
'') {
212 param[
"url"] = form_element_value(f.url_link)
214 param[
"url"] = patterns[form_element_value(f.url_protocol)].replace(
'%%link%%', form_element_value(f.url_link));
216 param[
"url"] += (form_element_value(f.anchor) ==
'' ?
'' :
'#' + form_element_value(f.anchor));
218 param[
"status_text"] = form_element_value(f.status_text);
219 param[
"link_title"] = form_element_value(f.link_title);
220 param[
"target"] = form_element_value(f.target);
221 param[
"new_window"] = form_element_value(f.new_window);
222 param[
"class_name"] = form_element_value(f.class_name);
223 param[
"id_name"] = form_element_value(f.id_name);
224 param[
"show_summary"] = form_element_value(f.show_summary);
225 param[
"assetid"] = f.elements[
"assetid[assetid]"].value;
227 param[
"new_window_options"] =
new Object();
228 param[
"new_window_options"][
"width"] = form_element_value(f.width);
229 param[
"new_window_options"][
"height"] = form_element_value(f.height);
230 for (var i=0; i < new_window_bool_options.length; i++) {
231 param[
"new_window_options"][new_window_bool_options[i]] = (f.elements[new_window_bool_options[i]].checked) ? 1 : 0;
234 __dlg_close(
"matrixInsertLink", param);
238 function onCancel() {
239 __dlg_close(
"matrixInsertLink", null);
243 function setUrl(protocol, link) {
244 var f = document.main_form;
246 if (protocol != null) highlight_combo_value(f.url_protocol, protocol);
248 f.url_link.value = link;
251 if (f.elements[
"assetid[assetid]"].value != undefined && f.elements[
"assetid[assetid]"].value !=
'<?php echo $_GET['assetid
']; ?>' && f.elements[
"assetid[assetid]"].value !=
'') {
252 assetid = f.elements[
"assetid[assetid]"].value;
253 }
else if (f.elements[
"link_assetid[assetid]"].value != undefined && f.elements[
"link_assetid[assetid]"].value !=
'<?php echo $_GET['assetid
']; ?>' && f.elements[
"link_assetid[assetid]"].value !=
'') {
254 assetid =
'%globals_asset_attribute_link_url:'+ f.elements[
"link_assetid[assetid]"].value +
'%';
255 }
else if (f.elements[
"page_redirect_assetid[assetid]"].value != undefined && f.elements[
"page_redirect_assetid[assetid]"].value !=
'<?php echo $_GET['assetid
']; ?>' && f.elements[
"page_redirect_assetid[assetid]"].value !=
'') {
256 assetid =
'%globals_asset_attribute_redirect_url:'+ f.elements[
"page_redirect_assetid[assetid]"].value +
'%';
261 if (f.elements[
"assetid[type_code]"].value !=
'') {
262 asset_type = f.elements[
"assetid[type_code]"].value;
263 }
else if (f.elements[
"link_assetid[type_code]"].value !=
'') {
264 asset_type = f.elements[
"link_assetid[type_code]"].value;
265 }
else if (f.elements[
"page_redirect_assetid[type_code]"].value !=
'') {
266 asset_type = f.elements[
"page_redirect_assetid[type_code]"].value;
268 if (asset_type !=
'') {
270 asset_type = asset_type.toLowerCase();
271 options = f.elements[
"asset_type_selector"].getElementsByTagName(
"option");
272 for(var i=0; i<options.length; i++) {
273 options[i].disabled =
false;
274 if (asset_type !=
'link' && options[i].value ==
'link_manager') {
275 options[i].disabled =
true;
276 }
else if (asset_type !=
'page_redirect' && options[i].value ==
'redirect') {
277 options[i].disabled =
true;
284 if (assetid.search(
'globals_asset_attribute') != -1) {
285 f.url_link.value = assetid;
287 if (assetid.search(/:/) != -1) {
288 f.url_link.value =
'./?a=' + assetid +
'$';
290 f.url_link.value =
'./?a=' + assetid;
293 highlight_combo_value(f.url_protocol,
'');
296 setTimeout(
'self.focus()',100);
299 function enable_new_window(f, enable) {
300 var bg_colour =
'#' + ((enable == 2) ?
'ffffff' :
'c0c0c0');
303 highlight_combo_value(f.new_window, enable);
305 f.target.disabled = (enable != 0);
307 var disable = (enable != 2);
308 f.width.disabled = disable;
309 f.height.disabled = disable;
310 f.width.style.backgroundColor = bg_colour;
311 f.height.style.backgroundColor = bg_colour;
312 for (var i=0; i < new_window_bool_options.length; i++) {
313 f.elements[new_window_bool_options[i]].disabled = disable;
317 function reset_type_selector()
320 options = document.main_form.elements[
"asset_type_selector"].getElementsByTagName(
"option");
321 for(var i=0; i<options.length; i++) {
322 options[i].disabled =
false;
325 document.getElementById(
'assetid[type_code]').value =
'';
326 document.getElementById(
'link_assetid[type_code]').value =
'';
327 document.getElementById(
'page_redirect_assetid[type_code]').value =
'';
333 <style type=
"text/css">
337 font: 11px Tahoma,Verdana,sans-serif;
343 font: 11px Tahoma,Verdana,sans-serif;
352 font: 11px Tahoma,Verdana,sans-serif;
358 #quick-search #quick-search-for {
359 font: 11px Arial,Verdana,sans-serif;
360 border: 1px solid black;
364 #quick-search #quick-search-for-label {
365 font: 11px Arial,Verdana,sans-serif;
378 border-bottom: 1px solid black;
384 padding: 0px 10px 5px 5px;
385 border-color: #725B7D;
388 .fl { width: 9em;
float: left; padding: 2px 5px; text-align: right; }
389 .fr { width: 7em;
float: left; padding: 2px 5px; text-align: right; }
392 form { padding: 0px; margin: 0px; }
394 select, input, button {
395 font: 11px Tahoma,Verdana,sans-serif;
403 .buttonColor, .buttonColor-hilite {
406 border-color: #9E86AA #725B7D #725B7D #9E86AA;
409 .buttonColor-hilite {
410 border-color: #402F48;
413 .buttonColor-chooser, .buttonColor-nocolor, .buttonColor-nocolor-hilite {
417 border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
420 .buttonColor-nocolor, .buttonColor-nocolor-hilite { padding: 0px; }
421 .buttonColor-nocolor-hilite { background: #402F48; color: #FFFFFF; }
425 #new-message-popup, #search-wait-popup {
430 background-color: white;
431 border: 2px solid black;
432 font: normal 10px Arial,Verdana,sans-serif;
436 #new-message-popup-titlebar, #search-wait-popup-titlebar {
441 #new-message-popup-close, #search-wait-popup-close {
445 #new-message-popup-close a, #search-wait-popup-close a {
447 text-decoration: none;
450 #new-message-popup-details, #search-wait-popup-details {
459 div.search-result-blurb {
465 div.search-result-pager {
471 div.search-result-detail {
478 a.search-result-expand-link {
479 text-decoration: none;
486 text-decoration: none;
490 .search-result-expand-div {
494 background-color: white;
498 .search-result-entry {
504 .sq-backend-search-failed-table {
505 border: 2px solid #594165;
506 border-collapse: collapse;
507 background-color: #ECECEC;
510 .sq-backend-search-failed-heading, .sq-backend-search-failed-body {
512 background-color: #ececec;
513 font-family: Arial, Verdana, Helvetica, sans-serif;
517 text-decoration: none;
521 .sq-backend-search-failed-body {
526 .sq-backend-search-results-table {
527 border: 2px solid #594165;
528 border-collapse: collapse;
529 background-color: #ECECEC;
532 .sq-backend-search-results-heading, .sq-backend-search-results-body {
534 background-color: #FFFFFF;
535 font-family: Arial, Verdana, Helvetica, sans-serif;
539 text-decoration: none;
543 .sq-backend-search-results-heading {
544 background-color: #F0F0E6;
547 .sq-backend-search-results-highlight {
548 background-color: yellow;
551 .sq-backend-search-results-body {
558 <body onload=
"Javascript: Init();" onUnload=
"Javascript: asset_finder_onunload();">
559 <form action=
"" method=
"get" name=
"main_form" id=
"main-form">
564 include_once(SQ_LIB_PATH.
'/asset_map/asset_map.inc');
566 $asset_map->embedAssetMap(
'simple', 200, 400);
573 <table width=
"100%" cellspacing=
"0" cellpadding=
"0">
575 <td valign=
"top" width=
"100%">
577 <legend><b><?php echo translate(
'general'); ?></b></legend>
578 <table style=
"width:100%">
580 <td
class=
"label"><?php echo translate(
'protocol'); ?>:</td>
582 combo_box(
'url_protocol', $url_protocol_combo_box, $_GET[
'protocol'],
'style="font-family: courier new; font-size: 11px;"'); ?></td>
583 <td
class=
"label"><?php echo translate(
'link'); ?>:</td>
584 <td><?php text_box(
'url_link', $_GET[
'url'], 40, 0)?></td>
587 <td
class=
"lable"><?php echo translate(
'asset_type').
':'; ?></td>
590 $asset_selector = Array(
591 'all_assets' =>
'Any Asset',
592 'link_manager' =>
'Link Asset',
593 'redirect' =>
'Redirect Page Asset',
596 $object_type =
'this.form.asset_type_selector.value';
597 $object_span1 =
'document.getElementById(\'asset_finder_all\')';
598 $object_span2 =
'document.getElementById(\'asset_finder_link_asset\')';
599 $object_span3 =
'document.getElementById(\'asset_finder_redirect_asset\')';
600 $js =
'onChange="chooseSourceType('.$object_type.
', '.$object_span1.
', '.$object_span2.
', '.$object_span3.
');"';
602 <script type=
"text/javascript">
603 function chooseSourceType(type, span_all, span_link_manager, span_redirect_page) {
604 all_asset_picker = document.getElementById(
'assetid[assetid]');
605 all_asset_picker_id = document.getElementById(
'sq_asset_finder_assetid_assetid');
606 all_asset_picker_label = document.getElementById(
'sq_asset_finder_assetid_label');
608 link_asset_picker = document.getElementById(
'link_assetid[assetid]');
609 link_asset_picker_id = document.getElementById(
'sq_asset_finder_link_assetid_assetid');
610 link_asset_picker_label = document.getElementById(
'sq_asset_finder_link_assetid_label');
612 redirect_asset_picker = document.getElementById(
'page_redirect_assetid[assetid]');
613 redirect_asset_picker_id = document.getElementById(
'sq_asset_finder_page_redirect_assetid_assetid');
614 redirect_asset_picker_label = document.getElementById(
'sq_asset_finder_page_redirect_assetid_label');
615 var selected_assetid =
'';
616 var selected_label =
'';
617 if (all_asset_picker_id.value !=
'') {
618 selected_assetid = all_asset_picker_id.value;
619 selected_label = all_asset_picker_label.value;
620 }
else if (link_asset_picker_id.value !=
'') {
621 selected_assetid = link_asset_picker_id.value;
622 selected_label = link_asset_picker_label.value;
623 }
else if (redirect_asset_picker_id.value !=
'') {
624 selected_assetid = redirect_asset_picker_id.value;
625 selected_label = redirect_asset_picker_label.value;
628 if (type ==
'all_assets') {
629 all_asset_picker.value=selected_assetid;
630 all_asset_picker.disabled=
false;
631 all_asset_picker_id.value=selected_assetid;
632 all_asset_picker_id.disabled=
false;
633 all_asset_picker_label.value=selected_label;
634 span_all.style.display=
'block';
635 span_all.disabled=
false;
636 span_link_manager.style.display=
'none';
637 span_link_manager.disabled=
true;
638 link_asset_picker.value=
'';
639 link_asset_picker.disabled=
true;
640 link_asset_picker_id.value=
'';
641 link_asset_picker_id.disabled=
true;
642 link_asset_picker_label.value=
'';
643 span_redirect_page.style.display=
'none';
644 span_redirect_page.disabled=
true;
645 redirect_asset_picker.value=
'';
646 redirect_asset_picker.disabled=
true;
647 redirect_asset_picker_id.value=
'';
648 redirect_asset_picker_id.disabled=
true;
649 redirect_asset_picker_label.value=
'';
651 }
else if (type ==
'link_manager') {
652 all_asset_picker.value=
'';
653 all_asset_picker.disabled=
true;
654 all_asset_picker_id.value=
'';
655 all_asset_picker_id.disabled=
true;
656 all_asset_picker_label.value=
'';
657 span_all.style.display=
'none';
658 span_all.disabled=
true;
659 span_link_manager.style.display=
'block';
660 span_link_manager.disabled=
false;
661 link_asset_picker.value=selected_assetid;
662 link_asset_picker.disabled=
false;
663 link_asset_picker_id.value=selected_assetid;
664 link_asset_picker_id.disabled=
false;
665 link_asset_picker_label.value=selected_label;
666 span_redirect_page.style.display=
'none';
667 span_redirect_page.disabled=
true;
668 redirect_asset_picker.value=
'';
669 redirect_asset_picker.disabled=
true;
670 redirect_asset_picker_id.value=
'';
671 redirect_asset_picker_id.disabled=
true;
672 redirect_asset_picker_label.value=
'';
675 all_asset_picker.value=
'';
676 all_asset_picker.disabled=
true;
677 all_asset_picker_id.value=
'';
678 all_asset_picker_id.disabled=
true;
679 all_asset_picker_label.value=
'';
680 span_all.style.display=
'none';
681 span_all.disabled=
true;
682 span_link_manager.style.display=
'none';
683 span_link_manager.disabled=
true;
684 link_asset_picker.value=
'';
685 link_asset_picker.disabled=
true;
686 link_asset_picker_id.value=
'';
687 link_asset_picker_id.disabled=
true;
688 link_asset_picker_label.value=
'';
689 span_redirect_page.style.display=
'block';
690 span_redirect_page.disabled=
false;
691 redirect_asset_picker.value=selected_assetid;
692 redirect_asset_picker.disabled=
false;
693 redirect_asset_picker_id.value=selected_assetid;
694 redirect_asset_picker_id.disabled=
false;
695 redirect_asset_picker_label.value=selected_label;
701 combo_box(
'asset_type_selector', $asset_selector, FALSE, $option_selected, 0, $js);
707 <td
class=
"label"><?php echo translate(
'select_asset'); ?>:</td>
709 <span
id=
"asset_finder_all" style=
"display:block">
710 <?php asset_finder(
'assetid', $_GET[
'assetid'], Array(),
'', FALSE,
'setUrl'); ?>
712 <span
id=
"asset_finder_link_asset" style=
"display:none">
713 <?php asset_finder(
'link_assetid', $_GET[
'assetid'], Array(
'link' =>
'I'),
'', FALSE,
'setUrl'); ?>
715 <span
id=
"asset_finder_redirect_asset" style=
"display:none">
716 <?php asset_finder(
'page_redirect_assetid', $_GET[
'assetid'], Array(
'page_redirect' =>
'I'),
'', FALSE,
'setUrl'); ?>
717 <script type=
"text/javascript">
719 var all_clr_btn = document.getElementById(
'sq_asset_finder_assetid_clear_btn');
720 var link_clr_btn = document.getElementById(
'sq_asset_finder_link_assetid_clear_btn');
721 var page_redirect_clr_btn = document.getElementById(
'sq_asset_finder_page_redirect_assetid_clear_btn');
722 if (all_clr_btn.addEventListener) {
723 all_clr_btn.addEventListener(
'click', reset_type_selector,
false);
724 link_clr_btn.addEventListener(
'click', reset_type_selector,
false);
725 page_redirect_clr_btn.addEventListener(
'click', reset_type_selector,
false);
726 }
else if (all_clr_btn.attachEvent) {
728 all_clr_btn.attachEvent(
'onclick', reset_type_selector);
729 link_clr_btn.attachEvent(
'onclick', reset_type_selector);
730 page_redirect_clr_btn.attachEvent(
'onclick', reset_type_selector);
738 <td
class=
"label"><?php echo translate(
'anchor_name'); ?>:</td>
739 <td colspan=
"3"><?php text_box(
'anchor', $_GET[
'anchor'], 40, 0) ?></td>
750 <table width=
"100%" cellspacing=
"0" cellpadding=
"0">
752 <td valign=
"top" width=
"100%">
754 <legend><?php echo translate(
'options'); ?></legend>
755 <table style=
"width:100%">
757 <td
class=
"label"><?php echo translate(
'id_name_text'); ?>:</td>
758 <td><?php text_box(
'id_name', $_GET[
'id_name'], 15); ?></td>
759 <td
class=
"label"><?php echo translate(
'class_name_text'); ?>:</td>
760 <td><?php text_box(
'class_name', $_GET[
'class_name'], 15); ?></td>
763 <td
class=
"label"><?php echo translate(
'title'); ?>:</td>
764 <td colspan=
"2"><?php text_box(
'link_title', $_GET[
'link_title'], 50); ?></td>
766 echo translate(
'include_summary').
':';
767 check_box(
'show_summary', 1, $_GET[
'show_summary']); ?>
779 <table width=
"100%" cellspacing=
"0" cellpadding=
"0">
781 <td valign=
"top" width=
"100%">
783 <legend><?php echo translate(
'new_window_options'); ?></legend>
784 <table style=
"width:100%">
786 <td
class=
"label" valign=
"top"><?php echo translate(
'target'); ?>:</td>
787 <td><?php text_box(
'target', $_GET[
'target']); ?></td>
790 <td
class=
"label" rowspan=
"2" valign=
"top"><?php echo translate(
'new_window'); ?>:</td>
791 <td><?php combo_box(
'new_window', Array(
'0' => translate(
'no'),
'1' => translate(
'yes'),
'2' => translate(
'advanced')), FALSE, $_GET[
'new_window'], 1,
'onChange="javascript: enable_new_window(this.form, form_element_value(this));"'); ?></td>
795 <table border=
"0" cellspacing=
"0" cellpadding=
"0">
799 foreach ($new_window_bool_options as $var => $name) {
803 <input type=
"checkbox" value=
"1" name=
"<?php echo $var?>" <?php echo ($_GET[
'new_window_options'][$var]) ?
'checked' :
'';?>>
807 if ($count % 2 == 0) echo
'</tr><tr>';
813 <?php echo translate(
'size'); ?> : <input type=
"text" value=
"<?php echo htmlspecialchars($_GET['new_window_options']['width']) ?>" size=
"3" name=
"width"> (w) x <input type=
"text" value=
"<?php echo htmlspecialchars($_GET['new_window_options']['height']) ?>" size=
"3" name=
"height"> (h)
828 <div style=
"margin-top: 5px; text-align: right;">
830 <button type=
"button" name=
"ok" onclick=
"return onOK();"><?php echo translate(
'ok'); ?></button>
831 <button type=
"button" name=
"cancel" onclick=
"return onCancel();"><?php echo translate(
'cancel'); ?></button>
838 <!-- Search results -->
839 <div
id=
"new-message-popup"><div
id=
"new-message-popup-titlebar"><div
id=
"new-message-popup-close">[ <a href=
"#" onclick=
"document.getElementById('new-message-popup').style.display = 'none'; return false;">x</a> ]</div><span
id=
"new-message-popup-title">Searched
for ''</span></div>
840 <div
id=
"new-message-popup-details"></div>
842 <div
id=
"search-wait-popup"><div
id=
"search-wait-popup-titlebar"><div
id=
"search-wait-popup-close">[ <a href=
"#" onclick=
"document.getElementById('search-wait-popup').style.display = 'none'; return false;">x</a> ]</div><span
id=
"search-wait-popup-title">Search in Progress</span></div>
843 <div
id=
"search-wait-popup-details">Your search is being processed, please wait...</div>
846 <script type=
"text/javascript"><!--
848 var results_per_page = <?php echo $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'search_manager',
'SQ_SEARCH_BACKEND_PAGE_SIZE') !== FALSE ? $GLOBALS[
'SQ_SYSTEM']->getUserPrefs(
'search_manager',
'SQ_SEARCH_BACKEND_PAGE_SIZE') : 5; ?>;
849 var total_results = 0;
851 function jump_to_search_results(page) {
853 document.getElementById(
"search-result-page-" + current).style.display =
'none';
854 document.getElementById(
"search-result-page-" + page).style.display =
'block';
857 document.getElementById(
"sq-search-results-page-start").innerHTML = (results_per_page * (page - 1)) + 1;
858 document.getElementById(
"sq-search-results-page-end").innerHTML = Math.min(total_results, results_per_page * page);
860 for (i = ((page - 1) * results_per_page) + 1; i <= Math.min(total_results, page * results_per_page); i++) {
863 document.getElementById(
"search-result-" + i +
"-expand-link").innerHTML =
'+';
864 document.getElementById(
"search-result-" + i +
"-detail").style.display =
'none';
870 function set_asset_finder_from_search(assetid, label, url, linkid) {
871 document.cookie =
'lastSelectedAssetId=' + escape(assetid);
873 ASSET_FINDER_OBJ.set_hidden_field(
'assetid[assetid]', assetid);
874 ASSET_FINDER_OBJ.set_hidden_field(
'assetid[url]', url);
875 ASSET_FINDER_OBJ.set_hidden_field(
'assetid[linkid]', linkid);
876 ASSET_FINDER_OBJ.set_text_field(
'sq_asset_finder_assetid_label', (assetid == 0) ?
'' : label +
' (Id : #' + assetid +
')');
878 document.getElementById(
"new-message-popup").style.display =
'none';
879 setUrl(
'',
'./?a=' + assetid);