mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-31 15:42:03 -04:00
Fixing the issue with breadcrumbs and subfolders; including the link to dashboard by default on all non-dashboard pages.
This commit is contained in:
parent
8d06758734
commit
af2289206f
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
class Utils
|
class Utils
|
||||||
{
|
{
|
||||||
|
public static function basePath() {
|
||||||
|
return substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') + 1);
|
||||||
|
}
|
||||||
|
|
||||||
public static function fatalError($message = false, $exception = false)
|
public static function fatalError($message = false, $exception = false)
|
||||||
{
|
{
|
||||||
if (!$message)
|
if (!$message)
|
||||||
|
@ -163,7 +163,15 @@ HTML::macro('image_data', function($imagePath) {
|
|||||||
|
|
||||||
HTML::macro('breadcrumbs', function() {
|
HTML::macro('breadcrumbs', function() {
|
||||||
$str = '<ol class="breadcrumb">';
|
$str = '<ol class="breadcrumb">';
|
||||||
$crumbs = explode('/', $_SERVER['REQUEST_URI']);
|
|
||||||
|
// Get the breadcrumbs by exploding the current path.
|
||||||
|
$crumbs = explode('/', str_replace(Utils::basePath(), '', $_SERVER['REQUEST_URI']));
|
||||||
|
|
||||||
|
// Include the link to Dashboard by default only if the user is not on the
|
||||||
|
// dashboard page.
|
||||||
|
if (!Request::is('dashboard')) {
|
||||||
|
$str .= '<li>' . link_to('dashboard', 'Dashboard') . '</li>';
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($crumbs as $key => $val)
|
foreach ($crumbs as $key => $val)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user