From 7bb31e14882d9eb97260361c04f1b48eeec6b81e Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 00:26:01 -0600 Subject: [PATCH 01/10] Changing configs to publish instead of set --- .../Bootstrap/BootstrapServiceProvider.php | 178 +++++++++--------- 1 file changed, 88 insertions(+), 90 deletions(-) diff --git a/src/NukaCode/Bootstrap/BootstrapServiceProvider.php b/src/NukaCode/Bootstrap/BootstrapServiceProvider.php index 3bab85a..22fac15 100755 --- a/src/NukaCode/Bootstrap/BootstrapServiceProvider.php +++ b/src/NukaCode/Bootstrap/BootstrapServiceProvider.php @@ -4,103 +4,101 @@ class BootstrapServiceProvider extends BaseServiceProvider { - /** - * Indicates if loading of the provider is deferred. - * - * @var bool - */ - protected $defer = false; + /** + * Indicates if loading of the provider is deferred. + * + * @var bool + */ + protected $defer = false; - const version = '1.0.0'; + const version = '1.0.0'; - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->shareWithApp(); - $this->setConfig(); - $this->registerViews(); - $this->registerAliases(); - $this->registerArtisanCommands(); - } + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + $this->shareWithApp(); + $this->setPublishGroups(); + $this->registerViews(); + $this->registerAliases(); + $this->registerArtisanCommands(); + } - /** - * Share the package with application - * - * @return void - */ - protected function shareWithApp() - { - $this->app['bootstrap'] = $this->app->share(function ($app) { - return true; - }); - } + /** + * Share the package with application + * + * @return void + */ + protected function shareWithApp() + { + $this->app['bootstrap'] = $this->app->share(function ($app) { + return true; + }); + } - /** - * Load the config for the package - * - * @return void - */ - protected function setConfig() - { - $this->app['config']->set( - [ - 'nukacode' => [ - 'bootstrap' => $this->getConfig() - ] - ] - ); - } + /** + * Load the config for the package + * + * @return void + */ + protected function setPublishGroups() + { + $this->publishes( + [ + __DIR__ . '/../../config/config.php' => config_path('nukacode-frontend.php') + ], 'config' + ); + } - /** - * Register views - * - * @return void - */ - protected function registerViews() - { - $this->app['view']->addLocation(__DIR__ . '/../../views'); - } + /** + * Register views + * + * @return void + */ + protected function registerViews() + { + $this->app['view']->addLocation(__DIR__ . '/../../views'); + } - /** - * Register aliases - * - * @return void - */ - protected function registerAliases() - { - $aliases = [ - // Facades - 'HTML' => 'NukaCode\Bootstrap\Support\Html\HTML', - 'Form' => 'NukaCode\Bootstrap\Support\Html\Form', - 'BBCode' => 'NukaCode\Bootstrap\Support\Html\BBCode', - ]; + /** + * Register aliases + * + * @return void + */ + protected function registerAliases() + { + $aliases = [ + // Facades + 'HTML' => 'NukaCode\Bootstrap\Support\Html\HTML', + 'Form' => 'NukaCode\Bootstrap\Support\Html\Form', + 'BBCode' => 'NukaCode\Bootstrap\Support\Html\BBCode', + ]; - $exclude = $this->app['config']->get('nukacode.bootstrap.excludeAliases'); + $exclude = $this->app['config']->get('nukacode-frontend.excludeAliases'); + + $this->loadAliases($aliases, $exclude); + } - $this->loadAliases($aliases, $exclude); - } + public function registerArtisanCommands() + { + $this->commands( + [ + 'NukaCode\Bootstrap\Console\ThemeCommand', + ] + ); + } - public function registerArtisanCommands() - { - $this->commands( - [ - 'NukaCode\Bootstrap\Console\ThemeCommand', - ] - ); - } + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return ['bootstrap']; + } - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return ['bootstrap']; - } - -} \ No newline at end of file +} From e25ec972d61349d9e5ce53bcca25756bdf67a40f Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 03:17:46 -0600 Subject: [PATCH 02/10] Update default.blade.php --- src/views/layouts/default.blade.php | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/views/layouts/default.blade.php b/src/views/layouts/default.blade.php index c83c04e..79239c6 100755 --- a/src/views/layouts/default.blade.php +++ b/src/views/layouts/default.blade.php @@ -1,19 +1,22 @@ - - @include('layouts.partials.header') - - - @include('layouts.partials.menu') - @if (isset($content)) - {{ $content }} - @else - @yield('content') - @endif + + @include('layouts.partials.header') + + + @include('layouts.partials.menu') - @include('layouts.partials.modals') +
+ @if (isset($content)) + {{ $content }} + @else + @yield('content') + @endif +
- @include('layouts.partials.javascript') + @include('layouts.partials.modals') - - \ No newline at end of file + @include('layouts.partials.javascript') + + + From b038af47aed406f30acb5f9ff0cf896e476dbd05 Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 08:59:54 -0600 Subject: [PATCH 03/10] smallGroupClose never got renamed to offsetGroupClose --- src/NukaCode/Bootstrap/Html/FormBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NukaCode/Bootstrap/Html/FormBuilder.php b/src/NukaCode/Bootstrap/Html/FormBuilder.php index 95d1ecc..97d37ed 100755 --- a/src/NukaCode/Bootstrap/Html/FormBuilder.php +++ b/src/NukaCode/Bootstrap/Html/FormBuilder.php @@ -124,7 +124,7 @@ public function offsetGroupOpen($labelSize = null, $inputSize = null, $iconSize } - public function smallGroupClose() + public function offsetGroupClose() { if ($this->previousSizes != null) { call_user_func_array([$this, 'setSizes'], $this->previousSizes); From b60165c61b2fabd036a6eee25f2625a7ee9b159d Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 16:57:58 -0600 Subject: [PATCH 04/10] Update 401.blade.php --- src/views/errors/401.blade.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/views/errors/401.blade.php b/src/views/errors/401.blade.php index 236d2f7..e6855b3 100755 --- a/src/views/errors/401.blade.php +++ b/src/views/errors/401.blade.php @@ -1,13 +1 @@ -
-
-
-
- 401 Unauthorized Error -
- You are not authorized to view this page.
- @if (Session::has('errorMessage')) - Error Message: {{ Session::get('errorMessage') }} - @endif -
-
-
\ No newline at end of file +@include('errors.layout', ['error' => 401, 'subTitle' => 'You are not authorized to view this page.']) From a787daa5455d0c2432033cffd591e49170933658 Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 16:58:08 -0600 Subject: [PATCH 05/10] Update 404.blade.php --- src/views/errors/404.blade.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/views/errors/404.blade.php b/src/views/errors/404.blade.php index 40e58b2..f971ccc 100755 --- a/src/views/errors/404.blade.php +++ b/src/views/errors/404.blade.php @@ -1,13 +1 @@ -
-
-
-
- 404 File Not Found Error -
- Sorry, the page you are looking for could not be found.
- @if (Session::has('errorMessage')) - Error Message: {{ Session::get('errorMessage') }} - @endif -
-
-
\ No newline at end of file +@include('errors.layout', ['error' => 404, 'subTitle' => 'The page you requested could not be found.']) From eeeb5e8eaa0bc08d044e8a00b2ed458f3886c62e Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 16:58:23 -0600 Subject: [PATCH 06/10] Create 400.blade.php --- src/views/errors/400.blade.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/views/errors/400.blade.php diff --git a/src/views/errors/400.blade.php b/src/views/errors/400.blade.php new file mode 100644 index 0000000..e16ae10 --- /dev/null +++ b/src/views/errors/400.blade.php @@ -0,0 +1 @@ +@include('errors.layout', ['error' => 400, 'subTitle' => 'We cannot process your request currently.']) From e08ed8e6beb778543426433453344d5e42625cf9 Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 16:58:37 -0600 Subject: [PATCH 07/10] Create 500.blade.php --- src/views/errors/500.blade.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/views/errors/500.blade.php diff --git a/src/views/errors/500.blade.php b/src/views/errors/500.blade.php new file mode 100644 index 0000000..4846e12 --- /dev/null +++ b/src/views/errors/500.blade.php @@ -0,0 +1 @@ +@include('errors.layout', ['error' => 500, 'subTitle' => 'We cannot process your request currently.']) From 73f33d6e6fad7ee0d62f7cb850da49b5d20e6f49 Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 16:58:49 -0600 Subject: [PATCH 08/10] Create layout.blade.php --- src/views/errors/layout.blade.php | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/views/errors/layout.blade.php diff --git a/src/views/errors/layout.blade.php b/src/views/errors/layout.blade.php new file mode 100644 index 0000000..ec24a7b --- /dev/null +++ b/src/views/errors/layout.blade.php @@ -0,0 +1,60 @@ + +@extends('layouts.default') + +@section('css') + @parent + + + +@stop + +
+
+
Error {{ $error }}
+
{{ $subTitle }}
+
+ @if (Session::has('errorMessage')) + Error Message: {{ Session::get('errorMessage') }} +
+ @endif +
+
+ {!! HTML::linkRoute('home', 'Go Back to the Home Page', [], ['class' => 'btn btn-primary']) !!} +
+
+
From 532852418491c91d0487e106a53e45a32c488f46 Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 22:32:34 -0600 Subject: [PATCH 09/10] Update menu.blade.php --- src/views/layouts/partials/menu.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/layouts/partials/menu.blade.php b/src/views/layouts/partials/menu.blade.php index faadf89..d1ecf56 100755 --- a/src/views/layouts/partials/menu.blade.php +++ b/src/views/layouts/partials/menu.blade.php @@ -1,6 +1,6 @@ @if (Menu::count() > 0)
-@endif \ No newline at end of file +@endif From 7f1d240df6051f2ebd0f5afa794762cb7f9bc2e8 Mon Sep 17 00:00:00 2001 From: stygiansabyss Date: Tue, 17 Feb 2015 23:06:41 -0600 Subject: [PATCH 10/10] Update FormBuilder.php --- src/NukaCode/Bootstrap/Html/FormBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NukaCode/Bootstrap/Html/FormBuilder.php b/src/NukaCode/Bootstrap/Html/FormBuilder.php index 97d37ed..f7c3d74 100755 --- a/src/NukaCode/Bootstrap/Html/FormBuilder.php +++ b/src/NukaCode/Bootstrap/Html/FormBuilder.php @@ -138,7 +138,6 @@ public function offsetGroupClose() return << - HTML; } @@ -494,6 +493,7 @@ private function checkForOptionals($name, $arguments) private function strpos_array($haystack, $needles, $offset = 0) { if (is_array($needles)) { + pp($needles); foreach ($needles as $needle) { $pos = $this->strpos_array($haystack, $needle); if ($pos !== false) {