Fix menu view.

This commit is contained in:
James Cole 2018-05-29 06:30:25 +02:00
parent 4ad68b7dfa
commit 0a007b1e6e
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 5 additions and 3 deletions

View File

@ -297,8 +297,10 @@ class AccountController extends Controller
throw new FireflyException('End is after start!'); // @codeCoverageIgnore
}
$what = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type)); // used for menu
$today = new Carbon;
$subTitleIcon = config('firefly.subIconsByIdentifier.' . $account->accountType->type);
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$currencyId = (int)$this->repository->getMetaValue($account, 'currency_id');
@ -320,7 +322,7 @@ class AccountController extends Controller
return view(
'accounts.show',
compact('account', 'showAll', 'currency', 'today', 'periods', 'subTitleIcon', 'transactions', 'subTitle', 'start', 'end', 'chartUri')
compact('account', 'showAll', 'what', 'currency', 'today', 'periods', 'subTitleIcon', 'transactions', 'subTitle', 'start', 'end', 'chartUri')
);
}

View File

@ -106,7 +106,7 @@ class General extends Twig_Extension
$what = $args[2]; // name of the route.
$activeWhat = $context['what'] ?? false;
if ($what === $activeWhat && !(false === strpos(Route::getCurrentRoute()->getName(), $route))) {
if ($what === $activeWhat && !(false === stripos(Route::getCurrentRoute()->getName(), $route))) {
return 'active';
}