С рабочего компа
This commit is contained in:
@ -403,26 +403,25 @@
|
||||
if($vt=='blob')
|
||||
{ $sql_query=str_replace('${'.$nodePropData->getAttribute("n").'}',':'.$nodePropData->getAttribute("n"),$sql_query);
|
||||
//Название файла запишем в указаное поле
|
||||
$v=getCdataValue($nodePropData);
|
||||
$val=getCdataValue($nodePropData);
|
||||
$cd=findFirstNodeOnAttribute($currNode,"prop","n",$nodePropData->getAttribute("n"))->getAttribute("cd");
|
||||
$nd=findFirstNodeOnAttribute($nodeProp,'prop','n',$cd);
|
||||
if($nd!=null) { getCdata($nd)->nodeValue=$v; }
|
||||
if($nd!=null) { getCdata($nd)->nodeValue=$val; }
|
||||
}else if($vt=='file')
|
||||
{
|
||||
$val=getCdataValue($nodePropData);
|
||||
$valSql=getSQLValue($vt, $val);
|
||||
$sql_query=str_replace('${'.$nodePropData->getAttribute("n").'}',$valSql,$sql_query);
|
||||
|
||||
//Копируем файл из './temp/' в указанную папку относительно корня сайта
|
||||
$flnm = afterLast($val,'_');
|
||||
$dir = "./temp/";
|
||||
if($v!='' && file_exists($dir.$flnm))
|
||||
if($val!='' && file_exists($dir.$flnm))
|
||||
{
|
||||
$path= $_SERVER['DOCUMENT_ROOT'].'/'.findFirstNodeOnAttribute($currNode,"prop","n",$nodePropData->getAttribute("n"))->getAttribute("path");
|
||||
@mkdir($path);//Создаём папку если её нет
|
||||
if(!rename($dir.$flnm, $path.$flnm)) sendError('Can\'t rename to "'.$path.$v.'"!');
|
||||
if(!rename($dir.$flnm, $path.$flnm))
|
||||
sendError('Can\'t rename to "'.$path.$v.'"!');
|
||||
}
|
||||
|
||||
}else
|
||||
{ $v=getSQLValue($vt, getCdataValue($nodePropData));
|
||||
$sql_query=str_replace('${'.$nodePropData->getAttribute("n").'}',$v,$sql_query);
|
||||
@ -525,10 +524,10 @@
|
||||
if($vt=='blob')
|
||||
{ $sql_query=str_replace('${'.$nodePropData->getAttribute("n").'}',':'.$nodePropData->getAttribute("n"),$sql_query);
|
||||
//Название файла запишем в указаное поле
|
||||
$v=getCdataValue($nodePropData);
|
||||
$val=getCdataValue($nodePropData);
|
||||
$cd=findFirstNodeOnAttribute($currNode,"prop","n",$nodePropData->getAttribute("n"))->getAttribute("cd"); //Имя поля с которого нужно брать название файла
|
||||
$nd=findFirstNodeOnAttribute($nodeProps,'prop','n',$cd);
|
||||
if($nd!=null) getCdata($nd)->nodeValue=$v;
|
||||
if($nd!=null) getCdata($nd)->nodeValue=$val;
|
||||
}else if($vt=='file') //Файл который не загружается в базу а храниться в файловой системе
|
||||
{
|
||||
$val=getCdataValue($nodePropData);
|
||||
@ -537,7 +536,7 @@
|
||||
//Копируем файл в указанную папку относительно корня сайта
|
||||
$flnm = afterLast($val,'_');
|
||||
$dir = "./temp/";
|
||||
if($v!='' && file_exists($dir.$flnm))
|
||||
if($val!='' && file_exists($dir.$flnm))
|
||||
{
|
||||
$path= $_SERVER['DOCUMENT_ROOT'].'/'.findFirstNodeOnAttribute($currNode,"prop","n",$nodePropData->getAttribute("n"))->getAttribute("path");
|
||||
@mkdir($path);//Создаём папку если её нет
|
||||
@ -546,8 +545,8 @@
|
||||
}
|
||||
}else
|
||||
{
|
||||
$v=getSQLValue($vt, getCdataValue($nodePropData));
|
||||
$sql_query=str_replace('${'.$nodePropData->getAttribute("n").'}',$v,$sql_query);
|
||||
$val=getSQLValue($vt, getCdataValue($nodePropData));
|
||||
$sql_query=str_replace('${'.$nodePropData->getAttribute("n").'}',$val,$sql_query);
|
||||
}
|
||||
}
|
||||
$nodePropData=$nodePropData->nextSibling;
|
||||
|
||||
Reference in New Issue
Block a user