diff --git a/blocks/private_files/lang/en/block_private_files.php b/blocks/private_files/lang/en/block_private_files.php index 51abdcc195d..f13e21fcf5e 100644 --- a/blocks/private_files/lang/en/block_private_files.php +++ b/blocks/private_files/lang/en/block_private_files.php @@ -26,4 +26,3 @@ $string['managemyfiles'] = 'Manage my files'; $string['pluginname'] = 'User private files'; $string['privatefiles'] = 'Private files'; -$string['nofiles'] = 'There are no files added yet, please click "Manage my private file" button to add files'; diff --git a/blocks/private_files/renderer.php b/blocks/private_files/renderer.php index b9bbbec6ca2..5c27971e55a 100644 --- a/blocks/private_files/renderer.php +++ b/blocks/private_files/renderer.php @@ -40,7 +40,7 @@ class block_private_files_renderer extends plugin_renderer_base { public function render_private_files_tree(private_files_tree $tree) { $module = array('name'=>'block_private_files', 'fullpath'=>'/blocks/private_files/module.js', 'requires'=>array('yui2-treeview')); if (empty($tree->dir['subdirs']) && empty($tree->dir['files'])) { - $html = $this->output->box(get_string('nofiles', 'block_private_files')); + $html = $this->output->box(get_string('nofilesavailable', 'repository')); } else { $htmlid = 'private_files_tree_'.uniqid(); $this->page->requires->js_init_call('M.block_private_files.init_tree', array(false, $htmlid)); diff --git a/user/renderer.php b/user/renderer.php index 9b0939275a5..73212d51697 100644 --- a/user/renderer.php +++ b/user/renderer.php @@ -38,13 +38,16 @@ class core_user_renderer extends plugin_renderer_base { } public function render_user_files_tree(user_files_tree $tree) { - $htmlid = 'user_files_tree_'.uniqid(); - $module = array('name'=>'core_user', 'fullpath'=>'/user/module.js'); - $this->page->requires->js_init_call('M.core_user.init_tree', array(false, $htmlid), false, $module); - - $html = '
'; - $html .= $this->htmllize_tree($tree, $tree->dir); - $html .= '
'; + if (empty($tree->dir['subdirs']) && empty($tree->dir['files'])) { + $html = $this->output->box(get_string('nofilesavailable', 'repository')); + } else { + $htmlid = 'user_files_tree_'.uniqid(); + $module = array('name'=>'core_user', 'fullpath'=>'/user/module.js'); + $this->page->requires->js_init_call('M.core_user.init_tree', array(false, $htmlid), false, $module); + $html = '
'; + $html .= $this->htmllize_tree($tree, $tree->dir); + $html .= '
'; + } return $html; }