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 |