More type hints.

This commit is contained in:
green-ponies (jgen) 2012-02-10 00:08:03 -05:00
parent 30eb5ddd8b
commit a95766c410
4 changed files with 15 additions and 20 deletions

View File

@ -7,7 +7,7 @@
class Tag_HistoryTheme extends Themelet { class Tag_HistoryTheme extends Themelet {
var $messages = array(); var $messages = array();
public function display_history_page(Page $page, $image_id, $history) { public function display_history_page(Page $page, /*int*/ $image_id, /*array*/ $history) {
global $user; global $user;
$start_string = " $start_string = "
<div style='text-align: left'> <div style='text-align: left'>
@ -50,7 +50,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 $page, $history) { public function display_global_page(Page $page, /*array*/ $history) {
$start_string = " $start_string = "
<div style='text-align: left'> <div style='text-align: left'>
".make_form(make_link("tag_history/revert"))." ".make_form(make_link("tag_history/revert"))."
@ -91,7 +91,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 $page, $image_id) { public function display_history_link(Page $page, /*int*/ $image_id) {
$link = '<a href="'.make_link('tag_history/'.$image_id).'">Tag History</a>'; $link = '<a href="'.make_link('tag_history/'.$image_id).'">Tag History</a>';
$page->add_block(new Block(null, $link, "main", 5)); $page->add_block(new Block(null, $link, "main", 5));
} }
@ -99,7 +99,7 @@ class Tag_HistoryTheme extends Themelet {
/* /*
* Add a section to the admin page. * Add a section to the admin page.
*/ */
public function display_admin_block($validation_msg='') { public function display_admin_block(/*string*/ $validation_msg='') {
global $page; global $page;
if (!empty($validation_msg)) { if (!empty($validation_msg)) {
@ -130,7 +130,7 @@ class Tag_HistoryTheme extends Themelet {
$page->add_block(new Block("Revert by IP", $html)); $page->add_block(new Block("Revert by IP", $html));
} }
public function add_status($title, $body) { public function add_status(/*string*/ $title, /*string*/ $body) {
$this->messages[] = '<p><b>'. $title .'</b><br>'. $body .'</p>'; $this->messages[] = '<p><b>'. $title .'</b><br>'. $body .'</p>';
} }
} }

View File

@ -3,6 +3,7 @@
* Name: Image Manager * Name: Image Manager
* Author: Shish <webmaster@shishnet.org> * Author: Shish <webmaster@shishnet.org>
* Modified by: jgen <jgen.tech@gmail.com> * Modified by: jgen <jgen.tech@gmail.com>
* Link: http://code.shishnet.org/shimmie2/
* Description: Handle the image database * Description: Handle the image database
* Visibility: admin * Visibility: admin
*/ */
@ -280,10 +281,7 @@ class ImageIO extends Extension {
// add image {{{ // add image {{{
private function add_image($image) { private function add_image($image) {
global $page; global $page, $user, $database, $config;
global $user;
global $database;
global $config;
/* /*
* Validate things * Validate things

View File

@ -1,7 +1,8 @@
<?php <?php
/** /**
* Name: Uploader * Name: Uploader
* Author: Shish * Author: Shish <webmaster@shishnet.org>
* Link: http://code.shishnet.org/shimmie2/
* Description: Allows people to upload files to the website * Description: Allows people to upload files to the website
*/ */
@ -18,7 +19,7 @@ class DataUploadEvent extends Event {
* @param $tmpname The temporary file used for upload. * @param $tmpname The temporary file used for upload.
* @param $metadata Info about the file, should contain at least "filename", "extension", "tags" and "source". * @param $metadata Info about the file, should contain at least "filename", "extension", "tags" and "source".
*/ */
public function DataUploadEvent(User $user, $tmpname, $metadata) { public function DataUploadEvent(User $user, /*string*/ $tmpname, /*array*/ $metadata) {
assert(file_exists($tmpname)); assert(file_exists($tmpname));
$this->user = $user; $this->user = $user;
@ -272,9 +273,7 @@ class Upload extends Extension {
* @retval bool TRUE on upload successful. * @retval bool TRUE on upload successful.
*/ */
private function try_upload($file, $tags, $source, $replace='') { private function try_upload($file, $tags, $source, $replace='') {
global $page; global $page, $config, $user;
global $config;
global $user;
if(empty($source)) $source = null; if(empty($source)) $source = null;
@ -322,9 +321,7 @@ class Upload extends Extension {
* @retval bool TRUE on transload successful. * @retval bool TRUE on transload successful.
*/ */
private function try_transload($url, $tags, $source, $replace='') { private function try_transload($url, $tags, $source, $replace='') {
global $page; global $page, $config, $user;
global $config;
global $user;
$ok = true; $ok = true;

View File

@ -155,7 +155,7 @@ class UploadTheme extends Themelet {
} }
/* only allows 1 file to be uploaded - for replacing another image file */ /* only allows 1 file to be uploaded - for replacing another image file */
public function display_replace_page(Page $page, $image_id) { public function display_replace_page(Page $page, /*int*/ $image_id) {
global $config, $page; global $config, $page;
$page->add_html_header("<link rel='stylesheet' href='".get_base_href()."/ext/upload/_style.css' type='text/css'>"); $page->add_html_header("<link rel='stylesheet' href='".get_base_href()."/ext/upload/_style.css' type='text/css'>");
$tl_enabled = ($config->get_string("transload_engine", "none") != "none"); $tl_enabled = ($config->get_string("transload_engine", "none") != "none");
@ -211,7 +211,7 @@ class UploadTheme extends Themelet {
$page->add_block(new Block("Upload Replacement Image", $html, "main", 20)); $page->add_block(new Block("Upload Replacement Image", $html, "main", 20));
} }
public function display_upload_status(Page $page, $ok) { public function display_upload_status(Page $page, /*bool*/ $ok) {
if($ok) { if($ok) {
$page->set_mode("redirect"); $page->set_mode("redirect");
$page->set_redirect(make_link()); $page->set_redirect(make_link());
@ -223,7 +223,7 @@ class UploadTheme extends Themelet {
} }
} }
public function display_upload_error(Page $page, $title, $message) { public function display_upload_error(Page $page, /*string*/ $title, /*string*/ $message) {
$page->add_block(new Block($title, $message)); $page->add_block(new Block($title, $message));
} }