Hermes::getJobTypeSelect PHP Method

getJobTypeSelect() public static method

Return HTML needed to build an enum or multienum for jobtype selection.
public static getJobTypeSelect ( string $id, boolean $multi = false, $show_disabled = false ) : string
$id string The DOM id to identify the select list.
$multi boolean Allow multi select?
return string The HTML needed to render the select element.
    public static function getJobTypeSelect($id, $multi = false, $show_disabled = false)
    {
        if ($show_disabled) {
            $params = array();
        } else {
            $params = array('enabled' => true);
        }
        $types = self::getJobTypeData($params);
        $select = '<select name="' . ($multi ? 'type[]' : 'type') . '" id="' . $id . '" ' . ($multi ? 'multiple="multiple"' : '') . '>';
        $select .= '<option value="">' . _("--- Select a Job Type ---") . '</option>';
        foreach ($types as $tid => $type) {
            $select .= '<option value="' . $tid . '">' . htmlspecialchars($type['name']) . '</option>';
        }
        return $select . '</select>';
    }