1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace JeroenNoten\LaravelAdminLte\Components; |
4
|
|
|
|
5
|
|
|
use Illuminate\View\Component; |
6
|
|
|
|
7
|
|
|
class ProfileRowItem extends Component |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* The title/header for the item. |
11
|
|
|
* |
12
|
|
|
* @var string |
13
|
|
|
*/ |
14
|
|
|
public $title; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* The text/description for the item. |
18
|
|
|
* |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
public $text; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* A Font Awesome icon for the item. |
25
|
|
|
* |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
public $icon; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* The item size. Used to wrap the item inside a col-size div. |
32
|
|
|
* |
33
|
|
|
* @var int |
34
|
|
|
*/ |
35
|
|
|
public $size; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* The badge theme for the text attribute. When used, the text attribute |
39
|
|
|
* will be wrapped inside a badge of the configured theme. Available themes |
40
|
|
|
* are: light, dark, primary, secondary, info, success, warning, danger or |
41
|
|
|
* any other AdminLTE color like lighblue or teal. |
42
|
|
|
* |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
public $badge; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Setup an url for the item. When enabled the title attribute will be |
49
|
|
|
* wrapped inside a link pointing to that url. |
50
|
|
|
* |
51
|
|
|
* @var string |
52
|
|
|
*/ |
53
|
|
|
public $url; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Create a new component instance. |
57
|
|
|
* |
58
|
|
|
* @return void |
59
|
|
|
*/ |
60
|
2 |
|
public function __construct( |
61
|
|
|
$title = null, $text = null, $icon = null, $size = 12, |
62
|
|
|
$badge = null, $url = null |
63
|
|
|
) { |
64
|
2 |
|
$this->title = $title; |
65
|
2 |
|
$this->text = $text; |
66
|
2 |
|
$this->icon = $icon; |
67
|
2 |
|
$this->size = $size; |
68
|
2 |
|
$this->badge = $badge; |
69
|
2 |
|
$this->url = $url; |
70
|
2 |
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Make the text wrapper class. |
74
|
|
|
* |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
1 |
|
public function makeTextWrapperClass() |
78
|
|
|
{ |
79
|
1 |
|
$classes = ['float-right']; |
80
|
|
|
|
81
|
1 |
|
if (isset($this->badge)) { |
82
|
1 |
|
$classes[] = "badge bg-{$this->badge}"; |
83
|
|
|
} |
84
|
|
|
|
85
|
1 |
|
return implode(' ', $classes); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* Get the view / contents that represent the component. |
90
|
|
|
* |
91
|
|
|
* @return \Illuminate\View\View|string |
92
|
|
|
*/ |
93
|
1 |
|
public function render() |
94
|
|
|
{ |
95
|
1 |
|
return view('adminlte::components.profile-row-item'); |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|