ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
Html.php
Go to the documentation of this file.
1
<?
php
2
namespace
Gettext\Languages\Exporter
;
3
4
class
Html
extends
Exporter
5
{
9
protected
static
function
toStringDo
(
$languages
)
10
{
11
return
self::buildTable(
$languages
,
false
);
12
}
13
protected
static
function
h
($str)
14
{
15
return
htmlspecialchars($str, ENT_COMPAT,
'UTF-8'
);
16
}
17
protected
static
function
buildTable
(
$languages
, $forDocs)
18
{
19
$prefix = $forDocs ?
' '
:
''
;
20
$lines = array();
21
$lines[] = $prefix.
'<table'
.($forDocs ?
' class="table table-bordered table-condensed table-striped"'
:
''
).
'>'
;
22
$lines[] = $prefix.
' <thead>'
;
23
$lines[] = $prefix.
' <tr>'
;
24
$lines[] = $prefix.
' <th>Language code</th>'
;
25
$lines[] = $prefix.
' <th>Language name</th>'
;
26
$lines[] = $prefix.
' <th># plurals</th>'
;
27
$lines[] = $prefix.
' <th>Formula</th>'
;
28
$lines[] = $prefix.
' <th>Plurals</th>'
;
29
$lines[] = $prefix.
' </tr>'
;
30
$lines[] = $prefix.
' </thead>'
;
31
$lines[] = $prefix.
' <tbody>'
;
32
foreach
(
$languages
as
$lc
) {
33
$lines[] = $prefix.
' <tr>'
;
34
$lines[] = $prefix.
' <td>'
.$lc->id.
'</td>'
;
35
$name
= self::h($lc->name);
36
if
(isset($lc->supersededBy)) {
37
$name
.=
'<br /><small><span>Superseded by</span> '
.$lc->supersededBy.
'</small>'
;
38
}
39
$lines[] = $prefix.
' <td>'
.
$name
.
'</td>'
;
40
$lines[] = $prefix.
' <td>'
.count($lc->categories).
'</td>'
;
41
$lines[] = $prefix.
' <td>'
.self::h($lc->formula).
'</td>'
;
42
$cases = array();
43
foreach
($lc->categories as
$c
) {
44
$cases[] =
'<li><span>'
.$c->id.
'</span><code>'
.self::h($c->examples).
'</code></li>'
;
45
}
46
$lines[] = $prefix.
' <td><ol'
.($forDocs ?
' class="cases"'
:
''
).
' start="0">'
.implode(
''
, $cases).
'</ol></td>'
;
47
$lines[] = $prefix.
' </tr>'
;
48
}
49
$lines[] = $prefix.
' </tbody>'
;
50
$lines[] = $prefix.
'</table>'
;
51
52
return
implode(
"\n"
, $lines);
53
}
57
public
static
function
getDescription
()
58
{
59
return
'Build a HTML table'
;
60
}
61
}
Gettext\Languages\Exporter\Exporter
Base class for all the exporters.
Definition:
Exporter.php:10
Gettext\Languages\Exporter\Html\h
static h($str)
Definition:
Html.php:13
Gettext\Languages\Exporter\Html
Definition:
Html.php:4
Gettext\Languages\Exporter\Html\getDescription
static getDescription()
Definition:
Html.php:57
$c
$c
Definition:
inc.setup_header.php:183
Gettext\Languages\Exporter
Definition:
Docs.php:2
Gettext\Languages\Exporter\Html\toStringDo
static toStringDo($languages)
Definition:
Html.php:9
$lc
$lc
Definition:
date.php:267
Gettext\Languages\Exporter\Html\buildTable
static buildTable($languages, $forDocs)
Definition:
Html.php:17
$name
$name
Definition:
client_example.php:35
php
$languages
$languages
Definition:
cssgen2.php:34
libs
composer
vendor
gettext
languages
src
Exporter
Html.php
Generated on Thu Jan 30 2025 19:01:18 for ILIAS by
1.8.13 (using
Doxyfile
)