2015-05-19 15:41:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Cachet.
|
|
|
|
*
|
2015-05-25 17:59:08 +01:00
|
|
|
* (c) Cachet HQ <support@cachethq.io>
|
2015-05-19 15:41:29 +01:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace CachetHQ\Cachet\Composers;
|
|
|
|
|
|
|
|
use CachetHQ\Cachet\Facades\Setting;
|
|
|
|
use Illuminate\View\View;
|
|
|
|
|
|
|
|
class ThemeComposer
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bind data to the view.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\View\View $view
|
|
|
|
*/
|
|
|
|
public function compose(View $view)
|
|
|
|
{
|
2015-05-20 12:56:59 -05:00
|
|
|
$view->with('themeBackgroundColor', Setting::get('style_background_color'));
|
|
|
|
$view->with('themeTextColor', Setting::get('style_text_color'));
|
2015-05-19 15:41:29 +01:00
|
|
|
|
|
|
|
$viewData = $view->getData();
|
|
|
|
$themeView = array_only($viewData, preg_grep('/^theme/', array_keys($viewData)));
|
|
|
|
$hasThemeSettings = array_filter($themeView, function ($data) {
|
|
|
|
return $data != null;
|
|
|
|
});
|
|
|
|
|
|
|
|
$view->with('themeSetup', !empty($hasThemeSettings));
|
|
|
|
}
|
|
|
|
}
|