mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 04:33:13 +01:00
"MDL-21906, disable filepicker for editor during installation"
This commit is contained in:
parent
bd0f26bd05
commit
137bbbc620
@ -986,6 +986,7 @@ $string['makeeditable'] = 'If you make \'$a\' editable by the web server process
|
||||
$string['manageblocks'] = 'Blocks';
|
||||
$string['managecourses'] = 'Manage courses';
|
||||
$string['managedatabase'] = 'Database';
|
||||
$string['manageeditorfiles'] = 'Manage files used by editor';
|
||||
$string['managefilters'] = 'Filters';
|
||||
$string['managemeta'] = 'Is this a meta course?';
|
||||
$string['managemetadisabled'] = 'This is disabled because this course is already in a meta course';
|
||||
|
@ -201,18 +201,21 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
||||
$str .= '</select>';
|
||||
$str .= '</div>';
|
||||
|
||||
if ($maxfiles != 0 ) { // 0 means no files, -1 unlimited
|
||||
$str .= '<div><input type="hidden" name="'.$elname.'[itemid]" value="'.$draftitemid.'" /></div>';
|
||||
/// embedded image files - TODO: hide on the fly when switching editors
|
||||
$str .= '<div id="'.$id.'_filemanager">';
|
||||
$editorurl = "$CFG->wwwroot/repository/filepicker.php?action=browse&env=editor&itemid=$draftitemid&subdirs=$subdirs&maxbytes=$maxbytes&ctx_id=".$ctx->id.'&course='.$PAGE->course->id;
|
||||
$str .= '<object type="text/html" data="'.$editorurl.'" height="160" width="600" style="border:1px solid #000">Error</object>'; // TODO: localise, fix styles, etc.
|
||||
$str .= '</div>';
|
||||
} else {
|
||||
// should disable file picker
|
||||
//$str .= 'No file allowed';
|
||||
// during moodle installation, user area doesn't exist
|
||||
// so we need to disable filepicker here.
|
||||
if (!during_initial_install() && empty($CFG->adminsetuppending)) {
|
||||
// 0 means no files, -1 unlimited
|
||||
if ($maxfiles != 0 ) {
|
||||
$str .= '<div><input type="hidden" name="'.$elname.'[itemid]" value="'.$draftitemid.'" /></div>';
|
||||
$str .= '<div id="'.$id.'_filemanager">';
|
||||
$editorurl = "$CFG->wwwroot/repository/filepicker.php?action=browse&env=editor&itemid=$draftitemid&subdirs=$subdirs&maxbytes=$maxbytes&ctx_id=".$ctx->id.'&course='.$PAGE->course->id;
|
||||
$str .= html_writer::link($editorurl, get_string('manageeditorfiles'), array('target'=>'_blank'));
|
||||
//$str .= '<object type="text/html" data="'.$editorurl.'" height="160" width="600" style="border:1px solid #000">Error</object>';
|
||||
$str .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$str .= '</div>';
|
||||
|
||||
return $str;
|
||||
|
Loading…
x
Reference in New Issue
Block a user