mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02: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:
@@ -205,6 +205,17 @@ class upload_ui extends e_admin_ui
|
|||||||
$new_data['upload_active'] = 0;
|
$new_data['upload_active'] = 0;
|
||||||
return $new_data;
|
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;
|
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');
|
$uploadObj = e107::getAddon($owner,'e_upload');
|
||||||
|
|
||||||
@@ -371,7 +383,9 @@ class upload_form_ui extends e_admin_form_ui
|
|||||||
|
|
||||||
case 'write':
|
case 'write':
|
||||||
$owner = $this->getController()->getModel()->get('upload_owner');
|
$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;
|
break;
|
||||||
|
|
||||||
case 'batch':
|
case 'batch':
|
||||||
|
Reference in New Issue
Block a user