} else {
$credits = '';
}
- $bgcolor = $this->themeSettings->loadingBackColor;
+ $bgcolor = $this->theme->getLoadingBackgroundColor();
// Feuilles de style
$sheets = array_merge($this->stylesheets, $this->specialCSS);
use Cubist\Backpack\Magic\Fields\SelectFromModel;
use Cubist\Util\CommandLine;
use Cubist\Util\CommandLine\Imagemagick\Ico;
+use SplFileInfo;
// __('!!Paramètres des thèmes')
class FluidbookTheme extends ToolboxModel
protected $_operations = [ChangeownerOperation::class];
use ToolboxSettings;
+
public function setFields()
{
parent::setFields();
return $this->_settingsData;
}
+ public function getLoadingBackgroundColor()
+ {
+ if ($this->hasAsset('backgroundImage')) {
+ return $this->getSettings()->get('loadingBackColor');
+ }
+
+ return \Cubist\Util\Graphics\Color::colorToCSS($this->getSettings()->get('backgroundColor'));
+ }
+
+ public function hasAsset($key)
+ {
+ $collection = $this->{$key};
+
+ if ($collection) {
+ $path = $this->getFirstMediaPath($collection);
+ if (!$path || !file_exists($path)) {
+ $res = false;
+ } else {
+ $res = new SplFileInfo($path);
+ }
+ } else {
+ $res = false;
+ }
+ return $res;
+ }
+
public static function hashThemeArray($a)
{
if (!$a) {