1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 01:30:32 +02:00

Issue #317 - specific path has been added for importing into media-manager. e_IMPORT.

This commit is contained in:
Cameron
2013-05-17 18:17:04 -07:00
parent 5f264b10af
commit 9dd4d0c666
5 changed files with 21 additions and 13 deletions

View File

@@ -1408,7 +1408,7 @@ class media_admin_ui extends e_admin_ui
$pref['upload_storagetype'] = "1";
require_once(e_HANDLER."upload_handler.php"); //TODO - still not a class!
// $uploaded = process_uploaded_files(e_MEDIA.'temp/'); //FIXME doesn't handle xxx.JPG (uppercase)
$uploaded = process_uploaded_files(e_TEMP); //FIXME doesn't handle xxx.JPG (uppercase)
$uploaded = process_uploaded_files(e_IMPORT); //FIXME doesn't handle xxx.JPG (uppercase)
$upload = array_shift($uploaded);
if(vartrue($upload['error']))
{
@@ -1424,7 +1424,7 @@ class media_admin_ui extends e_admin_ui
$mes->addDebug(print_a($upload,TRUE));
// $oldpath = e_MEDIA."temp/".$upload['name'];
$oldpath = e_TEMP.$upload['name'];
$oldpath = e_IMPORT.$upload['name'];
$newpath = $this->checkDupe($oldpath,$typePath.'/'.$upload['name']);
if(!rename($oldpath, e_MEDIA.$newpath))
@@ -1467,7 +1467,7 @@ class media_admin_ui extends e_admin_ui
$fname = basename($new_data['media_url']);
// move to the required place
if(strpos($new_data['media_url'], '{e_TEMP}') !== FALSE)
if(strpos($new_data['media_url'], '{e_IMPORT}') !== FALSE)
// if(strpos($new_data['media_url'], '{e_MEDIA}temp/') !== FALSE)
{
$tp = e107::getParser();
@@ -1560,7 +1560,7 @@ class media_admin_ui extends e_admin_ui
$rejectArray = array('^\.ftpquota$','^index\.html$','^null\.txt$','\.bak$','^.tmp','.*\.xml$','^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','^\.htaccess$','index\.html','null\.txt');
$fl->setFileFilter($rejectArray);
// $files = $fl->get_files(e_MEDIA."temp/");
$files = $fl->get_files(e_TEMP);
$files = $fl->get_files(e_IMPORT);
// e107::js('core','core/admin.js','prototype');
@@ -1569,7 +1569,7 @@ class media_admin_ui extends e_admin_ui
if(!vartrue($_POST['batch_import_selected']))
{
$mes->add("Scanning for new media (images, videos, files) in folder: <b> ".e_UPLOAD."</b>", E_MESSAGE_INFO);
$mes->add("Scanning for new media (images, videos, files) in folder: <b> ".e_IMPORT."</b>", E_MESSAGE_INFO);
}
if(!count($files))
@@ -1689,7 +1689,7 @@ class media_admin_ui extends e_admin_ui
{
list($file,$ext) = explode(".",$imgFile);
$xmlFile = e_UPLOAD.$file.".xml";
$xmlFile = e_IMPORT.$file.".xml";
if(is_readable($xmlFile))
{
@@ -1707,7 +1707,10 @@ class media_admin_ui extends e_admin_ui
);
}
return array('title'=>basename($file),'description'=>'','authorName'=>'','authorEmail'=>'');
$srch = array("_","-");
$description = str_replace($srch," ",$file);
return array('title'=>basename($file),'description'=>$description,'authorName'=>USERNAME,'authorEmail'=>'');
/*
Example: matchingfilename.xml (ie. same name as jpg|.gif|.png etc)
@@ -1732,7 +1735,7 @@ class media_admin_ui extends e_admin_ui
{
list($file,$ext) = explode(".",$imgFile);
$xmlFile = e_UPLOAD.$file.".xml";
$xmlFile = e_IMPORT.$file.".xml";
if(file_exists($xmlFile))
{
@@ -1751,7 +1754,7 @@ class media_admin_ui extends e_admin_ui
}
// $oldpath = e_MEDIA."temp/".$file;
$oldpath = e_TEMP.$file;
$oldpath = e_IMPORT.$file;
if(file_exists($oldpath))
{
unlink($oldpath);
@@ -1800,7 +1803,7 @@ class media_admin_ui extends e_admin_ui
{
// $oldpath = e_MEDIA."temp/".$file;
$oldpath = e_TEMP.$file;
$oldpath = e_IMPORT.$file;
// Resize on Import Routine ------------------------
if(vartrue($img_import_w) && vartrue($img_import_h))