mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Possible fix for issue e107inc/e107#3152
Makes the category field editable (dropdown) so a download category can be assigned.
This commit is contained in:
parent
82a662b13c
commit
3a228c0181
@ -204,7 +204,18 @@ class upload_ui extends e_admin_ui
|
||||
$this->getModel()->addValidationError(UPLLAN_62);
|
||||
$new_data['upload_active'] = 0;
|
||||
return $new_data;
|
||||
}
|
||||
}
|
||||
// Make sure the upload_category contains only integers
|
||||
if (substr($new_data['upload_category'], 0, 10) == 'download__')
|
||||
{
|
||||
$new_data['upload_category'] = intval(substr($new_data['upload_category'], 10));
|
||||
}
|
||||
// Make sure the owner is not empty
|
||||
if (trim($new_data['upload_owner']) == '')
|
||||
{
|
||||
$new_data['upload_owner'] = 'download';
|
||||
}
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -262,7 +273,8 @@ class upload_ui extends e_admin_ui
|
||||
return 0;
|
||||
}
|
||||
|
||||
$owner = varset($upload['upload_owner'], 'download');
|
||||
// Make sure the owner is not empty
|
||||
$owner = vartrue($upload['upload_owner'], 'download');
|
||||
|
||||
$uploadObj = e107::getAddon($owner,'e_upload');
|
||||
|
||||
@ -371,7 +383,9 @@ class upload_form_ui extends e_admin_form_ui
|
||||
|
||||
case 'write':
|
||||
$owner = $this->getController()->getModel()->get('upload_owner');
|
||||
return $value."-- ".$owner; // $this->radio_switch('upload_active', $value, LAN_ACCEPT, LAN_PENDING, $options);
|
||||
//return $value."-- ".$owner; // $this->radio_switch('upload_active', $value, LAN_ACCEPT, LAN_PENDING, $options);
|
||||
// make category editable instead of just displaying data
|
||||
return e107::getForm()->select('upload_category', $opts, $value);
|
||||
break;
|
||||
|
||||
case 'batch':
|
||||
|
Loading…
x
Reference in New Issue
Block a user