PluginProbe
Depicter — Popup & Slider Builder / 1.6.2
Depicter — Popup & Slider Builder v1.6.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Document / Models / Common / Styles / Border.php

Border.php in Depicter — Popup & Slider Builder 1.6.2, at app/src/Document/Models/Common/Styles/Border.php

69 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Document\Models\Common\Styles;
3
4
5 use Depicter\Document\CSS\Breakpoints;
6
7 class Border extends States
8 {
9 /**
10 * style name
11 */
12 const NAME = 'border';
13
14 /**
15 * @var string
16 */
17 public $borderWidth = '1px';
18
19 /**
20 * @var string
21 */
22 public $borderStyle = 'solid';
23
24 /**
25 * @var string
26 */
27 public $borderColor = '#000';
28
29 public function set( $css ) {
30 $devices = Breakpoints::names();
31
32 foreach ( $devices as $device ) {
33 if ( isset( $this->{$device}->enable ) ) {
34
35 // If it is disabled in a breakpoint other than default, generate a reset style for breakpoint
36 if( $device !== 'default' && ! empty( $this->default->enable ) && ! $this->{$device}->enable ){
37 $css[$device][ self::NAME ] = 'none';
38
39 } elseif( $this->{$device}->enable ) {
40
41 if( isset( $this->{$device}->top->value ) ){
42 if ( !empty( $this->{$device}->link ) ) {
43 $css[$device]['border-width'] = $this->{$device}->top->value . $this->{$device}->top->unit;
44 } else {
45 $css[$device]['border-width'] = $this->{$device}->top->value . $this->{$device}->top->unit . " " . $this->{$device}->right->value . $this->{$device}->right->unit . " " . $this->{$device}->bottom->value . $this->{$device}->bottom->unit . " " . $this->{$device}->left->value . $this->{$device}->left->unit;
46 }
47 } elseif ( $device == 'default') {
48 $css[$device]['border-width'] = $this->borderWidth;
49 }
50
51 if ( !empty($this->{$device}->style) ) {
52 $css[$device]['border-style'] = $this->{$device}->style;
53 } elseif ($device == 'default') {
54 $css[$device]['border-style'] = $this->borderStyle;
55 }
56
57 if ( !empty( $this->{$device}->color ) ) {
58 $css[$device]['border-color'] = $this->{$device}->color;
59 } elseif ( $device == 'default' ) {
60 $css[$device]['border-color'] = $this->borderColor;
61 }
62 }
63 }
64 }
65
66 return $css;
67 }
68 }
69