Cachet/app/Composers/ThemeComposer.php

68 lines
2.2 KiB
PHP
Raw Normal View History

<?php
/*
* This file is part of Cachet.
*
2015-07-06 17:37:01 +01:00
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Composers;
use Illuminate\Contracts\Config\Repository;
2015-06-01 11:45:48 +01:00
use Illuminate\Contracts\View\View;
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>
*/
class ThemeComposer
{
/**
* 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;
}
/**
* 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
*/
public function compose(View $view)
{
$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'));
$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'));
$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'));
$view->withThemeLinks($this->config->get('setting.style_links', '#7ED321'));
}
}