From a6586b5919253b7b2bb77cceaff6455d7b87f6f8 Mon Sep 17 00:00:00 2001 From: Stefan Date: Mon, 12 Oct 2015 20:34:12 +0200 Subject: [PATCH] Added option to select brand type text or logo or text + logo --- app/controllers/admin/SettingsController.php | 4 ++- ...015_10_12_192706_add_brand_to_settings.php | 34 +++++++++++++++++++ app/views/backend/layouts/default.blade.php | 7 +++- app/views/backend/settings/edit.blade.php | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 app/database/migrations/2015_10_12_192706_add_brand_to_settings.php diff --git a/app/controllers/admin/SettingsController.php b/app/controllers/admin/SettingsController.php index c714fefac1d7..e4a572298def 100755 --- a/app/controllers/admin/SettingsController.php +++ b/app/controllers/admin/SettingsController.php @@ -68,7 +68,8 @@ public function postEdit() // Declare the rules for the form validation $rules = array( - "per_page" => 'required|min:1|numeric', + "brand" => 'required|min:1|numeric', + "per_page" => 'required|min:1|numeric', "qr_text" => 'min:1|max:31', "logo" => 'mimes:jpeg,bmp,png,gif', "custom_css" => 'alpha_space', @@ -115,6 +116,7 @@ public function postEdit() if (Config::get('app.lock_passwords')==false) { $setting->site_name = e(Input::get('site_name')); + $setting->brand = e(Input::get('brand')); $setting->custom_css = e(Input::get('custom_css')); } diff --git a/app/database/migrations/2015_10_12_192706_add_brand_to_settings.php b/app/database/migrations/2015_10_12_192706_add_brand_to_settings.php new file mode 100644 index 000000000000..eae3acd849d5 --- /dev/null +++ b/app/database/migrations/2015_10_12_192706_add_brand_to_settings.php @@ -0,0 +1,34 @@ +tinyInteger('brand')->default(1); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function(Blueprint $table) + { + $table->dropColumn('brand'); + }); + } + +} diff --git a/app/views/backend/layouts/default.blade.php b/app/views/backend/layouts/default.blade.php index b409510a44fc..1b3921fd76fc 100644 --- a/app/views/backend/layouts/default.blade.php +++ b/app/views/backend/layouts/default.blade.php @@ -113,7 +113,12 @@ - @if (Setting::getSettings()->logo) + @if (Setting::getSettings()->brand === 3) + + + {{{ Setting::getSettings()->site_name }}} + + @elseif (Setting::getSettings()->brand === 2) diff --git a/app/views/backend/settings/edit.blade.php b/app/views/backend/settings/edit.blade.php index 41a7e891380c..7c04f68dcaed 100755 --- a/app/views/backend/settings/edit.blade.php +++ b/app/views/backend/settings/edit.blade.php @@ -102,7 +102,7 @@ {{ Form::label('header_color', Lang::get('admin/settings/general.header_color')) }}
- {{ Form::text('header_color', Input::old('header_color', $setting->header_color), array('class' => 'form-control', 'style' => 'width: 100px;')) }} + {{ Form::text('header_color', Input::old('header_color', $setting->header_color), array('class' => 'form-control', 'style' => 'width: 100px;','placeholder' => '#FF0000')) }} {{ $errors->first('header_color', '
:message') }}