"button", "value" => "Add Note", "onclick" => "addNewNote()"])); } public function request_button(int $image_id): HTMLElement { return SHM_SIMPLE_FORM( "note/add_request", INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]), INPUT(["type" => "submit", "value" => "Add Note Request"]), ); } public function nuke_notes_button(int $image_id): HTMLElement { return SHM_SIMPLE_FORM( "note/nuke_notes", INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]), INPUT(["type" => "submit", "value" => "Nuke Notes", "onclick" => "return confirm_action('Are you sure?')"]), ); } public function nuke_requests_button(int $image_id): HTMLElement { return SHM_SIMPLE_FORM( "note/nuke_requests", INPUT(["type" => "hidden", "name" => "image_id", "value" => $image_id]), INPUT(["type" => "submit", "value" => "Nuke Requests", "onclick" => "return confirm_action('Are you sure?')"]), ); } public function search_notes_page(Page $page): void { //IN DEVELOPMENT, NOT FULLY WORKING $html = '
'; $page->set_title(html_escape("Search Note")); $page->set_heading(html_escape("Search Note")); $page->add_block(new Block("Search Note", $html, "main", 10)); } // check action POST on form public function display_note_system(Page $page, int $image_id, array $recovered_notes, bool $adminOptions): void { $to_json = []; foreach ($recovered_notes as $note) { $to_json[] = [ 'image_id' => $image_id, 'x1' => $note["x1"], 'y1' => $note["y1"], 'height' => $note["height"], 'width' => $note["width"], 'note' => $note["note"], 'note_id' => $note["id"], ]; } $page->add_html_header(""); } public function display_note_list($images, $pageNumber, $totalPages) { global $page; $pool_images = ''; foreach ($images as $pair) { $image = $pair[0]; $thumb_html = $this->build_thumb_html($image); $pool_images .= ''. ' '.$thumb_html.''. ''; } $this->display_paginator($page, "note/list", null, $pageNumber, $totalPages); $page->set_title("Notes"); $page->set_heading("Notes"); $page->add_block(new Block("Notes", $pool_images, "main", 20)); } public function display_note_requests($images, $pageNumber, $totalPages) { global $page; $pool_images = ''; foreach ($images as $pair) { $image = $pair[0]; $thumb_html = $this->build_thumb_html($image); $pool_images .= ''. ' '.$thumb_html.''. ''; } $this->display_paginator($page, "requests/list", null, $pageNumber, $totalPages); $page->set_title("Note Requests"); $page->set_heading("Note Requests"); $page->add_block(new Block("Note Requests", $pool_images, "main", 20)); } private function get_history(array $histories): string { global $user; $html = "Post | ". "Note | ". "Body | ". "Updater | ". "Date | "; if (!$user->is_anonymous()) { $html .= "Action | "; } $html .= "
---|---|---|---|---|---|
".$image_link." | ". "".$history_link." | ". "".$history['note']." | ". "".$user_link." | ". "".autodate($history['date'])." | "; if (!$user->is_anonymous()) { $html .= "".$revert_link." | "; } } $html .= "
Search for posts with notes.
note=noted
Returns posts with a note matching "noted".
notes>0
Returns posts with 1 or more notes.
Can use <, <=, >, >=, or =.
notes_by=username
Returns posts with note(s) by "username".
notes_by_user_id=123
Returns posts with note(s) by user 123.