merge Agasa's mass tagger work (replace tags mode, as opposed to the default of adding)
This commit is contained in:
parent
01aacdb19c
commit
5c30eab6ad
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Name: Mass Tagger
|
||||
* Author: Christian Walde <walde.christian@googlemail.com>
|
||||
* Author: Christian Walde <walde.christian@googlemail.com>, contributions by Shish and Agasa
|
||||
* License: WTFPL
|
||||
* Description: Tag a bunch of images at once
|
||||
* Documentation:
|
||||
@ -38,9 +38,19 @@ class MassTagger extends Extension {
|
||||
|
||||
$images = array_map( "Image::by_id", $ids );
|
||||
|
||||
if(isset($_POST['setadd']) &&
|
||||
$_POST['setadd'] == 'set')
|
||||
{
|
||||
foreach($images as $image) {
|
||||
$image->set_tags($tag);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($images as $image) {
|
||||
$image->set_tags($tag . " " . $image->get_tag_list());
|
||||
}
|
||||
}
|
||||
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
|
@ -13,6 +13,7 @@ class MassTaggerTheme extends Themelet {
|
||||
Click on images to mark them. Use the 'Index Options' in the Board Config to increase the amount of shown images.
|
||||
<br />
|
||||
<input type='hidden' name='ids' id='mass_tagger_ids' />
|
||||
Set instead of add? <input type='checkbox' name='setadd' value='set' />
|
||||
<label>Tags: <input type='text' name='tag' /></label>
|
||||
|
||||
<input type='submit' value='Tag Marked Images' />
|
||||
|
Loading…
x
Reference in New Issue
Block a user