Commit fc3ec2ca authored by dongsheng's avatar dongsheng
Browse files

"MDL-18486, 1. hide toolbar, pagination when doing global searching, 2....

"MDL-18486, 1. hide toolbar, pagination when doing global searching, 2. display empty directory in local pluign"
parent 005789bb
......@@ -923,7 +923,7 @@ abstract class repository {
'size' => 0,
'date' => $filedate,
'path' => array_reverse($path),
'thumbnail' => $CFG->pixpath .'/f/folder.gif'
'thumbnail' => $CFG->pixpath .'/f/folder-32.png'
);
//if ($dynamicmode && $child->is_writable()) {
......@@ -943,8 +943,7 @@ abstract class repository {
//}
//Uncomment this following line if you wanna display all directory ()even empty
//if (!$search || $_filecount || (stristr($tmp['title'], $search) !== false)) {
if ($_filecount) {
if (!$search || $_filecount || (stristr($tmp['title'], $search) !== false)) {
$filecount += $_filecount;
$list[] = $tmp;
}
......@@ -1802,7 +1801,7 @@ function repository_get_client($context, $id = '', $accepted_filetypes = '*', $
.fp-login-form{text-align:center}
.fp-searchbar{float:right}
.fp-viewbar{width:300px;float:left}
.fp-toolbar{padding: .8em;background: #FFFFCC;color:white;text-align:center}
.fp-toolbar{padding: .8em;background: #FFFFCC;color:white;text-align:center;margin: 3px}
.fp-toolbar a{padding: 0 .5em}
.fp-list{list-style-type:none;padding:0;float:left;width:100%;margin:0;}
.fp-list li{border-bottom:1px dotted gray;margin-bottom: 1em;}
......@@ -1847,7 +1846,7 @@ EOD;
'yui_json',
'yui_button',
'yui_selector',
'repository/repository.js'
'repository/repository.src.js'
));
$lang = array();
$lang['title'] = get_string('title', 'repository');
......
This diff is collapsed.
......@@ -147,6 +147,10 @@ var repository_client = (function(){
var r = repository_client.fp[data.client_id];
r.view_staus = 0;
r.fs = data.list;
if (data.gsearch) {
// will be used to hide header and footer
r.gsearch = true;
}
if(r.view_staus) {
repository_client.view_as_list(data.client_id, data.list);
} else {
......@@ -808,6 +812,11 @@ repository_client.print_footer = function(client_id) {
panel.appendChild(footer);
// add repository manage buttons here
var oDiv = document.getElementById('repo-tb-'+client_id);
if(this.fp[client_id].gsearch) {
// reset
this.fp[client_id].gsearch='';
return;
}
if(!fs.nosearch) {
var search = document.createElement('A');
search.href = '###';
......
......@@ -73,6 +73,7 @@
}
}
$listing = array('list'=>$list);
$listing['gsearch'] = true;
$listing['client_id'] = $client_id;
die(json_encode($listing));
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment