mirror of
https://github.com/e107inc/e107.git
synced 2025-07-16 12:36:26 +02:00
Save-path corrected on batch-import.
This commit is contained in:
@ -524,7 +524,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPath($mime)
|
function getPath($mime,$owner='_common')
|
||||||
{
|
{
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
@ -536,9 +536,20 @@ class media_admin_ui extends e_admin_ui
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = $this->mimePaths[$pmime].date("Y-m");
|
$dir = $this->mimePaths[$pmime].$owner;
|
||||||
|
|
||||||
if(!is_dir($dir))
|
if(!is_dir($dir)) // Owner Directory
|
||||||
|
{
|
||||||
|
if(!mkdir($dir, 0755))
|
||||||
|
{
|
||||||
|
$mes->add("Couldn't create folder ($dir).", E_MESSAGE_ERROR);
|
||||||
|
return FALSE;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$dir .= "/".date("Y-m");
|
||||||
|
|
||||||
|
if(!is_dir($dir)) // Dated Directory
|
||||||
{
|
{
|
||||||
if(!mkdir($dir, 0755))
|
if(!mkdir($dir, 0755))
|
||||||
{
|
{
|
||||||
@ -627,7 +638,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>
|
||||||
Import into Category: ".$frm->selectbox('batch_category',$this->cats);
|
Import into Category: ".$frm->selectbox('batch_category',$this->ownercats);
|
||||||
|
|
||||||
$waterMarkPath = e_THEME.e107::getPref('sitetheme')."/images/watermark.png";
|
$waterMarkPath = e_THEME.e107::getPref('sitetheme')."/images/watermark.png";
|
||||||
|
|
||||||
@ -726,8 +737,9 @@ class media_admin_ui extends e_admin_ui
|
|||||||
$mes->add("Couldn't get file info from : ".$oldpath, E_MESSAGE_ERROR);
|
$mes->add("Couldn't get file info from : ".$oldpath, E_MESSAGE_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list($owner,$category) = explode("|",$_POST['batch_category']);
|
||||||
$newpath = $this->getPath($f['mime']).'/'.$file;
|
|
||||||
|
$newpath = $this->getPath($f['mime'],$owner).'/'.$file;
|
||||||
$newname = $tp->toDB($_POST['batch_import_name'][$key]);
|
$newname = $tp->toDB($_POST['batch_import_name'][$key]);
|
||||||
$newdiz = $tp->toDB($_POST['batch_import_diz'][$key]);
|
$newdiz = $tp->toDB($_POST['batch_import_diz'][$key]);
|
||||||
|
|
||||||
@ -750,7 +762,7 @@ class media_admin_ui extends e_admin_ui
|
|||||||
$insert = array(
|
$insert = array(
|
||||||
'media_caption' => $newdiz,
|
'media_caption' => $newdiz,
|
||||||
'media_description' => '',
|
'media_description' => '',
|
||||||
'media_category' => $_POST['batch_category'],
|
'media_category' => $category,
|
||||||
'media_datestamp' => $f['modified'],
|
'media_datestamp' => $f['modified'],
|
||||||
'media_url' => $tp->createConstants($newpath,'rel'),
|
'media_url' => $tp->createConstants($newpath,'rel'),
|
||||||
'media_userclass' => 0,
|
'media_userclass' => 0,
|
||||||
|
Reference in New Issue
Block a user