Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
124 - 1
<?php
2
function htmlHeader($level, $text, $class = null, $id = null) {
3
    $str = '<h' . $level;
4
    if ($id) {
5
        $str .= ' id="' . $id . '"';
6
    }
7
    if ($class) {
8
        $str .= ' class="' . $class . '"';
9
    }
10
    $str .= '>';
11
    $str .= $text;
12
    $str .= '</h' . $level . '>';
13
    return $str;
14
}
15
 
16
function htmlInput($type, $name = null, $value = null, $id = null, $placeholder = null, $aria_label = null) {
17
    $str = '<input type="' . $type . '"';
18
    if ($id) {
19
        $str .= ' id="' . $id . '"';
20
    }
21
    if ($name) {
22
        $str .= ' name="' . $name . '"';
23
    }
24
    if ($value) {
25
        $str .= ' value="' . $value . '"';
26
    }
27
    if ($placeholder) {
28
        $str .= ' value="' . $placeholder . '"';
29
    }
30
    if ($aria_label) {
31
        $str .= ' value="' . $aria_label . '"';
32
    }
33
    $str .= ' />';
34
    return $str;
35
}