mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Merge pull request #3164 from SimSync/issue_3152_public_upload
Fixes #3152 Download / Upload categories problem
This commit is contained in:
@@ -204,7 +204,15 @@ class upload_ui extends e_admin_ui
|
|||||||
$this->getModel()->addValidationError(UPLLAN_62);
|
$this->getModel()->addValidationError(UPLLAN_62);
|
||||||
$new_data['upload_active'] = 0;
|
$new_data['upload_active'] = 0;
|
||||||
return $new_data;
|
return $new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the upload_category contains only integers
|
||||||
|
// Make sure the owner correspondents to the category id
|
||||||
|
list($catOwner, $catID) = explode("__", $new_data['upload_category'], 2);
|
||||||
|
$new_data['upload_category'] = intval($catID);
|
||||||
|
$new_data['upload_owner'] = $catOwner;
|
||||||
|
|
||||||
|
return $new_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -262,7 +270,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 +380,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':
|
||||||
|
@@ -107,7 +107,7 @@ class userUpload
|
|||||||
$catID = null;
|
$catID = null;
|
||||||
$catOwner = null;
|
$catOwner = null;
|
||||||
$file = null;
|
$file = null;
|
||||||
$image = null;
|
$image = '';
|
||||||
$filesize = 0;
|
$filesize = 0;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user