3 require('../../../../config.php');
4 require('../../lib.php');
6 $choose = required_param('choose', PARAM_FILE
);
10 if (!$CFG->resource_allowlocalfiles
) {
11 error('You cannot access this script');
14 print_header(get_string('localfilechoose', 'resource'));
16 print_simple_box(get_string('localfileinfo', 'resource'), 'center');
19 <script type
="text/javascript">
21 function set_value(txt
) {
22 if (txt
.indexOf('/') > -1) {
23 path
= txt
.substring(txt
.indexOf('/'),txt
.length
);
24 } else if (txt
.indexOf('\\') > -1) {
25 path
= txt
.substring(txt
.indexOf('\\'),txt
.length
);
29 opener
.document
.getElementById('<?php echo $choose ?>').value
= '<?php p(RESOURCE_LOCALPATH) ?>'+path
;
36 <div align
="center" class="form">
38 <fieldset
class="invisiblefieldset">
39 <input type
="file" size
="60" name
="myfile" /><br
/>
40 <input type
="button" value
="<?php print_string('localfileselect','resource') ?>"
41 onClick
="return set_value(getElementById('myform').myfile.value)">
42 <input type
="button" value
="<?php print_string('cancel') ?>"
43 onClick
="window.close()">
49 print_footer('empty');