forked from Cavemanon/cavepaintings
More type hints.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Name: Image Manager
|
||||
* Author: Shish <webmaster@shishnet.org>
|
||||
* Modified by: jgen <jgen.tech@gmail.com>
|
||||
* Link: http://code.shishnet.org/shimmie2/
|
||||
* Description: Handle the image database
|
||||
* Visibility: admin
|
||||
*/
|
||||
@@ -280,10 +281,7 @@ class ImageIO extends Extension {
|
||||
|
||||
// add image {{{
|
||||
private function add_image($image) {
|
||||
global $page;
|
||||
global $user;
|
||||
global $database;
|
||||
global $config;
|
||||
global $page, $user, $database, $config;
|
||||
|
||||
/*
|
||||
* Validate things
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Name: Uploader
|
||||
* Author: Shish
|
||||
* Author: Shish <webmaster@shishnet.org>
|
||||
* Link: http://code.shishnet.org/shimmie2/
|
||||
* 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 $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));
|
||||
|
||||
$this->user = $user;
|
||||
@@ -272,9 +273,7 @@ class Upload extends Extension {
|
||||
* @retval bool TRUE on upload successful.
|
||||
*/
|
||||
private function try_upload($file, $tags, $source, $replace='') {
|
||||
global $page;
|
||||
global $config;
|
||||
global $user;
|
||||
global $page, $config, $user;
|
||||
|
||||
if(empty($source)) $source = null;
|
||||
|
||||
@@ -322,9 +321,7 @@ class Upload extends Extension {
|
||||
* @retval bool TRUE on transload successful.
|
||||
*/
|
||||
private function try_transload($url, $tags, $source, $replace='') {
|
||||
global $page;
|
||||
global $config;
|
||||
global $user;
|
||||
global $page, $config, $user;
|
||||
|
||||
$ok = true;
|
||||
|
||||
|
@@ -155,7 +155,7 @@ class UploadTheme extends Themelet {
|
||||
}
|
||||
|
||||
/* 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;
|
||||
$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");
|
||||
@@ -211,7 +211,7 @@ class UploadTheme extends Themelet {
|
||||
$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) {
|
||||
$page->set_mode("redirect");
|
||||
$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));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user