Skip to content

Commit

Permalink
Factored out an if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
roccivic committed Oct 30, 2012
1 parent dd918ca commit 53a3132
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions libraries/navigation/NavigationTree.class.php
Expand Up @@ -526,11 +526,8 @@ public function renderPath()
$this->groupTree();
$retval = "<div class='list_container' style='display: none;'>";
$retval .= "<ul>";
if (($node->real_name == 'tables' || $node->real_name == 'views')
&& $node->numChildren() >= (int)$GLOBALS['cfg']['LeftDisplayTableFilterMinimum']) {
// fast filter
$retval .= $this->fastFilterHtml();
}

$retval .= $this->fastFilterHtml($node);

if ($node->type == Node::CONTAINER && ! $node->is_group) {
$retval .= $this->getPageSelector($node);
Expand Down Expand Up @@ -726,11 +723,7 @@ public function renderNode($node, $recursive = -1, $class = '')
if ($wrap) {
$retval .= "<div$hide class='list_container'><ul>";
}
if (($node->real_name == 'tables' || $node->real_name == 'views')
&& $node->numChildren() >= (int)$GLOBALS['cfg']['LeftDisplayTableFilterMinimum']
) {
$retval .= $this->fastFilterHtml();
}
$retval .= $this->fastFilterHtml($node);
if ($node->type == Node::CONTAINER && ! $node->is_group) {
$retval .= $this->getPageSelector($node);
}
Expand Down Expand Up @@ -766,14 +759,21 @@ private function setVisibility()
/**
* Generates the HTML code for displaying the fast filter for tables
*
* @param Node $node The node for which to generate the fast filter html
*
* @return string LI element used for the fast filter
*/
private function fastFilterHtml()
private function fastFilterHtml($node)
{
$retval = "<li class='fast_filter'>";
$retval .= "<input value='" . __('filter tables by name') . "' />";
$retval .= "<span title='" . __('Clear Fast Filter') . "'>X</span>";
$retval .= "</li>";
$retval = '';
if (($node->real_name == 'tables' || $node->real_name == 'views')
&& $node->realParent()->getPresence($node->real_name) >= (int)$GLOBALS['cfg']['LeftDisplayTableFilterMinimum']
) {
$retval .= "<li class='fast_filter'>";
$retval .= "<input value='" . __('filter tables by name') . "' />";
$retval .= "<span title='" . __('Clear Fast Filter') . "'>X</span>";
$retval .= "</li>";
}
return $retval;
}

Expand Down

0 comments on commit 53a3132

Please sign in to comment.