-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f1e98c
Showing
6 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ResourcePanel {margin:5px;} | ||
.ResourcePanelSmall {margin:5px;} | ||
.chosen .ResourcePanel, .chosen .ResourcePanelSmall{border:5px solid hotPink; margin:1px 0;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
function HookInline_keywordsSearchSearchbarbottomtoolbar() | ||
{ | ||
global $lang; | ||
?> | ||
<div id="SearchBoxPanel" class="keywordPanel"> | ||
<div class="SearchSpace"> | ||
<h2><?php echo $lang["addkeywords"]; ?></h2> | ||
<p><?php echo $lang['keywordstoresource']; ?></p> | ||
|
||
<form id="manipulateKeywords"> | ||
<input id="newKeywordsForSelectedResources" class="SearchWidth"/> | ||
<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["addkeywords"]; ?>"> | ||
</form> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
function HookInline_keywordsSearchAdditionalheaderjs() | ||
{ | ||
global $baseurl; | ||
if(checkperm('a')) | ||
{ ?> | ||
<script type='text/javascript'> | ||
jQuery(document).ready(function() { | ||
jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').on('click', function() { | ||
jQuery(this).toggleClass('chosen'); | ||
}); | ||
|
||
jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').on('click','a',function(event){event.stopPropagation();}); | ||
|
||
jQuery('#clearSelectedResourceButton').on('click', function() { | ||
jQuery('.chosen').removeClass('chosen'); | ||
jQuery('#newKeywordsForSelectedResources').val(''); | ||
}); | ||
|
||
jQuery('#selectAllResourceButton').on('click', function() { | ||
jQuery('.ResourcePanelShell, .ResourcePanelShellSmall').addClass('chosen'); | ||
}); | ||
|
||
jQuery('#submitSelectedResourceButton').on('click', function() { | ||
resourceIds = jQuery.map(jQuery('.chosen'), function(a, b){ | ||
return jQuery(a).attr('id').replace('ResourceShell',''); | ||
}).join('+'); | ||
jQuery.ajax({ | ||
type: "POST", | ||
url: "<?php echo $baseurl; ?>/plugins/simple_keywords/pages/add_keywords.php", | ||
data: { refs: resourceIds, keywords: jQuery('#newKeywordsForSelectedResources').val().replace(/ /g,'+') } | ||
}).done(function( msg ) { | ||
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(){}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
<?php } | ||
return true; | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: inline_keywords | ||
author: Aaron T. Maturen | ||
version: 0.1 | ||
desc: Short project description | ||
info_url: http://url.to.your/info_pages/ (Link to web page with additional information about the plugin) | ||
config_url: /plugins/simple_keywords/pages/setup.php | ||
default_priority: 999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
$lang['selectall'] = 'Select All'; | ||
$lang['unselectall'] = 'Unselect All'; | ||
$lang['addkeywords'] = 'Add Keyword(s)'; | ||
$lang['keywordstoresource'] = 'Add keyword(s) to selected resources.'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
include_once "../../../include/db.php"; | ||
include_once "../../../include/authenticate.php";if (!checkperm("a")) {exit("Permission denied");} | ||
include_once "../../../include/general.php"; | ||
include_once "../../../include/resource_functions.php"; | ||
|
||
$keywords = explode(' ',str_replace('+',' ',$_REQUEST['keywords'])); | ||
$refs = explode(' ',str_replace('+',' ',$_REQUEST['refs'])); | ||
foreach($refs as $ref){ | ||
foreach($keywords as $keyword){ | ||
add_keyword_mappings($ref, $keyword,8); | ||
} | ||
} | ||
?> |