PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / trunk
Kubio AI Page Builder vtrunk
2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / src / Core / Background / BackgroundDefaults.php
kubio / lib / src / Core / Background Last commit date
Background.php 1 year ago BackgroundDefaults.php 2 years ago BackgroundImage.php 1 year ago BackgroundOverlay.php 1 year ago BackgroundSlideshow.php 1 year ago BackgroundVideo.php 1 year ago
BackgroundDefaults.php
97 lines
1 <?php
2
3 namespace Kubio\Core\Background;
4
5 use Kubio\Config;
6 use Kubio\Core\LodashBasic;
7 use Kubio\Core\Utils as GeneralUtils;
8
9 class BackgroundDefaults {
10
11
12 const BASEURL = 'props.background';
13
14 public static function getDefaultImage() {
15 $background_url = static::BASEURL;
16 $imageDefault = LodashBasic::merge(
17 array(),
18 Config::value( "{$background_url}.image.default" ),
19 array( array( 'source' => array( 'url' => GeneralUtils::getDefaultAssetsURL( 'background-image-1.jpg' ) ) ) )
20 );
21
22 return $imageDefault;
23 }
24
25 public static function getDefaultVideo() {
26 $background_url = static::BASEURL;
27 $videoDefault = LodashBasic::merge(
28 array(),
29 Config::value( "{$background_url}.video.default" ),
30 array(
31 'internal' => array(
32 'url' => 'https://static-assets.kubiobuilder.com/defaults/demo-video.mp4',
33 'mime' => 'video/mp4',
34 ),
35 'poster' => array(
36 'url' => 'https://static-assets.kubiobuilder.com/defaults/demo-video-cover.jpg',
37 ),
38 )
39 );
40 return $videoDefault;
41 }
42
43 public static function getDefaultOverlay() {
44 $background_url = static::BASEURL;
45 $overlayDefault = Config::value( "{$background_url}.overlay.default" );
46 return $overlayDefault;
47 }
48
49 public static function getDefaultSlideShow() {
50 $background_url = static::BASEURL;
51 $slideshowDefault = LodashBasic::merge(
52 array(),
53 Config::value( "{$background_url}.slideshow.default" ),
54 array(
55 'slides' => array(
56 array(
57 'id' => 1,
58 'url' => GeneralUtils::getDefaultAssetsURL( 'background-image-1.jpg' ),
59 ),
60 array(
61 'id' => 2,
62 'url' => GeneralUtils::getDefaultAssetsURL( 'background-image-2.jpg' ),
63 ),
64 array(
65 'id' => 3,
66 'url' => GeneralUtils::getDefaultAssetsURL( 'background-image-3.jpg' ),
67 ),
68 ),
69
70 )
71 );
72
73 return $slideshowDefault;
74 }
75
76 public static function getDefaultBackground() {
77
78 $imageDefault = static::getDefaultImage();
79 $videoDefault = static::getDefaultVideo();
80 $slideshowDefault = static::getDefaultSlideShow();
81 $overlayDefault = static::getDefaultOverlay();
82 $defaultValue = LodashBasic::merge(
83 array(),
84 Config::value( 'props.background.default' ),
85 array(
86 'type' => '',
87 'image' => $imageDefault,
88 'video' => $videoDefault,
89 'slideshow' => $slideshowDefault,
90 'overlay' => $overlayDefault,
91 )
92 );
93
94 return $defaultValue;
95 }
96 }
97