mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Issue #317 - specific path has been added for importing into media-manager. e_IMPORT.
This commit is contained in:
@@ -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))
|
||||
|
@@ -511,7 +511,7 @@ function update_706_to_800($type='')
|
||||
$serialized_prefs = array("'emote'", "'menu_pref'", "'search_prefs'", "'emote_default'", "'pm_prefs'");
|
||||
|
||||
|
||||
$create_dir = array(e_MEDIA,e_SYSTEM,e_CACHE,e_CACHE_CONTENT,e_CACHE_IMAGE, e_CACHE_DB, e_LOG, e_BACKUP, e_CACHE_URL, e_TEMP);
|
||||
$create_dir = array(e_MEDIA,e_SYSTEM,e_CACHE,e_CACHE_CONTENT,e_CACHE_IMAGE, e_CACHE_DB, e_LOG, e_BACKUP, e_CACHE_URL, e_TEMP, e_IMPORT);
|
||||
|
||||
foreach($create_dir as $dr)
|
||||
{
|
||||
|
@@ -470,6 +470,7 @@ class e107
|
||||
$ret['LOGS_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'logs/';
|
||||
$ret['BACKUP_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'backup/';
|
||||
$ret['TEMP_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'temp/';
|
||||
$ret['IMPORT_DIRECTORY'] = $ret['SYSTEM_DIRECTORY'].'import/';
|
||||
//TODO create directories which don't exist.
|
||||
|
||||
return $ret;
|
||||
@@ -2925,7 +2926,7 @@ class e107
|
||||
define('e_LOG', $this->get_override_rel('LOGS'));
|
||||
define('e_BACKUP', $this->get_override_rel('BACKUP'));
|
||||
define('e_TEMP', $this->get_override_rel('TEMP'));
|
||||
|
||||
define('e_IMPORT', $this->get_override_rel('IMPORT'));
|
||||
//
|
||||
// HTTP absolute paths
|
||||
//
|
||||
|
@@ -1940,6 +1940,7 @@ class e_parse extends e_parser
|
||||
'e_WEB_JS/' => '{e_WEB_JS}',
|
||||
'e_WEB_CSS/' => '{e_WEB_CSS}',
|
||||
'e_WEB_IMAGE/' => '{e_WEB_IMAGE}',
|
||||
'e_IMPORT/' => '{e_IMPORT}',
|
||||
// 'e_WEB_PACK/' => '{e_WEB_PACK}',
|
||||
|
||||
'e_BASE/' => '{e_BASE}',
|
||||
@@ -2249,6 +2250,7 @@ class e_parse extends e_parser
|
||||
'{e_MEDIA_IMAGE}' => e_MEDIA_IMAGE,
|
||||
'{e_MEDIA_ICON}' => e_MEDIA_ICON,
|
||||
'{e_AVATAR}' => e_AVATAR,
|
||||
'{e_IMPORT}' => e_IMPORT,
|
||||
'{e_WEB_JS}' => e_WEB_JS,
|
||||
'{e_WEB_CSS}' => e_WEB_CSS,
|
||||
'{e_WEB_IMAGE}' => e_WEB_IMAGE,
|
||||
@@ -2274,6 +2276,7 @@ class e_parse extends e_parser
|
||||
'{e_MEDIA_IMAGE}' => e_MEDIA_IMAGE_ABS,
|
||||
'{e_MEDIA_ICON}' => e_MEDIA_ICON_ABS,
|
||||
'{e_AVATAR}' => e_AVATAR_ABS,
|
||||
'{e_IMPORT}' => e_IMPORT_ABS,
|
||||
'{e_WEB_JS}' => e_JS_ABS,
|
||||
'{e_WEB_CSS}' => e_CSS_ABS,
|
||||
'{e_WEB_IMAGE}' => e_WEB_IMAGE_ABS,
|
||||
@@ -2299,6 +2302,7 @@ class e_parse extends e_parser
|
||||
'{e_MEDIA_IMAGE}' => SITEURLBASE.e_MEDIA_IMAGE_ABS,
|
||||
'{e_MEDIA_ICON}' => SITEURLBASE.e_MEDIA_ICON_ABS,
|
||||
'{e_AVATAR}' => SITEURLBASE.e_AVATAR_ABS,
|
||||
'{e_IMPORT}' => SITEURLBASE.e_IMPORT_ABS,
|
||||
'{e_WEB_JS}' => SITEURLBASE.e_JS_ABS,
|
||||
'{e_WEB_CSS}' => SITEURLBASE.e_CSS_ABS,
|
||||
'{e_WEB_IMAGE}' => SITEURLBASE.e_WEB_IMAGE_ABS,
|
||||
|
@@ -27,7 +27,7 @@ header("Pragma: no-cache");
|
||||
|
||||
// Settings
|
||||
// $targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
|
||||
$targetDir = e_UPLOAD;
|
||||
$targetDir = e_IMPORT;
|
||||
//$targetDir = 'uploads';
|
||||
|
||||
$cleanupTargetDir = true; // Remove old files
|
||||
|
Reference in New Issue
Block a user