Skip to content

Commit

Permalink
Merge pull request #7 from ixiam/dev-navigation
Browse files Browse the repository at this point in the history
hide nav if there's no link
  • Loading branch information
adixon authored Sep 4, 2018
2 parents 7a80458 + 0b52ab2 commit de4f408
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions CRM/Logviewer/Page/LogViewEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,17 @@ public function run() {
}
fclose($handle);

$prev_url = !$prevLine ? '#' : CRM_Utils_System::url('civicrm/admin/logviewer/logentry', $query = 'lineNumber='.$prevLine);
$next_url = !$nextLine ? '#' : CRM_Utils_System::url('civicrm/admin/logviewer/logentry', $query = 'lineNumber='.$nextLine);
$this->assign('prevURL', $prev_url);
$this->assign('nextURL', $next_url);
$prev_a = $next_a = '';
if($prevLine){
$prev_url = CRM_Utils_System::url('civicrm/admin/logviewer/logentry', $query = 'lineNumber='.$prevLine);
$prev_a = '<a href="'.$prev_url.'">&#60;&#60; Prev</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
}
if($nextLine){
$next_url = CRM_Utils_System::url('civicrm/admin/logviewer/logentry', $query = 'lineNumber='.$nextLine);
$next_a = '<a href="'.$next_url.'">Next &#62;&#62;</a>';
}
$this->assign('prevURL', $prev_a);
$this->assign('nextURL', $next_a);
$this->assign('logEntry', $entry);

parent::run();
Expand Down
4 changes: 2 additions & 2 deletions templates/CRM/Logviewer/Page/LogViewEntry.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a href="{$prevURL}"><< Prev</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{$nextURL}">Next >></a>
{$prevURL}{$nextURL}
<br />
<h3>Log Entry for {$dateTime}</h3>
{literal}<script>hljs.initHighlightingOnLoad();</script>{/literal}
<pre class="prettyprint"><code>{$logEntry}</code></pre>
<a href="{$prevURL}"><< Prev</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{$nextURL}">Next >></a>
{$prevURL}{$nextURL}

0 comments on commit de4f408

Please sign in to comment.