From ee52d582c467e1b749e8bf3d52694831f931daaa Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 28 Jul 2012 11:12:05 +0100 Subject: [PATCH] image replacing simplicity --- ext/image/main.php | 4 ++-- ext/upload/theme.php | 32 ++++++++++---------------------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/ext/image/main.php b/ext/image/main.php index 6f72a557..c7ffbe6d 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -72,7 +72,7 @@ class ImageReplaceEvent extends Event { * @param $image * The image object of the new image to use */ - public function ImageReplaceEvent($id, Image $image) { + public function ImageReplaceEvent(/*int*/ $id, Image $image) { $this->id = $id; $this->image = $image; } @@ -81,7 +81,7 @@ class ImageReplaceEvent extends Event { class ImageReplaceException extends SCoreException { var $error; - public function __construct($error) { + public function __construct(/*string*/ $error) { $this->error = $error; } } diff --git a/ext/upload/theme.php b/ext/upload/theme.php index f5aa649e..fd732fbc 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -237,29 +237,18 @@ class UploadTheme extends Themelet { global $config, $page; $tl_enabled = ($config->get_string("transload_engine", "none") != "none"); - $js2 = 'javascript:$(function() { - $("#data").hide(); - $("#data").val(""); - $("#url").show(); });'; - - $js1 = 'javascript:$(function() { - $("#url").hide(); - $("#url").val(""); - $("#data").show(); });'; - - $upload_list = ''; - $upload_list .= " + $upload_list = " -
File
"; - if($tl_enabled) { - $upload_list .=" - URL
- + File + "; - } else { - $upload_list .= " - "; - } + if($tl_enabled) { + $upload_list .=" + or URL + + "; + } + $upload_list .= ""; $max_size = $config->get_int('upload_size'); $max_kb = to_shorthand_int($max_size); @@ -268,7 +257,6 @@ class UploadTheme extends Themelet { $thumbnail = $this->build_thumb_html($image, null); $html = " -

Replacing Image ID ".$image_id."
Please note: You will have to refresh the image page, or empty your browser cache.

" .$thumbnail."
" .make_form(make_link("upload/replace/".$image_id), "POST", $multipart=True)."