EOF; } public static function link($args) { $options = 'href="'.$args['href'].'"'; if (isset($args['class'])) { $options .= ' class="'.$args['class'].'"'; } if (isset($args['target'])) { $options .= ' target="'.$args['target'].'"'; } if (isset($args['icon'])) { return ' '.$args['title'].''; } return ''.$args['title'].''; } public static function pageTitle($args) { $icon = $args['icon']; $title = $args['title']; return << $title EOF; } public static function formOpen($args) { $class = empty($args['class'])?'':'class="'.$args['class'].'"'; $id = empty($args['id'])?'':'id="'.$args['id'].'"'; $enctype = empty($args['enctype'])?'':'enctype="'.$args['enctype'].'"'; $action = empty($args['action'])?'action=""':'action="'.$args['action'].'"'; $method = empty($args['method'])?'method="post"':'method="'.$args['method'].'"'; $style = empty($args['style'])?'':'style="'.$args['style'].'"'; return << EOF; } public static function formClose() { return << EOF; } public static function formTitle($args) { $title = $args['title']; return <<$title EOF; } public static function formInputTextBlock($args) { $name = $args['name']; $disabled = empty($args['disabled'])?'':'disabled'; $placeholder = isset($args['placeholder'])?$args['placeholder']:''; $value = isset($args['value'])?$args['value']:''; $id = 'js'.$name; if (isset($args['id'])) { $id = $args['id']; } $tip = ''; if (isset($args['tip'])) { $tip = ''.$args['tip'].''; } $label = ''; if (isset($args['label'])) { $label = ''; } $class = 'form-control'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $type = 'text'; if (isset($args['type'])) { $type = $args['type']; } return << $label $tip EOF; } public static function formInputFile($args) { $id = 'js'.$args['name']; if (isset($args['id'])) { $id = $args['id']; } $class = 'custom-file'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $html = '
'; $html .= ''; $html .= ''; $html .= '
'; return $html; } public static function formTextarea($args) { $id = 'js'.$args['name']; if (isset($args['id'])) { $id = $args['id']; } $class = 'form-control'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $html = '
'; if (isset($args['label'])) { $html .= ''; } $html .= '
'; $html .= ''; if (isset($args['tip'])) { $html .= ''.$args['tip'].''; } $html .= '
'; $html .= '
'; return $html; } public static function formTextareaBlock($args) { $id = 'js'.$args['name']; if (isset($args['id'])) { $id = $args['id']; } $class = 'form-control'; if (!empty($args['class'])) { $class = $class.' '.$args['class']; } $html = '
'; if (!empty($args['label'])) { $html .= ''; } $html .= ''; if (!empty($args['tip'])) { $html .= ''.$args['tip'].''; } $html .= '
'; return $html; } public static function formInputGroupText($args) { $label = $args['label']; $labelInside = $args['labelInside']; $tip = $args['tip']; $value = $args['value']; $name = $args['name']; $id = 'js'.$name; if (isset($args['id'])) { $id = $args['id']; } $disabled = isset($args['disabled'])?'disabled':''; return <<
$labelInside
$tip EOF; } public static function formInputText($args) { $name = $args['name']; $disabled = empty($args['disabled'])?'':'disabled'; $placeholder = isset($args['placeholder'])?$args['placeholder']:''; $value = isset($args['value'])?$args['value']:''; $id = 'js'.$name; if (isset($args['id'])) { $id = $args['id']; } $tip = ''; if (isset($args['tip'])) { $tip = ''.$args['tip'].''; } $label = ''; if (isset($args['label'])) { $label = ''; } $class = 'form-control'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $type = 'text'; if (isset($args['type'])) { $type = $args['type']; } return << $label
$tip
EOF; } public static function formCheckbox($args) { $labelForCheckbox = isset($args['labelForCheckbox'])?$args['labelForCheckbox']:''; $placeholder = isset($args['placeholder'])?$args['placeholder']:''; $tip = isset($args['tip'])?$args['tip']:' '; $value = isset($args['value'])?$args['value']:''; $name = $args['name']; $id = 'js'.$name; if (isset($args['id'])) { $id = $args['id']; } $disabled = isset($args['disabled'])?'disabled':''; $class = 'form-group'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $type = 'text'; if (isset($args['type'])) { $type = $args['type']; } $label = ''; if (!empty($args['label'])) { $label = ''; } $checked = $args['checked']?'checked':''; return << $label
$tip
EOF; } public static function formSelect($args) { $id = 'js'.$args['name']; if (isset($args['id'])) { $id = $args['id']; } $class = 'custom-select'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $html = '
'; if (isset($args['label'])) { $html .= ''; } $html .= '
'; $html .= ''; if (isset($args['tip'])) { $html .= ''.$args['tip'].''; } $html .= '
'; $html .= '
'; return $html; } public static function formSelectBlock($args) { $id = 'js'.$args['name']; if (isset($args['id'])) { $id = $args['id']; } $class = 'custom-select'; if (!empty($args['class'])) { $class = $class.' '.$args['class']; } $html = '
'; if (!empty($args['label'])) { $html .= ''; } $html .= ''; if (!empty($args['tip'])) { $html .= ''.$args['tip'].''; } $html .= '
'; return $html; } public static function formInputHidden($args) { return ''; } public static function alert($args) { $class = 'alert'; if (!empty($args['class'])) { $class = $class.' '.$args['class']; } $text = $args['text']; return <<$text EOF; } }