git add stuff
This commit is contained in:
50
simpla/design/js/tiny_mce/plugins/smimage/php/action.php
vendored
Normal file
50
simpla/design/js/tiny_mce/plugins/smimage/php/action.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
// Löschen
|
||||
if (isset($_GET["action"]) && $_GET["action"] == "delete") {
|
||||
|
||||
// Datei löschen
|
||||
if (isset($_GET["file"])) { @unlink($IMAGE_PATH.$_GET["file"]); }
|
||||
|
||||
// Verzeichnis löschen
|
||||
else if (isset($_GET["folder"])) { DeleteFolder($IMAGE_PATH.$_GET["folder"]); }
|
||||
}
|
||||
|
||||
// Umbenennen
|
||||
else if (isset($_GET["action"]) && $_GET["action"] == "rename") {
|
||||
|
||||
// Datei umbenennen
|
||||
if (isset($_GET["file"])) {
|
||||
|
||||
// Dateinamen formatieren
|
||||
$_GET["name"] = FormatFileName($_GET["name"]);
|
||||
|
||||
// Umbenennen
|
||||
@rename($IMAGE_PATH.$_GET["file"], $IMAGE_PATH.$_GET["name"]);
|
||||
}
|
||||
|
||||
// Verzeichnis umbenennen
|
||||
else if (isset($_GET["folder"])) {
|
||||
|
||||
// Verzeichnisnamen formatieren
|
||||
$_GET["name"] = FormatFolderName($_GET["name"]);
|
||||
|
||||
// Umbenennen
|
||||
@rename($IMAGE_PATH.$_GET["folder"], $IMAGE_PATH.$_GET["name"]);
|
||||
}
|
||||
}
|
||||
|
||||
// Bild drehen
|
||||
else if (isset($_GET["action"]) && $_GET["action"] == "rotate") { Image_Rotate($IMAGE_PATH.$_GET["file"], $_GET["degrees"], $SESSION["jpg_quality"]); }
|
||||
|
||||
// Neues Verzeichnis erstellen
|
||||
else if (isset($_GET["action"]) && $_GET["action"] == "newfolder") {
|
||||
|
||||
// Verzeichnisnamen formatieren
|
||||
$_GET["name"] = FormatFolderName($_GET["name"]);
|
||||
|
||||
// Verzeichnis erstellen
|
||||
@mkdir($IMAGE_PATH.$_GET["name"], $CONFIG["chmod_folder"]);
|
||||
}
|
||||
|
||||
?>
|
||||
38
simpla/design/js/tiny_mce/plugins/smimage/php/config.php
vendored
Normal file
38
simpla/design/js/tiny_mce/plugins/smimage/php/config.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
$CONFIG = array();
|
||||
|
||||
// Allgemeine Konfiguration / General configuration
|
||||
$CONFIG["server"] = "";
|
||||
$CONFIG["directory"] = "";
|
||||
|
||||
$CONFIG["orderby"] = "0";
|
||||
$CONFIG["show_thumbnail"] = "1";
|
||||
$CONFIG["thumbnails_perpage"] = "20";
|
||||
$CONFIG["thumbnail_size"] = "110";
|
||||
$CONFIG["jpg_quality"] = "80";
|
||||
|
||||
$CONFIG["show_upload"] = "1";
|
||||
$CONFIG["upload_filesize"] = "";
|
||||
|
||||
$CONFIG["show_image_menu"] = "1";
|
||||
$CONFIG["show_folder_menu"] = "1";
|
||||
$CONFIG["show_newfolder"] = "1";
|
||||
|
||||
$CONFIG["check_session_variable"] = "";
|
||||
|
||||
// Konfiguration der Oberfläche / Configuration of the surface
|
||||
$CONFIG["preview_thumbnail_size"] = "200";
|
||||
|
||||
// Konfiguration Verzeichnis- und Dateirechte / Configuration folder and file rights
|
||||
$CONFIG["chmod_folder"] = 0777;
|
||||
$CONFIG["chmod_file"] = 0644;
|
||||
|
||||
// Konfiguration Cache / Configuration cache
|
||||
$CONFIG["no_cache"] = "0";
|
||||
|
||||
// Spezial Konfiguration / Special configuration
|
||||
$CONFIG["document_root"] = "";
|
||||
$CONFIG["style"] = "";
|
||||
|
||||
?>
|
||||
20
simpla/design/js/tiny_mce/plugins/smimage/php/error.php
vendored
Normal file
20
simpla/design/js/tiny_mce/plugins/smimage/php/error.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>SMImage - Error</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
||||
<meta name="author" content="Jens Stolinski" />
|
||||
<meta name="publisher" content="Jens Stolinski" />
|
||||
<meta name="company" content="SYNASYS MEDIA" />
|
||||
|
||||
<!-- CSS -->
|
||||
<link rel="stylesheet" href="css/smimage.css" type="text/css" media="screen" />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div style="text-align:center; margin-top:100px;"><div><img src="img/icon_lock_128x128.png" border="0"></div></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
6
simpla/design/js/tiny_mce/plugins/smimage/php/folder_menu.php
vendored
Normal file
6
simpla/design/js/tiny_mce/plugins/smimage/php/folder_menu.php
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="image_menu folder_menu" id="imenu<?php echo $IMENU_ID; ?>" onmouseover="SMImage_ShowImageMenu('imenu<?php echo $IMENU_ID; ?>', 'block');" onmouseout="SMImage_ShowImageMenu('imenu<?php echo $IMENU_ID; ?>', 'none');">
|
||||
<ul>
|
||||
<li><a href="javascript:;" onclick="SMImage_RenameFolder('<?php echo bin2hex(RC4("id=1&".$GET)); ?>', '<?php echo $FOLDERS[$j]; ?>');"><img style="vertical-align:text-bottom; margin-top:3px; margin-right:6px;" src="img/icon_rename_16x16.png" border="0"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.image_menu_caption_2', '?'));</script></a></li>
|
||||
<li><a href="javascript:;" onclick="SMImage_DeleteFolder('<?php echo bin2hex(RC4("id=1&".$GET)); ?>', '<?php echo $FOLDERS[$j]; ?>');"><img style="vertical-align:text-bottom; margin-top:3px; margin-right:6px;" src="img/icon_delete_16x16.png" border="0"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.image_menu_caption_1', '?'));</script></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
496
simpla/design/js/tiny_mce/plugins/smimage/php/image.php
vendored
Normal file
496
simpla/design/js/tiny_mce/plugins/smimage/php/image.php
vendored
Normal file
@@ -0,0 +1,496 @@
|
||||
<?php
|
||||
|
||||
// Bildbreite zurückgeben
|
||||
function Image_GetWidth($img) {
|
||||
$image_infos = @getimagesize($img);
|
||||
return $image_infos[0];
|
||||
}
|
||||
|
||||
// Bildhöhe zurückgeben
|
||||
function Image_GetHeight($img) {
|
||||
$image_infos = @getimagesize($img);
|
||||
return $image_infos[1];
|
||||
}
|
||||
|
||||
// Neue Bildgröße brechnen
|
||||
function GetNewImageSize($file, $size) {
|
||||
$a = array();
|
||||
$a["width"] = $size;
|
||||
$a["height"] = $size;
|
||||
|
||||
if (list($width_orig, $height_orig, $image_type) = getimagesize(GetDocumentRoot().$file)) {
|
||||
if ($height_orig > $size || $width_orig > $size) {
|
||||
if ($height_orig >= $width_orig) {
|
||||
$ratio_orig = $height_orig / $width_orig;
|
||||
$a["width"] = round($size / $ratio_orig);
|
||||
}
|
||||
else if ($width_orig >= $height_orig) {
|
||||
$ratio_orig = $width_orig / $height_orig;
|
||||
$a["height"] = round($size / $ratio_orig);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$a["width"] = $width_orig;
|
||||
$a["height"] = $height_orig;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
// Bild schärfen
|
||||
function Image_Sharpen($img, $amount, $radius, $threshold) {
|
||||
if ($amount > 500) { $amount = 500; }
|
||||
$amount = $amount * 0.016;
|
||||
if ($radius > 50) { $radius = 50; }
|
||||
$radius = $radius * 2;
|
||||
if ($threshold > 255) { $threshold = 255; }
|
||||
|
||||
$radius = abs(round($radius));
|
||||
if ($radius == 0) { return $img; imagedestroy($img); break; }
|
||||
|
||||
$w = imagesx($img); $h = imagesy($img);
|
||||
$imgCanvas = imagecreatetruecolor($w, $h);
|
||||
$imgBlur = imagecreatetruecolor($w, $h);
|
||||
|
||||
if (function_exists('imageconvolution')) {
|
||||
$matrix = array(
|
||||
array( 1, 2, 1 ),
|
||||
array( 2, 4, 2 ),
|
||||
array( 1, 2, 1 )
|
||||
);
|
||||
imagecopy($imgBlur, $img, 0, 0, 0, 0, $w, $h);
|
||||
imageconvolution($imgBlur, $matrix, 16, 0);
|
||||
}
|
||||
else {
|
||||
for ($i = 0; $i < $radius; $i++) {
|
||||
imagecopy($imgBlur, $img, 0, 0, 1, 0, $w - 1, $h);
|
||||
imagecopymerge($imgBlur, $img, 1, 0, 0, 0, $w, $h, 50);
|
||||
imagecopymerge($imgBlur, $img, 0, 0, 0, 0, $w, $h, 50);
|
||||
imagecopy($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h);
|
||||
|
||||
imagecopymerge($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 33.33333 );
|
||||
imagecopymerge($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 25);
|
||||
}
|
||||
}
|
||||
|
||||
if($threshold>0) {
|
||||
for ($x = 0; $x < $w-1; $x++) {
|
||||
for ($y = 0; $y < $h; $y++) {
|
||||
|
||||
$rgbOrig = ImageColorAt($img, $x, $y);
|
||||
$rOrig = (($rgbOrig >> 16) & 0xFF);
|
||||
$gOrig = (($rgbOrig >> 8) & 0xFF);
|
||||
$bOrig = ($rgbOrig & 0xFF);
|
||||
|
||||
$rgbBlur = ImageColorAt($imgBlur, $x, $y);
|
||||
|
||||
$rBlur = (($rgbBlur >> 16) & 0xFF);
|
||||
$gBlur = (($rgbBlur >> 8) & 0xFF);
|
||||
$bBlur = ($rgbBlur & 0xFF);
|
||||
|
||||
$rNew = (abs($rOrig - $rBlur) >= $threshold)
|
||||
? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig))
|
||||
: $rOrig;
|
||||
$gNew = (abs($gOrig - $gBlur) >= $threshold)
|
||||
? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig))
|
||||
: $gOrig;
|
||||
$bNew = (abs($bOrig - $bBlur) >= $threshold)
|
||||
? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig))
|
||||
: $bOrig;
|
||||
|
||||
if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) {
|
||||
$pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew);
|
||||
ImageSetPixel($img, $x, $y, $pixCol);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ($x = 0; $x < $w; $x++) {
|
||||
for ($y = 0; $y < $h; $y++) {
|
||||
$rgbOrig = ImageColorAt($img, $x, $y);
|
||||
$rOrig = (($rgbOrig >> 16) & 0xFF);
|
||||
$gOrig = (($rgbOrig >> 8) & 0xFF);
|
||||
$bOrig = ($rgbOrig & 0xFF);
|
||||
|
||||
$rgbBlur = ImageColorAt($imgBlur, $x, $y);
|
||||
|
||||
$rBlur = (($rgbBlur >> 16) & 0xFF);
|
||||
$gBlur = (($rgbBlur >> 8) & 0xFF);
|
||||
$bBlur = ($rgbBlur & 0xFF);
|
||||
|
||||
$rNew = ($amount * ($rOrig - $rBlur)) + $rOrig;
|
||||
|
||||
if($rNew > 255) { $rNew = 255; }
|
||||
else if($rNew < 0) { $rNew = 0; }
|
||||
|
||||
$gNew = ($amount * ($gOrig - $gBlur)) + $gOrig;
|
||||
|
||||
if($gNew > 255) {$gNew = 255;}
|
||||
else if($gNew < 0) { $gNew = 0; }
|
||||
|
||||
$bNew = ($amount * ($bOrig - $bBlur)) + $bOrig;
|
||||
|
||||
if( $bNew > 255) { $bNew = 255; }
|
||||
else if ( $bNew < 0 ) { $bNew = 0; }
|
||||
|
||||
$rgbNew = ($rNew << 16) + ($gNew <<8) + $bNew;
|
||||
ImageSetPixel($img, $x, $y, $rgbNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
imagedestroy($imgCanvas);
|
||||
imagedestroy($imgBlur);
|
||||
|
||||
return $img;
|
||||
}
|
||||
|
||||
// Bilddatei verkleinern und speichern
|
||||
function Image_Resize($file, $size, $jpg_quality) {
|
||||
$width = $size;
|
||||
$height = $size;
|
||||
|
||||
// Neue Bildgröße und Typ ermitteln
|
||||
list($width_orig, $height_orig, $type) = @getimagesize($file);
|
||||
|
||||
// Neue Bildgröße und Typ brechnen
|
||||
if ($width_orig > $width || $height_orig > $height) {
|
||||
$ratio_orig = $width_orig/$height_orig;
|
||||
|
||||
if ($width/$height > $ratio_orig) {
|
||||
$width = $height*$ratio_orig;
|
||||
} else {
|
||||
$height = $width/$ratio_orig;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$width = $width_orig;
|
||||
$height = $height_orig;
|
||||
}
|
||||
|
||||
// Neues Bild erstellen
|
||||
$image_p = imagecreatetruecolor($width, $height);
|
||||
|
||||
switch($type) {
|
||||
case 1:
|
||||
if (ImageTypes() & IMG_GIF) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromgif($file);
|
||||
|
||||
// Transparenz erhalten
|
||||
$trnprt_indx = imagecolortransparent($image);
|
||||
if ($trnprt_indx >= 0) {
|
||||
$trnprt_color = @imagecolorsforindex($image, $trnprt_indx);
|
||||
$trnprt_indx = @imagecolorallocate($image_p, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
|
||||
imagefill($image_p, 0, 0, $trnprt_indx);
|
||||
imagecolortransparent($image_p, $trnprt_indx);
|
||||
}
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Bild schärfen
|
||||
$image_p = Image_Sharpen($image_p, 80, 0.5, 3);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagegif($image_p, $file);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ImageTypes() & IMG_JPG) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromjpeg($file);
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Bild schärfen
|
||||
$image_p = Image_Sharpen($image_p, 80, 0.5, 3);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagejpeg($image_p, $file, $jpg_quality);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (ImageTypes() & IMG_PNG) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefrompng($file);
|
||||
|
||||
// Transparenz erhalten
|
||||
imagealphablending($image_p, false);
|
||||
$colorTransparent = imagecolorallocatealpha($image_p, 0, 0, 0, 127);
|
||||
imagefill($image_p, 0, 0, $colorTransparent);
|
||||
imagesavealpha($image_p, true);
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Bild schärfen
|
||||
$image_p = Image_Sharpen($image_p, 80, 0.5, 3);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagepng($image_p, $file);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
break;
|
||||
}
|
||||
|
||||
// Speicher freigeben
|
||||
if (isset($image)) { imagedestroy($image); }
|
||||
if (isset($image_p)) { imagedestroy($image_p); }
|
||||
}
|
||||
|
||||
// Bilddatei drehen und speichern
|
||||
function Image_Rotate($file, $degrees, $jpg_quality) {
|
||||
|
||||
// Bildgröße und Type ermitteln
|
||||
list($width, $height, $type) = @getimagesize($file);
|
||||
|
||||
// Neues Bild erstellen
|
||||
if ($degrees != 180) {
|
||||
$h = $width;
|
||||
$w = $height;
|
||||
$width = $w;
|
||||
$height = $h;
|
||||
}
|
||||
$image_p = imagecreatetruecolor($width, $height);
|
||||
|
||||
switch($type) {
|
||||
case 1:
|
||||
if (ImageTypes() & IMG_GIF) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromgif($file);
|
||||
|
||||
// Bild drehen
|
||||
$image = imagerotate($image, $degrees, -1);
|
||||
|
||||
// Transparenz erhalten
|
||||
$trnprt_indx = imagecolortransparent($image);
|
||||
if ($trnprt_indx >= 0) {
|
||||
$trnprt_color = imagecolorsforindex($image, $trnprt_indx);
|
||||
$trnprt_indx = imagecolorallocate($image_p, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
|
||||
imagefill($image_p, 0, 0, $trnprt_indx);
|
||||
imagecolortransparent($image_p, $trnprt_indx);
|
||||
}
|
||||
|
||||
// Bild kopieren
|
||||
imagecopy($image_p ,$image, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagegif($image_p, $file);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ImageTypes() & IMG_JPG) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromjpeg($file);
|
||||
|
||||
// Bild drehen
|
||||
$image = imagerotate($image, $degrees, -1);
|
||||
|
||||
// Bild kopieren
|
||||
imagecopy($image_p ,$image, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagejpeg($image_p, $file, $jpg_quality);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (ImageTypes() & IMG_PNG) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefrompng($file);
|
||||
|
||||
// Bild drehen
|
||||
$image = imagerotate($image, $degrees, -1);
|
||||
|
||||
// Transparenz erhalten
|
||||
imagealphablending($image_p, false);
|
||||
$colorTransparent = imagecolorallocatealpha($image_p, 0, 0, 0, 127);
|
||||
imagefill($image_p, 0, 0, $colorTransparent);
|
||||
imagesavealpha($image_p, true);
|
||||
|
||||
// Bild kopieren
|
||||
imagecopy($image_p ,$image, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagepng($image_p, $file);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
break;
|
||||
}
|
||||
|
||||
// Speicher freigeben
|
||||
if (isset($image)) { imagedestroy($image); }
|
||||
if (isset($image_p)) { imagedestroy($image_p); }
|
||||
}
|
||||
|
||||
// Filter auf das Bild anwenden
|
||||
// 1 = Graustufen
|
||||
// 2 = Graustufen + Kontrast
|
||||
// 3 = Sepia
|
||||
function Image_Filter($file, $jpg_quality, $filter) {
|
||||
|
||||
// Bildgröße und Type ermitteln
|
||||
list($width, $height, $type) = @getimagesize($file);
|
||||
|
||||
// Neues Bild erstellen
|
||||
$image_p = imagecreatetruecolor($width, $height);
|
||||
|
||||
switch($type) {
|
||||
case 1:
|
||||
if (ImageTypes() & IMG_GIF) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromgif($file);
|
||||
|
||||
// Filter anwenden
|
||||
switch($filter) {
|
||||
case 1:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
break;
|
||||
case 2:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
@imagefilter($image, IMG_FILTER_CONTRAST, -5);
|
||||
break;
|
||||
case 3:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
@imagefilter($image, IMG_FILTER_COLORIZE, 100, 50, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
// Transparenz erhalten
|
||||
$trnprt_indx = imagecolortransparent($image);
|
||||
if ($trnprt_indx >= 0) {
|
||||
$trnprt_color = imagecolorsforindex($image, $trnprt_indx);
|
||||
$trnprt_indx = imagecolorallocate($image_p, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
|
||||
imagefill($image_p, 0, 0, $trnprt_indx);
|
||||
imagecolortransparent($image_p, $trnprt_indx);
|
||||
}
|
||||
|
||||
// Bild kopieren
|
||||
imagecopy($image_p ,$image, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagegif($image_p, $file);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ImageTypes() & IMG_JPG) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromjpeg($file);
|
||||
|
||||
// Filter anwenden
|
||||
switch($filter) {
|
||||
case 1:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
break;
|
||||
case 2:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
@imagefilter($image, IMG_FILTER_CONTRAST, -5);
|
||||
break;
|
||||
case 3:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
@imagefilter($image, IMG_FILTER_COLORIZE, 100, 50, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
// Bild kopieren
|
||||
imagecopy($image_p ,$image, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagejpeg($image_p, $file, $jpg_quality);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (ImageTypes() & IMG_PNG) {
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefrompng($file);
|
||||
|
||||
// Filter anwenden
|
||||
switch($filter) {
|
||||
case 1:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
break;
|
||||
case 2:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
@imagefilter($image, IMG_FILTER_CONTRAST, -5);
|
||||
break;
|
||||
case 3:
|
||||
@imagefilter($image, IMG_FILTER_GRAYSCALE);
|
||||
@imagefilter($image, IMG_FILTER_COLORIZE, 100, 50, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
// Transparenz erhalten
|
||||
imagealphablending($image_p, false);
|
||||
$colorTransparent = imagecolorallocatealpha($image_p, 0, 0, 0, 127);
|
||||
imagefill($image_p, 0, 0, $colorTransparent);
|
||||
imagesavealpha($image_p, true);
|
||||
|
||||
// Bild kopieren
|
||||
imagecopy($image_p ,$image, 0, 0, 0, 0, $width, $height);
|
||||
|
||||
// Bilddatei speichern
|
||||
@imagepng($image_p, $file);
|
||||
}
|
||||
else {
|
||||
//
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
//
|
||||
break;
|
||||
}
|
||||
|
||||
// Speicher freigeben
|
||||
if (isset($image)) { imagedestroy($image); }
|
||||
if (isset($image_p)) { imagedestroy($image_p); }
|
||||
}
|
||||
|
||||
?>
|
||||
37
simpla/design/js/tiny_mce/plugins/smimage/php/image_data.php
vendored
Normal file
37
simpla/design/js/tiny_mce/plugins/smimage/php/image_data.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<div id="window_imagedata_top" class="top"></div>
|
||||
|
||||
<div class="content">
|
||||
<form name="form_imagedata" action="" method="post" enctype="multipart/form-data">
|
||||
<div>
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.insert_label_1', '?'));</script>:</b></div>
|
||||
<div><input style="margin-bottom:8px; width:98%;" type="text" name="edit1" onfocus="Input_OnFocus(this);" onblur="Input_OnBlur(this);"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.insert_label_2', '?'));</script>:</b></div>
|
||||
<div><input style="margin-bottom:8px; width:98%;" type="text" name="edit2" onfocus="Input_OnFocus(this);" onblur="Input_OnBlur(this);"></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.insert_label_3', '?'));</script>:</b></div>
|
||||
<div style="margin-bottom:6px;">
|
||||
<img id="imagedata_alignment_1" class="button_mouseout" style="margin-right:8px;" src="img/icon_float_none_24x24.png" height="24" width="24" border="0" onmouseover="Button_MouseOver(this);" onmouseout="Button_MouseOut(this);" onclick="SMImage_SetImageDataAlignment(this, '');" /><img id="imagedata_alignment_2" class="button_mouseout" style="margin-right:8px;" src="img/icon_float_left_24x24.png" height="24" width="24" border="0" onmouseover="Button_MouseOver(this);" onmouseout="Button_MouseOut(this);" onclick="SMImage_SetImageDataAlignment(this, 'float:left;');" /><img id="imagedata_alignment_3" class="button_mouseout" style="margin-right:8px;" src="img/icon_float_right_24x24.png" height="24" width="24" border="0" onmouseover="Button_MouseOver(this);" onmouseout="Button_MouseOut(this);" onclick="SMImage_SetImageDataAlignment(this, 'float:right;');" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.insert_label_4', '?'));</script>:</b></div>
|
||||
<div><input style="margin-bottom:14px; width:98%;" type="text" name="edit3" onfocus="Input_OnFocus(this);" onblur="Input_OnBlur(this);"></div>
|
||||
</div>
|
||||
<div style="margin:0 auto; width:215px;">
|
||||
<script language="javascript" type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
var jSMB1 = new jSMButton();
|
||||
var jSMB2 = new jSMButton();
|
||||
|
||||
jSMB1.SetStyle('float:left;');
|
||||
jSMB2.SetStyle('float:left; margin-left:15px;');
|
||||
jSMB1.Paint('jSMB1', tinyMCEPopup.getLang('smimage.button_ok_caption', '?'), 'SMImage_InsertNewImage(document.form_imagedata.edit1.value, document.form_imagedata.edit2.value, document.form_imagedata.edit3.value);');
|
||||
jSMB2.Paint('jSMB2', tinyMCEPopup.getLang('smimage.button_cancel_caption', '?'), 'SMImage_CloseImageData();');
|
||||
/* ]]> */
|
||||
</script>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
8
simpla/design/js/tiny_mce/plugins/smimage/php/image_menu.php
vendored
Normal file
8
simpla/design/js/tiny_mce/plugins/smimage/php/image_menu.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="image_menu" id="imenu<?php echo $IMENU_ID; ?>" onmouseover="SMImage_ShowImageMenu('imenu<?php echo $IMENU_ID; ?>', 'block');" onmouseout="SMImage_ShowImageMenu('imenu<?php echo $IMENU_ID; ?>', 'none');">
|
||||
<ul>
|
||||
<li><a href="javascript:;" onclick="SMImage_RotateImage('<?php echo bin2hex(RC4("id=1&".$GET)); ?>', '<?php echo $FILES[$j]; ?>', '90');"><img style="vertical-align:text-bottom; margin-top:3px; margin-right:6px;" src="img/icon_rotate_left_16x16.png" border="0"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.image_menu_caption_4', '?'));</script></a></li>
|
||||
<li><a href="javascript:;" onclick="SMImage_RotateImage('<?php echo bin2hex(RC4("id=1&".$GET)); ?>', '<?php echo $FILES[$j]; ?>', '-90');"><img style="vertical-align:text-bottom; margin-top:3px; margin-right:6px;" src="img/icon_rotate_right_16x16.png" border="0"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.image_menu_caption_3', '?'));</script></a></li>
|
||||
<li><a href="javascript:;" onclick="SMImage_RenameImage('<?php echo bin2hex(RC4("id=1&page=".$SESSION["page"]."&".$GET)); ?>', '<?php echo $FILES[$j]; ?>');"><img style="vertical-align:text-bottom; margin-top:3px; margin-right:6px;" src="img/icon_rename_16x16.png" border="0"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.image_menu_caption_2', '?'));</script></a></li>
|
||||
<li><a href="javascript:;" onclick="SMImage_DeleteImage('<?php echo bin2hex(RC4("id=1&".$GET)); ?>', '<?php echo $FILES[$j]; ?>');"><img align="middle" style="vertical-align:text-bottom; margin-top:3px; margin-right:6px;" src="img/icon_delete_16x16.png" border="0"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.image_menu_caption_1', '?'));</script></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
16
simpla/design/js/tiny_mce/plugins/smimage/php/menu_table.php
vendored
Normal file
16
simpla/design/js/tiny_mce/plugins/smimage/php/menu_table.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<ul>
|
||||
<?php
|
||||
if ($SESSION["show_upload"] == 1) {
|
||||
echo "<li><a id=\"m11\" href=\"javascript:;\" title=\"\" onclick=\"window.location.href='index.php?get=".bin2hex(RC4("id=2&".$GET))."'; if (window.event){ window.event.returnValue = false; }\"><img src=\"img/icon_upload_24x24.png\" border=\"0\" /></a></li>";
|
||||
echo "<li><img class=\"separator\" src=\"img/icon_separator.png\" border=\"0\" /></li>";
|
||||
}
|
||||
|
||||
if ($SESSION["show_newfolder"] == 1) {
|
||||
echo "<li><a id=\"m2\" href=\"javascript:;\" title=\"\" onclick=\"SMImage_NewFolder('".bin2hex(RC4("id=1&".$GET))."');\"><img src=\"img/icon_new_folder_24x24.png\" border=\"0\" /></a></li>";
|
||||
echo "<li><img class=\"separator\" src=\"img/icon_separator.png\" border=\"0\" /></li>";
|
||||
}
|
||||
?>
|
||||
<li><a id="m5" href="javascript:;" title="" onclick="SMImage_PageReload('<?php echo bin2hex(RC4("id=1&".$GET)); ?>'); if (window.event){ window.event.returnValue = false; }"><img src="img/icon_reload_24x24.png" border="0" /></a></li>
|
||||
<li><img class="separator" src="img/icon_separator.png" border="0" /></li>
|
||||
<li><select class="select" id="Select1" name="Select1" size="1" onchange="location.href=this.options[this.selectedIndex].value"><option <?php if($SESSION["show_thumbnail"] == 1) { echo "selected"; } ?> value="index.php?get=<?php echo bin2hex(RC4("id=1&show_thumbnail=1&".str_replace("&show_thumbnail=0", "", $GET))); ?>"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.menu_view_select_1', '?'));</script></option><option <?php if($SESSION["show_thumbnail"] == 0) { echo "selected"; } ?> value="index.php?get=<?php echo bin2hex(RC4("id=1&show_thumbnail=0&".str_replace("&show_thumbnail=1", "", $GET))); ?>"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.menu_view_select_2', '?'));</script></option></select></li>
|
||||
</ul>
|
||||
35
simpla/design/js/tiny_mce/plugins/smimage/php/menu_thumbnail.php
vendored
Normal file
35
simpla/design/js/tiny_mce/plugins/smimage/php/menu_thumbnail.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<ul>
|
||||
<?php
|
||||
if ($SESSION["show_upload"] == 1) {
|
||||
if ($SESSION["id"] == 1) {
|
||||
echo "<li><a id=\"m11\" href=\"javascript:;\" title=\"\" onclick=\"window.location.href='index.php?get=".bin2hex(RC4("id=2&".$GET))."'; if (window.event){ window.event.returnValue = false; }\"><img src=\"img/icon_upload_24x24.png\" border=\"0\" /></a></li>";
|
||||
echo "<li><img class=\"separator\" src=\"img/icon_separator.png\" border=\"0\" /></li>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($SESSION["show_newfolder"] == 1) {
|
||||
echo "<li><a id=\"m2\" href=\"javascript:;\" title=\"\" onclick=\"SMImage_NewFolder('".bin2hex(RC4("id=1&".$GET))."');\"><img src=\"img/icon_new_folder_24x24.png\" border=\"0\" /></a></li>";
|
||||
echo "<li><img class=\"separator\" src=\"img/icon_separator.png\" border=\"0\" /></li>";
|
||||
}
|
||||
|
||||
if ($SESSION["id"] == 1 && $SESSION["show_thumbnail"] == 1) {
|
||||
if ($SESSION["page"] > 0) {
|
||||
echo "<li><a id=\"m3\" href=\"javascript:;\" title=\"\" onclick=\"window.location.href='index.php?get=".bin2hex(RC4("id=1&page=".($SESSION["page"]-1)."&".$GET))."'; if (window.event){ window.event.returnValue = false; }\"><img src=\"img/icon_back_24x24.png\" border=\"0\" /></a></li>";
|
||||
}
|
||||
else {
|
||||
echo "<li><a id=\"m3\" href=\"javascript:;\" title=\"\"><img src=\"img/icon_back_2_24x24.png\" border=\"0\" /></a></li>";
|
||||
}
|
||||
|
||||
if ((($SESSION["page"]+1) * $SESSION["thumbnails_perpage"]) < count($FILES)) {
|
||||
echo "<li><a id=\"m4\" href=\"javascript:;\" title=\"\" onclick=\"window.location.href='index.php?get=".bin2hex(RC4("id=1&page=".($SESSION["page"]+1)."&".$GET))."'; if (window.event){ window.event.returnValue = false; }\"><img src=\"img/icon_forward_24x24.png\" border=\"0\" /></a></li>";
|
||||
}
|
||||
else {
|
||||
echo "<li><a id=\"m4\" href=\"javascript:;\" title=\"\"><img src=\"img/icon_forward_2_24x24.png\" border=\"0\" /></a></li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li><img class="separator" src="img/icon_separator.png" border="0" /></li>
|
||||
<li><a id="m5" href="javascript:;" title="" onclick="SMImage_PageReload('<?php echo bin2hex(RC4("id=1&".$GET)); ?>'); if (window.event){ window.event.returnValue = false; }"><img src="img/icon_reload_24x24.png" border="0" /></a></li>
|
||||
<li><img class="separator" src="img/icon_separator.png" border="0" /></li>
|
||||
<li><select class="select" id="Select1" name="Select1" size="1" onChange="location.href=this.options[this.selectedIndex].value;"><option <?php if($SESSION["show_thumbnail"] == 1) { echo "selected"; } ?> value="index.php?get=<?php echo bin2hex(RC4("id=1&show_thumbnail=1&".str_replace("&show_thumbnail=0", "", $GET))); ?>"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.menu_view_select_1', '?'));</script></option><option <?php if($SESSION["show_thumbnail"] == 0) { echo "selected"; } ?> value="index.php?get=<?php echo bin2hex(RC4("id=1&show_thumbnail=0&".str_replace("&show_thumbnail=1", "", $GET))); ?>"><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.menu_view_select_2', '?'));</script></option></select></li>
|
||||
</ul>
|
||||
6
simpla/design/js/tiny_mce/plugins/smimage/php/menu_upload.php
vendored
Normal file
6
simpla/design/js/tiny_mce/plugins/smimage/php/menu_upload.php
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<?php
|
||||
echo "<li><a id=\"m12\" href=\"javascript:;\" title=\"\" onclick=\"window.location.href='index.php?get=".bin2hex(RC4("id=1&".$GET))."'; if (window.event){ window.event.returnValue = false; }\"><img src=\"img/icon_image_24x24.png\" border=\"0\" /></a></li>";
|
||||
echo "<li><img class=\"separator\" src=\"img/icon_separator.png\" border=\"0\" /></li>";
|
||||
?>
|
||||
</ul>
|
||||
183
simpla/design/js/tiny_mce/plugins/smimage/php/session.php
vendored
Normal file
183
simpla/design/js/tiny_mce/plugins/smimage/php/session.php
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
// Initialisierung
|
||||
$SESSION = array();
|
||||
$QUERY = array();
|
||||
|
||||
// Query-Zeichenkette entschlüsseln
|
||||
if (isset($_GET["get"])) {
|
||||
parse_str(RC4(@pack("H*", $_GET["get"])), $QUERY);
|
||||
}
|
||||
else {
|
||||
include("error.php");
|
||||
die;
|
||||
}
|
||||
|
||||
// Query-Zeichenkette auf Vollständigkeit überprüfen
|
||||
if (!isset($QUERY["id"]) || !isset($QUERY["check_session_variable"])) {
|
||||
include("error.php");
|
||||
die;
|
||||
}
|
||||
|
||||
// Verzeichnispfad überprüfen
|
||||
if ($CONFIG["directory"] != "" && $CONFIG["directory"][0] != "/") { $CONFIG["directory"] = "/".$CONFIG["directory"]; }
|
||||
if ($CONFIG["directory"] != "" && $CONFIG["directory"][strlen($CONFIG["directory"])-1] != "/") { $CONFIG["directory"] = $CONFIG["directory"]."/"; }
|
||||
|
||||
// Serverpfad überprüfen
|
||||
if ($CONFIG["server"] != "" && $CONFIG["server"][strlen($CONFIG["server"])-1] == "/") { $CONFIG["server"] = substr($CONFIG["server"], 0, -1); }
|
||||
|
||||
// Initialisierung
|
||||
$SESSION["id"] = "1";
|
||||
$SESSION["back"] = "0";
|
||||
$SESSION["page"] = "0";
|
||||
$SESSION["dir_root"] = $CONFIG["directory"];
|
||||
$SESSION["dir"] = $CONFIG["directory"];
|
||||
$SESSION["server"] = $CONFIG["server"];
|
||||
$SESSION["thumbnail_size"] = $CONFIG["thumbnail_size"];
|
||||
$SESSION["jpg_quality"] = $CONFIG["jpg_quality"];
|
||||
$SESSION["show_thumbnail"] = $CONFIG["show_thumbnail"];
|
||||
$SESSION["orderby"] = $CONFIG["orderby"];
|
||||
$SESSION["show_upload"] = $CONFIG["show_upload"];
|
||||
$SESSION["show_image_menu"] = $CONFIG["show_image_menu"];
|
||||
$SESSION["show_folder_menu"] = $CONFIG["show_folder_menu"];
|
||||
$SESSION["show_newfolder"] = $CONFIG["show_newfolder"];
|
||||
$SESSION["thumbnails_perpage"] = $CONFIG["thumbnails_perpage"];
|
||||
$SESSION["upload_filesize"] = $CONFIG["upload_filesize"];
|
||||
$SESSION["check_session_variable"] = $CONFIG["check_session_variable"];
|
||||
$SESSION["document_root"] = $CONFIG["document_root"];
|
||||
|
||||
// Query auswerten
|
||||
if (isset($QUERY["id"])) { $SESSION["id"] = $QUERY["id"]; }
|
||||
if (isset($QUERY["back"])) { $SESSION["back"] = $QUERY["back"]; }
|
||||
if (isset($QUERY["page"])) { $SESSION["page"] = $QUERY["page"]; }
|
||||
if (isset($QUERY["dir_root"]) && $QUERY["dir_root"] != "") {
|
||||
$SESSION["dir_root"] = $QUERY["dir_root"];
|
||||
|
||||
// Verzeichnispfad überprüfen
|
||||
if ($SESSION["dir_root"] != "" && $SESSION["dir_root"][0] != "/") { $SESSION["dir_root"] = "/".$SESSION["dir_root"]; }
|
||||
if ($SESSION["dir_root"] != "" && $SESSION["dir_root"][strlen($SESSION["dir_root"])-1] != "/") { $SESSION["dir_root"] = $SESSION["dir_root"]."/"; }
|
||||
|
||||
$SESSION["dir"] = $SESSION["dir_root"];
|
||||
}
|
||||
if (isset($QUERY["dir"])) { $SESSION["dir"] = $QUERY["dir"]; }
|
||||
if (isset($QUERY["server"]) && $QUERY["server"] != "") {
|
||||
|
||||
// Serverpfad überprüfen
|
||||
if ($QUERY["server"] != "" && $QUERY["server"][strlen($QUERY["server"])-1] == "/") { $QUERY["server"] = substr($QUERY["server"], 0, -1); }
|
||||
|
||||
$SESSION["server"] = $QUERY["server"];
|
||||
}
|
||||
if (isset($QUERY["thumbnail_size"]) && $QUERY["thumbnail_size"] != "") {
|
||||
$SESSION["thumbnail_size"] = $QUERY["thumbnail_size"];
|
||||
}
|
||||
if (isset($QUERY["jpg_quality"]) && $QUERY["jpg_quality"] != "") {
|
||||
$SESSION["jpg_quality"] = $QUERY["jpg_quality"];
|
||||
}
|
||||
if (isset($QUERY["show_thumbnail"]) && $QUERY["show_thumbnail"] != "") {
|
||||
$SESSION["show_thumbnail"] = $QUERY["show_thumbnail"];
|
||||
}
|
||||
if (isset($QUERY["orderby"]) && $QUERY["orderby"] != "") {
|
||||
$SESSION["orderby"] = $QUERY["orderby"];
|
||||
}
|
||||
if (isset($QUERY["show_upload"]) && $QUERY["show_upload"] != "") {
|
||||
$SESSION["show_upload"] = $QUERY["show_upload"];
|
||||
}
|
||||
if (isset($QUERY["show_image_menu"]) && $QUERY["show_image_menu"] != "") {
|
||||
$SESSION["show_image_menu"] = $QUERY["show_image_menu"];
|
||||
}
|
||||
if (isset($QUERY["show_folder_menu"]) && $QUERY["show_folder_menu"] != "") {
|
||||
$SESSION["show_folder_menu"] = $QUERY["show_folder_menu"];
|
||||
}
|
||||
if (isset($QUERY["show_newfolder"]) && $QUERY["show_newfolder"] != "") {
|
||||
$SESSION["show_newfolder"] = $QUERY["show_newfolder"];
|
||||
}
|
||||
if (isset($QUERY["thumbnails_perpage"]) && $QUERY["thumbnails_perpage"] != "") {
|
||||
$SESSION["thumbnails_perpage"] = $QUERY["thumbnails_perpage"];
|
||||
}
|
||||
if (isset($QUERY["upload_filesize"]) && $QUERY["upload_filesize"] != "") {
|
||||
$SESSION["upload_filesize"] = $QUERY["upload_filesize"];
|
||||
}
|
||||
if (isset($QUERY["check_session_variable"]) && $QUERY["check_session_variable"] != "") {
|
||||
$SESSION["check_session_variable"] = $QUERY["check_session_variable"];
|
||||
}
|
||||
if (isset($QUERY["document_root"]) && $QUERY["document_root"] != "") {
|
||||
$SESSION["document_root"] = $QUERY["document_root"];
|
||||
}
|
||||
|
||||
// Session-Variable überprüfen
|
||||
if ($SESSION["check_session_variable"] != "") {
|
||||
|
||||
// Session Starten
|
||||
session_start();
|
||||
|
||||
// Session-Variable überprüfen
|
||||
if (!isset($_SESSION[$SESSION["check_session_variable"]])) {
|
||||
include("error.php");
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
// Eine Verzeichnisebene höher anzeigen
|
||||
if (isset($_GET["action"]) && $_GET["action"] == "back") {
|
||||
$array = explode ("/", $SESSION["dir"]);
|
||||
|
||||
$SESSION["dir"] = "";
|
||||
for ($i = 0; $i < count($array)-2; $i++ ) {
|
||||
$SESSION["dir"] = $SESSION["dir"].$array[$i]."/";
|
||||
}
|
||||
|
||||
if ($SESSION["dir_root"] == $SESSION["dir"]) { $SESSION["back"] = 0; }
|
||||
}
|
||||
|
||||
// Query-Zeichenkette 1
|
||||
$GET = "dir_root=".$SESSION["dir_root"]
|
||||
."&dir=".$SESSION["dir"]
|
||||
."&server=".$SESSION["server"]
|
||||
."&thumbnail_size=".$SESSION["thumbnail_size"]
|
||||
."&show_thumbnail=".$SESSION["show_thumbnail"]
|
||||
."&jpg_quality=".$SESSION["jpg_quality"]
|
||||
."&back=".$SESSION["back"]
|
||||
."&orderby=".$SESSION["orderby"]
|
||||
."&show_upload=".$SESSION["show_upload"]
|
||||
."&show_image_menu=".$SESSION["show_image_menu"]
|
||||
."&show_folder_menu=".$SESSION["show_folder_menu"]
|
||||
."&show_newfolder=".$SESSION["show_newfolder"]
|
||||
."&thumbnails_perpage=".$SESSION["thumbnails_perpage"]
|
||||
."&upload_filesize=".$SESSION["upload_filesize"]
|
||||
."&check_session_variable=".$SESSION["check_session_variable"]
|
||||
."&document_root=".$SESSION["document_root"];
|
||||
|
||||
// Query-Zeichenkette 2
|
||||
$GET2 = "dir_root=".$SESSION["dir_root"]
|
||||
."&server=".$SESSION["server"]
|
||||
."&thumbnail_size=".$SESSION["thumbnail_size"]
|
||||
."&show_thumbnail=".$SESSION["show_thumbnail"]
|
||||
."&jpg_quality=".$SESSION["jpg_quality"]
|
||||
."&orderby=".$SESSION["orderby"]
|
||||
."&show_upload=".$SESSION["show_upload"]
|
||||
."&show_image_menu=".$SESSION["show_image_menu"]
|
||||
."&show_folder_menu=".$SESSION["show_folder_menu"]
|
||||
."&show_newfolder=".$SESSION["show_newfolder"]
|
||||
."&thumbnails_perpage=".$SESSION["thumbnails_perpage"]
|
||||
."&upload_filesize=".$SESSION["upload_filesize"]
|
||||
."&check_session_variable=".$SESSION["check_session_variable"]
|
||||
."&document_root=".$SESSION["document_root"];
|
||||
|
||||
// Query-Zeichenkette 3
|
||||
$GET3 = "dir_root=".$SESSION["dir_root"]
|
||||
."&dir=".$SESSION["dir"]
|
||||
."&server=".$SESSION["server"]
|
||||
."&thumbnail_size=".$SESSION["thumbnail_size"]
|
||||
."&show_thumbnail=".$SESSION["show_thumbnail"]
|
||||
."&jpg_quality=".$SESSION["jpg_quality"]
|
||||
."&back=".$SESSION["back"]
|
||||
."&show_upload=".$SESSION["show_upload"]
|
||||
."&show_image_menu=".$SESSION["show_image_menu"]
|
||||
."&show_folder_menu=".$SESSION["show_folder_menu"]
|
||||
."&show_newfolder=".$SESSION["show_newfolder"]
|
||||
."&thumbnails_perpage=".$SESSION["thumbnails_perpage"]
|
||||
."&upload_filesize=".$SESSION["upload_filesize"]
|
||||
."&check_session_variable=".$SESSION["check_session_variable"]
|
||||
."&document_root=".$SESSION["document_root"];
|
||||
|
||||
?>
|
||||
148
simpla/design/js/tiny_mce/plugins/smimage/php/smpreview.php
vendored
Normal file
148
simpla/design/js/tiny_mce/plugins/smimage/php/smpreview.php
vendored
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
include("tools.php");
|
||||
|
||||
function SendEmptyImage() {
|
||||
header ("Content-type: image/png");
|
||||
$img = @imagecreatetruecolor(200, 100);
|
||||
imagefill($img, 255, 255, 255);
|
||||
$c = imagecolorallocate($img, 255, 255, 255);
|
||||
imagefill($img, 0, 0, $c);
|
||||
$text_color = imagecolorallocate($img, 68, 85, 102);
|
||||
imagestring($img, 10, 80, 40, "???", $text_color);
|
||||
imagepng($img);
|
||||
imagedestroy($img);
|
||||
}
|
||||
|
||||
// Neue Bildgröße brechnen
|
||||
function GetNewImageSize($file, $size) {
|
||||
$a = array();
|
||||
$a["width"] = $size;
|
||||
$a["height"] = $size;
|
||||
|
||||
if (list($width_orig, $height_orig, $image_type) = getimagesize($file)) {
|
||||
if ($height_orig > $size || $width_orig > $size) {
|
||||
if ($height_orig >= $width_orig) {
|
||||
$ratio_orig = $height_orig / $width_orig;
|
||||
$a["width"] = round($size / $ratio_orig);
|
||||
}
|
||||
else if ($width_orig >= $height_orig) {
|
||||
$ratio_orig = $width_orig / $height_orig;
|
||||
$a["height"] = round($size / $ratio_orig);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$a["width"] = $width_orig;
|
||||
$a["height"] = $height_orig;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
// Neue Bildgröße brechnen
|
||||
$a = array();
|
||||
$a = GetNewImageSize(GetDocumentRoot().$_GET["src"], $_GET["size"]);
|
||||
$width = $a["width"];
|
||||
$height = $a["height"];
|
||||
unset($a);
|
||||
|
||||
// Originale Bildgröße und Bilddateityp ermitteln
|
||||
if (!list($width_orig, $height_orig, $image_type) = getimagesize(GetDocumentRoot().$_GET["src"])) {
|
||||
SendEmptyImage();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Neues Bild erstellen
|
||||
if (!$image_p = imagecreatetruecolor($width, $height)) {
|
||||
SendEmptyImage();
|
||||
exit;
|
||||
}
|
||||
|
||||
// GIF-, JPG- und PNG-Bildformat
|
||||
switch($image_type) {
|
||||
case 1:
|
||||
if (ImageTypes() & IMG_GIF) {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/gif");
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromgif(GetDocumentRoot().$_GET["src"]);
|
||||
|
||||
// Transparenz erhalten
|
||||
$trnprt_indx = imagecolortransparent($image);
|
||||
if ($trnprt_indx >= 0) {
|
||||
$trnprt_color = @imagecolorsforindex($image, $trnprt_indx);
|
||||
$trnprt_indx = @imagecolorallocate($image_p, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
|
||||
imagefill($image_p, 0, 0, $trnprt_indx);
|
||||
imagecolortransparent($image_p, $trnprt_indx);
|
||||
}
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Output
|
||||
imagegif($image_p);
|
||||
}
|
||||
else {
|
||||
SendEmptyImage();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ImageTypes() & IMG_JPG) {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/jpeg");
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefromjpeg(GetDocumentRoot().$_GET["src"]);
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Output
|
||||
imagejpeg($image_p, null, $_GET["jpg_quality"]);
|
||||
}
|
||||
else {
|
||||
SendEmptyImage();
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (ImageTypes() & IMG_PNG) {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/png");
|
||||
|
||||
// Bilddatei laden
|
||||
$image = imagecreatefrompng(GetDocumentRoot().$_GET["src"]);
|
||||
|
||||
// Transparenz erhalten
|
||||
imagealphablending($image_p, false);
|
||||
$colorTransparent = imagecolorallocatealpha($image_p, 0, 0, 0, 127);
|
||||
imagefill($image_p, 0, 0, $colorTransparent);
|
||||
imagesavealpha($image_p, true);
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Output
|
||||
imagepng($image_p);
|
||||
}
|
||||
else {
|
||||
SendEmptyImage();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
SendEmptyImage();
|
||||
break;
|
||||
}
|
||||
|
||||
// Speicher freigeben
|
||||
if (isset($image)) { imagedestroy($image); }
|
||||
if (isset($image_p)) { imagedestroy($image_p); }
|
||||
|
||||
?>
|
||||
62
simpla/design/js/tiny_mce/plugins/smimage/php/style.php
vendored
Normal file
62
simpla/design/js/tiny_mce/plugins/smimage/php/style.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<style type="text/css">
|
||||
/* <![CDATA[ */
|
||||
.image {
|
||||
padding-top: 5px;
|
||||
height: <?php echo($SESSION["thumbnail_size"] + 5); ?>px;
|
||||
width: <?php echo($SESSION["thumbnail_size"] + 10); ?>px;
|
||||
background-color: #f6f9fb;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.textbox {
|
||||
line-height: 20px;
|
||||
width: <?php echo($SESSION["thumbnail_size"] + 10); ?>px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.image_menu {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
margin-top: -110px;
|
||||
margin-left: -1px;
|
||||
list-style: none;
|
||||
font-size: 10pt;
|
||||
width: <?php echo($SESSION["thumbnail_size"] + 10); ?>px;
|
||||
background: #ffffff url("img/image_menu_bg.gif") repeat-y;
|
||||
border: 1px solid #a8adb4;
|
||||
text-align: left;
|
||||
filter: alpha(opacity=90);
|
||||
-moz-opacity: 0.9;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.image_menu2 {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
margin-top: -78px;
|
||||
width: 130px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.image_menu2_default {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
margin-top: -34px;
|
||||
width: 130px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.folder_menu {
|
||||
display: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
margin-top: -65px;
|
||||
border: 1px solid #ffcc66;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
153
simpla/design/js/tiny_mce/plugins/smimage/php/thumbnail.php
vendored
Normal file
153
simpla/design/js/tiny_mce/plugins/smimage/php/thumbnail.php
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
include("tools.php");
|
||||
|
||||
function SendEmptyImage() {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/gif");
|
||||
|
||||
// Output
|
||||
imagegif(imagecreatefromgif("../img/icon_image_32x32.gif"));
|
||||
}
|
||||
|
||||
// Neue Bildgröße brechnen
|
||||
function GetNewImageSize($file, $size) {
|
||||
$a = array();
|
||||
$a["width"] = $size;
|
||||
$a["height"] = $size;
|
||||
|
||||
if (list($width_orig, $height_orig, $image_type) = getimagesize($file)) {
|
||||
if ($height_orig > $size || $width_orig > $size) {
|
||||
if ($height_orig >= $width_orig) {
|
||||
$ratio_orig = $height_orig / $width_orig;
|
||||
$a["width"] = round($size / $ratio_orig);
|
||||
}
|
||||
else if ($width_orig >= $height_orig) {
|
||||
$ratio_orig = $width_orig / $height_orig;
|
||||
$a["height"] = round($size / $ratio_orig);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$a["width"] = $width_orig;
|
||||
$a["height"] = $height_orig;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
// Neue Bildgröße brechnen
|
||||
$a = array();
|
||||
$a = GetNewImageSize(GetDocumentRoot().$_GET["src"], $_GET["size"]);
|
||||
$width = $a["width"];
|
||||
$height = $a["height"];
|
||||
unset($a);
|
||||
|
||||
// Originale Bildgröße und Bilddateityp ermitteln
|
||||
if (!list($width_orig, $height_orig, $image_type) = getimagesize(GetDocumentRoot().$_GET["src"])) {
|
||||
SendEmptyImage();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Neues Bild erstellen
|
||||
if (!$image_p = imagecreatetruecolor($width, $height)) {
|
||||
SendEmptyImage();
|
||||
exit;
|
||||
}
|
||||
|
||||
// GIF-, JPG- und PNG-Bildformat
|
||||
switch($image_type) {
|
||||
case 1:
|
||||
if (ImageTypes() & IMG_GIF) {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/gif");
|
||||
|
||||
// Bilddatei laden
|
||||
if ($image = imagecreatefromgif(GetDocumentRoot().$_GET["src"])) {
|
||||
|
||||
// Transparenz erhalten
|
||||
$trnprt_indx = imagecolortransparent($image);
|
||||
if ($trnprt_indx >= 0) {
|
||||
$trnprt_color = @imagecolorsforindex($image, $trnprt_indx);
|
||||
$trnprt_indx = @imagecolorallocate($image_p, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);
|
||||
imagefill($image_p, 0, 0, $trnprt_indx);
|
||||
imagecolortransparent($image_p, $trnprt_indx);
|
||||
}
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Output
|
||||
imagegif($image_p);
|
||||
}
|
||||
else { SendEmptyImage(); }
|
||||
}
|
||||
else {
|
||||
SendEmptyImage();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (ImageTypes() & IMG_JPG) {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/jpeg");
|
||||
|
||||
// Bilddatei laden
|
||||
if ($image = imagecreatefromjpeg(GetDocumentRoot().$_GET["src"])) {
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Output
|
||||
imagejpeg($image_p, null, $_GET["jpg_quality"]);
|
||||
}
|
||||
else { SendEmptyImage(); }
|
||||
|
||||
}
|
||||
else {
|
||||
SendEmptyImage();
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (ImageTypes() & IMG_PNG) {
|
||||
|
||||
// Content type
|
||||
header("Content-type: image/png");
|
||||
|
||||
// Bilddatei laden
|
||||
if ($image = imagecreatefrompng(GetDocumentRoot().$_GET["src"])) {
|
||||
|
||||
// Transparenz erhalten
|
||||
imagealphablending($image_p, false);
|
||||
$colorTransparent = imagecolorallocatealpha($image_p, 0, 0, 0, 127);
|
||||
imagefill($image_p, 0, 0, $colorTransparent);
|
||||
imagesavealpha($image_p, true);
|
||||
|
||||
// Resample
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
|
||||
// Output
|
||||
imagepng($image_p);
|
||||
}
|
||||
else { SendEmptyImage(); }
|
||||
|
||||
}
|
||||
else {
|
||||
SendEmptyImage();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
SendEmptyImage();
|
||||
break;
|
||||
}
|
||||
|
||||
// Speicher freigeben
|
||||
if (isset($image)) { imagedestroy($image); }
|
||||
if (isset($image_p)) { imagedestroy($image_p); }
|
||||
|
||||
?>
|
||||
291
simpla/design/js/tiny_mce/plugins/smimage/php/tools.php
vendored
Normal file
291
simpla/design/js/tiny_mce/plugins/smimage/php/tools.php
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
<?php
|
||||
|
||||
include("config.php");
|
||||
|
||||
// Server Root-Pfad zurückgeben
|
||||
function GetDocumentRoot() {
|
||||
global $SESSION;
|
||||
|
||||
if ($SESSION["document_root"] != "") {
|
||||
$s = $SESSION["document_root"];
|
||||
if ($s[strlen($s)-1] == "/") { $s = substr($s, 0, -1); }
|
||||
return $s;
|
||||
}
|
||||
|
||||
if (isset($_SERVER["DOCUMENT_ROOT"])) { return $_SERVER["DOCUMENT_ROOT"]; }
|
||||
else if (isset($_SERVER["APPL_PHYSICAL_PATH"])) {
|
||||
$s = $_SERVER["APPL_PHYSICAL_PATH"];
|
||||
$s = str_replace('\\', '/', $_SERVER["APPL_PHYSICAL_PATH"]);
|
||||
if ($s[strlen($s)-1] == "/") { $s = substr($s, 0, -1); }
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
|
||||
// Datei-Erweiterung zurückgeben
|
||||
function GetFileExt($file) {
|
||||
$pfad_info = @pathinfo($file);
|
||||
return $pfad_info['extension'];
|
||||
}
|
||||
|
||||
// Datei-Erweiterung prüfen
|
||||
function IsFileExt($file, $ext) {
|
||||
if (GetFileExt(strtolower($file)) == strtolower($ext)) { return true; }
|
||||
else { return false; }
|
||||
}
|
||||
|
||||
// Verzeichnis lesen und alle Dateien ermitteln
|
||||
function GetFiles($dir, $orderby) {
|
||||
$files = array();
|
||||
|
||||
if ($dh = @opendir($dir)) {
|
||||
while($file = readdir($dh)) {
|
||||
if (!preg_match("/^\.+$/", $file)) {
|
||||
if (is_file($dir.$file) && (IsFileExt($file, "jpg") || IsFileExt($file, "jpeg") || IsFileExt($file, "gif") || IsFileExt($file, "png"))) {
|
||||
$files[0][] = $file;
|
||||
$files[1][] = filemtime($dir.$file);
|
||||
$files[2][] = filesize($dir.$file);
|
||||
$files[3][] = Image_GetWidth($dir.$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
switch ($orderby) {
|
||||
case "0":
|
||||
@array_multisort($files[1], SORT_NUMERIC, SORT_DESC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "1":
|
||||
@array_multisort($files[0], SORT_STRING, SORT_ASC);
|
||||
break;
|
||||
case "2":
|
||||
@array_multisort($files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "3":
|
||||
@array_multisort($files[2], SORT_NUMERIC, SORT_ASC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "4":
|
||||
@array_multisort($files[2], SORT_NUMERIC, SORT_DESC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "5":
|
||||
@array_multisort($files[3], SORT_NUMERIC, SORT_ASC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "6":
|
||||
@array_multisort($files[3], SORT_NUMERIC, SORT_DESC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "7":
|
||||
@array_multisort($files[1], SORT_NUMERIC, SORT_ASC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
case "8":
|
||||
@array_multisort($files[1], SORT_NUMERIC, SORT_DESC, $files[0], SORT_STRING, SORT_DESC);
|
||||
break;
|
||||
}
|
||||
|
||||
// Server-Cache löschen
|
||||
clearstatcache();
|
||||
|
||||
// Datei-Array zurückgeben
|
||||
return $files[0];
|
||||
}
|
||||
|
||||
// Verzeichnis lesen und alle Ordner ermitteln
|
||||
function GetFolders($dir) {
|
||||
$folders = array();
|
||||
|
||||
if ($dh = @opendir($dir)) {
|
||||
while($file = readdir($dh)) {
|
||||
if (!preg_match("/^\.+$/", $file)) {
|
||||
if (is_dir($dir.$file)) { $folders[] = $file; }
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
@sort($folders, SORT_STRING);
|
||||
|
||||
// Server-Cache löschen
|
||||
clearstatcache();
|
||||
|
||||
// Ordner-Array zurückgeben
|
||||
return $folders;
|
||||
}
|
||||
|
||||
// Verzeichnis rekursiv löschen
|
||||
// Rückgabewerte:
|
||||
// 0 - O.K.
|
||||
// -1 - Kein Verzeichnis
|
||||
// -2 - Fehler beim Löschen
|
||||
// -3 - Ein Eintrag eines Verzeichnisses war keine Datei und kein Verzeichnis und kein Link
|
||||
function DeleteFolder($path) {
|
||||
|
||||
// Auf Verzeichnis testen
|
||||
if (!is_dir($path)) { return -1; }
|
||||
|
||||
// Verzeichnis öffnen
|
||||
$dir = @opendir($path);
|
||||
|
||||
// Fehler?
|
||||
if (!$dir) { return -2; }
|
||||
|
||||
while (($entry = @readdir($dir)) != false) {
|
||||
|
||||
if ($entry == '.' || $entry == '..') continue;
|
||||
|
||||
if (is_dir($path.'/'.$entry)) {
|
||||
$res = DeleteFolder($path.'/'.$entry);
|
||||
|
||||
// Fehler ?
|
||||
if ($res == -1) {
|
||||
@closedir($dir);
|
||||
return -2;
|
||||
}
|
||||
else if ($res == -2) {
|
||||
@closedir($dir);
|
||||
return -2;
|
||||
}
|
||||
else if ($res == -3) {
|
||||
@closedir($dir);
|
||||
return -3;
|
||||
}
|
||||
else if ($res != 0) {
|
||||
@closedir($dir);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else if (is_file($path.'/'.$entry) || is_link($path.'/'.$entry)) {
|
||||
|
||||
// Datei löschen
|
||||
$res = @unlink($path.'/'.$entry);
|
||||
|
||||
// Fehler?
|
||||
if (!$res) {
|
||||
@closedir($dir);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@closedir($dir);
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
|
||||
// Verzeichnis schliessen
|
||||
@closedir($dir);
|
||||
|
||||
// Verzeichnis löschen
|
||||
$res = @rmdir($path);
|
||||
|
||||
// Fehler?
|
||||
if (!$res) { return -2; }
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Datumsformat zurückgeben
|
||||
function GetDateFormat() {
|
||||
$lang = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
|
||||
$curlang = substr($lang, 0, 2);
|
||||
|
||||
if (isset($lang)) {
|
||||
if ($curlang == "en") { return "Y-m-d"; }
|
||||
elseif ($curlang == "de" || $curlang == "nl") { return "d.m.Y"; }
|
||||
else { return "Y-m-d"; }
|
||||
}
|
||||
|
||||
else { return "Y-m-d"; }
|
||||
}
|
||||
|
||||
// Dateinamen richtig formatieren und zurückgeben
|
||||
function FormatFileName($name) {
|
||||
|
||||
// Leerzeichen entfernen
|
||||
$name = ltrim($name);
|
||||
$name = rtrim($name);
|
||||
|
||||
// Umlaute ersetzen
|
||||
$name = str_replace(array('ä','ö','ü','ß','Ä','Ö','Ü'), array('ae','oe','ue','ss','Ae','Oe','Ue'), $name);
|
||||
|
||||
// Zeichen ersetzen
|
||||
$name = str_replace(" ", "_", $name);
|
||||
$name = preg_replace('/[^a-z0-9_\.\-]/i', '', $name);
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
// Verzeichnisnamen richtig formatieren und zurückgeben
|
||||
function FormatFolderName($name) {
|
||||
|
||||
// Leerzeichen entfernen
|
||||
$name = ltrim($name);
|
||||
$name = rtrim($name);
|
||||
|
||||
// Umlaute ersetzen
|
||||
$name = str_replace(array('ä','ö','ü','ß','Ä','Ö','Ü'), array('ae','oe','ue','ss','Ae','Oe','Ue'), $name);
|
||||
|
||||
// Zeichen ersetzen
|
||||
$name = str_replace(" ", "_", $name);
|
||||
$name = preg_replace('/[^a-z0-9_\-]/i', '', $name);
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
// Aktuellen Verzeichnispfad zurückgeben
|
||||
function GetCurrentPath($dir_root, $dir) {
|
||||
$a = explode ('/', $dir_root);
|
||||
$s = $a[count($a)-2];
|
||||
unset($a);
|
||||
echo "/".$s."/".@str_replace($dir_root,"" , $dir);
|
||||
}
|
||||
|
||||
// RC4 Verschlüsselung
|
||||
function RC4($data) {
|
||||
$s = array();
|
||||
$key = 'f62Z4Dpv7RpBCY3MJcrOcV7nwySM7k7XijkFeCFMVnTdaa9RyXcLZl81CxkK2TGgZnWbXGvQ6nyOs2lSLJIH2ahxf0FDSgQbykByzpSL62EKluUzfWmHarf4qPYUtNUi';
|
||||
|
||||
for ($i = 0; $i < 256; $i++) { $s[$i] = $i; }
|
||||
|
||||
$j = 0;
|
||||
$x;
|
||||
|
||||
for ($i = 0; $i < 256; $i++) {
|
||||
$j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256;
|
||||
$x = $s[$i];
|
||||
$s[$i] = $s[$j];
|
||||
$s[$j] = $x;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$j = 0;
|
||||
$ct = '';
|
||||
$y;
|
||||
|
||||
for ($y = 0; $y < strlen($data); $y++) {
|
||||
$i = ($i + 1) % 256;
|
||||
$j = ($j + $s[$i]) % 256;
|
||||
$x = $s[$i];
|
||||
$s[$i] = $s[$j];
|
||||
$s[$j] = $x;
|
||||
$ct .= $data[$y] ^ chr($s[($s[$i] + $s[$j]) % 256]);
|
||||
}
|
||||
|
||||
return $ct;
|
||||
}
|
||||
|
||||
// PHP-Version zurückgeben
|
||||
function GetPHPVersion_Major() {
|
||||
$v = phpversion();
|
||||
$version = Array();
|
||||
|
||||
foreach(explode('.', $v) as $bit) {
|
||||
if(is_numeric($bit)) { $version[] = $bit; }
|
||||
}
|
||||
|
||||
return $version[0];
|
||||
}
|
||||
|
||||
// PHP-Ini "safe_mode" zurückgeben
|
||||
function GetPHPIni_SafeMode() {
|
||||
if(ini_get('safe_mode')) { return(true); } else { return(false); }
|
||||
}
|
||||
|
||||
?>
|
||||
86
simpla/design/js/tiny_mce/plugins/smimage/php/upload.php
vendored
Normal file
86
simpla/design/js/tiny_mce/plugins/smimage/php/upload.php
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
$UPLOAD_RESULT = true;
|
||||
|
||||
// Bilddatei speichern
|
||||
if (isset($_GET["action"]) && $_GET["action"] == "upload") {
|
||||
|
||||
// Dateierweiterung prüfen
|
||||
if (strtolower($_POST["edit2"]) == ".jpg" || strtolower($_POST["edit2"]) == ".jpeg" || strtolower($_POST["edit2"]) == ".gif" || strtolower($_POST["edit2"]) == ".png") {
|
||||
|
||||
// Dateinamen formatieren
|
||||
$_POST["edit1"] = FormatFileName($_POST["edit1"]);
|
||||
|
||||
// Bild verkleinern und speichern
|
||||
if (is_numeric($_POST["edit3"])) { Image_Resize($_FILES['input1']['tmp_name'], $_POST["edit3"], $SESSION["jpg_quality"]); }
|
||||
|
||||
// Filter auf das Bild anwenden
|
||||
if (is_numeric($_POST["select1"])) { Image_Filter($_FILES['input1']['tmp_name'], $SESSION["jpg_quality"], $_POST["select1"]); }
|
||||
|
||||
// Prüfen ob die Bilddatei bereits existiert, wenn ja den Dateinamen anpassen
|
||||
while (file_exists(GetDocumentRoot().$SESSION["dir"].$_POST["edit1"].$_POST["edit2"])) {
|
||||
$_POST["edit1"] = "_".$_POST["edit1"];
|
||||
}
|
||||
|
||||
// Bilddatei kopieren
|
||||
if ($SESSION["upload_filesize"] != "") {
|
||||
if (filesize($_FILES['input1']['tmp_name']) / 1024 <= $SESSION["upload_filesize"]) {
|
||||
$UPLOAD_RESULT = @move_uploaded_file($_FILES['input1']['tmp_name'], GetDocumentRoot().$SESSION["dir"].$_POST["edit1"].$_POST["edit2"]);
|
||||
}
|
||||
else { $UPLOAD_RESULT = false; }
|
||||
}
|
||||
else {
|
||||
$UPLOAD_RESULT = @move_uploaded_file($_FILES['input1']['tmp_name'], GetDocumentRoot().$SESSION["dir"].$_POST["edit1"].$_POST["edit2"]);
|
||||
}
|
||||
|
||||
// Dateirechte anpassen
|
||||
if ($UPLOAD_RESULT) { @chmod(GetDocumentRoot().$SESSION["dir"].$_POST["edit1"].$_POST["edit2"], $CONFIG["chmod_file"]); }
|
||||
}
|
||||
else { $UPLOAD_RESULT = false; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="upload">
|
||||
<form name="form1" action="" method="post" enctype="multipart/form-data">
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.upload_label_1', '?'));</script>:</b> <span style="color:#8a95a2;">(<script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.upload_info_1', '?'));</script>: <?php if ($SESSION["upload_filesize"] != "") { echo $SESSION["upload_filesize"]." KB"; } else { echo (str_replace("M", "", ini_get('post_max_size')) * 1024)." KB"; } ?>)</span></div>
|
||||
<div><input style="margin-bottom:8px;" type="file" name="input1" size="82" onchange="Upload_ShowFileName();" onfocus="Input_OnFocus(this);" onblur="Input_OnBlur(this);"></div>
|
||||
|
||||
<div style="float:left;">
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.upload_label_2', '?'));</script>:</b></div>
|
||||
<div><input style="margin-bottom:8px; width:200px;" type="text" name="edit1" maxlength="50" onfocus="Input_OnFocus(this);" onblur="Input_OnBlur(this);"><input style="width:40px; border-left:0px; font-weight:bold; background-color:#f6f9fb; margin-bottom:8px;" type="text" name="edit2" readonly></div>
|
||||
</div>
|
||||
|
||||
<div style="float:left; margin-left:25px;">
|
||||
<div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.upload_label_3', '?'));</script>:</b></div>
|
||||
<div><input style="width:60px;" type="text" name="edit3" value="<?php if (isset($_POST["edit3"])) { echo $_POST["edit3"]; }else{echo 1024;} ?>" maxlength="4" onchange="SMImage_CheckFormIsNaN(this);" onfocus="Input_OnFocus(this);" onblur="Input_OnBlur(this);"><b style="margin-left:5px;">px</b></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (GetPHPVersion_Major() >= 5) {
|
||||
echo "<div style=\"float:left; margin-left:25px; margin-right:25px;\"><div style=\"margin-bottom:2px;\"><b><script language=\"javascript\" type=\"text/javascript\">document.write(tinyMCEPopup.getLang('smimage.upload_label_4', '?'));</script>:</b></div><div><select style=\"width:120px;\" name=\"select1\" size=\"1\" ><option selected value=\"\"></option><option value=\"1\"><script language=\"javascript\" type=\"text/javascript\">document.write(tinyMCEPopup.getLang('smimage.upload_filter_select_1', '?'));</script></option><option value=\"2\"><script language=\"javascript\" type=\"text/javascript\">document.write(tinyMCEPopup.getLang('smimage.upload_filter_select_2', '?'));</script></option><option value=\"3\"><script language=\"javascript\" type=\"text/javascript\">document.write(tinyMCEPopup.getLang('smimage.upload_filter_select_3', '?'));</script></option></select></div></div>";
|
||||
}
|
||||
?>
|
||||
|
||||
<div style="margin-top:12px; margin-bottom:50px;">
|
||||
<script language="javascript" type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
var jSMB = new jSMButton();
|
||||
jSMB.SetStyle('float:left;');
|
||||
jSMB.Paint('jSMB', tinyMCEPopup.getLang('smimage.button_save_caption', '?'), 'SMImage_Upload(\'<?php echo bin2hex(RC4("id=2&".$GET)); ?>\', document.form1.edit1.value + document.form1.edit2.value);');
|
||||
/* ]]> */
|
||||
</script>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="main_upload" style="overflow:scroll; margin-left:4px; background-color:#e9edf2;">
|
||||
<?php
|
||||
if (isset($_GET["action"]) && $_GET["action"] == "upload" && $UPLOAD_RESULT) {
|
||||
echo "<img style=\"border:1px solid #616A74;\"src=\"".$SESSION["dir"].$_POST["edit1"].$_POST["edit2"]."\" border=\"0\" alt=\"\">";
|
||||
}
|
||||
else if (isset($_GET["action"]) && $_GET["action"] == "upload" && !$UPLOAD_RESULT) { echo "<div class=\"alert alert_error\"><script language=\"javascript\" type=\"text/javascript\">document.write(tinyMCEPopup.getLang('smimage.message_upload_1', '?'));</script></div>"; }
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div style="height:4px; background-color:#ffffff; font-size:0px";></div>
|
||||
Reference in New Issue
Block a user