mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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
|
LOG=single
|
||||||
REQUIRE_HTTPS=false
|
REQUIRE_HTTPS=false
|
||||||
API_SECRET=password
|
API_SECRET=password
|
||||||
|
#CUSTOM_MODULES=
|
||||||
|
|
||||||
#TRUSTED_PROXIES=
|
#TRUSTED_PROXIES=
|
||||||
|
|
||||||
@ -82,6 +83,5 @@ WEPAY_APP_FEE_MULTIPLIER=0.002
|
|||||||
WEPAY_APP_FEE_FIXED=0
|
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
|
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_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,
|
'selected' => true,
|
||||||
])
|
])
|
||||||
@endif
|
@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>
|
<li class="divider"></li>
|
||||||
@if (Utils::isAdmin())
|
@if (Utils::isAdmin())
|
||||||
@if (count(session(SESSION_USER_ACCOUNTS)) > 1)
|
@if (count(session(SESSION_USER_ACCOUNTS)) > 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user