$attrs attributes * * @return string */ public static function arrayAttrToHtml($attrs): string { $sttrsStr = []; foreach ($attrs as $key => $val) { $sttrsStr[] = $key . '="' . DUPX_U::esc_attr($val) . '"'; } return implode(' ', $sttrsStr); } /** * Get header main * * @param string $htmlTitle Title * * @return void */ public static function getHeaderMain($htmlTitle): void { ?>

' . '
' . '
' . DUPX_U::esc_html($fileContent) . '
' . '
' . ''; } else { $lightBoxContent = '

File not found.'; } return DUPX_U_Html::getLigthBox($linkLabelHtml, $titleContent, $lightBoxContent, $echo); } /** * getLightBoxIframe * * @param string $linkLabelHtml the link label * @param string $titleContent the title of the light box * @param string $url the url of the iframe * @param bool $autoUpdate if true the iframe is auto updated * @param bool $enableTargetDownload Download button enabled * @param bool $echo if true the light box is echoed * * @return string */ public static function getLightBoxIframe( $linkLabelHtml, $titleContent, $url, $autoUpdate = false, $enableTargetDownload = false, $echo = true ) { $classes = ['dup-lightbox-iframe']; $afterContent = '

'; if ($autoUpdate) { //$classes[] = 'auto-update'; $afterContent .= ''; } if ($enableTargetDownload) { $path = parse_url($url, PHP_URL_PATH); if (!empty($path)) { $urlPath = parse_url($url, PHP_URL_PATH); $fileName = basename($urlPath); } else { $fileName = parse_url($url, PHP_URL_HOST); } $afterContent .= ''; } $afterContent .= '
'; $lightBoxContent = ' '; return DUPX_U_Html::getLigthBox($linkLabelHtml, $titleContent, $lightBoxContent, $echo, $afterContent); } /** * Light box CSS * * @return void */ protected static function lightBoxCss() { ?>
class="" data-more-step="" style="max-height: px">
$attrs attributes of input * @param bool $pwdSimulation if true emulate password type * * @return void */ public static function inputPasswordToggle($name, $id = '', $classes = [], $attrs = [], $pwdSimulation = false): void { if (!is_array($attrs)) { $attrs = []; } if (!is_array($classes)) { $classes = empty($classes) ? [] : [$classes]; } $idAttr = empty($id) ? '_id_' . $name : $id; $classes[] = 'input-password-group input-postfix-btn-group'; if ($pwdSimulation) { $attrs['type'] = 'text'; $attrs['class'] = 'pwd-simulation text-security-disc'; } else { $attrs['type'] = 'password'; } $attrs['name'] = $name; $attrs['id'] = $idAttr; $attrsHtml = []; foreach ($attrs as $atName => $atValue) { $attrsHtml[] = $atName . '="' . DUPX_U::esc_attr($atValue) . '"'; } ?> /> $inputAttrs input attributes * @param array $switchAttrs switch attributes * * @return void */ public static function checkboxSwitch($inputAttrs = [], $switchAttrs = []): void { $inputAttrs['type'] = 'checkbox'; if (!isset($switchAttrs['class'])) { $switchAttrs['class'] = []; } $switchAttrs['class'] = implode(' ', array_merge(['checkbox-switch'], (array) $switchAttrs['class'])); ?> > >