2015-05-19 15:41:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Cachet.
|
|
|
|
*
|
2015-07-06 17:37:01 +01:00
|
|
|
* (c) Alt Three Services Limited
|
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;
|
|
|
|
|
2016-07-13 14:38:36 +01:00
|
|
|
use Illuminate\Contracts\Config\Repository;
|
2015-06-01 11:45:48 +01:00
|
|
|
use Illuminate\Contracts\View\View;
|
2015-05-19 15:41:29 +01:00
|
|
|
|
2016-10-07 13:51:59 +01:00
|
|
|
/**
|
2017-07-27 20:20:08 -04:00
|
|
|
* This is the theme composer class.
|
2016-10-07 13:51:59 +01:00
|
|
|
*
|
|
|
|
* @author James Brooks <james@alt-three.com>
|
|
|
|
* @author Graham Campbell <graham@alt-three.com>
|
|
|
|
*/
|
2015-05-19 15:41:29 +01:00
|
|
|
class ThemeComposer
|
|
|
|
{
|
2016-07-13 14:38:36 +01:00
|
|
|
/**
|
|
|
|
* The illuminate config instance.
|
|
|
|
*
|
|
|
|
* @var \Illuminate\Contracts\Config\Repository
|
|
|
|
*/
|
|
|
|
protected $config;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new theme composer.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Contracts\Config\Repository $config
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct(Repository $config)
|
|
|
|
{
|
|
|
|
$this->config = $config;
|
|
|
|
}
|
|
|
|
|
2015-05-19 15:41:29 +01:00
|
|
|
/**
|
|
|
|
* Bind data to the view.
|
|
|
|
*
|
2015-06-01 11:45:48 +01:00
|
|
|
* @param \Illuminate\Contracts\View\View $view
|
2015-08-30 22:45:27 +01:00
|
|
|
*
|
|
|
|
* @return void
|
2015-05-19 15:41:29 +01:00
|
|
|
*/
|
|
|
|
public function compose(View $view)
|
|
|
|
{
|
2016-07-13 14:38:36 +01:00
|
|
|
$view->withThemeBackgroundColor($this->config->get('setting.style_background_color', '#F0F3F4'));
|
|
|
|
$view->withThemeBackgroundFills($this->config->get('setting.style_background_fills', '#FFFFFF'));
|
|
|
|
$view->withThemeBannerBackgroundColor($this->config->get('setting.style_banner_background_color', ''));
|
|
|
|
$view->withThemeBannerPadding($this->config->get('setting.style_banner_padding', '40px 0'));
|
|
|
|
$view->withThemeTextColor($this->config->get('setting.style_text_color', '#333333'));
|
2017-01-02 15:39:23 +00:00
|
|
|
$view->withThemeReds($this->config->get('setting.style_reds', '#FF6F6F'));
|
|
|
|
$view->withThemeBlues($this->config->get('setting.style_blues', '#3498DB'));
|
2016-07-13 14:38:36 +01:00
|
|
|
$view->withThemeGreens($this->config->get('setting.style_greens', '#7ED321'));
|
|
|
|
$view->withThemeYellows($this->config->get('setting.style_yellows', '#F7CA18'));
|
|
|
|
$view->withThemeOranges($this->config->get('setting.style_oranges', '#FF8800'));
|
2016-10-21 20:00:18 -03:00
|
|
|
$view->withThemeGreys($this->config->get('setting.style_greys', '#888888'));
|
2017-01-02 15:39:23 +00:00
|
|
|
$view->withThemeMetrics($this->config->get('setting.style_metrics', '#0DCCC0'));
|
2016-07-13 14:38:36 +01:00
|
|
|
$view->withThemeLinks($this->config->get('setting.style_links', '#7ED321'));
|
2015-05-19 15:41:29 +01:00
|
|
|
}
|
|
|
|
}
|