Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Commit

Permalink
- Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Jan 14, 2018
1 parent a25dd09 commit 24f845c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/IPub/Menu/Filters/Status/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

namespace IPub\Menu\Filters\Status;

use Nette;
use Nette\Application;

use IPub;
use IPub\Menu\Entities;
use IPub\Menu\Filters;

Expand Down Expand Up @@ -99,11 +97,20 @@ public function accept()
private function checkRule($rule) : bool
{
try {
// Try to check rule if is possible
return $this->presenter->isLinkCurrent($rule);
if (is_array($rule)) {
$link = $this->presenter->link($rule[0], $rule[1]);

return $this->presenter->link('this') === $link;

} else {
// Try to check rule if is possible
return $this->presenter->isLinkCurrent($rule);
}

} catch (Application\UI\InvalidLinkException $e) {
// Presenter for checked route does not exists
}

return FALSE;
}
}

0 comments on commit 24f845c

Please sign in to comment.