Make these functions public to prevent scrutinizer from complaining.

This commit is contained in:
jgen 2014-04-26 00:27:16 -04:00
parent e6b1d514d1
commit 298344048c
5 changed files with 25 additions and 20 deletions

View file

@ -332,7 +332,7 @@ class CommentList extends Extension {
$image = null; // this is "clever", I may live to regret it
}
}
if(!is_null($image)) $images[] = array($image, $comments);
if(!is_null($image)) $images[] = array($image, $comments);
}
}

View file

@ -573,12 +573,17 @@ class OuroborosAPI extends Extension
protected function postShow($id = null)
{
if (!is_null($id)) {
$post = new _SafeOuroborosImage(Image::by_id($id));
$this->sendData('post', $post);
} else {
$this->sendResponse(424, 'ID is mandatory');
}
}
$image = Image::by_id($id);
if ( ! $image instanceof Image) {
$this->sendResponse(404, 'ID not found');
} else {
$post = new _SafeOuroborosImage($image);
$this->sendData('post', $post);
}
} else {
$this->sendResponse(424, 'ID is mandatory');
}
}
/**
* Wrapper for getting a list of posts

View file

@ -1,7 +1,7 @@
<?php
class CustomCommentListTheme extends CommentListTheme {
var $inner_id = 0;
public $inner_id = 0;
public function display_comment_list($images, $page_number, $total_pages, $can_post) {
global $config, $page;
@ -51,7 +51,7 @@ class CustomCommentListTheme extends CommentListTheme {
// sidebar fails in this theme
}
private function build_upload_box() {
public function build_upload_box() {
return "[[ insert upload-and-comment extension here ]]";
}

View file

@ -9,12 +9,12 @@ class Themelet extends BaseThemelet {
$page->add_block(new Block(null, $body, "main", $position));
}
private function futaba_gen_page_link($base_url, $query, $page, $name) {
public function futaba_gen_page_link($base_url, $query, $page, $name) {
$link = make_link("$base_url/$page", $query);
return "[<a href='$link'>{$name}</a>]";
}
private function futaba_gen_page_link_block($base_url, $query, $page, $current_page, $name) {
public function futaba_gen_page_link_block($base_url, $query, $page, $current_page, $name) {
$paginator = "";
if($page == $current_page) $paginator .= "<b>";
$paginator .= $this->futaba_gen_page_link($base_url, $query, $page, $name);
@ -22,7 +22,7 @@ class Themelet extends BaseThemelet {
return $paginator;
}
private function futaba_build_paginator($current_page, $total_pages, $base_url, $query) {
public function futaba_build_paginator($current_page, $total_pages, $base_url, $query) {
$next = $current_page + 1;
$prev = $current_page - 1;
//$rand = mt_rand(1, $total_pages);
@ -30,11 +30,11 @@ class Themelet extends BaseThemelet {
$at_start = ($current_page <= 1 || $total_pages <= 1);
$at_end = ($current_page >= $total_pages);
//$first_html = $at_start ? "First" : $this->litetheme_gen_page_link($base_url, $query, 1, "First");
$prev_html = $at_start ? "Prev" : $this->futaba_gen_page_link($base_url, $query, $prev, "Prev");
//$random_html = $this->litetheme_gen_page_link($base_url, $query, $rand, "Random");
$next_html = $at_end ? "Next" : $this->futaba_gen_page_link($base_url, $query, $next, "Next");
//$last_html = $at_end ? "Last" : $this->litetheme_gen_page_link($base_url, $query, $total_pages, "Last");
//$first_html = $at_start ? "First" : $this->futaba_gen_page_link($base_url, $query, 1, "First");
$prev_html = $at_start ? "Prev" : $this->futaba_gen_page_link($base_url, $query, $prev, "Prev");
//$random_html = $this->futaba_gen_page_link($base_url, $query, $rand, "Random");
$next_html = $at_end ? "Next" : $this->futaba_gen_page_link($base_url, $query, $next, "Next");
//$last_html = $at_end ? "Last" : $this->futaba_gen_page_link($base_url, $query, $total_pages, "Last");
$start = $current_page-5 > 1 ? $current_page-5 : 1;
$end = $start+10 < $total_pages ? $start+10 : $total_pages;

View file

@ -20,12 +20,12 @@ class Themelet extends BaseThemelet {
$page->add_block(new Block(null, $body, "main", 90));
}
private function litetheme_gen_page_link($base_url, $query, $page, $name, $link_class=null) {
public function litetheme_gen_page_link($base_url, $query, $page, $name, $link_class=null) {
$link = make_link("$base_url/$page", $query);
return "<a class='$link_class' href='$link'>$name</a>";
}
private function litetheme_gen_page_link_block($base_url, $query, $page, $current_page, $name) {
public function litetheme_gen_page_link_block($base_url, $query, $page, $current_page, $name) {
$paginator = "";
if($page == $current_page) {$link_class = "tab-selected";} else {$link_class = "";}
@ -34,7 +34,7 @@ class Themelet extends BaseThemelet {
return $paginator;
}
private function litetheme_build_paginator($current_page, $total_pages, $base_url, $query) {
public function litetheme_build_paginator($current_page, $total_pages, $base_url, $query) {
$next = $current_page + 1;
$prev = $current_page - 1;
$rand = mt_rand(1, $total_pages);