mirror of
https://github.com/e107inc/e107.git
synced 2025-08-09 08:06:38 +02:00
Issue #1974 - Media-Manager file-mode: Added Option to remove selected file. Fixes #1959 - allow for more than one media-category of a particular type during plugin installation. Issue #6 LAN fix on "Choose a file".
This commit is contained in:
@@ -2281,6 +2281,8 @@ class e107plugin
|
||||
case 'install':
|
||||
case 'refresh':
|
||||
$c = 1;
|
||||
$i = array('file'=>1, 'image'=>1, 'video'=>1);
|
||||
|
||||
foreach($tag['mediaCategories']['category'] as $v)
|
||||
{
|
||||
$type = $v['@attributes']['type'];
|
||||
@@ -2290,17 +2292,23 @@ class e107plugin
|
||||
continue;
|
||||
}
|
||||
|
||||
if($c == 4 || ($prevType == $type))
|
||||
if($c == 4)
|
||||
{
|
||||
$mes->addDebug(EPL_ADLAN_244);
|
||||
break;
|
||||
}
|
||||
|
||||
$prevType = $type;
|
||||
// $prevType = $type;
|
||||
|
||||
$data['owner'] = $folder;
|
||||
$data['image'] = vartrue($v['@attributes']['image']);
|
||||
$data['category'] = $folder."_".$type;
|
||||
$data['category'] = $folder."_".$type;
|
||||
|
||||
if($i[$type] > 1)
|
||||
{
|
||||
$data['category'] .= "_".$i[$type];
|
||||
}
|
||||
|
||||
$data['title'] = $v['@value'];
|
||||
$data['sef'] = vartrue($v['@attributes']['sef']);
|
||||
// $data['type'] = $v['@attributes']['type']; //TODO
|
||||
@@ -2309,7 +2317,8 @@ class e107plugin
|
||||
$status = e107::getMedia()->createCategory($data) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
$mes->add("Adding Media Category: {$data['category']}", $status);
|
||||
e107::getMedia()->import($data['category'],e_PLUGIN.$folder, false,'min-size=20000');
|
||||
$c++;
|
||||
$c++;
|
||||
$i[$type]++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
Reference in New Issue
Block a user