only display editors for editable fields
This commit is contained in:
parent
e67d679194
commit
16af27e6b7
@ -20,13 +20,18 @@ class TagEditTheme extends Themelet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function get_tag_editor_html(Image $image) {
|
public function get_tag_editor_html(Image $image) {
|
||||||
|
global $user;
|
||||||
$h_tags = html_escape($image->get_tag_list());
|
$h_tags = html_escape($image->get_tag_list());
|
||||||
return "
|
return "
|
||||||
<tr>
|
<tr>
|
||||||
<th width='50px'>Tags</th>
|
<th width='50px'>Tags</th>
|
||||||
<td>
|
<td>
|
||||||
|
".($user->can("edit_image_tag") ? "
|
||||||
<span class='view'>$h_tags</span>
|
<span class='view'>$h_tags</span>
|
||||||
<input class='edit' type='text' name='tag_edit__tags' value='$h_tags' class='autocomplete_tags' id='tag_editor'>
|
<input class='edit' type='text' name='tag_edit__tags' value='$h_tags' class='autocomplete_tags' id='tag_editor'>
|
||||||
|
" : "
|
||||||
|
$h_tags
|
||||||
|
")."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
@ -42,8 +47,12 @@ class TagEditTheme extends Themelet {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Uploader</th>
|
<th>Uploader</th>
|
||||||
<td>
|
<td>
|
||||||
|
".($user->can("edit_image_owner") ? "
|
||||||
<span class='view'><a class='username' href='".make_link("user/$h_owner")."'>$h_owner</a>$h_ip, $h_date</span>
|
<span class='view'><a class='username' href='".make_link("user/$h_owner")."'>$h_owner</a>$h_ip, $h_date</span>
|
||||||
<input class='edit' type='text' name='tag_edit__owner' value='$h_owner'>
|
<input class='edit' type='text' name='tag_edit__owner' value='$h_owner'>
|
||||||
|
" : "
|
||||||
|
<a class='username' href='".make_link("user/$h_owner")."'>$h_owner</a>$h_ip, $h_date
|
||||||
|
")."
|
||||||
</td>
|
</td>
|
||||||
<td width='80px' rowspan='4'>$h_av</td>
|
<td width='80px' rowspan='4'>$h_av</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -51,14 +60,19 @@ class TagEditTheme extends Themelet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function get_source_editor_html(Image $image) {
|
public function get_source_editor_html(Image $image) {
|
||||||
|
global $user;
|
||||||
$h_source = html_escape($image->get_source());
|
$h_source = html_escape($image->get_source());
|
||||||
$f_source = $this->format_source($image->get_source());
|
$f_source = $this->format_source($image->get_source());
|
||||||
return "
|
return "
|
||||||
<tr>
|
<tr>
|
||||||
<th>Source</th>
|
<th>Source</th>
|
||||||
<td>
|
<td>
|
||||||
|
".($user->can("edit_image_source") ? "
|
||||||
<span class='view' style='overflow: hidden; white-space: nowrap;'>$f_source</span>
|
<span class='view' style='overflow: hidden; white-space: nowrap;'>$f_source</span>
|
||||||
<input class='edit' type='text' name='tag_edit__source' value='$h_source'>
|
<input class='edit' type='text' name='tag_edit__source' value='$h_source'>
|
||||||
|
" : "
|
||||||
|
<span style='overflow: hidden; white-space: nowrap;'>$f_source</span>
|
||||||
|
")."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
@ -78,14 +92,19 @@ class TagEditTheme extends Themelet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function get_lock_editor_html(Image $image) {
|
public function get_lock_editor_html(Image $image) {
|
||||||
|
global $user;
|
||||||
$b_locked = $image->is_locked() ? "Yes (Only admins may edit these details)" : "No";
|
$b_locked = $image->is_locked() ? "Yes (Only admins may edit these details)" : "No";
|
||||||
$h_locked = $image->is_locked() ? " checked" : "";
|
$h_locked = $image->is_locked() ? " checked" : "";
|
||||||
return "
|
return "
|
||||||
<tr>
|
<tr>
|
||||||
<th>Locked</th>
|
<th>Locked</th>
|
||||||
<td>
|
<td>
|
||||||
|
".($user->can("lock_image") ? "
|
||||||
<span class='view'>$b_locked</span>
|
<span class='view'>$b_locked</span>
|
||||||
<input class='edit' type='checkbox' name='tag_edit__locked'$h_locked>
|
<input class='edit' type='checkbox' name='tag_edit__locked'$h_locked>
|
||||||
|
" : "
|
||||||
|
$b_locked
|
||||||
|
")."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user