mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-17 16:42:48 +01:00
Add links to custom modules
This commit is contained in:
parent
dbdb9a0b4a
commit
6f43f8d605
@ -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=
|
||||
BLUEVINE_PARTNER_TOKEN=
|
||||
|
23
app/Libraries/ModuleUtils.php
Normal file
23
app/Libraries/ModuleUtils.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php namespace App\Libraries;
|
||||
|
||||
class ModuleUtils
|
||||
{
|
||||
public static function loadModules()
|
||||
{
|
||||
$data = [];
|
||||
$modules = env('CUSTOM_MODULES');
|
||||
$modules = explode(',', $modules);
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$info = CurlUtils::get($module . '?action=info');
|
||||
if ($info = json_decode($info)) {
|
||||
$info->url = $module;
|
||||
$data[] = $info;
|
||||
}
|
||||
}
|
||||
|
||||
session(['custom_modules' => $data]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -423,6 +423,14 @@
|
||||
'selected' => true,
|
||||
])
|
||||
@endif
|
||||
@if ( ! Utils::isNinjaProd())
|
||||
@if ($modules = session('custom_modules') ?: App\Libraries\ModuleUtils::loadModules())
|
||||
<li class="divider"></li>
|
||||
@foreach ($modules as $module)
|
||||
<li>{{ link_to($module->url, $module->name) }}</li>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
<li class="divider"></li>
|
||||
@if (Utils::isAdmin())
|
||||
@if (count(session(SESSION_USER_ACCOUNTS)) > 1)
|
||||
|
Loading…
Reference in New Issue
Block a user