From e7e51734d7a63b6ae7a36946b6200078212b3d5d Mon Sep 17 00:00:00 2001 From: SecretR Date: Wed, 9 Jan 2013 10:49:33 +0200 Subject: [PATCH] #9 related - use type comma on media manager page; multiselect "selected" fix --- e107_admin/image.php | 8 ++++++-- e107_handlers/form_handler.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index 5700600a2..8cfc47178 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -543,6 +543,7 @@ class media_form_ui extends e_admin_form_ui +/* function media_category($curVal,$mode) // not really necessary since we can use 'dropdown' - but just an example of a custom function. { @@ -575,9 +576,10 @@ class media_form_ui extends e_admin_form_ui } $text .= ""; return $text; - } + }*/ } + class media_admin_ui extends e_admin_ui { @@ -608,7 +610,7 @@ class media_admin_ui extends e_admin_ui 'checkboxes' => array('title'=> '', 'type' => null, 'data'=> null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), 'media_id' => array('title'=> LAN_ID, 'type' => 'number', 'data'=> 'int', 'width' =>'5%', 'forced'=> TRUE, 'nolist'=>TRUE), 'media_url' => array('title'=> 'Preview', 'type' => 'image', 'data'=> 'str', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>TRUE, 'writeParms'=>'thumb=180&thumb_urlraw=0&thumb_aw=180', 'width' => '110px'), - 'media_category' => array('title'=> LAN_CATEGORY, 'type' => 'method', 'data'=> 'comma', 'width' => 'auto', 'filter' => true, 'batch' => true,'writeParms'=>'multiple=1'), + 'media_category' => array('title'=> LAN_CATEGORY, 'type' => 'comma', 'data'=> 'str', 'width' => 'auto', 'filter' => true, 'batch' => true), // Upload should be managed completely separately via upload-handler. // 'media_upload' => array('title'=> "Upload File", 'type' => 'upload', 'data'=> false, 'readParms' => 'hidden', 'writeParms' => 'disable_button=1', 'width' => '10%', 'nolist' => true), @@ -749,6 +751,8 @@ class media_admin_ui extends e_admin_ui $this->cats[$cat] = $row['media_cat_title']; } asort($this->cats); + + $this->fields['media_category']['writeParms'] = $this->cats; $pref = e107::getPref(); $tp = e107::getParser(); diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index f7c64d05b..d941306df 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -1034,7 +1034,7 @@ class e_form if(vartrue($options['multiple'])) { $name = (strpos($name, '[') === false) ? $name.'[]' : $name; - $selected = explode(",",$selected); + if(!is_array($selected)) $selected = explode(",",$selected); } $text = $this->select_open($name, $options)."\n";