ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 Protected Member Functions inherited from Gettext\Languages\Exporter\Exporter
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.

References $lc, $name, and array.

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  }
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
$lc
Definition: date.php:267

◆ getDescription()

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

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  }

◆ toStringDo()

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

Definition at line 9 of file Html.php.

10  {
11  return self::buildTable($languages, false);
12  }

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