From bf1873c60b5400ed2bf9d59e96b69d95904bf40e Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Fri, 6 Aug 2010 05:44:16 +0000 Subject: [PATCH] "MDL-23065, non javascript filepicker, fixed maxfiles condition, improve ui" --- repository/draftfiles_manager.php | 2 +- repository/filepicker.php | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/repository/draftfiles_manager.php b/repository/draftfiles_manager.php index 3b8f7f8db28..8e3d82a10de 100755 --- a/repository/draftfiles_manager.php +++ b/repository/draftfiles_manager.php @@ -275,7 +275,7 @@ default: if ($env == 'filepicker') { $maxfiles = 1; } - if ($filecount < $maxfiles && $maxfiles != -1) { + if ($filecount < $maxfiles || $maxfiles == -1) { echo ' '.get_string('addfile', 'repository').''; } if ($env == 'filemanager') { diff --git a/repository/filepicker.php b/repository/filepicker.php index 7d058911e7a..d2982d39dd8 100755 --- a/repository/filepicker.php +++ b/repository/filepicker.php @@ -98,6 +98,7 @@ $params['draftpath'] = $draftpath; $home_url = new moodle_url('/repository/draftfiles_manager.php', $params); $params['savepath'] = $savepath; +$params['repo_id'] = $repo_id; $url = new moodle_url($CFG->httpswwwroot."/repository/filepicker.php", $params); $PAGE->set_url('/repository/filepicker.php', $params); @@ -168,14 +169,22 @@ case 'sign': } else { if (!empty($list['path'])) { foreach ($list['path'] as $p) { - echo '
'; - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo ' / '; + //echo '
'; + //echo '
'; + //echo '
'; + //echo ''; + //echo '
'; + + $pathurl = new moodle_url($url, array( + 'p'=>$p['path'], + 'action'=>'list', + 'draftpath'=>$draftpath, + 'savepath'=>$savepath + )); + echo '' . html_writer::link($pathurl, $p['name']) . ''; + echo ' / '; } } if (!empty($list['page'])) {