secure=$secure;} } private function getResolutions($resol){ switch($resol){ case "all": return array_merge($this->standartResolution,$this->widthResolution); break; case "sMonitor": return $this->standartResolution; break; case "vMonitor": return $this->widthResolution; break; default: return false; break; } } private function createFolder($folder,$crObj){ if ($folder=="" OR !file_exists($folder) OR !is_dir($folder) OR $crObj==""){return false;} switch (gettype($crObj)){ case "array": foreach($crOdj as $fold){ if (file_exists($folder.'/'.$fold)){continue;} mkdir($folder.'/'.$fold,0777); chmod($folder.'/'.$fold,0777); return true; } break; case "string": return false; break; default: return false; break; } } private function createImageForder($folder,$do,$nFile=""){ if ($folder=="" OR !file_exists($folder) OR !is_dir($folder) ){return false;} switch ($do){ case "all": $mResolution=array_merge($this->standartResolution,$this->widthResolution); return $this->createFolder($folder,$mResolution); break; case "sMonitor": $mResolution=$this->standartResolution; return $this->createFolder($folder,$mResolution); break; case "vMonitor": $mResolution=$this->widthResolution; return $this->createFolder($folder,$mResolution); break; case "current": return $this->createFolder($folder,$nFile); break; case "anyFolder": if ($nFile==""){return false;} mkdir($folder.'/'.$nFile, 0777); chmod($folder.'/'.$nFile, 0777); offline alert if an admin is logged in if (defined( '_ADMIN_OFFLINE' )) { include( $mosConfig_absolute_path .'/offlinebar.php' ); } // start basic HTML if ( $no_html == 0 ) { $customIndex2 = 'templates/'. $mainframe->getTemplate() .'/index2.php'; if (file_exists( $customIndex2 )) { require( $customIndex2 ); } else { // needed to seperate the ISO number from the language file constant _ISO $iso = split( '=', _ISO ); // xml prolog echo ''; ?>
getHead(); ?> id || $mainframe->get( 'joomlaJavascript' )) { ?> if ($del){ chmod($src, 0777); unlink($src); } return $newSrc; } private function createEmptyImgObj($width,$height){ ($width=="")?$width=$this->defaultWidth:$width=intval($width, 10); ($height=="")?$height=$this->$defaultHeight:$height=intval($height, 10); $image = new Imagick(); $image->newImage($width, $height, new ImagickPixel("white")); $image->setImageFormat("png"); echo $image->getImagesBlob(); $image->clear(); $image->destroy(); return true; } public function setDefaultSize($defaultWidth,$defaultHeight){ $this->$defaultWidth=intval($defaultWidth, 10); $this->$defaultHeight=intval($defaultHeight, 10); } private function resizer($image_res,$old_size,$new_size,$side){ if ($side=="x"){ $x=round(($old_size-$new_size)/2); $y=0; } elseif($side=="y"){ $x=0; $y=round(($old_size-$new_size)/2); } else{ return false; } $image_res->cropImage($new_size,$new_size,$x,$y); return $image_res; } public function resizeImg($src,$width,$height,$del=false,$resize='symmetrically',$quality=100){ $src=($this->secure).'/'.$src; ($width=="")?$width=$this->defaultWidth:$width=intval($width, 10); ($height=="")?$height=$this->defaultHeight:$height=intval($height, 10); $fType=$this->verifyFile($src); if (!$fType){ $this->createEmptyImgObj($width,$height); return false; } $resStr=$this->fileCorrRename($src,$del); if (!$resStr){ $this->createEmptyImgObj($width,$height); return false; } $sourseSrc=$resStr; $image_res = new Imagick(); $image_res->readImage($sourseSrc); $image_width=$image_res->getImageWidth(); $image_height=$image_res->getImageHeight(); $x_ratio = $width/$image_width; $y_ratio = $height/$image_height; $ratio = max($x_ratio, $y_ratio); $use_x_ratio = ($x_ratio == $ratio); $new_width = $use_x_ratio ? $width : floor($image_width * $ratio); $new_height = !$use_x_ratio ? $height : floor($image_height * $ratio); if ( ($image_width>$width OR $image_height>$height) AND $resize=="symmetrically" ){ $strR = "_".$new_width."_".$new_height.".{$fType}"; $resStr = str_replace(".{$fType}", $strR, $resStr); $image_res->writeImage($resStr); chmod($resStr, 0777); exec(escapeshellcmd("convert {$resStr} -resize {$new_width}x{$new_height} -quality {$quality} -sharpen 4x1 {$resStr}")); $image_res->clear(); $image_res->destroy(); if ($del AND file_exists($sourseSrc)){ chmod($sourseSrc, 0777); unlink($sourseSrc); } return $resStr; } elseif($resize=="flaming"){ if ($use_x_ratio){ $image_res=$this->resizer($image_res,$new_height,$width,"y"); $strR = "_".$width."_".$new_height.".{$fType}"; $resStr = str_replace(".{$fType}", $strR, $resStr); } else{ $image_res=$this->resizer($image_res,$new_width,$height,"x"); $strR = "_".$new_width."_".$height.".{$fType}"; $resStr = str_replace(".{$fType}", $strR, $resStr); } $image_res->writeImage($resStr); chmod($resStr, 0777); $image_res->clear(); $image_res->destroy(); if ($del AND file_exists($sourseSrc)){ chmod($sourseSrc, 0777); unlink($sourseSrc); } return $resStr; } else{ $image_res->clear(); $image_res->destroy(); return $sourseSrc; } } public function createMonitPict($fObj,$resol){ $fObj=($this->secure).'/'.$fObj; if (!file_exists($fObj)){return false;} if (is_dir($fObj)){ if ($resol==""){$resol="all";} if (!($this->createImageForder($fObj,$resol))){return false;} $resolutions=$this->getResolutions($resol); if (!$resolutions){return false;} foreach ($fObj as $file){ if ( $file=="." OR $file==".." OR (!($this->verifyFile($fObj.'/'.$file))) ){continue;} foreach ($resolutions as $curResolution){ $curResData=explode('x',$curResolution); $fileResizeName=$this->resizeImg($fObj.'/'.$file,$curResData[0],$curResData[1]); if ($fileResizeName){ copy($fileResizeName,$fObj.'/'.$curResolution); unlink($fileResizeName); } } } } elseif(is_file($fObj)){ } else{ return false; } } } ?>-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 10pt; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 1px; COLOR: #000000; FONT-FAMILY: Arial; BACKGROUND-COLOR: transparent; BORDER-RIGHT-WIDTH: 0px" link=#4b4b4b> ANSUL MOBIL FIRE PROTECTION SOLUTIONS 2