summaryrefslogtreecommitdiff
path: root/includes/sys_template.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/sys_template.php')
-rw-r--r--includes/sys_template.php57
1 files changed, 54 insertions, 3 deletions
diff --git a/includes/sys_template.php b/includes/sys_template.php
index d3f7a24e..6beaa57a 100644
--- a/includes/sys_template.php
+++ b/includes/sys_template.php
@@ -6,7 +6,7 @@
$themes = array(
"0" => "Engelsystem light",
"1" => "Engelsystem dark",
- "2" => "Engelsystem 31c3"
+ "2" => "Engelsystem cccamp15"
);
/**
@@ -85,9 +85,18 @@ function toolbar_dropdown($glyphicon, $label, $submenu, $class = '') {
function toolbar_popover($glyphicon, $label, $content, $class = '') {
$id = md5(microtime() . $glyphicon . $label);
return '<li class="dropdown messages ' . $class . '">
- <a id="' . $id . '" href="#" tabindex="0">' . ($glyphicon != '' ? '<span class="glyphicon glyphicon-' . $glyphicon . '"></span> ' : '') . $label . ' <span class="caret"></span></a>
+ <a id="' . $id . '" href="#">' . ($glyphicon != '' ? '<span class="glyphicon glyphicon-' . $glyphicon . '"></span> ' : '')
+ . $label . ' <span class="caret"></span></a>
<script type="text/javascript">
- $(document).ready(function(){$("#' . $id . '").popover({trigger: "click focus", html: true, content: "' . addslashes(join('', $content)) . '", placement: "bottom", container: "#navbar-collapse-1"})});
+ $(function(){
+ $("#' . $id . '").popover({
+ trigger: "focus",
+ html: true,
+ content: "' . addslashes(join('', $content)) . '",
+ placement: "bottom",
+ container: "#navbar-collapse-1"
+ })
+ });
</script></li>';
}
@@ -123,6 +132,40 @@ function form_spinner($name, $label, $value) {
}
/**
+ * Render a bootstrap datepicker
+ *
+ * @param string $name
+ * Name of the parameter
+ * @param string $label
+ * Label
+ * @param int $value
+ * Unix Timestamp
+ * @param int $min_date
+ * Earliest possible date
+ * @return HTML
+ */
+function form_date($name, $label, $value, $start_date = '') {
+ $id = $name . '-date';
+ $value = is_numeric($value) ? date('Y-m-d', $value) : '';
+ $start_date = is_numeric($start_date) ? date('Y-m-d', $start_date) : '';
+ return form_element($label, '
+ <div class="input-group date" id="' . $id . '">
+ <input type="text" name="' . $name . '" class="form-control" value="' . $value . '"><span class="input-group-addon">' . glyph('th') . '</span>
+ </div>
+ <script type="text/javascript">
+ $(function(){
+ $("#' . $id . '").datepicker({
+ language: "' . locale_short() . '",
+ todayBtn: "linked",
+ format: "yyyy-mm-dd",
+ startDate: "' . $start_date . '"
+ });
+ });
+ </script>
+ ', $id);
+}
+
+/**
* Rendert eine Liste von Checkboxen für ein Formular
*
* @param
@@ -226,6 +269,14 @@ function form_text($name, $label, $value, $disabled = false) {
}
/**
+ * Rendert ein Formular-Emailfeld
+ */
+function form_email($name, $label, $value, $disabled = false) {
+ $disabled = $disabled ? ' disabled="disabled"' : '';
+ return form_element($label, '<input class="form-control" id="form_' . $name . '" type="email" name="' . $name . '" value="' . htmlspecialchars($value) . '" ' . $disabled . '/>', 'form_' . $name);
+}
+
+/**
* Rendert ein Formular-Dateifeld
*/
function form_file($name, $label) {