mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
media manager category types
This commit is contained in:
@@ -155,7 +155,10 @@ class media_cat_ui extends e_admin_ui
|
|||||||
'media_cat_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'nolist'=>true, 'forced'=> TRUE, 'readonly'=>TRUE),
|
'media_cat_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'nolist'=>true, 'forced'=> TRUE, 'readonly'=>TRUE),
|
||||||
'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
|
'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
|
||||||
'media_cat_owner' => array('title'=> "Owner", 'type' => 'dropdown', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
'media_cat_owner' => array('title'=> "Owner", 'type' => 'dropdown', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
||||||
'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
|
|
||||||
|
'media_cat_type' => array('title'=> "Type", 'type' => 'radio', 'data'=>false, 'width' => 'auto', 'thclass' => 'left', 'validate' => true, 'nolist'=>true),
|
||||||
|
|
||||||
|
'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
|
||||||
'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
||||||
'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
|
'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
|
||||||
'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int'),
|
'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int'),
|
||||||
@@ -174,6 +177,9 @@ class media_cat_ui extends e_admin_ui
|
|||||||
"download" => "download"
|
"download" => "download"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// FIXME lan
|
||||||
|
$this->fields['media_cat_type']['writeParms'] = array('image' => 'Image', 'file' => 'File', 'video' => 'Video');
|
||||||
|
|
||||||
if($this->getAction() == 'list')
|
if($this->getAction() == 'list')
|
||||||
{
|
{
|
||||||
$this->fields['media_cat_owner']['writeParms'] = $restricted;
|
$this->fields['media_cat_owner']['writeParms'] = $restricted;
|
||||||
@@ -207,10 +213,11 @@ class media_cat_ui extends e_admin_ui
|
|||||||
|
|
||||||
//$replace = array("_"," ","'",'"',"."); //FIXME Improve
|
//$replace = array("_"," ","'",'"',"."); //FIXME Improve
|
||||||
//$new_data['media_cat_category'] = str_replace($replace,"-",$new_data['media_cat_category']);
|
//$new_data['media_cat_category'] = str_replace($replace,"-",$new_data['media_cat_category']);
|
||||||
|
$type = $this->getRequest()->getPosted('media_cat_type', 'image').'_';
|
||||||
|
|
||||||
$increment = ($this->ownerCount[$new_data['media_cat_owner']] +1);
|
$increment = ($this->ownerCount[$new_data['media_cat_owner']] +1);
|
||||||
$new_data['media_cat_category'] = $new_data['media_cat_owner']."_".$increment;
|
$new_data['media_cat_category'] = $new_data['media_cat_owner'].'_'.$type.$increment;
|
||||||
|
//print_a($new_data); exit;
|
||||||
return $new_data;
|
return $new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1566,21 +1566,21 @@ class e107plugin
|
|||||||
{
|
{
|
||||||
$type = $v['@attributes']['type'];
|
$type = $v['@attributes']['type'];
|
||||||
|
|
||||||
if($type != 'image' && $type !='file')
|
if(strpos($type, 'image') !== 0 && strpos($type, 'file') !== 0 && strpos($type, 'video') !== 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($c == 3 || ($prevType == $type))
|
if($c == 4 || ($prevType == $type))
|
||||||
{
|
{
|
||||||
$mes->addDebug("Only 2 Media Categories are permitted during install. One for images and one for files.");
|
$mes->addDebug("Only 3 Media Categories are permitted during install. One for images and one for files.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$prevType = $type;
|
$prevType = $type;
|
||||||
|
|
||||||
$data['owner'] = $folder;
|
$data['owner'] = $folder;
|
||||||
$data['category'] = $folder."_".$c;
|
$data['category'] = $folder."_".$type;
|
||||||
$data['title'] = $v['@value'];
|
$data['title'] = $v['@value'];
|
||||||
// $data['type'] = $v['@attributes']['type']; //TODO
|
// $data['type'] = $v['@attributes']['type']; //TODO
|
||||||
$data['class'] = 253;
|
$data['class'] = 253;
|
||||||
|
Reference in New Issue
Block a user