3 require('../../../../config.php');
4 require('../../lib.php');
6 $pathname = optional_param('pathname', '');
9 if (confirm_sesskey()) {
10 set_user_preference('resource_localpath', $pathname);
13 <script type
="text/javascript">
22 print_header(get_string('localfilechoose', 'resource'));
24 print_simple_box(get_string('localfilepath', 'resource', $CFG->wwwroot
.'/user/edit.php?course='.SITEID
), 'center');
27 <script type
="text/javascript">
29 function set_value(txt
) {
30 if (txt
.indexOf('/') > -1) {
31 txt
= txt
.substring(0,txt
.lastIndexOf('/'));
32 } else if (txt
.indexOf('\\') > -1) {
33 txt
= txt
.substring(0,txt
.lastIndexOf('\\'));
35 getElementById('myform').pathname
.value
= txt
;
36 getElementById('myform').submit();
42 <div align
="center" class="form">
43 <form id
="myform" action
="localpath.php" method
="post">
44 <fieldset
class="invisiblefieldset">
45 <input type
="hidden" name
="sesskey" value
="<?php echo sesskey(); ?>">
46 <input type
="hidden" name
="pathname" value
="" />
47 <input type
="file" size
="60" name
="myfile" /><br
/>
48 <input type
="button" value
="<?php print_string('localfileselect','resource') ?>"
49 onClick
="return set_value(getElementById('myform').myfile.value)">
50 <input type
="button" value
="<?php print_string('cancel') ?>"
51 onClick
="window.close()">
56 print_footer('empty');