1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-17 07:10:48 +03:00

fix upload image

This commit is contained in:
Mzhelskiy Maxim 2010-04-17 20:12:15 +00:00
parent 6b9582369a
commit 932d0ef733
3 changed files with 34 additions and 2 deletions

View file

@ -47,6 +47,13 @@ class LsImage extends Module {
*/
protected $aParamsDefault = array();
/**
* Тескт последней ошибки
*
* @var unknown_type
*/
protected $sLastErrorText = null;
/**
* Инициализация модуля
*/
@ -56,6 +63,29 @@ class LsImage extends Module {
'round_corner' =>false
);
}
/**
* Получает текст последней ошибки
*
* @return unknown
*/
public function GetLastError() {
return $this->sLastErrorText;
}
/**
* Устанавливает текст последней ошибки
*
* @param unknown_type $sText
*/
public function SetLastError($sText) {
$this->sLastErrorText=$sText;
}
/**
* Очищает текст последней ошибки
*
*/
public function ClearLastError() {
$this->sLastErrorText=null;
}
/**
* Merge default and named params for images
*
@ -89,6 +119,7 @@ class LsImage extends Module {
* @return string
*/
public function Resize($sFileSrc,$sDirDest,$sFileDest,$iWidthMax,$iHeightMax,$iWidthDest=null,$iHeightDest=null,$bForcedMinSize=true,$aParams=null,$oImage=null) {
$this->ClearLastError();
/**
* Если параметры не переданы, устанавливаем действия по умолчанию
*/
@ -102,6 +133,7 @@ class LsImage extends Module {
if(!$oImage) $oImage=new LiveImage($sFileSrc);
if($oImage->get_last_error()){
$this->SetLastError($oImage->get_last_error());
return false;
}

View file

@ -72,7 +72,7 @@ if ($oEngine->User_IsAuthorization()) {
}
}
if (!is_null($sFile)) {
if ($sFile) {
$bStateError=false;
$sMsgTitle='';
$sMsg='';

View file

@ -736,7 +736,7 @@ return array(
*/
'uploadimg' => 'Вставка изображения',
'uploadimg_file' => 'Файл',
'uploadimg_file_error' => 'Невозможно обработать файл',
'uploadimg_file_error' => 'Невозможно обработать файл, проверьте тип и размер файла',
'uploadimg_url' => 'Ссылка на изображение',
'uploadimg_url_error_type' => 'Файл не является изображением',
'uploadimg_url_error_read' => 'Невозможно прочитать внешний файл',