1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* File holding the FooterInfo class |
4
|
|
|
* |
5
|
|
|
* This file is part of the MediaWiki skin Chameleon. |
6
|
|
|
* |
7
|
|
|
* @copyright 2013 - 2014, Stephan Gambke |
8
|
|
|
* @license GNU General Public License, version 3 (or any later version) |
9
|
|
|
* |
10
|
|
|
* The Chameleon skin is free software: you can redistribute it and/or modify |
11
|
|
|
* it under the terms of the GNU General Public License as published by the Free |
12
|
|
|
* Software Foundation, either version 3 of the License, or (at your option) any |
13
|
|
|
* later version. |
14
|
|
|
* |
15
|
|
|
* The Chameleon skin is distributed in the hope that it will be useful, but |
16
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
17
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
18
|
|
|
* details. |
19
|
|
|
* |
20
|
|
|
* You should have received a copy of the GNU General Public License along |
21
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>. |
22
|
|
|
* |
23
|
|
|
* @file |
24
|
|
|
* @ingroup Chameleon |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
namespace Skins\Chameleon\Components; |
28
|
|
|
|
29
|
|
|
use Skins\Chameleon\ChameleonTemplate; |
30
|
|
|
use Skins\Chameleon\IdRegistry; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* The FooterInfo class. |
34
|
|
|
* |
35
|
|
|
* An list of footer items (last modified time, view count, number of watching users, credits, copyright) |
36
|
|
|
* Does not include so called places (about, privacy policy, and disclaimer links). They need to be added to the page elsewhere. |
37
|
|
|
* |
38
|
|
|
* This is an unstyled unordered list: <ul id="footer-info" > |
39
|
|
|
* |
40
|
|
|
* @author Stephan Gambke |
41
|
|
|
* @since 1.0 |
42
|
|
|
* @ingroup Skins |
43
|
|
|
*/ |
44
|
|
|
class FooterInfo extends Component { |
45
|
|
|
|
46
|
1 |
|
public function __construct( ChameleonTemplate $template, \DOMElement $domElement = null, $indent = 0 ) { |
47
|
1 |
|
parent::__construct( $template, $domElement , $indent ); |
48
|
1 |
|
$this->addClasses( 'list-unstyled small' ); |
49
|
1 |
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Builds the HTML code for this component |
53
|
|
|
* |
54
|
|
|
* @return String the HTML code |
55
|
|
|
*/ |
56
|
8 |
|
public function getHtml() { |
57
|
|
|
|
58
|
8 |
|
$ret = $this->indent() . '<!-- footer links -->' . |
59
|
8 |
|
$this->indent() . |
60
|
8 |
|
\Html::openElement( 'ul', array( |
61
|
8 |
|
'class' => 'footer-info ' . $this->getClassString(), |
62
|
8 |
|
'id' => IdRegistry::getRegistry()->getId( 'footer-info' ), |
63
|
|
|
) |
64
|
8 |
|
); |
65
|
|
|
|
66
|
8 |
|
$footerlinks = $this->getSkinTemplate()->getFooterLinks(); |
67
|
8 |
|
$this->indent( 1 ); |
68
|
8 |
View Code Duplication |
foreach ( $footerlinks as $category => $links ) { |
69
|
|
|
|
70
|
8 |
|
if ( $category !== 'places' ) { |
71
|
|
|
|
72
|
8 |
|
$ret .= $this->indent() . '<!-- ' . htmlspecialchars( $category ) . ' -->'; |
73
|
8 |
|
foreach ( $links as $key ) { |
74
|
8 |
|
$ret .= $this->indent() . '<li>' . $this->getSkinTemplate()->get( $key ) . '</li>'; |
75
|
8 |
|
} |
76
|
|
|
|
77
|
8 |
|
} |
78
|
8 |
|
} |
79
|
|
|
|
80
|
8 |
|
$ret .= $this->indent( -1 ) . '</ul>' . "\n"; |
81
|
|
|
|
82
|
8 |
|
return $ret; |
83
|
|
|
} |
84
|
|
|
} |
85
|
|
|
|