forked from aaronmaturen/rs_inline_keywords
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
121 lines (112 loc) · 7.92 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
function HookInline_keywordsSearchSearchbarbottomtoolbar()
{
global $baseurl,$lang, $inline_keywords_usertype;
if(checkperm($inline_keywords_usertype))
{
?>
<div id="SearchBoxPanel" class="keywordPanel">
<div class="SearchSpace">
<h2><?php echo $lang["editfields"]; ?></h2>
<p><?php echo $lang['keywordstoresource']; ?></p>
<form id="manipulateKeywords">
<span class="wrap">
<p>
<label for='newKeywordsForSelectedResources'>Keywords</label>
<input id='newKeywordsForSelectedResources' class='SearchWidth'/>
</p>
</span>
<div id="skmessages"></div>
<div id="skproposals">
<img src="<?php echo $baseurl ?>/plugins/smartkeywording_rs/images/ui-anim_basic_16x16.gif" style="width:16px;height:16px;padding:0px;top:0px;right:0px;" id="loadingAnimation">
</div>
<input type="button" id="selectAllResourceButton" value="<?php echo $lang["selectall"]; ?>">
<input type="button" id="clearSelectedResourceButton" value="<?php echo $lang["unselectall"]; ?>">
<input type="button" id="submitSelectedResourceButton" value="<?php echo $lang["submitchanges"]; ?>">
</form>
</div>
</div>
<?php
}
}
function HookInline_keywordsSearchAdditionalheaderjs()
{
global $baseurl, $inline_keywords_usertype, $inline_keywords_background_colour;
if(checkperm($inline_keywords_usertype))
{ ?>
<link type="text/css" href="<?php echo $baseurl?>/plugins/smartkeywording_rs/css/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/jquery-ui.min.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/jquery.cookie.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/jquery.tools.min.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/bootstrap-alerts.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/bootstrap-buttons.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/bootstrap-twipsy.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/bootstrap-popover.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/kreuzverweis.ui.delayedExec.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/kreuzverweis.ui.messages.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/kreuzverweis.smartkeywording.webgui.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/smartkeywording_rs/js/kreuzverweis.sk.rs.js" type="text/javascript"></script>
<script src="<?php echo $baseurl?>/plugins/inline_keywords/js/kreuzverweis.sk.inline.js" type="text/javascript"></script>
<script src="../plugins/inline_keywords/js/jquery.infieldlabel.min.js" type="text/javascript" charset="utf-8"></script>
<script type='text/javascript'>
jQuery(document).ready(function() {
addSKAutocomplete("newKeywordsForSelectedResources");
addSKProposalsOnReturn("newKeywordsForSelectedResources","skproposals");
addSKSelection("skproposals");
jQuery('form#manipulateKeywords :text').focus(function(event){
jQuery(this).siblings('label').fadeOut('fast');
});
jQuery('form#manipulateKeywords :text').blur(function(event){
if(jQuery(this).val() === ""){
jQuery(this).siblings('label').fadeIn('fast');
}
});
jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').on('click', function(event) {
if(!(event.originalEvent.srcElement instanceof HTMLImageElement )){
//console.log(event.originalEvent.srcElement instance of HTMLImageElement);
jQuery(this).toggleClass('chosen');
jQuery('.ResourcePanel, .ResourcePanelSmall').css('border-color','');
jQuery('.chosen .ResourcePanel, .chosen .ResourcePanelSmall').css('border-color','<?php echo $inline_keywords_background_colour; ?>');
}
});
jQuery('#clearSelectedResourceButton').on('click', function() {
jQuery('.chosen').removeClass('chosen');
jQuery('#newKeywordsForSelectedResources').val('');
jQuery('.ResourcePanel, .ResourcePanelSmall').css('border-color','');
jQuery('.chosen .ResourcePanel, .chosen .ResourcePanelSmall').css('border-color','<?php echo $inline_keywords_background_colour; ?>');
});
jQuery('#selectAllResourceButton').on('click', function() {
jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').addClass('chosen');
jQuery('.ResourcePanel, .ResourcePanelSmall').css('border-color','');
jQuery('.chosen .ResourcePanel, .chosen .ResourcePanelSmall').css('border-color','<?php echo $inline_keywords_background_colour; ?>');
});
jQuery('#submitSelectedResourceButton').on('click', function() {
resourceIds = jQuery.map(jQuery('.chosen'), function(a, b){
return jQuery(a).attr('id').replace('ResourceShell','');
}).join('+');
jQuery("#loadingAnimation").show();
var selectedKeywords=getSelectedKeywords("skproposals");
jQuery("#skproposals > span").remove();
jQuery.ajax({
type: "POST",
url: "<?php echo $baseurl; ?>/plugins/inline_keywords/pages/add_keywords.php",
data: { refs: resourceIds, keywords: selectedKeywords}
}).done(function( msg ) {
getProposals(0, selectedKeywords, function() {
jQuery("#loadingAnimation").hide();
addProposals(this);
})
if(msg !== ''){alert( "Data Saved: " + msg );}
//jQuery(".keywordPanel").effect("highlight", {}, 3000);
jQuery(".keywordPanel").fadeTo("slow", 0.5, function () {
jQuery(".keywordPanel").fadeTo("slow", 1.0, function(){});
});
});
});
jQuery("#loadingAnimation").hide();
});
</script>
<?php }
return true;
}
?>