From 6f43f8d6052c236a8f94198ba07d6ebb38765122 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 7 Dec 2016 14:21:14 +0200 Subject: [PATCH] Add links to custom modules --- .env.example | 4 ++-- app/Libraries/ModuleUtils.php | 23 +++++++++++++++++++++++ resources/views/header.blade.php | 8 ++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 app/Libraries/ModuleUtils.php diff --git a/.env.example b/.env.example index 222ca39f15..f233a46556 100644 --- a/.env.example +++ b/.env.example @@ -29,6 +29,7 @@ PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address' LOG=single REQUIRE_HTTPS=false API_SECRET=password +#CUSTOM_MODULES= #TRUSTED_PROXIES= @@ -82,6 +83,5 @@ WEPAY_APP_FEE_MULTIPLIER=0.002 WEPAY_APP_FEE_FIXED=0 WEPAY_THEME='{"name":"Invoice Ninja","primary_color":"0b4d78","secondary_color":"0b4d78","background_color":"f8f8f8","button_color":"33b753"}' # See https://www.wepay.com/developer/reference/structures#theme - BLUEVINE_PARTNER_UNIQUE_ID= -BLUEVINE_PARTNER_TOKEN= \ No newline at end of file +BLUEVINE_PARTNER_TOKEN= diff --git a/app/Libraries/ModuleUtils.php b/app/Libraries/ModuleUtils.php new file mode 100644 index 0000000000..53db3f2309 --- /dev/null +++ b/app/Libraries/ModuleUtils.php @@ -0,0 +1,23 @@ +url = $module; + $data[] = $info; + } + } + + session(['custom_modules' => $data]); + + return $data; + } +} diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index 528ba9f798..7ff815970e 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -423,6 +423,14 @@ 'selected' => true, ]) @endif + @if ( ! Utils::isNinjaProd()) + @if ($modules = session('custom_modules') ?: App\Libraries\ModuleUtils::loadModules()) +
  • + @foreach ($modules as $module) +
  • {{ link_to($module->url, $module->name) }}
  • + @endforeach + @endif + @endif
  • @if (Utils::isAdmin()) @if (count(session(SESSION_USER_ACCOUNTS)) > 1)