fix tag editing with danbooru theme, hopefully in a more permanant way

git-svn-id: file:///home/shish/svn/shimmie2/trunk@721 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-02-17 02:39:43 +00:00
parent 04fe9ad03a
commit c7c33a1a8d
2 changed files with 8 additions and 26 deletions

View File

@ -77,12 +77,17 @@ class ViewTheme extends Themelet {
$html .= " (<a href='http://$h_source'>source</a>)";
}
}
$html .= " (<a href=\"javascript: toggle('imgdata')\">edit info</a>)";
$html .= $this->build_image_editor($image, $editor_parts);
return $html;
}
protected function build_image_editor($image, $editor_parts) {
if(isset($_GET['search'])) {$h_query = "search=".url_escape($_GET['search']);}
else {$h_query = "";}
$html = " (<a href=\"javascript: toggle('imgdata')\">edit info</a>)";
$html .= "
<div id='imgdata'>
<form action='".make_link("post/set")."' method='POST'>

View File

@ -14,7 +14,7 @@ class CustomViewTheme extends ViewTheme {
var $pin = null;
protected function build_info($image) {
protected function build_info($image, $editor_parts) {
global $user;
$owner = $image->get_owner();
$h_owner = html_escape($owner->name);
@ -36,30 +36,7 @@ class CustomViewTheme extends ViewTheme {
}
}
global $config;
global $user;
if($config->get_bool("tag_edit_anon") || ($user->id != $config->get_int("anon_id"))) {
$html .= " (<a href=\"javascript: toggle('imgdata')\">edit</a>)";
if(isset($_GET['search'])) {$h_query = "search=".url_escape($_GET['search']);}
else {$h_query = "";}
$h_tags = html_escape($image->get_tag_list());
$i_image_id = int_escape($image->id);
$html .= "
<div id='imgdata'><form action='".make_link("tag_edit/set")."' method='POST'>
<input type='hidden' name='image_id' value='$i_image_id'>
<input type='hidden' name='query' value='$h_query'>
<table style='width: 500px;'>
<tr><td width='50px'>Tags</td><td width='300px'><input type='text' name='tags' value='$h_tags'></td></tr>
<tr><td>Source</td><td><input type='text' name='source' value='$h_source'></td></tr>
<tr><td>&nbsp;</td><td><input type='submit' value='Set'></td></tr>
</table>
</form>
</div>
";
}
$html .= $this->build_image_editor($image, $editor_parts);
return $html;
}