"Engelsystem 32c3",
"2" => "Engelsystem cccamp15",
"0" => "Engelsystem light",
"1" => "Engelsystem dark"
];
/**
* Display muted (grey) text.
*
* @param string $text
*/
function mute($text) {
return '' . $text . '';
}
/**
* Renders a bootstrap label with given content and class.
*
* @param string $content
* The text
* @param string $class
* default, primary, info, success, warning, danger
*/
function label($content, $class = 'default') {
return '' . $content . '';
}
function progress_bar($valuemin, $valuemax, $valuenow, $class = '', $content = '') {
return '
';
}
/**
* Render glyphicon
*
* @param string $glyph_name
*/
function glyph($glyph_name) {
return ' ';
}
/**
* Renders a tick or a cross by given boolean
*
* @param boolean $boolean
*/
function glyph_bool($boolean) {
return '' . glyph($boolean ? 'ok' : 'remove') . '';
}
function div($class, $content = [], $dom_id = "") {
if (is_array($content)) {
$content = join("\n", $content);
}
$dom_id = $dom_id != '' ? ' id="' . $dom_id . '"' : '';
return '' . $content . '
';
}
function heading($content, $number = 1) {
return "" . $content . "";
}
/**
* Render a toolbar.
*
* @param array $items
* @return string
*/
function toolbar($items = [], $right = false) {
return '' . join("\n", $items) . '
';
}
function toolbar_pills($items) {
return '' . join("\n", $items) . '
';
}
/**
* Render a link for a toolbar.
*
* @param string $href
* @param string $glyphicon
* @param string $label
* @param bool $selected
* @return string
*/
function toolbar_item_link($href, $glyphicon, $label, $selected = false) {
return '' . ($glyphicon != '' ? ' ' : '') . $label . '';
}
function toolbar_item_divider() {
return '';
}
function toolbar_dropdown($glyphicon, $label, $submenu, $class = '') {
return '
' . ($glyphicon != '' ? ' ' : '') . $label . '
';
}
function toolbar_popover($glyphicon, $label, $content, $class = '') {
$dom_id = md5(microtime() . $glyphicon . $label);
return '
' . ($glyphicon != '' ? ' ' : '') . $label . '
';
}
/**
* Generiert HTML Code für eine "Seite".
* Fügt dazu die übergebenen Elemente zusammen.
*/
function page($elements) {
return join($elements);
}
/**
* Generiert HTML Code für eine "Seite" mit zentraler Überschrift
* Fügt dazu die übergebenen Elemente zusammen.
*/
function page_with_title($title, $elements) {
return '' . $title . '
' . join($elements) . '';
}
/**
* Rendert eine Datentabelle
*/
function table($columns, $rows_raw, $data = true) {
// If only one column is given
if (! is_array($columns)) {
$rows = [];
foreach ($rows_raw as $row) {
$rows[] = [
'col' => $row
];
}
return render_table([
'col' => $columns
], $rows, $data);
}
return render_table($columns, $rows_raw, $data);
}
/**
* Helper for rendering a html-table.
* use table()
*/
function render_table($columns, $rows, $data = true) {
if (count($rows) == 0) {
return info(_("No data found."), true);
}
$html = '';
$html .= '';
foreach ($columns as $key => $column) {
$html .= '' . $column . ' | ';
}
$html .= '
';
$html .= '';
foreach ($rows as $row) {
$html .= '';
foreach ($columns as $key => $column) {
$value = " ";
if (isset($row[$key])) {
$value = $row[$key];
}
$html .= '' . $value . ' | ';
}
$html .= '
';
}
$html .= '';
$html .= '
';
return $html;
}
/**
* Rendert einen Knopf
*/
function button($href, $label, $class = "") {
return '' . $label . '';
}
/**
* Rendert einen Knopf mit Glyph
*/
function button_glyph($href, $glyph, $class = "") {
return button($href, glyph($glyph), $class);
}
/**
* Rendert eine Toolbar mit Knöpfen
*/
function buttons($buttons = []) {
return '' . table_buttons($buttons) . '
';
}
function table_buttons($buttons = []) {
return '' . join(' ', $buttons) . '
';
}
// Load and render template
function template_render($file, $data) {
if (file_exists($file)) {
$template = file_get_contents($file);
if (is_array($data)) {
foreach ($data as $name => $content) {
$template = str_replace("%" . $name . "%", $content, $template);
}
}
return $template;
}
engelsystem_error("Cannot find template file «" . $file . "».");
}
function shorten($str, $length = 50) {
if (strlen($str) < $length) {
return $str;
}
return '' . substr($str, 0, $length - 3) . '...';
}
function table_body($array) {
$html = "";
foreach ($array as $line) {
$html .= "";
if (is_array($line)) {
foreach ($line as $td) {
$html .= "" . $td . " | ";
}
} else {
$html .= "" . $line . " | ";
}
$html .= "
";
}
return $html;
}
function ReplaceSmilies($neueckig) {
$neueckig = str_replace(";o))", "", $neueckig);
$neueckig = str_replace(":-))", "", $neueckig);
$neueckig = str_replace(";o)", "", $neueckig);
$neueckig = str_replace(":)", "", $neueckig);
$neueckig = str_replace(":-)", "", $neueckig);
$neueckig = str_replace(":(", "", $neueckig);
$neueckig = str_replace(":-(", "", $neueckig);
$neueckig = str_replace(":o(", "", $neueckig);
$neueckig = str_replace(":o)", "", $neueckig);
$neueckig = str_replace(";o(", "", $neueckig);
$neueckig = str_replace(";(", "", $neueckig);
$neueckig = str_replace(";-(", "", $neueckig);
$neueckig = str_replace("8)", "", $neueckig);
$neueckig = str_replace("8o)", "", $neueckig);
$neueckig = str_replace(":P", "", $neueckig);
$neueckig = str_replace(":-P", "", $neueckig);
$neueckig = str_replace(":oP", "", $neueckig);
$neueckig = str_replace(";P", "", $neueckig);
$neueckig = str_replace(";oP", "", $neueckig);
$neueckig = str_replace("?)", "", $neueckig);
return $neueckig;
}
?>