Skip to content
Snippets Groups Projects
Commit 4d3c45a8 authored by Georg Ehrke's avatar Georg Ehrke Committed by Jörn Friedrich Dreyer
Browse files

backport 1bccc809

parent f86f4c8b
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,8 @@ $forms=OC_App::getForms('admin'); ...@@ -18,6 +18,8 @@ $forms=OC_App::getForms('admin');
$htaccessworking=OC_Util::ishtaccessworking(); $htaccessworking=OC_Util::ishtaccessworking();
$entries=OC_Log_Owncloud::getEntries(3); $entries=OC_Log_Owncloud::getEntries(3);
$entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
function compareEntries($a,$b){ function compareEntries($a,$b){
return $b->time - $a->time; return $b->time - $a->time;
} }
...@@ -25,6 +27,7 @@ usort($entries, 'compareEntries'); ...@@ -25,6 +27,7 @@ usort($entries, 'compareEntries');
$tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 )); $tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 ));
$tmpl->assign('entries',OC_Util::sanitizeHTML($entries)); $tmpl->assign('entries',OC_Util::sanitizeHTML($entries));
$tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking',$htaccessworking); $tmpl->assign('htaccessworking',$htaccessworking);
$tmpl->assign('forms',array()); $tmpl->assign('forms',array());
foreach($forms as $form){ foreach($forms as $form){
......
...@@ -14,4 +14,4 @@ $count=(isset($_GET['count']))?$_GET['count']:50; ...@@ -14,4 +14,4 @@ $count=(isset($_GET['count']))?$_GET['count']:50;
$offset=(isset($_GET['offset']))?$_GET['offset']:0; $offset=(isset($_GET['offset']))?$_GET['offset']:0;
$entries=OC_Log_Owncloud::getEntries($count,$offset); $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));
...@@ -23,6 +23,9 @@ OC.Log={ ...@@ -23,6 +23,9 @@ OC.Log={
if(result.status=='success'){ if(result.status=='success'){
OC.Log.addEntries(result.data); OC.Log.addEntries(result.data);
$('html, body').animate({scrollTop: $(document).height()}, 800); $('html, body').animate({scrollTop: $(document).height()}, 800);
if(!result.remain){
$('#moreLog').css('display', 'none');
}
} }
}); });
}, },
......
...@@ -50,5 +50,8 @@ if(!$_['htaccessworking']) { ...@@ -50,5 +50,8 @@ if(!$_['htaccessworking']) {
</tr> </tr>
<?php endforeach;?> <?php endforeach;?>
</table> </table>
<?php if($_['entriesremain']): ?>
<input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input> <input id='moreLog' type='button' value='<?php echo $l->t('More');?>...'></input>
<?php endif; ?>
</fieldset> </fieldset>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment