ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Gettext\Languages\Exporter\Html Class Reference
+ Inheritance diagram for Gettext\Languages\Exporter\Html:
+ Collaboration diagram for Gettext\Languages\Exporter\Html:

Static Public Member Functions

static getDescription ()
 
- Static Public Member Functions inherited from Gettext\Languages\Exporter\Exporter
static getExporters ($onlyForPublicUse=false)
 Return the list of all the available exporters. More...
 
static getExporterDescription ($exporterHandle)
 Return the description of a specific exporter. More...
 
static getExporterClassName ($exporterHandle)
 Returns the fully qualified class name of a exporter given its handle. More...
 
static toString ($languages, $options=null)
 Convert a list of Language instances to string. More...
 
static toFile ($languages, $filename, $options=null)
 Save the Language instances to a file. More...
 
static isForPublicUse ()
 Is this exporter for public use? More...
 
static getDescription ()
 Return a short description of the exporter. More...
 

Static Protected Member Functions

static toStringDo ($languages)
 
static h ($str)
 
static buildTable ($languages, $forDocs)
 
static toStringDo ($languages)
 Convert a list of Language instances to string. More...
 

Detailed Description

Definition at line 4 of file Html.php.

Member Function Documentation

◆ buildTable()

static Gettext\Languages\Exporter\Html::buildTable (   $languages,
  $forDocs 
)
staticprotected

Definition at line 17 of file Html.php.

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 }
$languages
Definition: cssgen2.php:34
$lc
Definition: date.php:267

References $c, $languages, $lc, $name, and Gettext\Languages\Exporter\Html\h().

Referenced by Gettext\Languages\Exporter\Html\toStringDo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription()

static Gettext\Languages\Exporter\Html::getDescription ( )
static
See also
Exporter::getDescription

Reimplemented from Gettext\Languages\Exporter\Exporter.

Reimplemented in Gettext\Languages\Exporter\Docs.

Definition at line 57 of file Html.php.

58 {
59 return 'Build a HTML table';
60 }

◆ h()

static Gettext\Languages\Exporter\Html::h (   $str)
staticprotected

Definition at line 13 of file Html.php.

14 {
15 return htmlspecialchars($str, ENT_COMPAT, 'UTF-8');
16 }

Referenced by Gettext\Languages\Exporter\Html\buildTable().

+ Here is the caller graph for this function:

◆ toStringDo()

static Gettext\Languages\Exporter\Html::toStringDo (   $languages)
staticprotected
See also
Exporter::toStringDo

Reimplemented from Gettext\Languages\Exporter\Exporter.

Reimplemented in Gettext\Languages\Exporter\Docs.

Definition at line 9 of file Html.php.

10 {
11 return self::buildTable($languages, false);
12 }
static buildTable($languages, $forDocs)
Definition: Html.php:17

References $languages, and Gettext\Languages\Exporter\Html\buildTable().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: