Skip to content

Commit

Permalink
No extra consecutive blank lines
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasReker committed Dec 14, 2018
1 parent 9a45181 commit be768e3
Show file tree
Hide file tree
Showing 64 changed files with 2 additions and 129 deletions.
5 changes: 0 additions & 5 deletions admin-dev/filemanager/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
// | | | |- responsivefilemanager
// | | | | |- plugin.min.js


$base_url = Tools::getHttpHost(true); // DON'T TOUCH (base url (only domain) of site (without final /)).
$base_url = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE') ? $base_url : str_replace('https', 'http', $base_url);
$upload_dir = Context::getContext()->shop->getBaseURI().'img/cms/'; // path from base_url to base of upload folder (with start and final /)
Expand Down Expand Up @@ -130,7 +129,6 @@
$aviary_version=3;
$aviary_language='en';


//The filter and sorter are managed through both javascript and php scripts because if you have a lot of
//file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script.
//The plugin automatic swich javascript to php when the current folder exceeds the below limit of files number
Expand All @@ -150,12 +148,10 @@
$java_upload=false;
$JAVAMaxSizeUpload=200; //Gb


//************************************
//Thumbnail for external use creation
//************************************


// New image resized creation with fixed path from filemanager folder after uploading (thumbnails in fixed mode)
// If you want create images resized out of upload folder for use with external script you can choose this method,
// You can create also more than one image at a time just simply add a value in the array
Expand All @@ -169,7 +165,6 @@
$fixed_image_creation_width = array(300,400); //width of image (you can leave empty if you set height)
$fixed_image_creation_height = array(200,''); //height of image (you can leave empty if you set width)


// New image resized creation with relative path inside to upload folder after uploading (thumbnails in relative mode)
// With Responsive filemanager you can create automatically resized image inside the upload folder, also more than one at a time
// just simply add a value in the array
Expand Down
5 changes: 0 additions & 5 deletions admin-dev/filemanager/dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
} else {
include('include/utils.php');



if (isset($_GET['fldr'])
&& !empty($_GET['fldr'])
&& preg_match('/\.{1,2}[\/|\\\]?/', urldecode($_GET['fldr'])) === 0
Expand All @@ -34,7 +32,6 @@
$subdir = '';
}


/***
*SUB-DIR CODE
***/
Expand Down Expand Up @@ -139,7 +136,6 @@
$descending = $_SESSION['descending'];
}


$lang = $default_language;
if (isset($_GET['lang']) && $_GET['lang'] != 'undefined' && $_GET['lang'] != '') {
$lang = $_GET['lang'];
Expand All @@ -155,7 +151,6 @@
}
}


require_once $language_file;

if (!isset($_GET['type'])) {
Expand Down
45 changes: 0 additions & 45 deletions admin-dev/filemanager/include/php_image_magician.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
#
# ========================================================================#


class imageLib
{
private $fileName;
Expand Down Expand Up @@ -195,7 +194,6 @@ class imageLib

private $cropFromTopPercent = 10;


## --------------------------------------------------------

public function __construct($fileName)
Expand Down Expand Up @@ -225,7 +223,6 @@ public function __construct($fileName)
// *** Open up the file
$this->image = $this->openImage($fileName);


// *** Assign here so we don't modify the original
$this->imageResized = $this->image;

Expand All @@ -237,7 +234,6 @@ public function __construct($fileName)
$this->height = imagesy($this->image);
$this->heightOriginal = imagesy($this->image);


/* Added 15-09-08
* Get the filesize using this build in method.
* Stores an array of size
Expand Down Expand Up @@ -341,7 +337,6 @@ public function resizeImage($newWidth, $newHeight, $option = 0, $sharpen = false
$this->keepTransparancy($optimalWidth, $optimalHeight, $this->imageResized);
imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);


// *** If '4', then crop too
if ($option == 4 || $option == 'crop') {
if (($optimalWidth >= $newWidth && $optimalHeight >= $newHeight)) {
Expand Down Expand Up @@ -714,7 +709,6 @@ private function getSizeByAuto($newWidth, $newHeight)
} else {
// *** Image to be resizerd is a square


if ($newHeight < $newWidth) {
//$optimalWidth = $newWidth;
//$optimalHeight= $this->getSizeByFixedWidth($newWidth);
Expand Down Expand Up @@ -947,15 +941,13 @@ public function addBorder($thickness = 1, $rgbArray = array(255, 255, 255))
$g = $rgbArray['g'];
$b = $rgbArray['b'];


$x1 = 0;
$y1 = 0;
$x2 = imagesx($this->imageResized) - 1;
$y2 = imagesy($this->imageResized) - 1;

$rgbArray = imagecolorallocate($this->imageResized, $r, $g, $b);


for ($i = 0; $i < $thickness; $i++) {
imagerectangle($this->imageResized, $x1++, $y1++, $x2--, $y2--, $rgbArray);
}
Expand Down Expand Up @@ -1226,7 +1218,6 @@ public function addReflection($reflectionHeight = 50, $startingTransparency = 30

$transparencyAmount = $this->invertTransparency($startingTransparency, 100);


// *** Fade
if ($stretch) {
$step = 100/($reflectionHeight + $startingTransparency);
Expand All @@ -1247,12 +1238,10 @@ public function addReflection($reflectionHeight = 50, $startingTransparency = 30
// *** Apply fade
imagecopymerge($im, $li, 0, 0, 0, 0, $this->width, $divider, 100); // Divider


// *** width, height of reflection.
$x = imagesx($im);
$y = imagesy($im);


// *** Determines if the reflection should be displayed inside or outside the image
if ($inside) {

Expand Down Expand Up @@ -1370,7 +1359,6 @@ public function roundCorners($radius = 5, $bgColor = 'transparent')
}
}


// *** If we use transparency, we need to color our curved mask with a unique color
if ($isTransparent) {
$bgColor = $this->findUnusedGreen();
Expand All @@ -1385,8 +1373,6 @@ public function roundCorners($radius = 5, $bgColor = 'transparent')
$a = $rgbArray['a'];
}



// *** Create top-left corner mask (square)
$cornerImg = imagecreatetruecolor($radius, $radius);
//$cornerImg = imagecreate($radius, $radius);
Expand All @@ -1400,25 +1386,17 @@ public function roundCorners($radius = 5, $bgColor = 'transparent')
// *** Give it a color
$maskColor = imagecolorallocate($cornerImg, 0, 0, 0);



// *** Replace the mask color (black) to transparent
imagecolortransparent($cornerImg, $maskColor);



// *** Create the image background color
$imagebgColor = imagecolorallocate($cornerImg, $r, $g, $b);



// *** Fill the corner area to the user defined color
imagefill($cornerImg, 0, 0, $imagebgColor);


imagefilledellipse($cornerImg, $radius, $radius, $radius * 2, $radius * 2, $maskColor);


// *** Map to top left corner
imagecopymerge($this->imageResized, $cornerImg, 0, 0, 0, 0, $radius, $radius, 100); #tl

Expand All @@ -1432,7 +1410,6 @@ public function roundCorners($radius = 5, $bgColor = 'transparent')
$cornerImg = imagerotate($cornerImg, 90, 0);
imagecopymerge($this->imageResized, $cornerImg, $this->width - $radius, 0, 0, 0, $radius, $radius, 100); #tr


// *** If corners are to be transparent, we fill our chromakey color as transparent.
if ($isTransparent) {
//imagecolortransparent($this->imageResized, $imagebgColor);
Expand Down Expand Up @@ -1466,7 +1443,6 @@ public function addShadow($shadowAngle=45, $blur=15, $bgColor='transparent')
// *** Set blur width and height
$blurWidth = $blurHeight = $blur;


if ($shadowAngle == 0) {
$distWidth = 0;
$distHeight = 0;
Expand All @@ -1475,7 +1451,6 @@ public function addShadow($shadowAngle=45, $blur=15, $bgColor='transparent')
$distHeight = $shadowDistance * sin(deg2rad($shadowAngle));
}


// *** Convert color
if (fix_strtolower($bgColor) != 'transparent') {
$rgbArray = $this->formatColor($bgColor);
Expand All @@ -1484,16 +1459,13 @@ public function addShadow($shadowAngle=45, $blur=15, $bgColor='transparent')
$b0 = $rgbArray['b'];
}


$image = $this->imageResized;
$width = $this->width;
$height = $this->height;


$newImage = imagecreatetruecolor($width, $height);
imagecopyresampled($newImage, $image, 0, 0, 0, 0, $width, $height, $width, $height);


// *** RGB
$rgb = imagecreatetruecolor($width+$blurWidth, $height+$blurHeight);
$colour = imagecolorallocate($rgb, 0, 0, 0);
Expand All @@ -1504,14 +1476,12 @@ public function addShadow($shadowAngle=45, $blur=15, $bgColor='transparent')
//imagecopymerge($rgb, $newImage, 1+$blurWidth*0.5-$distWidth, 1+$blurHeight*0.5-$distHeight, 0,0, $width, $height, 100);
imagecopymerge($rgb, $newImage, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, 0, 0, $width+$blurWidth, $height+$blurHeight, 100);


// *** Shadow (alpha)
$shadow = imagecreatetruecolor($width+$blurWidth, $height+$blurHeight);
imagealphablending($shadow, false);
$colour = imagecolorallocate($shadow, 0, 0, 0);
imagefilledrectangle($shadow, 0, 0, $width+$blurWidth, $height+$blurHeight, $colour);


for ($i=0;$i<=STEPS;$i++) {
$t = ((1.0*$i)/STEPS);
$intensity = 255*$t*$t;
Expand Down Expand Up @@ -1541,12 +1511,10 @@ public function addShadow($shadowAngle=45, $blur=15, $bgColor='transparent')
imagefilledarc($shadow, $blurWidth-1, $height, 2*(1-$t)*$blurWidth, 2*(1-$t)*$blurHeight, 90, 180, $colour, IMG_ARC_PIE);
}


$colour = imagecolorallocate($shadow, 255, 255, 255);
imagefilledrectangle($shadow, $blurWidth, $blurHeight, $width, $height, $colour);
imagefilledrectangle($shadow, $blurWidth*0.5-$distWidth, $blurHeight*0.5-$distHeight, $width+$blurWidth*0.5-1-$distWidth, $height+$blurHeight*0.5-1-$distHeight, $colour);


// *** The magic
imagealphablending($rgb, false);

Expand Down Expand Up @@ -1618,7 +1586,6 @@ public function addCaptionBox($side='b', $thickness=50, $padding=0, $bgColor='#0
// *** Store incase we want to use method addTextToCaptionBox()
$this->captionBoxPositionArray = $positionArray;


$transparencyAmount = $this->invertTransparency($transparencyAmount, 127, false);
$transparent = imagecolorallocatealpha($this->imageResized, $r, $g, $b, $transparencyAmount);
imagefilledrectangle($this->imageResized, $positionArray['x1'], $positionArray['y1'], $positionArray['x2'], $positionArray['y2'], $transparent);
Expand Down Expand Up @@ -1652,7 +1619,6 @@ public function addTextToCaptionBox($text, $fontColor='#fff', $fontSize = 12, $a
}
}


// *** Get text font
$font = $this->getTextFont($font);

Expand Down Expand Up @@ -1795,7 +1761,6 @@ public function getExif($debug=false)
$ep = $this->resolveExposureProgram($ep);
}


// *** Resolve MeteringMode
$mm = $exifData['MeteringMode'];
$mm = $this->resolveMeteringMode($mm);
Expand All @@ -1804,7 +1769,6 @@ public function getExif($debug=false)
$flash = $exifData['Flash'];
$flash = $this->resolveFlash($flash);


if (isset($exifData['Make'])) {
$exifDataArray['make'] = $exifData['Make'];
} else {
Expand Down Expand Up @@ -2104,7 +2068,6 @@ private function resolveFlash($flash)
Get IPTC Data
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/


/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
Write IPTC Data
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
Expand Down Expand Up @@ -2172,7 +2135,6 @@ private function iptc_maketag($rec, $dat, $val)

//http://xmpphptoolkit.sourceforge.net/


/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-
Add Text
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/
Expand Down Expand Up @@ -2220,7 +2182,6 @@ private function getTextFont($font)
// *** Font path (shou
$fontPath = dirname(__FILE__) . '/' . $this->fontDir;


// *** The below is/may be needed depending on your version (see ref)
putenv('GDFONTPATH=' . realpath('.'));

Expand Down Expand Up @@ -2531,7 +2492,6 @@ private function openImage($file)

break;


// ... etc

default:
Expand Down Expand Up @@ -2643,7 +2603,6 @@ public function saveImage($savePath, $imageQuality="100")

break;


// ... etc

default:
Expand Down Expand Up @@ -2717,7 +2676,6 @@ public function displayImage($fileType = 'jpg', $imageQuality="100")
break;
}


//imagedestroy($this->imageResized);
}

Expand Down Expand Up @@ -3399,9 +3357,6 @@ public function __destruct()
## --------------------------------------------------------
}




/*
* Example with some API calls (outdated):
*
Expand Down
2 changes: 0 additions & 2 deletions admin-dev/filemanager/include/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ function fix_strtoupper($str)
}
}


function fix_strtolower($str)
{
if (function_exists('mb_strtoupper')) {
Expand Down Expand Up @@ -268,7 +267,6 @@ function config_loading($current_path, $fld)
return false;
}


function image_check_memory_usage($img, $max_breedte, $max_hoogte)
{
if (file_exists($img)) {
Expand Down
1 change: 0 additions & 1 deletion admin-dev/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ function checkTabRights($id_tab)
return false;
}


/**
* Converts a simpleXML element into an array. Preserves attributes and everything.
* You can choose to get your elements either flattened, or stored in a custom index that
Expand Down
Loading

0 comments on commit be768e3

Please sign in to comment.