Skip to content

Commit

Permalink
added archive button
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron T. Maturen committed Jul 20, 2012
1 parent 0ef4024 commit ad411f0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
git log | grep -m 1 commit
commit=`git log | grep -m 1 commit `
commitnick=${commit:7:10}
commitnick='0.6'
commitnick='0.7'
echo "updating version information in inline_keywords.yaml with latest git commit $commitnick"
sed -ibk "s/version: .*/version: $commitnick/" inline_keywords.yaml
rm inline_keywords.yamlbk
cd ..
rm inline_keywords*.rsp
cp -r rs_inline_keywords inline_keywords
tar -cz -f inline_keywords-$commitnick.rsp -X inline_keywords/exclude.txt inline_keywords
rm -rf inline_keywords

15 changes: 15 additions & 0 deletions hooks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function HookInline_keywordsSearchSearchbarbottomtoolbar()
<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"]; ?>">
<input type="button" id="archiveResourcesButton" value="<?php echo $lang["archiveresources"]; ?>">
</form>
</div>
</div>
Expand Down Expand Up @@ -91,6 +92,20 @@ function HookInline_keywordsSearchAdditionalheaderjs()
jQuery('.chosen .ResourcePanel, .chosen .ResourcePanelSmall').css('border-color','<?php echo $inline_keywords_background_colour; ?>');
});

jQuery('#archiveResourcesButton').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/inline_keywords/pages/archive_resources.php",
data: { refs: resourceIds }
}).done(function( msg ) {
location.reload(true);
});

});

jQuery('#submitSelectedResourceButton').on('click', function() {
var form_values = jQuery('form#manipulateKeywords').serialize();
resourceIds = jQuery.map(jQuery('.chosen'), function(a, b){
Expand Down
2 changes: 1 addition & 1 deletion inline_keywords.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: inline_keywords
author: Aaron T. Maturen
version: 0.6
version: 0.7
desc: Enable Editing Fields on Search Result Page
info_url: https://github.com/aaronmaturen/rs_inline_keywords
config_url: /plugins/inline_keywords/pages/setup.php
Expand Down
2 changes: 2 additions & 0 deletions languages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@

$lang['no-yes'] = array('No', 'Yes');

$lang["archiveresources"] = 'Archive';

?>
14 changes: 14 additions & 0 deletions pages/archive_resources.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors','On');
require '../../../include/db.php';
require '../../../include/authenticate.php';if (!checkperm("a")) {exit("Permission denied");}
require '../../../include/general.php';
require '../../../include/resource_functions.php';
$refs = explode(' ',str_replace('+',' ',$_REQUEST['refs']));
foreach($refs as $ref){
# echo sql_query("update resource set archive=2 where ref='$ref'");
delete_resource($ref);
}
echo 'marked as archived';
?>

0 comments on commit ad411f0

Please sign in to comment.