very classy
This commit is contained in:
parent
d709f1566e
commit
eeda4d6ab3
@ -6,7 +6,7 @@ class BulkAddTheme extends Themelet {
|
|||||||
/*
|
/*
|
||||||
* Show a standard page for results to be put into
|
* Show a standard page for results to be put into
|
||||||
*/
|
*/
|
||||||
public function display_upload_results($page) {
|
public function display_upload_results(Page $page) {
|
||||||
$page->set_title("Adding folder");
|
$page->set_title("Adding folder");
|
||||||
$page->set_heading("Adding folder");
|
$page->set_heading("Adding folder");
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
@ -20,7 +20,7 @@ class BulkAddTheme extends Themelet {
|
|||||||
* links to bulk_add with POST[dir] set to the name of a server-side
|
* links to bulk_add with POST[dir] set to the name of a server-side
|
||||||
* directory full of images
|
* directory full of images
|
||||||
*/
|
*/
|
||||||
public function display_admin_block($page) {
|
public function display_admin_block(Page $page) {
|
||||||
$html = "
|
$html = "
|
||||||
Add a folder full of images; any subfolders will have their names
|
Add a folder full of images; any subfolders will have their names
|
||||||
used as tags for the images within.
|
used as tags for the images within.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class EventLogTheme extends Themelet {
|
class EventLogTheme extends Themelet {
|
||||||
public function display_page($page, $events) {
|
public function display_page(Page $page, $events) {
|
||||||
$page->set_title("Event Log");
|
$page->set_title("Event Log");
|
||||||
$page->set_heading("Event Log");
|
$page->set_heading("Event Log");
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
@ -10,7 +10,7 @@ class EventLogTheme extends Themelet {
|
|||||||
$this->display_controls($page);
|
$this->display_controls($page);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function display_table($page, $events) {
|
protected function display_table(Page $page, $events) {
|
||||||
$table = "
|
$table = "
|
||||||
<style>
|
<style>
|
||||||
.event_log_table TD {
|
.event_log_table TD {
|
||||||
@ -70,7 +70,7 @@ class EventLogTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Log Contents", $table));
|
$page->add_block(new Block("Log Contents", $table));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function display_controls($page) {
|
protected function display_controls(Page $page) {
|
||||||
$html = "
|
$html = "
|
||||||
<form action='".make_link("event_log")."' method='POST'>
|
<form action='".make_link("event_log")."' method='POST'>
|
||||||
<input type='hidden' name='action' value='clear'>
|
<input type='hidden' name='action' value='clear'>
|
||||||
|
@ -4,7 +4,7 @@ class FeaturedTheme extends Themelet {
|
|||||||
/*
|
/*
|
||||||
* Show $text on the $page
|
* Show $text on the $page
|
||||||
*/
|
*/
|
||||||
public function display_featured($page, $image) {
|
public function display_featured(Page $page, Image $image) {
|
||||||
$page->add_block(new Block("Featured Image", $this->build_thumb_html($image), "left", 3));
|
$page->add_block(new Block("Featured Image", $this->build_thumb_html($image), "left", 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class FlashFileHandlerTheme extends Themelet {
|
class FlashFileHandlerTheme extends Themelet {
|
||||||
public function display_image($page, $image) {
|
public function display_image(Page $page, Image $image) {
|
||||||
$ilink = $image->get_image_link();
|
$ilink = $image->get_image_link();
|
||||||
// FIXME: object and embed have "height" and "width"
|
// FIXME: object and embed have "height" and "width"
|
||||||
$html = "
|
$html = "
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class IcoFileHandlerTheme extends Themelet {
|
class IcoFileHandlerTheme extends Themelet {
|
||||||
public function display_image($page, $image) {
|
public function display_image(Page $page, Image $image) {
|
||||||
$ilink = make_link("get_ico/{$image->id}/{$image->id}.ico");
|
$ilink = make_link("get_ico/{$image->id}/{$image->id}.ico");
|
||||||
$html = "
|
$html = "
|
||||||
<img id='main_image' src='$ilink'>
|
<img id='main_image' src='$ilink'>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class MP3FileHandlerTheme extends Themelet {
|
class MP3FileHandlerTheme extends Themelet {
|
||||||
public function display_image($page, $image) {
|
public function display_image(Page $page, Image $image) {
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
$ilink = $image->get_image_link();
|
$ilink = $image->get_image_link();
|
||||||
$html = "
|
$html = "
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class SVGFileHandlerTheme extends Themelet {
|
class SVGFileHandlerTheme extends Themelet {
|
||||||
public function display_image($page, $image) {
|
public function display_image(Page $page, Image $image) {
|
||||||
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
||||||
// $ilink = $image->get_image_link();
|
// $ilink = $image->get_image_link();
|
||||||
$html = "
|
$html = "
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class HomeTheme extends Themelet {
|
class HomeTheme extends Themelet {
|
||||||
public function display_page($page, $sitename, $data_href, $theme_name, $body) {
|
public function display_page(Page $page, $sitename, $data_href, $theme_name, $body) {
|
||||||
$page->set_mode("data");
|
$page->set_mode("data");
|
||||||
$page->set_data(<<<EOD
|
$page->set_data(<<<EOD
|
||||||
<html>
|
<html>
|
||||||
|
@ -20,7 +20,7 @@ class ImageBanTheme extends Themelet {
|
|||||||
* 'date' => when the ban started
|
* 'date' => when the ban started
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function display_image_hash_bans($page, $page_number, $bans) {
|
public function display_image_hash_bans(Page $page, $page_number, $bans) {
|
||||||
$h_bans = "";
|
$h_bans = "";
|
||||||
foreach($bans as $ban) {
|
foreach($bans as $ban) {
|
||||||
$h_bans .= "
|
$h_bans .= "
|
||||||
@ -70,7 +70,7 @@ class ImageBanTheme extends Themelet {
|
|||||||
*
|
*
|
||||||
* $image_id = the image to delete
|
* $image_id = the image to delete
|
||||||
*/
|
*/
|
||||||
public function get_buttons_html($image) {
|
public function get_buttons_html(Image $image) {
|
||||||
$html = "
|
$html = "
|
||||||
<form action='".make_link("image_hash_ban/add")."' method='POST'>
|
<form action='".make_link("image_hash_ban/add")."' method='POST'>
|
||||||
<input type='hidden' name='hash' value='{$image->hash}'>
|
<input type='hidden' name='hash' value='{$image->hash}'>
|
||||||
|
@ -11,7 +11,7 @@ class IPBanTheme extends Themelet {
|
|||||||
* 'end' => when the ban will end
|
* 'end' => when the ban will end
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function display_bans($page, $bans) {
|
public function display_bans(Page $page, $bans) {
|
||||||
global $user;
|
global $user;
|
||||||
$h_bans = "";
|
$h_bans = "";
|
||||||
foreach($bans as $ban) {
|
foreach($bans as $ban) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
class LinkImageTheme extends Themelet {
|
class LinkImageTheme extends Themelet {
|
||||||
public function links_block($page,$data) {
|
public function links_block(Page $page, $data) {
|
||||||
|
|
||||||
$thumb_src = $data['thumb_src'];
|
$thumb_src = $data['thumb_src'];
|
||||||
$image_src = $data['image_src'];
|
$image_src = $data['image_src'];
|
||||||
$post_link = $data['post_link'];
|
$post_link = $data['post_link'];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class NotesTheme extends Themelet {
|
class NotesTheme extends Themelet {
|
||||||
public function display_notes($page, $notes) {
|
public function display_notes(Page $page, $notes) {
|
||||||
$html = <<<EOD
|
$html = <<<EOD
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
img = byId("main_image");
|
img = byId("main_image");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class NumericScoreTheme extends Themelet {
|
class NumericScoreTheme extends Themelet {
|
||||||
public function get_voter_html($image) {
|
public function get_voter_html(Image $image) {
|
||||||
$i_image_id = int_escape($image->id);
|
$i_image_id = int_escape($image->id);
|
||||||
$i_score = int_escape($image->numeric_score);
|
$i_score = int_escape($image->numeric_score);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class RegenThumbTheme extends Themelet {
|
|||||||
/*
|
/*
|
||||||
* Show a link to the new thumbnail
|
* Show a link to the new thumbnail
|
||||||
*/
|
*/
|
||||||
public function display_results($page, $image) {
|
public function display_results(Page $page, Image $image) {
|
||||||
$page->set_title("Thumbnail Regenerated");
|
$page->set_title("Thumbnail Regenerated");
|
||||||
$page->set_heading("Thumbnail Regenerated");
|
$page->set_heading("Thumbnail Regenerated");
|
||||||
$page->add_header("<meta http-equiv=\"cache-control\" content=\"no-cache\">");
|
$page->add_header("<meta http-equiv=\"cache-control\" content=\"no-cache\">");
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class ReportImageTheme extends Themelet {
|
class ReportImageTheme extends Themelet {
|
||||||
public function display_reported_images($page, $reports) {
|
public function display_reported_images(Page $page, $reports) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$h_reportedimages = "";
|
$h_reportedimages = "";
|
||||||
@ -71,7 +71,7 @@ class ReportImageTheme extends Themelet {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_image_banner($page, $image) {
|
public function display_image_banner(Page $page, Image $image) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$i_image = int_escape($image);
|
$i_image = int_escape($image);
|
||||||
|
@ -7,7 +7,7 @@ class SCoreReporter extends HtmlReporter {
|
|||||||
var $clear_modules = "";
|
var $clear_modules = "";
|
||||||
var $page;
|
var $page;
|
||||||
|
|
||||||
public function SCoreReporter($page) {
|
public function SCoreReporter(Page $page) {
|
||||||
$this->page = $page;
|
$this->page = $page;
|
||||||
$this->_fails = 0;
|
$this->_fails = 0;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class SVNUpdateTheme extends Themelet {
|
class SVNUpdateTheme extends Themelet {
|
||||||
public function display_form($page) {
|
public function display_form(Page $page) {
|
||||||
$html = "
|
$html = "
|
||||||
<a href='".make_link("update/view_changes")."'>Check for Updates</a>
|
<a href='".make_link("update/view_changes")."'>Check for Updates</a>
|
||||||
";
|
";
|
||||||
$page->add_block(new Block("Update", $html));
|
$page->add_block(new Block("Update", $html));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_update_todo($page, $log, $branches) {
|
public function display_update_todo(Page $page, $log, $branches) {
|
||||||
$h_log = html_escape($log);
|
$h_log = html_escape($log);
|
||||||
$updates = "
|
$updates = "
|
||||||
<textarea rows='20' cols='80'>$h_log</textarea>
|
<textarea rows='20' cols='80'>$h_log</textarea>
|
||||||
@ -37,7 +37,7 @@ class SVNUpdateTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Available Branches", $branches));
|
$page->add_block(new Block("Available Branches", $branches));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_update_log($page, $log) {
|
public function display_update_log(Page $page, $log) {
|
||||||
$h_log = html_escape($log);
|
$h_log = html_escape($log);
|
||||||
$html = "
|
$html = "
|
||||||
<textarea rows='20' cols='80'>$h_log</textarea>
|
<textarea rows='20' cols='80'>$h_log</textarea>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Tag_HistoryTheme extends Themelet {
|
class Tag_HistoryTheme extends Themelet {
|
||||||
public function display_history_page($page, $image_id, $history) {
|
public function display_history_page(Page $page, $image_id, $history) {
|
||||||
$start_string = "
|
$start_string = "
|
||||||
<div style='text-align: left'>
|
<div style='text-align: left'>
|
||||||
<form enctype='multipart/form-data' action='".make_link("tag_history/revert")."' method='POST'>
|
<form enctype='multipart/form-data' action='".make_link("tag_history/revert")."' method='POST'>
|
||||||
@ -36,7 +36,7 @@ class Tag_HistoryTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Tag History", $history_html, "main", 10));
|
$page->add_block(new Block("Tag History", $history_html, "main", 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_global_page($page, $history) {
|
public function display_global_page(Page $page, $history) {
|
||||||
$start_string = "
|
$start_string = "
|
||||||
<div style='text-align: left'>
|
<div style='text-align: left'>
|
||||||
<form enctype='multipart/form-data' action='".make_link("tag_history/revert")."' method='POST'>
|
<form enctype='multipart/form-data' action='".make_link("tag_history/revert")."' method='POST'>
|
||||||
@ -77,7 +77,7 @@ class Tag_HistoryTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Tag History", $history_html, "main", 10));
|
$page->add_block(new Block("Tag History", $history_html, "main", 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_history_link($page, $image_id) {
|
public function display_history_link(Page $page, $image_id) {
|
||||||
$link = "<a href='".make_link("tag_history/$image_id")."'>Tag History</a>\n";
|
$link = "<a href='".make_link("tag_history/$image_id")."'>Tag History</a>\n";
|
||||||
$page->add_block(new Block(null, $link, "main", 5));
|
$page->add_block(new Block(null, $link, "main", 5));
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
class taggerTheme extends Themelet {
|
class taggerTheme extends Themelet {
|
||||||
public function build_tagger ($page, $event) {
|
public function build_tagger (Page $page, $event) {
|
||||||
global $config;
|
global $config;
|
||||||
// Initialization code
|
// Initialization code
|
||||||
$base_href = $config->get_string('base_href');
|
$base_href = $config->get_string('base_href');
|
||||||
@ -22,7 +22,7 @@ class taggerTheme extends Themelet {
|
|||||||
$this->html($event->get_image()),
|
$this->html($event->get_image()),
|
||||||
"main"));
|
"main"));
|
||||||
}
|
}
|
||||||
private function html($image) {
|
private function html(Image $image) {
|
||||||
global $config;
|
global $config;
|
||||||
$i_image_id = int_escape($image->id);
|
$i_image_id = int_escape($image->id);
|
||||||
$h_source = html_escape($image->source);
|
$h_source = html_escape($image->source);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class TextScoreTheme extends Themelet {
|
class TextScoreTheme extends Themelet {
|
||||||
public function get_scorer_html($image) {
|
public function get_scorer_html(Image $image) {
|
||||||
$i_image_id = int_escape($image->id);
|
$i_image_id = int_escape($image->id);
|
||||||
|
|
||||||
$s_score = $this->score_to_name($image->text_score);
|
$s_score = $this->score_to_name($image->text_score);
|
||||||
|
@ -8,7 +8,7 @@ class WikiTheme {
|
|||||||
* $wiki_page = the wiki page, has ->title and ->body
|
* $wiki_page = the wiki page, has ->title and ->body
|
||||||
* $nav_page = a wiki page object with navigation, has ->body
|
* $nav_page = a wiki page object with navigation, has ->body
|
||||||
*/
|
*/
|
||||||
public function display_page($page, $wiki_page, $nav_page) {
|
public function display_page(Page $page, WikiPage $wiki_page, WikiPage $nav_page) {
|
||||||
if(is_null($nav_page)) {
|
if(is_null($nav_page)) {
|
||||||
$nav_page = new WikiPage();
|
$nav_page = new WikiPage();
|
||||||
$nav_page->body = "";
|
$nav_page->body = "";
|
||||||
@ -29,14 +29,14 @@ class WikiTheme {
|
|||||||
$page->add_block(new Block("Content", $this->create_display_html($wiki_page)));
|
$page->add_block(new Block("Content", $this->create_display_html($wiki_page)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_page_editor($page, $wiki_page) {
|
public function display_page_editor(Page $page, WikiPage $wiki_page) {
|
||||||
$page->set_title(html_escape($wiki_page->title));
|
$page->set_title(html_escape($wiki_page->title));
|
||||||
$page->set_heading(html_escape($wiki_page->title));
|
$page->set_heading(html_escape($wiki_page->title));
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
$page->add_block(new Block("Editor", $this->create_edit_html($wiki_page)));
|
$page->add_block(new Block("Editor", $this->create_edit_html($wiki_page)));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function can_edit($user, $page) {
|
protected function can_edit(User $user, WikiPage $page) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if(!is_null($page) && $page->is_locked() && !$user->is_admin()) return false;
|
if(!is_null($page) && $page->is_locked() && !$user->is_admin()) return false;
|
||||||
@ -46,7 +46,7 @@ class WikiTheme {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function create_edit_html($page) {
|
protected function create_edit_html(WikiPage $page) {
|
||||||
$h_title = html_escape($page->title);
|
$h_title = html_escape($page->title);
|
||||||
$u_title = url_escape($page->title);
|
$u_title = url_escape($page->title);
|
||||||
$i_revision = int_escape($page->revision) + 1;
|
$i_revision = int_escape($page->revision) + 1;
|
||||||
@ -70,7 +70,7 @@ class WikiTheme {
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function create_display_html($page) {
|
protected function create_display_html(WikiPage $page) {
|
||||||
$owner = $page->get_owner();
|
$owner = $page->get_owner();
|
||||||
|
|
||||||
$tfe = new TextFormattingEvent($page->body);
|
$tfe = new TextFormattingEvent($page->body);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ZoomTheme extends Themelet {
|
class ZoomTheme extends Themelet {
|
||||||
public function display_zoomer($page, $image, $zoom_by_default) {
|
public function display_zoomer(Page $page, Image $image, $zoom_by_default) {
|
||||||
$page->add_block(new Block(null, $this->make_zoomer($image->width, $zoom_by_default)));
|
$page->add_block(new Block(null, $this->make_zoomer($image->width, $zoom_by_default)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ class AdminPageTheme extends Themelet {
|
|||||||
/*
|
/*
|
||||||
* Show the basics of a page, for other extensions to add to
|
* Show the basics of a page, for other extensions to add to
|
||||||
*/
|
*/
|
||||||
public function display_page($page) {
|
public function display_page(Page $page) {
|
||||||
$page->set_title("Admin Tools");
|
$page->set_title("Admin Tools");
|
||||||
$page->set_heading("Admin Tools");
|
$page->set_heading("Admin Tools");
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
@ -32,7 +32,7 @@ class AdminPageTheme extends Themelet {
|
|||||||
* 'recount tag use'
|
* 'recount tag use'
|
||||||
* 'purge unused tags'
|
* 'purge unused tags'
|
||||||
*/
|
*/
|
||||||
public function display_form($page) {
|
public function display_form(Page $page) {
|
||||||
$html = "
|
$html = "
|
||||||
<p><form action='".make_link("admin_utils")."' method='POST'>
|
<p><form action='".make_link("admin_utils")."' method='POST'>
|
||||||
<select name='action'>
|
<select name='action'>
|
||||||
|
@ -7,7 +7,7 @@ class AliasEditorTheme extends Themelet {
|
|||||||
* $aliases = an array of ($old_tag => $new_tag)
|
* $aliases = an array of ($old_tag => $new_tag)
|
||||||
* $is_admin = whether things like "add new alias" should be shown
|
* $is_admin = whether things like "add new alias" should be shown
|
||||||
*/
|
*/
|
||||||
public function display_aliases($page, $aliases, $is_admin) {
|
public function display_aliases(Page $page, $aliases, $is_admin) {
|
||||||
if($is_admin) {
|
if($is_admin) {
|
||||||
$action = "<td>Action</td>";
|
$action = "<td>Action</td>";
|
||||||
$add = "
|
$add = "
|
||||||
|
@ -7,7 +7,7 @@ class CommentListTheme extends Themelet {
|
|||||||
* $page_number = the current page number
|
* $page_number = the current page number
|
||||||
* $total_pages = the total number of comment pages
|
* $total_pages = the total number of comment pages
|
||||||
*/
|
*/
|
||||||
public function display_page_start($page, $page_number, $total_pages) {
|
public function display_page_start(Page $page, $page_number, $total_pages) {
|
||||||
$prev = $page_number - 1;
|
$prev = $page_number - 1;
|
||||||
$next = $page_number + 1;
|
$next = $page_number + 1;
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ class CommentListTheme extends Themelet {
|
|||||||
*
|
*
|
||||||
* $comments = an array of Comment objects to be shown
|
* $comments = an array of Comment objects to be shown
|
||||||
*/
|
*/
|
||||||
public function display_recent_comments($page, $comments) {
|
public function display_recent_comments(Page $page, $comments) {
|
||||||
$html = $this->comments_to_html($comments, true);
|
$html = $this->comments_to_html($comments, true);
|
||||||
$html .= "<p><a class='more' href='".make_link("comment/list")."'>Full List</a>";
|
$html .= "<p><a class='more' href='".make_link("comment/list")."'>Full List</a>";
|
||||||
$page->add_block(new Block("Comments", $html, "left"));
|
$page->add_block(new Block("Comments", $html, "left"));
|
||||||
@ -39,7 +39,7 @@ class CommentListTheme extends Themelet {
|
|||||||
/*
|
/*
|
||||||
* Show comments for an image
|
* Show comments for an image
|
||||||
*/
|
*/
|
||||||
public function display_comments($page, $comments, $postbox, $image_id) {
|
public function display_comments(Page $page, $comments, $postbox, $image_id) {
|
||||||
if($postbox) {
|
if($postbox) {
|
||||||
$page->add_block(new Block("Comments",
|
$page->add_block(new Block("Comments",
|
||||||
$this->comments_to_html($comments).
|
$this->comments_to_html($comments).
|
||||||
@ -57,7 +57,7 @@ class CommentListTheme extends Themelet {
|
|||||||
* Add a block with thumbnail and comments, as part of the comment
|
* Add a block with thumbnail and comments, as part of the comment
|
||||||
* list page
|
* list page
|
||||||
*/
|
*/
|
||||||
public function add_comment_list($page, $image, $comments, $position, $with_postbox) {
|
public function add_comment_list(Page $page, Image $image, $comments, $position, $with_postbox) {
|
||||||
$html = "<div style='text-align: left'>";
|
$html = "<div style='text-align: left'>";
|
||||||
$html .= "<div style='float: left; margin-right: 16px;'>" . $this->build_thumb_html($image) . "</div>";
|
$html .= "<div style='float: left; margin-right: 16px;'>" . $this->build_thumb_html($image) . "</div>";
|
||||||
$html .= $this->comments_to_html($comments);
|
$html .= $this->comments_to_html($comments);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ExtManagerTheme extends Themelet {
|
class ExtManagerTheme extends Themelet {
|
||||||
public function display_table($page, $extensions) {
|
public function display_table(Page $page, $extensions) {
|
||||||
$html = "
|
$html = "
|
||||||
<form action='".make_link("ext_manager/set")."' method='POST'>
|
<form action='".make_link("ext_manager/set")."' method='POST'>
|
||||||
<table border='1'>
|
<table border='1'>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class PixelFileHandlerTheme extends Themelet {
|
class PixelFileHandlerTheme extends Themelet {
|
||||||
public function display_image($page, $image) {
|
public function display_image(Page $page, Image $image) {
|
||||||
$ilink = $image->get_image_link();
|
$ilink = $image->get_image_link();
|
||||||
$html = "<img id='main_image' src='$ilink'>";
|
$html = "<img id='main_image' src='$ilink'>";
|
||||||
$page->add_block(new Block("Image", $html, "main", 0));
|
$page->add_block(new Block("Image", $html, "main", 0));
|
||||||
|
@ -7,7 +7,7 @@ class IndexTheme extends Themelet {
|
|||||||
$this->search_terms = $search_terms;
|
$this->search_terms = $search_terms;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_page($page, $images) {
|
public function display_page(Page $page, $images) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if(count($this->search_terms) == 0) {
|
if(count($this->search_terms) == 0) {
|
||||||
|
@ -12,7 +12,7 @@ class SetupTheme extends Themelet {
|
|||||||
*
|
*
|
||||||
* The page should wrap all the options in a form which links to setup_save
|
* The page should wrap all the options in a form which links to setup_save
|
||||||
*/
|
*/
|
||||||
public function display_page($page, $panel) {
|
public function display_page(Page $page, $panel) {
|
||||||
$setupblock_html1 = "";
|
$setupblock_html1 = "";
|
||||||
$setupblock_html2 = "";
|
$setupblock_html2 = "";
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ class SetupTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Setup", $table));
|
$page->add_block(new Block("Setup", $table));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_advanced($page, $options) {
|
public function display_advanced(Page $page, $options) {
|
||||||
$rows = "";
|
$rows = "";
|
||||||
foreach($options as $name => $value) {
|
foreach($options as $name => $value) {
|
||||||
$h_value = html_escape($value);
|
$h_value = html_escape($value);
|
||||||
@ -90,7 +90,7 @@ class SetupTheme extends Themelet {
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function sb_to_html($block) {
|
protected function sb_to_html(SetupBlock $block) {
|
||||||
return "<div class='setupblock'><b>{$block->header}</b><br>{$block->body}</div>\n";
|
return "<div class='setupblock'><b>{$block->header}</b><br>{$block->body}</div>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ class TagEditTheme extends Themelet {
|
|||||||
* Display a form which links to tag_edit/replace with POST[search]
|
* Display a form which links to tag_edit/replace with POST[search]
|
||||||
* and POST[replace] set appropriately
|
* and POST[replace] set appropriately
|
||||||
*/
|
*/
|
||||||
public function display_mass_editor($page) {
|
public function display_mass_editor(Page $page) {
|
||||||
$html = "
|
$html = "
|
||||||
<form action='".make_link("tag_edit/replace")."' method='POST'>
|
<form action='".make_link("tag_edit/replace")."' method='POST'>
|
||||||
<table border='1' style='width: 200px;'>
|
<table border='1' style='width: 200px;'>
|
||||||
@ -18,12 +18,12 @@ class TagEditTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Mass Tag Edit", $html));
|
$page->add_block(new Block("Mass Tag Edit", $html));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_tag_editor_html($image) {
|
public function get_tag_editor_html(Image $image) {
|
||||||
$h_tags = html_escape($image->get_tag_list());
|
$h_tags = html_escape($image->get_tag_list());
|
||||||
return "<tr><td width='50px'>Tags</td><td width='300px'><input type='text' name='tag_edit__tags' value='$h_tags'></td></tr>";
|
return "<tr><td width='50px'>Tags</td><td width='300px'><input type='text' name='tag_edit__tags' value='$h_tags'></td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_source_editor_html($image) {
|
public function get_source_editor_html(Image $image) {
|
||||||
$h_source = html_escape($image->get_source());
|
$h_source = html_escape($image->get_source());
|
||||||
return "<tr><td>Source</td><td><input type='text' name='tag_edit__source' value='$h_source'></td></tr>";
|
return "<tr><td>Source</td><td><input type='text' name='tag_edit__source' value='$h_source'></td></tr>";
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ class TagListTheme extends Themelet {
|
|||||||
$this->navigation = $nav;
|
$this->navigation = $nav;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_page($page) {
|
public function display_page(Page $page) {
|
||||||
$page->set_title("Tag List");
|
$page->set_title("Tag List");
|
||||||
$page->set_heading($this->heading);
|
$page->set_heading($this->heading);
|
||||||
$page->add_block(new Block("Tags", $this->list));
|
$page->add_block(new Block("Tags", $this->list));
|
||||||
@ -31,7 +31,7 @@ class TagListTheme extends Themelet {
|
|||||||
* ...
|
* ...
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function display_related_block($page, $tag_infos) {
|
public function display_related_block(Page $page, $tag_infos) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
@ -63,7 +63,7 @@ class TagListTheme extends Themelet {
|
|||||||
* ...
|
* ...
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function display_popular_block($page, $tag_infos) {
|
public function display_popular_block(Page $page, $tag_infos) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
@ -96,7 +96,7 @@ class TagListTheme extends Themelet {
|
|||||||
* )
|
* )
|
||||||
* $search = the current array of tags being searched for
|
* $search = the current array of tags being searched for
|
||||||
*/
|
*/
|
||||||
public function display_refine_block($page, $tag_infos, $search) {
|
public function display_refine_block(Page $page, $tag_infos, $search) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class UploadTheme extends Themelet {
|
class UploadTheme extends Themelet {
|
||||||
public function display_block($page) {
|
public function display_block(Page $page) {
|
||||||
$page->add_block(new Block("Upload", $this->build_upload_block(), "left", 20));
|
$page->add_block(new Block("Upload", $this->build_upload_block(), "left", 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_full($page) {
|
public function display_full(Page $page) {
|
||||||
$page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "left", 20));
|
$page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "left", 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_page($page) {
|
public function display_page(Page $page) {
|
||||||
global $config;
|
global $config;
|
||||||
$tl_enabled = ($config->get_string("transload_engine", "none") != "none");
|
$tl_enabled = ($config->get_string("transload_engine", "none") != "none");
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ class UploadTheme extends Themelet {
|
|||||||
$page->add_block(new Block("Upload", $html, "main", 20));
|
$page->add_block(new Block("Upload", $html, "main", 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_upload_status($page, $ok) {
|
public function display_upload_status(Page $page, $ok) {
|
||||||
if($ok) {
|
if($ok) {
|
||||||
$page->set_mode("redirect");
|
$page->set_mode("redirect");
|
||||||
$page->set_redirect(make_link());
|
$page->set_redirect(make_link());
|
||||||
@ -73,7 +73,7 @@ class UploadTheme extends Themelet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_upload_error($page, $title, $message) {
|
public function display_upload_error(Page $page, $title, $message) {
|
||||||
$page->add_block(new Block($title, $message));
|
$page->add_block(new Block($title, $message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ class ViewImageTheme extends Themelet {
|
|||||||
/*
|
/*
|
||||||
* Build a page showing $image and some info about it
|
* Build a page showing $image and some info about it
|
||||||
*/
|
*/
|
||||||
public function display_page($page, $image, $editor_parts) {
|
public function display_page(Page $page, Image $image, $editor_parts) {
|
||||||
$page->set_title("Image {$image->id}: ".html_escape($image->get_tag_list()));
|
$page->set_title("Image {$image->id}: ".html_escape($image->get_tag_list()));
|
||||||
$page->set_heading(html_escape($image->get_tag_list()));
|
$page->set_heading(html_escape($image->get_tag_list()));
|
||||||
$page->add_block(new Block("Navigation", $this->build_navigation($image), "left", 0));
|
$page->add_block(new Block("Navigation", $this->build_navigation($image), "left", 0));
|
||||||
@ -12,7 +12,7 @@ class ViewImageTheme extends Themelet {
|
|||||||
$page->add_block(new Block(null, $this->build_pin($image), "main", 11));
|
$page->add_block(new Block(null, $this->build_pin($image), "main", 11));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_admin_block($page, $parts) {
|
public function display_admin_block(Page $page, $parts) {
|
||||||
if(count($parts) > 0) {
|
if(count($parts) > 0) {
|
||||||
$page->add_block(new Block("Image Admin", join("<br>", $parts), "left", 50));
|
$page->add_block(new Block("Image Admin", join("<br>", $parts), "left", 50));
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ class ViewImageTheme extends Themelet {
|
|||||||
|
|
||||||
var $pin = null;
|
var $pin = null;
|
||||||
|
|
||||||
protected function build_pin($image) {
|
protected function build_pin(Image $image) {
|
||||||
if(!is_null($this->pin)) {
|
if(!is_null($this->pin)) {
|
||||||
return $this->pin;
|
return $this->pin;
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ class ViewImageTheme extends Themelet {
|
|||||||
return $this->pin;
|
return $this->pin;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function build_navigation($image) {
|
protected function build_navigation(Image $image) {
|
||||||
$h_pin = $this->build_pin($image);
|
$h_pin = $this->build_pin($image);
|
||||||
$h_search = "
|
$h_search = "
|
||||||
<p><form action='".make_link()."' method='GET'>
|
<p><form action='".make_link()."' method='GET'>
|
||||||
@ -61,7 +61,7 @@ class ViewImageTheme extends Themelet {
|
|||||||
return "$h_pin<br>$h_search";
|
return "$h_pin<br>$h_search";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function build_info($image, $editor_parts) {
|
protected function build_info(Image $image, $editor_parts) {
|
||||||
global $user;
|
global $user;
|
||||||
$owner = $image->get_owner();
|
$owner = $image->get_owner();
|
||||||
$h_owner = html_escape($owner->name);
|
$h_owner = html_escape($owner->name);
|
||||||
@ -89,7 +89,7 @@ class ViewImageTheme extends Themelet {
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function build_image_editor($image, $editor_parts) {
|
protected function build_image_editor(Image $image, $editor_parts) {
|
||||||
if(count($editor_parts) == 0) return "";
|
if(count($editor_parts) == 0) return "";
|
||||||
|
|
||||||
if(isset($_GET['search'])) {$h_query = "search=".url_escape($_GET['search']);}
|
if(isset($_GET['search'])) {$h_query = "search=".url_escape($_GET['search']);}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user