aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-08-04 17:38:31 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-08-04 17:38:31 +0200
commit1bccc80996e270f928c207cdd3090f4284abaea5 (patch)
treea21569c238cd6928951a86375f03cafbc8a81e88
parentd7e77f64263cb846ce37a02761b8c3e35c048a00 (diff)
downloadnextcloud-server-1bccc80996e270f928c207cdd3090f4284abaea5.tar.gz
nextcloud-server-1bccc80996e270f928c207cdd3090f4284abaea5.zip
hide morelog button if there are no more log entries - bugfix for oc-1398
-rwxr-xr-xsettings/admin.php3
-rw-r--r--settings/ajax/getlog.php2
-rw-r--r--settings/js/log.js3
-rwxr-xr-xsettings/templates/admin.php3
4 files changed, 10 insertions, 1 deletions
diff --git a/settings/admin.php b/settings/admin.php
index 8369ee64e06..bf8e03c13c8 100755
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -18,6 +18,8 @@ $forms=OC_App::getForms('admin');
$htaccessworking=OC_Util::ishtaccessworking();
$entries=OC_Log_Owncloud::getEntries(3);
+$entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
+
function compareEntries($a,$b){
return $b->time - $a->time;
}
@@ -25,6 +27,7 @@ usort($entries, 'compareEntries');
$tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 ));
$tmpl->assign('entries',$entries);
+$tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking',$htaccessworking);
$tmpl->assign('forms',array());
foreach($forms as $form){
diff --git a/settings/ajax/getlog.php b/settings/ajax/getlog.php
index d9e80de37ba..d5af22ac339 100644
--- a/settings/ajax/getlog.php
+++ b/settings/ajax/getlog.php
@@ -14,4 +14,4 @@ $count=(isset($_GET['count']))?$_GET['count']:50;
$offset=(isset($_GET['offset']))?$_GET['offset']:0;
$entries=OC_Log_Owncloud::getEntries($count,$offset);
-OC_JSON::success(array("data" => OC_Util::sanitizeHTML($entries)));
+OC_JSON::success(array("data" => OC_Util::sanitizeHTML($entries), "remain"=>(count(OC_Log_Owncloud::getEntries(1,$offset + $offset)) != 0)?true:false));
diff --git a/settings/js/log.js b/settings/js/log.js
index fe2e92f7a86..04a7bf8b288 100644
--- a/settings/js/log.js
+++ b/settings/js/log.js
@@ -23,6 +23,9 @@ OC.Log={
if(result.status=='success'){
OC.Log.addEntries(result.data);
$('html, body').animate({scrollTop: $(document).height()}, 800);
+ if(!result.remain){
+ $('#moreLog').css('display', 'none');
+ }
}
});
},
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 033cd1a1642..60b9732d7f4 100755
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -52,7 +52,10 @@ if(!$_['htaccessworking']) {
</tr>
<?php endforeach;?>
</table>
+<?php if($_['entriesremain']): ?>
<input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input>
+<?php endif; ?>
+
</fieldset>