diff --git a/e107_admin/image.php b/e107_admin/image.php index fe0bb2dcc..5dd5907a0 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -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_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_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_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'), @@ -174,6 +177,9 @@ class media_cat_ui extends e_admin_ui "download" => "download" ); + // FIXME lan + $this->fields['media_cat_type']['writeParms'] = array('image' => 'Image', 'file' => 'File', 'video' => 'Video'); + if($this->getAction() == 'list') { $this->fields['media_cat_owner']['writeParms'] = $restricted; @@ -207,10 +213,11 @@ class media_cat_ui extends e_admin_ui //$replace = array("_"," ","'",'"',"."); //FIXME Improve //$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); - $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; } diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 669c78389..71f8df6df 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1566,21 +1566,21 @@ class e107plugin { $type = $v['@attributes']['type']; - if($type != 'image' && $type !='file') + if(strpos($type, 'image') !== 0 && strpos($type, 'file') !== 0 && strpos($type, 'video') !== 0) { 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; } $prevType = $type; $data['owner'] = $folder; - $data['category'] = $folder."_".$c; + $data['category'] = $folder."_".$type; $data['title'] = $v['@value']; // $data['type'] = $v['@attributes']['type']; //TODO $data['class'] = 253;