Add a note -->
';
}
public function request_button($image_id)
{
return make_form(make_link("note/add_request")) . '
';
}
public function nuke_notes_button($image_id)
{
return make_form(make_link("note/nuke_notes")) . '
';
}
public function nuke_requests_button($image_id)
{
return make_form(make_link("note/nuke_requests")) . '
';
}
public function search_notes_page(Page $page)
{ //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, $image_id, $recovered_notes, $adminOptions)
{
$base_href = get_base_href();
$page->add_html_header("");
$page->add_html_header("");
$page->add_html_header("");
$to_json = [];
foreach ($recovered_notes as $note) {
$parsedNote = $note["note"];
$parsedNote = str_replace("\n", "\\n", $parsedNote);
$parsedNote = str_replace("\r", "\\r", $parsedNote);
$to_json[] = [
'x1' => $note["x1"],
'y1' => $note["y1"],
'height' => $note["height"],
'width' => $note["width"],
'note' => $parsedNote,
'note_id' => $note["id"],
];
}
$html = "";
$html .= "
";
$page->add_block(new Block(null, $html, "main", 1, 'note_system'));
}
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($histories)
{
global $user;
$html = "".
"".
"Post | ".
"Note | ".
"Body | ".
"Updater | ".
"Date | ";
if (!$user->is_anonymous()) {
$html .= "Action | ";
}
$html .= "
".
"";
foreach ($histories as $history) {
$image_link = "".$history['image_id']."";
$history_link = "".$history['note_id'].".".$history['review_id']."";
$user_link = "".$history['user_name']."";
$revert_link = "Revert";
$html .= "".
"".$image_link." | ".
"".$history_link." | ".
"".$history['note']." | ".
"".$user_link." | ".
"".autodate($history['date'])." | ";
if (!$user->is_anonymous()) {
$html .= "".$revert_link." | ";
}
}
$html .= "
";
return $html;
}
public function display_histories($histories, $pageNumber, $totalPages)
{
global $page;
$html = $this->get_history($histories);
$page->set_title("Note Updates");
$page->set_heading("Note Updates");
$page->add_block(new Block("Note Updates", $html, "main", 10));
$this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages);
}
public function display_history($histories, $pageNumber, $totalPages)
{
global $page;
$html = $this->get_history($histories);
$page->set_title("Note History");
$page->set_heading("Note History");
$page->add_block(new Block("Note History", $html, "main", 10));
$this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages);
}
public function get_help_html()
{
return '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.
';
}
}