15function getLanguage() {
34 'Shift_JIS' =>
'ja_utf8',
37 $language =
'english';
38 if ( ! empty( $_POST[
'lang'] ) ) {
39 $language = $_POST[
'lang'];
40 }
else if ( isset( $_COOKIE[
'install_lang'] ) ) {
41 $language = $_COOKIE[
'install_lang'];
42 }
else if ( isset( $_SERVER[
'HTTP_ACCEPT_LANGUAGE'] ) ) {
43 foreach ( explode(
',', $_SERVER[
'HTTP_ACCEPT_LANGUAGE'] ) as $al ) {
44 $al = strtolower( $al );
45 $al_len = strlen( $al );
47 if ( preg_match(
'/([a-z]{2});q=[0-9.]+$/', $al, $al_match ) ) {
53 if ( isset( $language_array[ $al ] ) ) {
54 $language = $language_array[ $al ];
58 if ( file_exists( dirname( __DIR__ ) .
'/language/' . $al .
'_utf8' ) ) {
59 $language = $al .
'_utf8';
61 } elseif ( isset( $_SERVER[
'HTTP_ACCEPT_CHARSET'] ) ) {
62 foreach ( $charset_array as $ac => $lg ) {
63 if ( strpos( $_SERVER[
'HTTP_ACCEPT_CHARSET'], $ac ) !==
false ) {
69 if ( ! file_exists(
'./language/' . $language .
'/install.php' ) ) {
70 $language =
'english';
72 setcookie(
'install_lang', $language, [
'expires' => ini_get(
'session.cookie_lifetime' ),
'path' => ini_get(
'session.cookie_path' ),
'domain' => ini_get(
'session.cookie_domain' ),
'secure' => ini_get(
'session.cookie_secure' ),
'httponly' => ini_get(
'session.cookie_httponly' )]
81function getDirList( $dirname ) {
83 if ( is_dir( $dirname ) && $handle = opendir( $dirname ) ) {
84 while (
false !== ( $file = readdir( $handle ) ) ) {
85 if ( ! preg_match(
'/^[.]{1,2}$/', $file ) &&
'cvs' !== strtolower( $file ) && is_dir( $dirname . $file ) ) {
86 $dirlist[ $file ] = $file;
100function getImageFileList( $dirname ) {
102 if ( is_dir( $dirname ) && $handle = opendir( $dirname ) ) {
103 while (
false !== ( $file = readdir( $handle ) ) ) {
104 if ( ! preg_match(
'/^[.]{1,2}$/', $file ) && preg_match(
'/[.gif|.jpg|.png]$/i', $file ) ) {
105 $filelist[ $file ] = $file;
116function &xoops_module_gettemplate( $dirname, $template, $block =
false ) {
118 $path = XOOPS_ROOT_PATH .
'/modules/' . $dirname .
'/templates/blocks/' . $template;
120 $path = XOOPS_ROOT_PATH .
'/modules/' . $dirname .
'/templates/' . $template;
122 if ( ! file_exists( $path ) ) {
128 $lines = file( $path );
135 foreach ( $lines as $i => $iValue ) {
136 $ret .= str_replace(
"\n",
"\r\n", str_replace(
"\r\n",
"\n", $lines[ $i ] ) );
142function check_language( $language ) {
143 if ( file_exists(
'./language/' . $language .
'/install.php' ) ) {
150function b_back( $option =
null ) {
151 if ( ! isset( $option ) || ! is_array( $option ) ) {
155 if ( isset( $option[0] ) &&
'' !== $option[0] ) {
156 $content .=
'<a href="javascript:void(0);" onclick=\'location.href="index.php?op='
157 . htmlspecialchars( $option[0], ENT_QUOTES | ENT_HTML5 )
158 .
'"\' class="wizard-back" style="display:inline-block;vertical-align:top;">
159 <svg xmlns="http://www.w3.org/2000/svg" title="' . _INSTALL_L42
160 .
'" aria-hidden="true" focusable="false" width="1em" height="1em" style="vertical-align: -0.125em;" viewBox="0 0 24 24">
161 <path d="M17 13H8.75L12 16.25l-.664.75l-4.5-4.5l4.5-4.5l.664.75L8.75 12H17v1zm-15-.5a9.5 9.5 0 1 1 19 0a9.5 9.5 0 0 1-19 0zm1 0a8.5 8.5 0 1 0 17 0a8.5 8.5 0 0 0-17 0z" fill="currentColor"></path>
164 $content .=
'<a href="javascript:history.back();" class="wizard-back" style="display:inline-block;vertical-align:top;">
165 <svg xmlns="http://www.w3.org/2000/svg" title="' . _INSTALL_L42
166 .
'" aria-hidden="true" focusable="false" width="1em" height="1em" style="vertical-align: -0.125em;" viewBox="0 0 24 24">
167 <path d="M17 13H8.75L12 16.25l-.664.75l-4.5-4.5l4.5-4.5l.664.75L8.75 12H17v1zm-15-.5a9.5 9.5 0 1 1 19 0a9.5 9.5 0 0 1-19 0zm1 0a8.5 8.5 0 1 0 17 0a8.5 8.5 0 0 0-17 0z" fill="currentColor"></path>
170 if ( isset( $option[1] ) &&
'' != $option[1] ) {
171 $content .=
'<label class="wizard-back-label">' . htmlspecialchars( $option[1], ENT_QUOTES | ENT_HTML5 ) .
'</label>';
177function b_reload( $option =
'' ) {
178 if ( empty( $option ) ) {
181 if ( ! defined(
'_INSTALL_L200' ) ) {
182 define(
'_INSTALL_L200',
'Reload' );
184 if ( ! empty( $_POST[
'op'] ) ) {
186 } elseif ( ! empty( $_GET[
'op'] ) ) {
192 return '<a href="javascript:void(0);" onclick=\'location.href="index.php?op='
193 . htmlspecialchars( $op, ENT_QUOTES | ENT_HTML5 )
194 .
'"\' class="wizard-reload" style="display:inline-block;vertical-align:top;">
195 <svg xmlns="http://www.w3.org/2000/svg" title="' . _INSTALL_L200 .
'" aria-hidden="true" focusable="false" width="1em" height="1em" style="vertical-align: -0.125em;" viewBox="0 0 24 24">
196 <path d="M4.996 5h5v5h-1V6.493a6.502 6.502 0 0 0 2.504 12.5a6.5 6.5 0 0 0 1.496-12.827V5.142A7.5 7.5 0 1 1 7.744 6H4.996V5z" fill="#face74"/>
200function b_next( $option =
null ) {
201 if ( ! isset( $option ) || ! is_array( $option ) ) {
205 if ( isset( $option[1] ) &&
'' !== $option[1] ) {
206 $content .=
'<label class="wizard-next-label">' . htmlspecialchars( $option[1], ENT_QUOTES | ENT_HTML5 ) .
'</label>';
208 $content .=
'<input type="hidden" name="op" value="' . htmlspecialchars( $option[0], ENT_QUOTES | ENT_HTML5 ) .
'">';
209 $content .=
'<button type="submit" class="wizard-next" title="' . _INSTALL_L47
210 .
'" name="submit" value="' . _INSTALL_L47 .
'">
211 <svg xmlns="http://www.w3.org/2000/svg" title="' . _INSTALL_L47
212 .
'" aria-hidden="true" focusable="false" width="1em" height="1em" style="vertical-align: -0.125em;" viewBox="0 0 24 24">
213 <path d="M6.003 12h8.25l-3.25-3.25l.664-.75l4.5 4.5l-4.5 4.5l-.664-.75l3.25-3.25h-8.25v-1zm15 .5a9.5 9.5 0 1 1-19 0a9.5 9.5 0 0 1 19 0zm-1 0a8.5 8.5 0 1 0-17 0a8.5 8.5 0 0 0 17 0z" fill="currentColor"></path>