Moved file manager to the image element
This commit is contained in:
parent
7739eefea1
commit
74003bf0bb
4 changed files with 37 additions and 22 deletions
|
@ -41,11 +41,6 @@ class mod_customcert_edit_form extends moodleform {
|
|||
*/
|
||||
private $numpages = 1;
|
||||
|
||||
/**
|
||||
* The filemanager options.
|
||||
*/
|
||||
private $filemanageroptions = array();
|
||||
|
||||
/**
|
||||
* Form definition.
|
||||
*/
|
||||
|
@ -53,9 +48,6 @@ class mod_customcert_edit_form extends moodleform {
|
|||
global $DB;
|
||||
|
||||
$this->id = $this->_customdata['customcertid'];
|
||||
$this->filemanageroptions = array('maxbytes' => $this->_customdata['course']->maxbytes,
|
||||
'subdirs' => 1,
|
||||
'accepted_types' => 'image');
|
||||
|
||||
$mform =& $this->_form;
|
||||
|
||||
|
@ -71,10 +63,6 @@ class mod_customcert_edit_form extends moodleform {
|
|||
|
||||
$mform->addElement('submit', 'addcertpage', get_string('addcertpage', 'customcert'));
|
||||
|
||||
$mform->addElement('header', 'uploadimage', get_string('uploadimage', 'customcert'));
|
||||
|
||||
$mform->addElement('filemanager', 'customcertimage', get_string('uploadimage', 'customcert'), '', $this->filemanageroptions);
|
||||
|
||||
$mform->closeHeaderBefore('submitbtn');
|
||||
|
||||
// Add the submit buttons.
|
||||
|
@ -99,12 +87,6 @@ class mod_customcert_edit_form extends moodleform {
|
|||
|
||||
$mform = $this->_form;
|
||||
|
||||
// Editing existing instance - copy existing files into draft area.
|
||||
$draftitemid = file_get_submitted_draft_itemid('customcertimage');
|
||||
file_prepare_draft_area($draftitemid, context_course::instance($this->_customdata['course']->id)->id, 'mod_customcert', 'image', 0, $this->filemanageroptions);
|
||||
$element = $mform->getElement('customcertimage');
|
||||
$element->setValue($draftitemid);
|
||||
|
||||
// Check that we are updating a current customcert.
|
||||
if ($this->id) {
|
||||
// Get the pages for this customcert.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue