diff --git a/app/helpers.php b/app/helpers.php index eadd706b..8eb45b72 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -54,11 +54,19 @@ if (!function_exists('skin_view')) { /** * Render a skin * @param $template + * @param array $vars + * @param array $merge_data * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ function skin_view($template, array $vars = [], $merge_data = []) { + # Add the current skin name so we don't need to hardcode it in the templates + # Makes it a bit easier to create a new skin by modifying an existing one + $merge_data['SKIN_NAME'] = config('phpvms.skin'); $tpl = 'layouts/' . config('phpvms.skin') . '/' . $template; + + # TODO: Look for an overridden template in a special folder + return view($tpl, $vars, $merge_data); } } diff --git a/resources/views/layouts/default/acars/index.blade.php b/resources/views/layouts/default/acars/index.blade.php index 2c4eecbf..0c0b54f8 100644 --- a/resources/views/layouts/default/acars/index.blade.php +++ b/resources/views/layouts/default/acars/index.blade.php @@ -1,6 +1,6 @@ -@extends('layouts.default.app') - +@extends("layouts.${SKIN_NAME}.app") @section('title', 'live map') + @section('content') {{ Widget::liveMap() }} @endsection diff --git a/resources/views/layouts/default/app.blade.php b/resources/views/layouts/default/app.blade.php index 3edbd086..8edd5534 100644 --- a/resources/views/layouts/default/app.blade.php +++ b/resources/views/layouts/default/app.blade.php @@ -48,7 +48,7 @@
@@ -57,7 +57,7 @@{{ $errors->first('password_confirmation') }}
@endif - @include('layouts.default.auth.toc') + @include("layouts.${SKIN_NAME}.auth.toc")Your application has been submitted. It requires staff member approval, once a staff member has reviewed your application, you will receive an email confirmation.
++ Your application has been submitted. It requires staff member approval, once a + staff member has reviewed your application, you will receive an email confirmation. +
Well, this is embarrassing, you are not authorized to access or perform this function. Click here to go back to the home page.
++ Well, this is embarrassing, you are not authorized to access or perform this function. + Click here to go back to the home page. +
Well, this is embarrassing, the page you requested does not exist. Click here to go back to the home page. - -{{ $exception->getMessage() }} -
++ Well, this is embarrassing, the page you requested does not exist. + Click here to go back to the home page. + {{ $exception->getMessage() }} +