1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Contains the component class for rendering a well. |
4
|
|
|
* |
5
|
|
|
* @copyright (C) 2018, Tobias Oetterer, Paderborn University |
6
|
|
|
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 (or later) |
7
|
|
|
* |
8
|
|
|
* This file is part of the MediaWiki extension BootstrapComponents. |
9
|
|
|
* The BootstrapComponents extension is free software: you can redistribute it |
10
|
|
|
* and/or modify it under the terms of the GNU General Public License as published |
11
|
|
|
* by the Free Software Foundation, either version 3 of the License, or |
12
|
|
|
* (at your option) any later version. |
13
|
|
|
* |
14
|
|
|
* The BootstrapComponents extension is distributed in the hope that it will be useful, |
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17
|
|
|
* GNU General Public License for more details. |
18
|
|
|
* |
19
|
|
|
* You should have received a copy of the GNU General Public License |
20
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
21
|
|
|
* |
22
|
|
|
* @file |
23
|
|
|
* @ingroup BootstrapComponents |
24
|
|
|
* @author Tobias Oetterer |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
namespace BootstrapComponents\Components; |
28
|
|
|
|
29
|
|
|
use BootstrapComponents\AbstractComponent; |
30
|
|
|
use \Html; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Class Well |
34
|
|
|
* |
35
|
|
|
* Class for component 'well' |
36
|
|
|
* |
37
|
|
|
* @see https://github.com/oetterer/BootstrapComponents/blob/master/docs/components.md#Well |
38
|
|
|
* @since 1.0 |
39
|
|
|
*/ |
40
|
|
|
class Well extends AbstractComponent { |
41
|
|
|
/** |
42
|
|
|
* @inheritdoc |
43
|
|
|
* |
44
|
|
|
* @param string $input |
45
|
|
|
*/ |
46
|
5 |
|
public function placeMe( $input ) { |
47
|
|
|
|
48
|
5 |
|
$class = [ 'well' ]; |
49
|
5 |
|
if ( $size = $this->getValueFor( 'size' ) ) { |
50
|
2 |
|
$class[] = 'well-' . $size; |
51
|
2 |
|
} |
52
|
5 |
|
list ( $class, $style ) = $this->processCss( $class, [] ); |
53
|
5 |
|
return Html::rawElement( |
54
|
5 |
|
'div', |
55
|
|
|
[ |
56
|
5 |
|
'class' => $this->arrayToString( $class, ' ' ), |
57
|
5 |
|
'style' => $this->arrayToString( $style, ';' ), |
58
|
5 |
|
'id' => $this->getId(), |
59
|
5 |
|
], |
60
|
|
|
$input |
61
|
5 |
|
); |
62
|
|
|
} |
63
|
|
|
} |