fix indentation

This commit is contained in:
Shish
2014-04-06 20:47:01 +01:00
parent c8aa3327a1
commit f72bfbb050
18 changed files with 464 additions and 465 deletions

View File

@@ -1,6 +1,6 @@
<?php
class NotesTheme extends Themelet {
public function note_button($image_id) {
public function note_button($image_id) {
return '
<!-- <a href="#" id="addnotelink" >Add a note</a> -->
<form action="" method="">
@@ -39,32 +39,32 @@ class NotesTheme extends Themelet {
$page->set_title(html_escape("Search Note"));
$page->set_heading(html_escape("Search Note"));
$page->add_block(new Block("Search Note", $html, "main", 10));
$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)
{
$to_json = array();
foreach($recovered_notes as $note)
{
$parsedNote = $note["note"];
$parsedNote = str_replace("\n", "\\n", $parsedNote);
$parsedNote = str_replace("\r", "\\r", $parsedNote);
foreach($recovered_notes as $note)
{
$parsedNote = $note["note"];
$parsedNote = str_replace("\n", "\\n", $parsedNote);
$parsedNote = str_replace("\r", "\\r", $parsedNote);
$to_json[] = array(
$to_json[] = array(
'x1' => $note["x1"],
'y1' => $note["y1"],
'height' => $note["height"],
'width' => $note["width"],
'note' => $parsedNote,
'note_id' => $note["id"],
'y1' => $note["y1"],
'height' => $note["height"],
'width' => $note["width"],
'note' => $parsedNote,
'note_id' => $note["id"],
);
}
}
$html = "<script type='text/javascript'>";
$html .= "notes = " . json_encode($to_json);
$html .= "</script>
$html .= "</script>
<div id='noteform'>
".make_form(make_link("note/add_note"))."
@@ -88,41 +88,41 @@ class NotesTheme extends Themelet {
</form>
</div>
<div id='noteEditForm'>
<div id='noteEditForm'>
".make_form(make_link("note/edit_note"))."
<input type='hidden' name='image_id' value='".$image_id."' />
<input type='hidden' name='note_id' id='EditNoteID' value='' />
<input name='note_x1' type='hidden' value='' id='EditNoteX1' />
<input name='note_y1' type='hidden' value='' id='EditNoteY1' />
<input name='note_height' type='hidden' value='' id='EditNoteHeight' />
<input name='note_width' type='hidden' value='' id='EditNoteWidth' />
<table>
<tr>
<td colspan='2'>
<textarea name='note_text' id='EditNoteNote' ></textarea>
</td>
</tr>
<tr>
<td><input type='submit' value='Save Note' /></td>
<td><input type='button' value='Cancel' id='EditCancelNote' /></td>
</tr>
</table>
</form>";
<input type='hidden' name='image_id' value='".$image_id."' />
<input type='hidden' name='note_id' id='EditNoteID' value='' />
<input name='note_x1' type='hidden' value='' id='EditNoteX1' />
<input name='note_y1' type='hidden' value='' id='EditNoteY1' />
<input name='note_height' type='hidden' value='' id='EditNoteHeight' />
<input name='note_width' type='hidden' value='' id='EditNoteWidth' />
<table>
<tr>
<td colspan='2'>
<textarea name='note_text' id='EditNoteNote' ></textarea>
</td>
</tr>
<tr>
<td><input type='submit' value='Save Note' /></td>
<td><input type='button' value='Cancel' id='EditCancelNote' /></td>
</tr>
</table>
</form>";
if($adminOptions)
$html .= "
if($adminOptions)
$html .= "
".make_form(make_link("note/delete_note"))."
<input type='hidden' name='image_id' value='".$image_id."' />
<input type='hidden' name='note_id' value='' id='DeleteNoteNoteID' />
<table>
<tr>
<td><input type='submit' value='Delete note' /></td>
</tr>
</table>
</form>
<input type='hidden' name='image_id' value='".$image_id."' />
<input type='hidden' name='note_id' value='' id='DeleteNoteNoteID' />
<table>
<tr>
<td><input type='submit' value='Delete note' /></td>
</tr>
</table>
</form>
";
$html .= "</div>";
$html .= "</div>";
$page->add_block(new Block(null, $html, "main", 1));
}
@@ -170,64 +170,64 @@ class NotesTheme extends Themelet {
$page->add_block(new Block("Note Requests", $pool_images, "main", 20));
}
private function get_history($histories) {
global $user;
private function get_history($histories) {
global $user;
$html = "<table id='poolsList' class='zebra'>".
"<thead><tr>".
"<th>Image</th>".
"<th>Note</th>".
"<th>Body</th>".
"<th>Updater</th>".
"<th>Date</th>";
$html = "<table id='poolsList' class='zebra'>".
"<thead><tr>".
"<th>Image</th>".
"<th>Note</th>".
"<th>Body</th>".
"<th>Updater</th>".
"<th>Date</th>";
if(!$user->is_anonymous()){
$html .= "<th>Action</th>";
}
if(!$user->is_anonymous()){
$html .= "<th>Action</th>";
}
$html .= "</tr></thead>".
"<tbody>";
$html .= "</tr></thead>".
"<tbody>";
foreach($histories as $history) {
$image_link = "<a href='".make_link("post/view/".$history['image_id'])."'>".$history['image_id']."</a>";
$history_link = "<a href='".make_link("note/history/".$history['note_id'])."'>".$history['note_id'].".".$history['review_id']."</a>";
$user_link = "<a href='".make_link("user/".$history['user_name'])."'>".$history['user_name']."</a>";
$revert_link = "<a href='".make_link("note/revert/".$history['note_id']."/".$history['review_id'])."'>Revert</a>";
foreach($histories as $history) {
$image_link = "<a href='".make_link("post/view/".$history['image_id'])."'>".$history['image_id']."</a>";
$history_link = "<a href='".make_link("note/history/".$history['note_id'])."'>".$history['note_id'].".".$history['review_id']."</a>";
$user_link = "<a href='".make_link("user/".$history['user_name'])."'>".$history['user_name']."</a>";
$revert_link = "<a href='".make_link("note/revert/".$history['note_id']."/".$history['review_id'])."'>Revert</a>";
$html .= "<tr>".
"<td>".$image_link."</td>".
"<td>".$history_link."</td>".
"<td style='text-align:left;'>".$history['note']."</td>".
"<td>".$user_link."</td>".
"<td>".autodate($history['date'])."</td>";
$html .= "<tr>".
"<td>".$image_link."</td>".
"<td>".$history_link."</td>".
"<td style='text-align:left;'>".$history['note']."</td>".
"<td>".$user_link."</td>".
"<td>".autodate($history['date'])."</td>";
if(!$user->is_anonymous()){
$html .= "<td>".$revert_link."</td>";
}
if(!$user->is_anonymous()){
$html .= "<td>".$revert_link."</td>";
}
}
}
$html .= "</tr></tbody></table>";
$html .= "</tr></tbody></table>";
return $html;
}
return $html;
}
public function display_histories($histories, $pageNumber, $totalPages) {
global $page;
global $page;
$html = $this->get_history($histories);
$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));
$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);
$this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages);
}
public function display_history($histories, $pageNumber, $totalPages) {
global $page;
global $page;
$html = $this->get_history($histories);
$html = $this->get_history($histories);
$page->set_title("Note History");
$page->set_heading("Note History");
@@ -235,5 +235,5 @@ class NotesTheme extends Themelet {
$this->display_paginator($page, "note/updated", null, $pageNumber, $totalPages);
}
}
}
?>