'.PHP_EOL; } } else { $tmp = ''.PHP_EOL; } return $tmp; } public static function js($filename) { if (is_array($filename)) { $tmp = ''; foreach ($filename as $file) { $tmp .= ''.PHP_EOL; } } else { $tmp = ''.PHP_EOL; } return $tmp; } 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'].'"'; return << EOF; } public static function formClose() { return << EOF; } public static function formTitle($args) { $title = $args['title']; return <<$title EOF; } public static function formInputTextBlock($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 .= ''; if (isset($args['tip'])) { $html .= ''.$args['tip'].''; } $html .= '
'; return $html; } 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 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) { $label = isset($args['label'])?$args['label']:''; $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-control'; if (isset($args['class'])) { $class = $class.' '.$args['class']; } $type = 'text'; if (isset($args['type'])) { $type = $args['type']; } return <<
$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 formInputHidden($args) { return ''; } }