public function get_lock_editor_html(Image $image) { global $user; $b_locked = $image->is_locked() ? "Yes (Only admins may edit these details)" : "No"; $h_locked = $image->is_locked() ? " checked" : ""; return "\n\t\t\t<tr>\n\t\t\t\t<th>Locked</th>\n\t\t\t\t<td>\n\t\t" . ($user->can("edit_image_lock") ? "\n\t\t\t\t\t<span class='view'>{$b_locked}</span>\n\t\t\t\t\t<input class='edit' type='checkbox' name='tag_edit__locked'{$h_locked}>\n\t\t" : "\n\t\t\t\t\t{$b_locked}\n\t\t") . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t"; }
protected function build_info(Image $image, $editor_parts) { global $user; if (count($editor_parts) == 0) { return $image->is_locked() ? "<br>[Image Locked]" : ""; } $html = make_form(make_link("post/set")) . "\n\t\t\t\t\t<input type='hidden' name='image_id' value='{$image->id}'>\n\t\t\t\t\t<table style='width: 500px;' class='image_info form'>\n\t\t"; foreach ($editor_parts as $part) { $html .= $part; } if ((!$image->is_locked() || $user->can("edit_image_lock")) && $user->can("edit_image_tag")) { $html .= "\n\t\t\t\t\t\t<tr><td colspan='4'>\n\t\t\t\t\t\t\t<input class='view' type='button' value='Edit' onclick='\$(\".view\").hide(); \$(\".edit\").show();'>\n\t\t\t\t\t\t\t<input class='edit' type='submit' value='Set'>\n\t\t\t\t\t\t</td></tr>\n\t\t\t"; } $html .= "\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t"; return $html; }
protected function build_image_editor(Image $image, $editor_parts) { if (count($editor_parts) == 0) { return $image->is_locked() ? "<br>[Image Locked]" : ""; } if (isset($_GET['search'])) { $h_query = "search=" . url_escape($_GET['search']); } else { $h_query = ""; } $html = " (<a href=\"javascript: toggle('imgdata')\">edit info</a>)"; $html .= "\n\t\t\t<div id='imgdata'>\n\t\t\t\t<form action='" . make_link("post/set") . "' method='POST'>\n\t\t\t\t\t<input type='hidden' name='image_id' value='{$image->id}'>\n\t\t\t\t\t<input type='hidden' name='query' value='{$h_query}'>\n\t\t\t\t\t<table style='width: 500px;'>\n\t\t"; foreach ($editor_parts as $part) { $html .= $part; } $html .= "\n\t\t\t\t\t\t<tr><td colspan='2'><input type='submit' value='Set'></td></tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t\t<br>\n\t\t\t</div>\n\t\t"; return $html; }
/** * @param Image $image * @return bool */ private function can_source(Image $image) { global $user; return $user->can("edit_image_source") || !$image->is_locked(); }
public function get_lock_editor_html(Image $image) { $h_locked = $image->is_locked() ? " checked" : ""; return "<tr><td>Locked</td><td><input type='checkbox' name='tag_edit__locked'{$h_locked}></td></tr>"; }
/** * @param Image $image * @return bool */ private function can_tag(Image $image) { global $user; return $user->can("edit_image_tag") && (!$image->is_locked() || $user->can("edit_image_lock")); }