From: <be...@us...> - 2014-02-27 08:03:02
|
Revision: 12334 http://sourceforge.net/p/xoops/svn/12334 Author: beckmi Date: 2014-02-27 08:02:54 +0000 (Thu, 27 Feb 2014) Log Message: ----------- fixed language auto-detection (Rewarder/Mamba) - need testing Modified Paths: -------------- XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt XoopsModules/xlanguage/trunk/xlanguage/include/functions.php XoopsModules/xlanguage/trunk/xlanguage/include/vars.php XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php Modified: XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt 2014-02-26 02:34:32 UTC (rev 12333) +++ XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt 2014-02-27 08:02:54 UTC (rev 12334) @@ -1,5 +1,9 @@ xlanguage 3.04: ------------------- +- fixed language auto-detection (Rewarder/Mamba) + +xlanguage 3.04: +------------------- - updated POSIX Regex to PCRE (Mamba) - minor fixes (Mamba) - fixing generation of configuration file for extended languages @@ -26,12 +30,12 @@ ------------------- "input" parse improvement, reported by irmtfan @ xoops.org -xlanguage 2.02 +xlanguage 2.02 ------------------- bugfix for XSS vulnerability Thanks domifara @ dev.xoops.org -xlanguage 2.01 +xlanguage 2.01 ------------------- bugfix for nonexisting language Modified: XoopsModules/xlanguage/trunk/xlanguage/include/functions.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/include/functions.php 2014-02-26 02:34:32 UTC (rev 12333) +++ XoopsModules/xlanguage/trunk/xlanguage/include/functions.php 2014-02-27 08:02:54 UTC (rev 12334) @@ -30,57 +30,60 @@ function xlanguage_convert_encoding($value, $out_charset, $in_charset) { - if (is_array($value)) { - foreach($value as $key => $val){ - $value[$key] = xlanguage_convert_encoding($val, $out_charset, $in_charset); - } - } - else { - $value = xlanguage_convert_item($value, $out_charset, $in_charset); - } - return $value; + if (is_array($value)) { + foreach ($value as $key => $val) { + $value[$key] = xlanguage_convert_encoding($val, $out_charset, $in_charset); + } + } else { + $value = xlanguage_convert_item($value, $out_charset, $in_charset); + } + + return $value; } function xlanguage_convert_item($value, $out_charset, $in_charset) { - if(strtolower($in_charset) == strtolower($out_charset)) { - return $value; - } - $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true); - if(is_object($xconv_handler) && - $converted_value = @$xconv_handler->convert_encoding($value, $out_charset, $in_charset) - ){ - return $converted_value; - } - if(XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) { - $converted_value = @mb_convert_encoding($value, $out_charset, $in_charset); - }elseif(function_exists('iconv')) { - $converted_value = @iconv($in_charset, $out_charset, $value); - } - $value = empty($converted_value) ? $value : $converted_value; + if (strtolower($in_charset) == strtolower($out_charset)) { + return $value; + } + $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true); + if (is_object($xconv_handler) + && $converted_value = @$xconv_handler->convert_encoding($value, $out_charset, $in_charset) + ) { + return $converted_value; + } + if (XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) { + $converted_value = @mb_convert_encoding($value, $out_charset, $in_charset); + } elseif (function_exists('iconv')) { + $converted_value = @iconv($in_charset, $out_charset, $value); + } + $value = empty($converted_value) ? $value : $converted_value; - return $value; + return $value; } function xlanguage_createConfig() { - $xlang_handler=& xoops_getmodulehandler('language', 'xlanguage'); - return $xlang_handler->createConfig(); + $xlang_handler =& xoops_getmodulehandler('language', 'xlanguage'); + + return $xlang_handler->createConfig(); } function &xlanguage_loadConfig() { - $xlang_handler=& xoops_getmodulehandler('language', 'xlanguage'); - $config =& $xlang_handler->loadFileConfig(); - return $config; + $xlang_handler =& xoops_getmodulehandler('language', 'xlanguage'); + $config =& $xlang_handler->loadFileConfig(); + + return $config; } /** * Analyzes some PHP environment variables to find the most probable language * that should be used * - * @param string $ string to analyze - * @param integer $ type of the PHP environment variable which value is $str + * @param string $ string to analyze + * @param integer $ type of the PHP environment variable which value is $str + * * @global array the list of available translations * @global string the retained translation keyword * @access private @@ -88,196 +91,249 @@ function xlanguage_lang_detect($str = '', $envType = '') { global $available_languages; - $lang=''; - - if(!empty($available_languages)) { - foreach ($available_languages AS $key => $value) { - // $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable, - // 2 for the 'HTTP_USER_AGENT' one - $expr = $value[0]; - if (strpos($expr, '[-_]') === FALSE) { - $expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr); - } + $lang = ''; + + if (!empty($available_languages)) { + foreach ($available_languages AS $key => $value) { + // $envType = 1 for the 'HTTP_ACCEPT_LANGUAGE' environment variable, + // 2 for the 'HTTP_USER_AGENT' one + $expr = $value[0]; + if (strpos($expr, '[-_]') === false) { + $expr = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $expr); + } // if (($envType == 1 && eregi('^(' . $expr . ')(;q=[0-9]\\.[0-9])?$', $str)) // || ($envType == 2 && eregi('(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))', $str))) { - if (($envType == 1 && preg_match('#^(' . $expr . ')(;q=[0-9]\\.[0-9])?$#i', $str)) - || ($envType == 2 && preg_match('#(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))#i', $str))) { - $lang = $key; - //if($lang != 'en') - break; + if (($envType == 1 && preg_match('#^(' . $expr . ')(;q=[0-9]\\.[0-9])?$#i', $str)) + || ($envType == 2 && preg_match('#(\(|\[|;[[:space:]])(' . $expr . ')(;|\]|\))#i', $str)) + ) { + $lang = $key; + //if($lang != 'en') + break; + } } } - } + return $lang; } function xlanguage_detectLang() { - global $available_languages,$_SERVER; + global $available_languages, $_SERVER; - if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE']; - } + if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + $HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE']; + } - if (!empty($_SERVER['HTTP_USER_AGENT'])) { - $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; - } + if (!empty($_SERVER['HTTP_USER_AGENT'])) { + $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; + } - $lang = ''; - $xoops_lang =''; - // 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE - // variable - if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) { - $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); - $acceptedCnt = count($accepted); - reset($accepted); - for ($i = 0; $i < $acceptedCnt; $i++) { - $lang = xlanguage_lang_detect($accepted[$i], 1); - if(strncasecmp($lang,'en',2)){ - break; - } - } - } - // 2. try to findout user's language by checking its HTTP_USER_AGENT variable - if (empty($lang) && !empty($HTTP_USER_AGENT)) { - $lang = xlanguage_lang_detect($HTTP_USER_AGENT, 2); - } - // 3. If we catch a valid language, configure it - if (!empty($lang)) { - $xoops_lang = $available_languages[$lang][1]; - } - return $xoops_lang; + $lang = ''; + $xoops_lang = ''; + // 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE variable + + +// if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) { +// $accepted = explode(',', $HTTP_ACCEPT_LANGUAGE); +// $acceptedCnt = count($accepted); +// reset($accepted); +// for ($i = 0; $i < $acceptedCnt; ++$i) { +// $lang = xlanguage_lang_detect($accepted[$i], 1); +// if (strncasecmp($lang, 'en', 2)) { +// break; +// } +// } +// } + + + +//This returns the most preferred langauage "q=1" + $lang = getPreferredLanguage(); + + + // 2. if not found in HTTP_ACCEPT_LANGUAGE, try to find user's language by checking its HTTP_USER_AGENT variable + if (empty($lang) && !empty($HTTP_USER_AGENT)) { + $lang = xlanguage_lang_detect($HTTP_USER_AGENT, 2); + } + // 3. If we catch a valid language, configure it + if (!empty($lang)) { + $xoops_lang = $available_languages[$lang][1]; + } + + return $xoops_lang; } -function xlanguage_encoding($output){ - global $xlanguage; - $output = xlanguage_ml($output); - // escape XML doc - if(preg_match("/^\<\?[\s]?xml[\s]+version=([\"'])[^\>]+\\1[\s]+encoding=([\"'])[^\>]+\\2[\s]?\?\>/i", $output)){ - return $output; - } - $in_charset = $xlanguage["charset_base"]; +function xlanguage_encoding($output) +{ + global $xlanguage; + $output = xlanguage_ml($output); + // escape XML doc + if (preg_match("/^\<\?[\s]?xml[\s]+version=([\"'])[^\>]+\\1[\s]+encoding=([\"'])[^\>]+\\2[\s]?\?\>/i", $output)) { + return $output; + } + $in_charset = $xlanguage["charset_base"]; $out_charset = $xlanguage["charset"]; - - return $output = xlanguage_convert_encoding($output, $out_charset, $in_charset); + + return $output = xlanguage_convert_encoding($output, $out_charset, $in_charset); } function xlanguage_ml($s) { - global $xoopsConfig; - global $xlanguage_langs; - - if(!isset($xlanguage_langs)){ - $langs =& $GLOBALS["xlanguage_handler"]->getAll(true); - foreach( array_keys($langs) as $_lang ) { - $xlanguage_langs[$_lang] = $langs[$_lang]->getVar("lang_code"); - } - unset($langs); - } - if(empty($xlanguage_langs) || count($xlanguage_langs) ==0) return $s; - - // escape brackets inside of <code>...</code> - $patterns[] = '/(\<code>.*\<\/code>)/isU'; - - // escape brackets inside of <input type="..." value="..."> - $patterns[] = '/(\<input\b(?![^\>]*\btype=([\'"]?)(submit|image|reset|button))[^\>]*\>)/isU'; - - // escape brackets inside of <textarea></textarea> - $patterns[] = '/(\<textarea\b[^>]*>[^\<]*\<\/textarea>)/isU'; - - $s = preg_replace_callback( $patterns , 'xlanguage_ml_escape_bracket' , $s ) ; - - - // create the pattern between language tags - $pqhtmltags = explode( ',' , preg_quote( XLANGUAGE_TAGS_RESERVED , '/' ) ) ; - $mid_pattern = '(?:(?!(' . implode( '|' , $pqhtmltags ) . ')).)*' ; - - $patterns = array(); - $replaces = array(); - /* */ - if(isset($xlanguage_langs[$xoopsConfig['language']])) { - $lang = $xlanguage_langs[$xoopsConfig['language']]; - $patterns[] = '/(\[([^\]]*\|)?'.preg_quote($lang).'(\|[^\]]*)?\])('.$mid_pattern.')(\[\/([^\]]*\|)?'.preg_quote($lang).'(\|[^\]]*)?\])/isU'; - $replaces[] = '$4'; - } - /* */ - foreach( array_keys($xlanguage_langs) as $_lang ) { - if($_lang == @$xoopsConfig['language']) continue; - $name = $xlanguage_langs[$_lang]; - $patterns[] = '/(\[([^\]]*\|)?'.preg_quote($name).'(\|[^\]]*)?\])('.$mid_pattern.')(\[\/([^\]]*\|)?'.preg_quote($name).'(\|[^\]]*)?(\]\<br[\s]?[\/]?\>|\]))/isU'; - $replaces[] = ''; - } - if(!empty($xoopsConfig['language'])){ - $s = preg_replace( '/\[[\/]?[\|]?'.preg_quote($xoopsConfig['language']).'[\|]?\](\<br \/\>)?/i' , '' , $s ) ; - } - if(count($replaces)>0){ - $s = preg_replace( $patterns , $replaces , $s ) ; - } + global $xoopsConfig; + global $xlanguage_langs; - return $s ; + if (!isset($xlanguage_langs)) { + $langs =& $GLOBALS["xlanguage_handler"]->getAll(true); + foreach (array_keys($langs) as $_lang) { + $xlanguage_langs[$_lang] = $langs[$_lang]->getVar("lang_code"); + } + unset($langs); + } + if (empty($xlanguage_langs) || count($xlanguage_langs) == 0) { + return $s; + } + + // escape brackets inside of <code>...</code> + $patterns[] = '/(\<code>.*\<\/code>)/isU'; + + // escape brackets inside of <input type="..." value="..."> + $patterns[] = '/(\<input\b(?![^\>]*\btype=([\'"]?)(submit|image|reset|button))[^\>]*\>)/isU'; + + // escape brackets inside of <textarea></textarea> + $patterns[] = '/(\<textarea\b[^>]*>[^\<]*\<\/textarea>)/isU'; + + $s = preg_replace_callback($patterns, 'xlanguage_ml_escape_bracket', $s); + + // create the pattern between language tags + $pqhtmltags = explode(',', preg_quote(XLANGUAGE_TAGS_RESERVED, '/')); + $mid_pattern = '(?:(?!(' . implode('|', $pqhtmltags) . ')).)*'; + + $patterns = array(); + $replaces = array(); + /* */ + if (isset($xlanguage_langs[$xoopsConfig['language']])) { + $lang = $xlanguage_langs[$xoopsConfig['language']]; + $patterns[] = '/(\[([^\]]*\|)?' . preg_quote($lang) . '(\|[^\]]*)?\])(' . $mid_pattern . ')(\[\/([^\]]*\|)?' . preg_quote($lang) . '(\|[^\]]*)?\])/isU'; + $replaces[] = '$4'; + } + /* */ + foreach (array_keys($xlanguage_langs) as $_lang) { + if ($_lang == @$xoopsConfig['language']) { + continue; + } + $name = $xlanguage_langs[$_lang]; + $patterns[] = '/(\[([^\]]*\|)?' . preg_quote($name) . '(\|[^\]]*)?\])(' . $mid_pattern . ')(\[\/([^\]]*\|)?' . preg_quote($name) . '(\|[^\]]*)?(\]\<br[\s]?[\/]?\>|\]))/isU'; + $replaces[] = ''; + } + if (!empty($xoopsConfig['language'])) { + $s = preg_replace('/\[[\/]?[\|]?' . preg_quote($xoopsConfig['language']) . '[\|]?\](\<br \/\>)?/i', '', $s); + } + if (count($replaces) > 0) { + $s = preg_replace($patterns, $replaces, $s); + } + + return $s; } -function xlanguage_ml_escape_bracket( $matches ) +function xlanguage_ml_escape_bracket($matches) { - global $xlanguage_langs; - $ret = $matches[1]; - if(!empty($xlanguage_langs)) { - $pattern = '/(\[([\/])?('.implode("|",array_map("preg_quote", array_values($xlanguage_langs))).')([\|\]]))/isU'; - $ret = preg_replace($pattern, "[\\2\\3\\4", $ret); - } - return $ret; + global $xlanguage_langs; + $ret = $matches[1]; + if (!empty($xlanguage_langs)) { + $pattern = '/(\[([\/])?(' . implode("|", array_map("preg_quote", array_values($xlanguage_langs))) . ')([\|\]]))/isU'; + $ret = preg_replace($pattern, "[\\2\\3\\4", $ret); + } + + return $ret; } - function xlanguage_select_show($options = null) { - include_once XOOPS_ROOT_PATH."/modules/xlanguage/blocks/xlanguage_blocks.php"; - if(empty($options)){ - $options[0] = "images"; // display style: image, text, select - $options[1] = " "; // delimitor - $options[2] = 5; // items per line - } - - $block = b_xlanguage_select_show($options); - $block["tag"] = "xlanguage"; - - $content = ""; - $i = 1; - if(!empty($block["display"])) { //mb - if(in_array($block["display"], array("images", "text"))){ - foreach($block["languages"] as $name => $lang){ - $content .= "<a href=\"".$block["url"].$lang["name"]."\" title=\"".$lang["desc"]."\">"; - if($block["display"] == "images"){ - $content .= "<img src=\"".$lang["image"]."\" alt=\"".$lang["desc"]."\""; - if($block["selected"] != $lang["name"]){ - $content .= " style=\"MozOpacity: .8; opacity: .8; filter:Alpha(opacity=80);\""; - } - $content .= "/>"; - }else{ - $content .= $lang["desc"]; - } - $content .= "</a>"; - if( ( $i++ % $block["number"] ) == 0){ - $content .= "<br />"; - } - } - }else{ - $content .= "<select name=\"".$block["tag"]."\" - onChange=\"if(this.options[this.selectedIndex].value.length >0 ) { window.document.location=this.options[this.selectedIndex].value;}\" - >"; - if(!empty($block["languages"])) { //mb - foreach($block["languages"] as $name => $lang){ - $content .= "<option value=\"".$block["url"].$lang["name"]."\""; - if($block["selected"] == $lang["name"]){ - $content .= " selected "; - } - $content .= "/>".$lang["desc"]."</option>"; - } - } - $content .= "</select>"; - } - } + include_once XOOPS_ROOT_PATH . "/modules/xlanguage/blocks/xlanguage_blocks.php"; + if (empty($options)) { + $options[0] = "images"; // display style: image, text, select + $options[1] = " "; // delimitor + $options[2] = 5; // items per line + } - define("XLANGUAGE_SWITCH_CODE", $content); - return true; -} \ No newline at end of file + $block = b_xlanguage_select_show($options); + $block["tag"] = "xlanguage"; + + $content = ""; + $i = 1; + if (!empty($block["display"])) { //mb + if (in_array($block["display"], array("images", "text"))) { + foreach ($block["languages"] as $name => $lang) { + $content .= "<a href=\"" . $block["url"] . $lang["name"] . "\" title=\"" . $lang["desc"] . "\">"; + if ($block["display"] == "images") { + $content .= "<img src=\"" . $lang["image"] . "\" alt=\"" . $lang["desc"] . "\""; + if ($block["selected"] != $lang["name"]) { + $content .= " style=\"MozOpacity: .8; opacity: .8; filter:Alpha(opacity=80);\""; + } + $content .= "/>"; + } else { + $content .= $lang["desc"]; + } + $content .= "</a>"; + if ((++$i % $block["number"]) == 0) { + $content .= "<br />"; + } + } + } else { + $content .= "<select name=\"" . $block["tag"] . "\" + onChange=\"if (this.options[this.selectedIndex].value.length >0) { window.document.location=this.options[this.selectedIndex].value;}\" + >"; + if (!empty($block["languages"])) { //mb + foreach ($block["languages"] as $name => $lang) { + $content .= "<option value=\"" . $block["url"] . $lang["name"] . "\""; + if ($block["selected"] == $lang["name"]) { + $content .= " selected "; + } + $content .= "/>" . $lang["desc"] . "</option>"; + } + } + $content .= "</select>"; + } + } + + define("XLANGUAGE_SWITCH_CODE", $content); + + return true; +} + + + +function getPreferredLanguage() +{ + $langs = array(); + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { +// break up string into pieces (languages and q factors) + preg_match_all( + '/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', + $_SERVER['HTTP_ACCEPT_LANGUAGE'], + $lang_parse + ); + if (count($lang_parse[1])) { + // create a list like "en" => 0.8 + $langs = array_combine($lang_parse[1], $lang_parse[4]); + // set default to 1 for any without q factor + foreach ($langs as $lang => $val) { + if ($val === '') { + $langs[$lang] = 1; + } + } + // sort list based on value + arsort($langs, SORT_NUMERIC); + } + } +//extract most important (first) + foreach ($langs as $lang => $val) { + break; + } +//if complex language simplify it + if (stristr($lang, "-")) { + $tmp = explode("-", $lang); + $lang = $tmp[0]; + } + return $lang; +} Modified: XoopsModules/xlanguage/trunk/xlanguage/include/vars.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/include/vars.php 2014-02-26 02:34:32 UTC (rev 12333) +++ XoopsModules/xlanguage/trunk/xlanguage/include/vars.php 2014-02-27 08:02:54 UTC (rev 12334) @@ -1,107 +1,117 @@ -<?php -// $Id$ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // -if(!defined('XLANGUAGE_CONFIG_FILE')) define('XLANGUAGE_CONFIG_FILE', XOOPS_CACHE_PATH.'/xlanguage.php'); -if(!defined('XLANGUAGE_CONFIG_VAR')) define('XLANGUAGE_CONFIG_VAR', 'cached_config'); -if(!defined('XLANGUAGE_LANG_TAG')) define('XLANGUAGE_LANG_TAG', "lang"); -if(!defined('XLANGUAGE_TAGS_RESERVED')) define('XLANGUAGE_TAGS_RESERVED', "</head>,</body>"); - -/** - * phpMyAdmin Language Loading File - */ - -/** - * All the supported languages have to be listed in the array below. - * 1. The key must be the "official" ISO 639 language code and, if required, - * the dialect code. It can also contains some informations about the - * charset (see the Russian case). - * 2. The first of the values associated to the key is used in a regular - * expression to find some keywords corresponding to the language inside two - * environment variables. - * These values contains: - * - the "official" ISO language code and, if required, the dialect code - * also ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French - * dialects, 'zh[-_]tw' for Chinese traditional...); - * - the '|' character (it means 'OR'); - * - the full language name. - * 3. The second values associated to the key is the name of the file to load - * without the '.php' extension. - * 4. The last values associated to the key is the language code as defined by - * the RFC1766. - * - * Beware that the sorting order (first values associated to keys by - * alphabetical reverse order in the array) is important: 'zh-tw' (chinese - * traditional) must be detected before 'zh' (chinese simplified) for - * example. - * - * When there are more than one charset for a language, we put the -utf-8 - * first. - */ -$available_languages = array( - 'ar' => array('ar([-_][[:alpha:]]{2})?|arabic', 'arabic'), - 'bg' => array('bg|bulgarian', 'bulgarian'), - 'ca' => array('ca|catalan', 'catalan'), - 'cs' => array('cs|czech', 'czech'), - 'da' => array('da|danish', 'danish'), - 'de' => array('de([-_][[:alpha:]]{2})?|german', 'german'), - 'el' => array('el|greek', 'greek'), - 'en' => array('en([-_][[:alpha:]]{2})?|english', 'english'), - 'es' => array('es([-_][[:alpha:]]{2})?|spanish', 'spanish'), - 'et' => array('et|estonian', 'estonian'), - 'fi' => array('fi|finnish', 'finnish'), - 'fr' => array('fr([-_][[:alpha:]]{2})?|french', 'french'), - 'gl' => array('gl|galician', 'galician'), - 'he' => array('he|hebrew', 'hebrew'), - 'hr' => array('hr|croatian', 'croatian'), - 'hu' => array('hu|hungarian', 'hungarian'), - 'id' => array('id|indonesian', 'indonesian'), - 'it' => array('it|italian', 'italian'), - 'ja' => array('ja|japanese', 'japanese'), - 'ko' => array('ko|korean', 'koreano'), - 'ka' => array('ka|georgian', 'georgian'), - 'lt' => array('lt|lithuanian', 'lithuanian'), - 'lv' => array('lv|latvian', 'latvian'), - 'nl' => array('nl([-_][[:alpha:]]{2})?|dutch', 'dutch'), - 'no' => array('no|norwegian', 'norwegian'), - 'pl' => array('pl|polish', 'polish'), - 'pt-br' => array('pt[-_]br|brazilian portuguese', 'portuguesebr'), - 'pt' => array('pt([-_][[:alpha:]]{2})?|portuguese', 'portuguese'), - 'ro' => array('ro|romanian', 'romanian'), - 'ru' => array('ru|russian', 'russian'), - 'sk' => array('sk|slovak', 'slovak'), - 'sq' => array('sq|albanian', 'albanian'), - 'sr' => array('sr|serbian', 'serbian'), - 'sv' => array('sv|swedish', 'swedish'), - 'th' => array('th|thai', 'thai'), - 'tr' => array('tr|turkish', 'turkish'), - 'uk' => array('uk|ukrainian', 'ukrainian'), - 'zh-tw' => array('zh[-_]tw|chinese traditional', 'tchinese'), - 'zh-cn' => array('zh[-_]cn|chinese simplified', 'schinese'), - ); -?> \ No newline at end of file +<?php +// $Id$ +// ------------------------------------------------------------------------ // +// Xlanguage: eXtensible Language Management For Xoops // +// Copyright (c) 2004 Xoops China Community // +// <http://www.xoops.org.cn/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Author: D.J.(phppp) ph...@ho... // +// URL: http://www.xoops.org.cn // +// ------------------------------------------------------------------------- // +if (!defined('XLANGUAGE_CONFIG_FILE')) { + define('XLANGUAGE_CONFIG_FILE', XOOPS_CACHE_PATH . '/xlanguage.php'); +} +if (!defined('XLANGUAGE_CONFIG_VAR')) { + define('XLANGUAGE_CONFIG_VAR', 'cached_config'); +} +if (!defined('XLANGUAGE_LANG_TAG')) { + define('XLANGUAGE_LANG_TAG', "lang"); +} +if (!defined('XLANGUAGE_TAGS_RESERVED')) { + define('XLANGUAGE_TAGS_RESERVED', "</head>,</body>"); +} + +/** + * phpMyAdmin Language Loading File + */ + +/** + * All the supported languages have to be listed in the array below. + * 1. The key must be the "official" ISO 639 language code and, if required, + * the dialect code. It can also contains some informations about the + * charset (see the Russian case). + * 2. The first of the values associated to the key is used in a regular + * expression to find some keywords corresponding to the language inside two + * environment variables. + * These values contains: + * - the "official" ISO language code and, if required, the dialect code + * also ('bu' for Bulgarian, 'fr([-_][[:alpha:]]{2})?' for all French + * dialects, 'zh[-_]tw' for Chinese traditional...); + * - the '|' character (it means 'OR'); + * - the full language name. + * 3. The second values associated to the key is the name of the file to load + * without the '.php' extension. + * 4. The last values associated to the key is the language code as defined by + * the RFC1766. + * + * Beware that the sorting order (first values associated to keys by + * alphabetical reverse order in the array) is important: 'zh-tw' (chinese + * traditional) must be detected before 'zh' (chinese simplified) for + * example. + * + * When there are more than one charset for a language, we put the -utf-8 + * first. + */ +$available_languages = array( + 'ar' => array('ar([-_][[:alpha:]]{2})?|arabic', 'arabic'), + 'bg' => array('bg|bulgarian', 'bulgarian'), + 'ca' => array('ca|catalan', 'catalan'), + 'cs' => array('cs|czech', 'czech'), + 'da' => array('da|danish', 'danish'), + 'de' => array('de([-_][[:alpha:]]{2})?|german', 'german'), + 'el' => array('el|greek', 'greek'), + 'en' => array('en([-_][[:alpha:]]{2})?|english', 'english'), + 'es' => array('es([-_][[:alpha:]]{2})?|spanish', 'spanish'), + 'et' => array('et|estonian', 'estonian'), + 'fi' => array('fi|finnish', 'finnish'), + 'fr' => array('fr([-_][[:alpha:]]{2})?|french', 'french'), + 'gl' => array('gl|galician', 'galician'), + 'he' => array('he|hebrew', 'hebrew'), + 'hr' => array('hr|croatian', 'croatian'), + 'hu' => array('hu|hungarian', 'hungarian'), + 'id' => array('id|indonesian', 'indonesian'), + 'it' => array('it|italian', 'italian'), + 'ja' => array('ja|japanese', 'japanese'), + 'ko' => array('ko|korean', 'koreano'), + 'ka' => array('ka|georgian', 'georgian'), + 'lt' => array('lt|lithuanian', 'lithuanian'), + 'lv' => array('lv|latvian', 'latvian'), + 'nl' => array('nl([-_][[:alpha:]]{2})?|dutch', 'dutch'), + 'no' => array('no|norwegian', 'norwegian'), + 'pl' => array('pl|polish', 'polish'), + 'pt-br' => array('pt[-_]br|brazilian portuguese', 'portuguesebr'), + 'pt' => array('pt([-_][[:alpha:]]{2})?|portuguese', 'portuguese'), + 'ro' => array('ro|romanian', 'romanian'), + 'ru' => array('ru|russian', 'russian'), + 'sk' => array('sk|slovak', 'slovak'), + 'sq' => array('sq|albanian', 'albanian'), + 'sr' => array('sr|serbian', 'serbian'), + 'sv' => array('sv|swedish', 'swedish'), + 'th' => array('th|thai', 'thai'), + 'tr' => array('tr|turkish', 'turkish'), + 'uk' => array('uk|ukrainian', 'ukrainian'), + 'zh-tw' => array('zh[-_]tw|chinese traditional', 'tchinese'), + 'zh-cn' => array('zh[-_]cn|chinese simplified', 'schinese'), +); + +// mb +$GLOBALS['available_languages'] =& $available_languages; Modified: XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php 2014-02-26 02:34:32 UTC (rev 12333) +++ XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php 2014-02-27 08:02:54 UTC (rev 12334) @@ -27,65 +27,65 @@ // Author: D.J.(phppp) ph...@ho... // // URL: http://xoops.org.cn // // ------------------------------------------------------------------------- // -$modversion['name'] = _MI_XLANGUAGE_NAME; -$modversion['version'] = 3.04; -$modversion['description'] = _MI_XLANGUAGE_DESC; -$modversion['credits'] = "Adi Chiributa - web...@ar...; wjue - http://www.wjue.org; GIJOE - http://www.peak.ne.jp"; -$modversion['author'] = "phppp(D.J.)" ; -$modversion['help'] = "page=help"; -$modversion['license'] = "GNU GPL"; -$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/"; -$modversion['official'] = 0; -$modversion['image'] = "xlanguage_logo.png"; -$modversion['dirname'] = "xlanguage"; +$modversion['name'] = _MI_XLANGUAGE_NAME; +$modversion['version'] = 3.05; +$modversion['description'] = _MI_XLANGUAGE_DESC; +$modversion['credits'] = "Adi Chiributa - web...@ar...; wjue - http://www.wjue.org; GIJOE - http://www.peak.ne.jp"; +$modversion['author'] = "phppp(D.J.)"; +$modversion['help'] = "page=help"; +$modversion['license'] = "GNU GPL"; +$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html"; +$modversion['official'] = 0; +$modversion['image'] = "xlanguage_logo.png"; +$modversion['dirname'] = basename(dirname(__FILE__)); $modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin'; -$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16'; -$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32'; +$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16'; +$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32'; //about -$modversion['release_date'] = '2012/06/19'; -$modversion["module_website_url"] = "www.xoops.org/"; +$modversion['release_date'] = '2014/02/26'; +$modversion["module_website_url"] = "www.xoops.org/"; $modversion["module_website_name"] = "XOOPS"; -$modversion["module_status"] = "Final"; -$modversion['min_php']='5.2'; -$modversion['min_xoops']="2.5.5"; -$modversion['min_admin']='1.1'; -$modversion['min_db']= array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); +$modversion["module_status"] = "Beta 1"; +$modversion['min_php'] = '5.3.7'; +$modversion['min_xoops'] = "2.5.6"; +$modversion['min_admin'] = '1.1'; +$modversion['min_db'] = array('mysql' => '5.0.7', 'mysqli' => '5.0.7'); $modversion['system_menu'] = 1; $modversion['sqlfile']['mysql'] = "sql/mysql.sql"; -$modversion['tables'][0] = "xlanguage_base"; -$modversion['tables'][1] = "xlanguage_ext"; +$modversion['tables'][0] = "xlanguage_base"; +$modversion['tables'][1] = "xlanguage_ext"; // Admin things -$modversion['hasAdmin'] = 1; +$modversion['hasAdmin'] = 1; $modversion['adminindex'] = "admin/index.php"; -$modversion['adminmenu'] = "admin/menu.php"; +$modversion['adminmenu'] = "admin/menu.php"; // Use smarty $modversion["use_smarty"] = 1; //language selection block -$modversion['blocks'][1]['file'] = "xlanguage_blocks.php"; -$modversion['blocks'][1]['name'] = _MI_XLANGUAGE_BNAME; +$modversion['blocks'][1]['file'] = "xlanguage_blocks.php"; +$modversion['blocks'][1]['name'] = _MI_XLANGUAGE_BNAME; $modversion['blocks'][1]['description'] = ''; -$modversion['blocks'][1]['show_func'] = "b_xlanguage_select_show"; -$modversion['blocks'][1]['edit_func'] = "b_xlanguage_select_edit"; -$modversion['blocks'][1]['options'] = "images| |5"; -$modversion["blocks"][1]["template"] = "xlanguage_block.html"; +$modversion['blocks'][1]['show_func'] = "b_xlanguage_select_show"; +$modversion['blocks'][1]['edit_func'] = "b_xlanguage_select_edit"; +$modversion['blocks'][1]['options'] = "images| |5"; +$modversion["blocks"][1]["template"] = "xlanguage_block.html"; -$modversion['releasedate'] = "July 9th, 2006"; -$modversion['status'] = "stable"; +$modversion['releasedate'] = "July 9th, 2006"; +$modversion['status'] = "stable"; $modversion['xoopsversion'] = "2.0+"; -$modversion['author_website'][1]['url'] = "http://xoops.org.cn"; +$modversion['author_website'][1]['url'] = "http://xoops.org.cn"; $modversion['author_website'][1]['name'] = "The Xoops China Community"; -$modversion['author_website'][2]['url'] = "http://xoopsforge.com"; +$modversion['author_website'][2]['url'] = "http://xoopsforge.com"; $modversion['author_website'][2]['name'] = "XForge"; -$modversion['author_email'] = "ph...@ho..."; -$modversion['demo_site_url'] = "http://xoops.org.cn"; -$modversion['demo_site_name'] = "Xoops China"; -$modversion['support_site_url'] = "http://xoopsforge.com"; -$modversion['support_site_name'] = "XForge"; \ No newline at end of file +$modversion['author_email'] = "ph...@ho..."; +$modversion['demo_site_url'] = "http://xoops.org.cn"; +$modversion['demo_site_name'] = "Xoops China"; +$modversion['support_site_url'] = "http://xoopsforge.com"; +$modversion['support_site_name'] = "XForge"; |
From: <be...@us...> - 2015-09-25 09:26:25
|
Revision: 13152 http://sourceforge.net/p/xoops/svn/13152 Author: beckmi Date: 2015-09-25 09:26:23 +0000 (Fri, 25 Sep 2015) Log Message: ----------- synch with Git Modified Paths: -------------- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php XoopsModules/xlanguage/trunk/xlanguage/admin/index.php XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php XoopsModules/xlanguage/trunk/xlanguage/admin/main.php XoopsModules/xlanguage/trunk/xlanguage/api.php XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php XoopsModules/xlanguage/trunk/xlanguage/class/language.php XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt XoopsModules/xlanguage/trunk/xlanguage/language/english/blocks.php XoopsModules/xlanguage/trunk/xlanguage/language/english/modinfo.php XoopsModules/xlanguage/trunk/xlanguage/preloads/core.php XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php Added Paths: ----------- XoopsModules/xlanguage/trunk/xlanguage/images/croatia.png Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -26,4 +26,4 @@ echo $aboutAdmin->addNavigation('about.php'); echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); -include 'admin_footer.php'; \ No newline at end of file +include 'admin_footer.php'; Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -1,84 +1,83 @@ -<?php -// $Id: about2.php 8203 2011-11-07 03:55:46Z beckmi $ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // -include '../../../include/cp_header.php'; -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; -xoops_cp_header(); -$myts = &MyTextSanitizer::getInstance(); - -$module_handler =& xoops_gethandler('module'); -$versioninfo =& $module_handler->get($xoopsModule->getVar('mid')); - -// Left headings... -echo "<a href='index.php'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/" . $versioninfo -> getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>"; -echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " . $versioninfo->getInfo('version') . "</div>"; -echo "</div>"; -echo "<div>" . _MI_XLANG_RELEASE . ": " . $versioninfo -> getInfo('releasedate') . "</div>"; - -// Author Information -$sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_INFO, "", ""); -if ( $versioninfo->getInfo('author_realname')) - $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")"; -else - $author_name = $versioninfo->getInfo('author'); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_NAME, $author_name)); -$author_sites = $versioninfo -> getInfo('author_website'); -$author_site_info = ""; -foreach($author_sites as $site){ - $author_site_info .= "<a href='" . $site['url'] . "' target='blank'>" . $site['name'] . "</a>; "; -} -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_WEBSITE, $author_site_info)); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_EMAIL, "<a href='mailto:" . $versioninfo -> getInfo('author_email') . "'>" . $versioninfo -> getInfo('author_email') . "</a>")); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_CREDITS, $versioninfo -> getInfo('credits'))); -$sform -> display(); - -$sform = new XoopsThemeForm(_MI_XLANG_MODULE_INFO, "", ""); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_STATUS, $versioninfo -> getInfo('status'))); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_XOOPSVERSION, $versioninfo -> getInfo('xoopsversion'))); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_DEMO, "<a href='" . $versioninfo -> getInfo('demo_site_url') . "' target='blank'>" . $versioninfo -> getInfo('demo_site_name') . "</a>")); -$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_SUPPORT, "<a href='" . $versioninfo -> getInfo('support_site_url') . "' target='blank'>" . $versioninfo -> getInfo('support_site_name') . "</a>")); -$sform -> display(); - -$file = "../bugfixlist.txt"; -if (@file_exists($file)) -{ - $fp = @fopen($file, "r"); - $bugtext = @fread($fp, filesize($file)); - @fclose($file); - $sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_BUGFIXES, "", ""); - ob_start(); - echo "<div class='even' align='left'>".$myts->displayTarea($bugtext)."</div>"; - $sform -> addElement(new XoopsFormLabel('', ob_get_contents(), 0)); - ob_end_clean(); - $sform -> display(); - unset($file); -} - -xoops_cp_footer(); -?> \ No newline at end of file +<?php +// $Id: about2.php 8203 2011-11-07 03:55:46Z beckmi $ +// ------------------------------------------------------------------------ // +// Xlanguage: eXtensible Language Management For Xoops // +// Copyright (c) 2004 Xoops China Community // +// <http://www.xoops.org.cn/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Author: D.J.(phppp) ph...@ho... // +// URL: http://www.xoops.org.cn // +// ------------------------------------------------------------------------- // +include '../../../include/cp_header.php'; +include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; +xoops_cp_header(); +$myts = &MyTextSanitizer::getInstance(); + +$module_handler =& xoops_gethandler('module'); +$versioninfo =& $module_handler->get($xoopsModule->getVar('mid')); + +// Left headings... +echo "<a href='index.php'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/" . $versioninfo -> getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>"; +echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " . $versioninfo->getInfo('version') . "</div>"; +echo "</div>"; +echo "<div>" . _MI_XLANG_RELEASE . ": " . $versioninfo -> getInfo('releasedate') . "</div>"; + +// Author Information +$sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_INFO, "", ""); +if ( $versioninfo->getInfo('author_realname')) + $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")"; +else + $author_name = $versioninfo->getInfo('author'); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_NAME, $author_name)); +$author_sites = $versioninfo -> getInfo('author_website'); +$author_site_info = ""; +foreach($author_sites as $site){ + $author_site_info .= "<a href='" . $site['url'] . "' target='blank'>" . $site['name'] . "</a>; "; +} +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_WEBSITE, $author_site_info)); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_EMAIL, "<a href='mailto:" . $versioninfo -> getInfo('author_email') . "'>" . $versioninfo -> getInfo('author_email') . "</a>")); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_CREDITS, $versioninfo -> getInfo('credits'))); +$sform -> display(); + +$sform = new XoopsThemeForm(_MI_XLANG_MODULE_INFO, "", ""); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_STATUS, $versioninfo -> getInfo('status'))); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_XOOPSVERSION, $versioninfo -> getInfo('xoopsversion'))); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_DEMO, "<a href='" . $versioninfo -> getInfo('demo_site_url') . "' target='blank'>" . $versioninfo -> getInfo('demo_site_name') . "</a>")); +$sform -> addElement(new XoopsFormLabel(_MI_XLANG_MODULE_SUPPORT, "<a href='" . $versioninfo -> getInfo('support_site_url') . "' target='blank'>" . $versioninfo -> getInfo('support_site_name') . "</a>")); +$sform -> display(); + +$file = "../bugfixlist.txt"; +if (@file_exists($file)) +{ + $fp = @fopen($file, "r"); + $bugtext = @fread($fp, filesize($file)); + @fclose($file); + $sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_BUGFIXES, "", ""); + ob_start(); + echo "<div class='even' align='left'>".$myts->displayTarea($bugtext)."</div>"; + $sform -> addElement(new XoopsFormLabel('', ob_get_contents(), 0)); + ob_end_clean(); + $sform -> display(); + unset($file); +} + +xoops_cp_footer(); Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -7,4 +7,4 @@ ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" ."</div>"; -xoops_cp_footer(); \ No newline at end of file +xoops_cp_footer(); Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -43,4 +43,4 @@ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); }else{ redirect_header("../../../admin.php", 5, _AM_XLANG_MODULEADMIN_MISSING, false); - } \ No newline at end of file + } Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/index.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -1,37 +1,37 @@ -<?php -// $Id$ -// ------------------------------------------------------------------------ // -// XOOPS - PHP Content Management System // -// Copyright (c) 2000 XOOPS.org // -// <http://www.xoops.org/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -include '../../../include/cp_header.php'; - -include 'admin_header.php'; -xoops_cp_header(); - -$indexAdmin = new ModuleAdmin(); - - echo $indexAdmin->addNavigation('index.php'); - echo $indexAdmin->renderIndex(); - -include "admin_footer.php"; \ No newline at end of file +<?php +// $Id$ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +include '../../../include/cp_header.php'; + +include 'admin_header.php'; +xoops_cp_header(); + +$indexAdmin = new ModuleAdmin(); + + echo $indexAdmin->addNavigation('index.php'); + echo $indexAdmin->renderIndex(); + +include "admin_footer.php"; Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -32,11 +32,11 @@ $sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, "langform", xoops_getenv('PHP_SELF')); if($isBase){ - $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name); - $lang_select->addOptionArray($xlanguage_handler->getXoopsLangList()); - $sform->addElement($lang_select, true); + $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name); + $lang_select->addOptionArray($xlanguage_handler->getXoopsLangList()); + $sform->addElement($lang_select, true); }else{ - $sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true); + $sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true); } $sform->addElement(new XoopsFormText(_AM_XLANG_DESC, 'lang_desc', 50, 255, $lang_desc)); @@ -46,23 +46,21 @@ $lang_code->setDescription(_AM_XLANG_CODE_DESC); $sform->addElement($lang_code, true); - //$sform->addElement(new XoopsFormText(_AM_XLANG_CHARSET, 'lang_charset', 50, 255, $lang_charset), true); $lang_charset = new XoopsFormText(_AM_XLANG_CHARSET, 'lang_charset', 50, 255, $lang_charset); $lang_charset->setDescription(_AM_XLANG_CHARSET_DESC); $sform->addElement($lang_charset, true); - if(!$isBase){ - $baseList =& $xlanguage_handler->getAll(); - $base_list = array(); - foreach($baseList as $base => $baselang){ - $base_list[$base] = $base; - } - - $base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base); - $base_select->addOptionArray($base_list); - $sform->addElement($base_select, true); + $baseList =& $xlanguage_handler->getAll(); + $base_list = array(); + foreach($baseList as $base => $baselang){ + $base_list[$base] = $base; + } + + $base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base); + $base_select->addOptionArray($base_list); + $sform->addElement($base_select, true); } $sform->addElement(new XoopsFormText(_AM_XLANG_WEIGHT, 'weight', 10, 10, $weight)); @@ -91,4 +89,4 @@ $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); $sform->addElement($button_tray); -$sform->display(); \ No newline at end of file +$sform->display(); Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/main.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -1,4 +1,4 @@ -<?php +<?php // $Id: main.php 8586 2011-12-27 12:03:19Z beckmi $ // ------------------------------------------------------------------------ // // Xlanguage: eXtensible Language Management For Xoops // @@ -37,13 +37,13 @@ if ( isset( $_POST ) ){ foreach ( $_POST as $k => $v ) { ${$k} = $v; - } -} + } +} if ( isset( $_GET ) ){ foreach ( $_GET as $k => $v ) { ${$k} = $v; - } -} + } +} define("XLANG_CONFIG_LINK","<a href='main.php' target='_self'>"._AM_XLANG_CONFIG."</a>"); @@ -53,108 +53,107 @@ switch ( $op ) { case "del": - if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){ - xoops_cp_header(); + if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){ + xoops_cp_header(); $aboutAdmin = new ModuleAdmin(); -echo $aboutAdmin->addNavigation('main.php'); +echo $aboutAdmin->addNavigation('main.php'); // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; - xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM ); - }else{ - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - $lang =& $xlanguage_handler->get($lang_id, $isBase); - $xlanguage_handler->delete($lang); - redirect_header("main.php",2,_AM_XLANG_DELETED); - } + xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM ); + }else{ + if(isset($type)&&$type=='ext') $isBase = false; + else $isBase = true; + $lang =& $xlanguage_handler->get($lang_id, $isBase); + $xlanguage_handler->delete($lang); + redirect_header("main.php",2,_AM_XLANG_DELETED); + } break; case "save": - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - if(isset($lang_id)&&$lang_id>0){ - $lang =& $xlanguage_handler->get($lang_id, $isBase); - }else{ - $lang =& $xlanguage_handler->create(true, $isBase); - } - $lang_name = preg_replace("/[^a-zA-Z0-9\_\-]/", "", $lang_name); - - $lang->setVar('lang_name',$lang_name); - $lang->setVar('lang_desc',$lang_desc); - $lang->setVar('lang_code',$lang_code); - $lang->setVar('lang_charset',$lang_charset); - $lang->setVar('lang_image',$lang_image); - if(!$isBase){ - $lang->setVar('lang_base',$lang_base); - } - $lang->setVar('weight',$weight); - $xlanguage_handler->insert($lang); - redirect_header("main.php",2,_AM_XLANG_SAVED); + if(isset($type)&&$type=='ext') $isBase = false; + else $isBase = true; + if(isset($lang_id)&&$lang_id>0){ + $lang =& $xlanguage_handler->get($lang_id, $isBase); + }else{ + $lang =& $xlanguage_handler->create(true, $isBase); + } + $lang_name = preg_replace("/[^a-zA-Z0-9\_\-]/", "", $lang_name); + + $lang->setVar('lang_name',$lang_name); + $lang->setVar('lang_desc',$lang_desc); + $lang->setVar('lang_code',$lang_code); + $lang->setVar('lang_charset',$lang_charset); + $lang->setVar('lang_image',$lang_image); + if(!$isBase){ + $lang->setVar('lang_base',$lang_base); + } + $lang->setVar('weight',$weight); + $xlanguage_handler->insert($lang); + redirect_header("main.php",2,_AM_XLANG_SAVED); break; case "edit": xoops_cp_header(); $aboutAdmin = new ModuleAdmin(); -echo $aboutAdmin->addNavigation('main.php'); - // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; +echo $aboutAdmin->addNavigation('main.php'); + // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; // echo "<br />"; echo "<h4>" . _AM_XLANG_EDITLANG . "</h4>"; - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - if(isset($lang_id)&&$lang_id>0){ - $lang =& $xlanguage_handler->get($lang_id, $isBase); - }elseif(isset($lang_name)){ - $lang =& $xlanguage_handler->getByName($lang_name, $isBase); - }else{ - $lang =& $xlanguage_handler->create(true, $isBase); - } - $lang_name = $lang->getVar('lang_name'); - $lang_desc = $lang->getVar('lang_desc'); - $lang_code = $lang->getVar('lang_code'); - $lang_charset = $lang->getVar('lang_charset'); - $lang_image = $lang->getVar('lang_image'); - $weight = $lang->getVar('weight'); - if(!$isBase){ - $lang_base = $lang->getVar('lang_base'); - } + if(isset($type)&&$type=='ext') $isBase = false; + else $isBase = true; + if(isset($lang_id)&&$lang_id>0){ + $lang =& $xlanguage_handler->get($lang_id, $isBase); + }elseif(isset($lang_name)){ + $lang =& $xlanguage_handler->getByName($lang_name, $isBase); + }else{ + $lang =& $xlanguage_handler->create(true, $isBase); + } + $lang_name = $lang->getVar('lang_name'); + $lang_desc = $lang->getVar('lang_desc'); + $lang_code = $lang->getVar('lang_code'); + $lang_charset = $lang->getVar('lang_charset'); + $lang_image = $lang->getVar('lang_image'); + $weight = $lang->getVar('weight'); + if(!$isBase){ + $lang_base = $lang->getVar('lang_base'); + } include "langform.inc.php"; break; case "add": xoops_cp_header(); -$aboutAdmin = new ModuleAdmin(); -// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; +$aboutAdmin = new ModuleAdmin(); +// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; // echo "<br />"; // echo "<h4>" . _AM_XLANG_ADDLANG . "</h4>"; - if(isset($type)&&$type=='ext') { - $isBase = false; - echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); } - else { - $isBase = true; - echo $aboutAdmin->addNavigation('main.php?op=add&type=base'); - } - $lang_name = ''; - $lang_desc = ''; - $lang_code = ''; - $lang_charset = ''; - $lang_image = ''; - $weight = 1; - $lang_base = ''; + if(isset($type)&&$type=='ext') { + $isBase = false; + echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); } + else { + $isBase = true; + echo $aboutAdmin->addNavigation('main.php?op=add&type=base'); + } + $lang_name = ''; + $lang_desc = ''; + $lang_code = ''; + $lang_charset = ''; + $lang_image = ''; + $weight = 1; + $lang_base = ''; include "langform.inc.php"; break; - case 'createconfig': + case 'createconfig': xlanguage_createConfig(); redirect_header( 'main.php', 1, _AM_XLANG_CREATED ); exit(); break; case "default": - default: + default: xoops_cp_header(); $mainAdmin = new ModuleAdmin(); -echo $mainAdmin->addNavigation('main.php'); +echo $mainAdmin->addNavigation('main.php'); - // if (TDMDownloads_checkModuleAdmin()){ // $mainAdmin = new ModuleAdmin(); // echo $mainAdmin->addNavigation('downloads.php'); @@ -163,7 +162,7 @@ echo $mainAdmin->renderButton(); // } - + // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; languageList(); $configfile_status = (@is_readable(XLANGUAGE_CONFIG_FILE))?_AM_XLANG_CONFIGOK:_AM_XLANG_CONFIGNOTOK; @@ -174,67 +173,66 @@ // echo " - <b><a href='about.php'>" . _AM_XLANG_ABOUT . "</a></b>"; echo"</td></tr></table>"; break; -} +} xoops_cp_footer(); - function languageList() { global $xlanguage_handler, $xoopsModule; global $pathIcon16; - + $lang_list =& $xlanguage_handler->getAllList(); if ( is_array($lang_list)&&count( $lang_list ) > 0 ){ echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; echo "<div style='text-align: center;'><b><h4>" . _AM_XLANG_LANGLIST . "</h4></b><br />"; echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>" . _AM_XLANG_DESC . "</th><th align='center'>" . _AM_XLANG_NAME . "</th><th align='center'>" . _AM_XLANG_CHARSET . "</th><th align='center'>" . _AM_XLANG_CODE . "</th><th align='center'>" . _AM_XLANG_IMAGE . "</th><th align='center'>" . _AM_XLANG_WEIGHT . "</th><th align='center'>" . _AM_XLANG_BASE . "</th><th align='center'>" . _AM_XLANG_ACTION . "</th></tr>\n"; - $class = 'even'; + $class = 'even'; foreach( array_keys($lang_list) as $lang_name ) { - $lang =& $lang_list[$lang_name]; - $isOrphan = true; - if(isset($lang['base'])){ - echo "<tr>\n"; - echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n"; - echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n"; - echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n"; - echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n"; - if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$lang['base'] -> getVar('lang_image'))){ - $lang_image = $lang['base'] -> getVar('lang_image'); - }else{ - $lang_image = 'noflag.gif'; - } - echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n"; - echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n"; - echo "<td class='$class' >Ø</td>\n"; - echo "<td class='$class' ><a href='main.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n". - "<a href='main.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n"; - echo "</tr>\n"; - $isOrphan = false; - $class = ($class == 'odd') ? 'even' : 'odd'; + $lang =& $lang_list[$lang_name]; + $isOrphan = true; + if(isset($lang['base'])){ + echo "<tr>\n"; + echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n"; + echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n"; + echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n"; + echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n"; + if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$lang['base'] -> getVar('lang_image'))){ + $lang_image = $lang['base'] -> getVar('lang_image'); + }else{ + $lang_image = 'noflag.gif'; + } + echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n"; + echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n"; + echo "<td class='$class' >Ø</td>\n"; + echo "<td class='$class' ><a href='main.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n". + "<a href='main.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n"; + echo "</tr>\n"; + $isOrphan = false; + $class = ($class == 'odd') ? 'even' : 'odd'; } if(!isset($lang['ext'])||count($lang['ext'])<1) continue; foreach($lang['ext'] as $ext){ - echo "<tr>\n"; - echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n"; - echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n"; - echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n"; - echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n"; - if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$ext -> getVar('lang_image'))){ - $lang_image = $ext -> getVar('lang_image'); - }else{ - $lang_image = 'noflag.gif'; - } - echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n"; - echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n"; - $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base'); - echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n"; - echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n". - "<a href='main.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n"; - echo "</tr>\n"; + echo "<tr>\n"; + echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n"; + echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n"; + echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n"; + echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n"; + if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$ext -> getVar('lang_image'))){ + $lang_image = $ext -> getVar('lang_image'); + }else{ + $lang_image = 'noflag.gif'; + } + echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n"; + echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n"; + $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base'); + echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n"; + echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n". + "<a href='main.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n"; + echo "</tr>\n"; } - echo "<tr><td colspan='9' ></td></tr>\n"; - $class = ($class == 'odd') ? 'even' : 'odd'; + echo "<tr><td colspan='9' ></td></tr>\n"; + $class = ($class == 'odd') ? 'even' : 'odd'; } echo "</table></div>\n"; @@ -242,4 +240,3 @@ echo "<br />"; } } -?> Modified: XoopsModules/xlanguage/trunk/xlanguage/api.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -36,43 +36,43 @@ $xlanguage["action"] = false; if (!empty($_GET[XLANGUAGE_LANG_TAG])) { - $cookie_path = "/"; - setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0); - $xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG]; + $cookie_path = "/"; + setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0); + $xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG]; }elseif (!empty($_COOKIE[$cookie_var])) { - $xlanguage["lang"] = $_COOKIE[$cookie_var]; - /* FIXME: shall we remove it? */ - /* - if(preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])){ - }elseif (strpos($_SERVER['REQUEST_URI'], "?")) { - $_SERVER['REQUEST_URI'] .= "&".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"]; + $xlanguage["lang"] = $_COOKIE[$cookie_var]; + /* FIXME: shall we remove it? */ + /* + if(preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])){ + }elseif (strpos($_SERVER['REQUEST_URI'], "?")) { + $_SERVER['REQUEST_URI'] .= "&".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"]; }else{ - $_SERVER['REQUEST_URI'] .= "?".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"]; + $_SERVER['REQUEST_URI'] .= "?".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"]; } */ -}elseif($lang = xlanguage_detectLang()) { - $xlanguage["lang"] = $lang; +}elseif($lang = xlanguage_detectLang()) { + $xlanguage["lang"] = $lang; }else{ - $xlanguage["lang"] = $xoopsConfig['language']; + $xlanguage["lang"] = $xoopsConfig['language']; } $xlanguage_handler=& xoops_getmodulehandler('language', 'xlanguage'); $xlanguage_handler->loadConfig(); $lang = $xlanguage_handler->getByName($xlanguage["lang"]); if(is_object($lang) && strcasecmp($lang->getVar('lang_name'),$xoopsConfig['language'])){ - if($lang->isBase()){ - $xoopsConfig['language'] = $lang->getVar('lang_name'); - }else{ - $lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base')); - if(is_object($lang_base)){ - $xlanguage['charset_base'] = $lang_base->getVar('lang_charset'); - $xlanguage["action"] = true; - $xoopsConfig['language'] = $lang_base->getVar('lang_name'); - unset($lang_base); - } - } - if($lang->getVar('lang_charset')) $xlanguage['charset'] = $lang->getVar('lang_charset'); - if($lang->getVar('lang_code')) $xlanguage['code'] = $lang->getVar('lang_code'); + if($lang->isBase()){ + $xoopsConfig['language'] = $lang->getVar('lang_name'); + }else{ + $lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base')); + if(is_object($lang_base)){ + $xlanguage['charset_base'] = $lang_base->getVar('lang_charset'); + $xlanguage["action"] = true; + $xoopsConfig['language'] = $lang_base->getVar('lang_name'); + unset($lang_base); + } + } + if($lang->getVar('lang_charset')) $xlanguage['charset'] = $lang->getVar('lang_charset'); + if($lang->getVar('lang_code')) $xlanguage['code'] = $lang->getVar('lang_code'); } unset($lang); @@ -84,22 +84,21 @@ $in_charset = $xlanguage["charset"]; $out_charset = $xlanguage["charset_base"]; - //$CONV_REQUEST_array=array("_GET", "_POST"); - $CONV_REQUEST_array=array("_POST"); - foreach ($CONV_REQUEST_array as $HV){ - if(!empty(${$HV})) { - ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset); - } - $GLOBALS["HTTP".$HV."_VARS"] = ${$HV}; - } - } - ob_start("xlanguage_encoding"); + //$CONV_REQUEST_array=array("_GET", "_POST"); + $CONV_REQUEST_array=array("_POST"); + foreach ($CONV_REQUEST_array as $HV){ + if(!empty(${$HV})) { + ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset); + } + $GLOBALS["HTTP".$HV."_VARS"] = ${$HV}; + } + } + ob_start("xlanguage_encoding"); }else{ - ob_start("xlanguage_ml"); + ob_start("xlanguage_ml"); } - -/* +/* * hardcoded scripts for language switching in theme html files * * To use it: @@ -107,9 +106,8 @@ * 2 config options "$options = array("images", " ", 5); // display mode, delimitor, number per line"; Options for display mode: image - flag; text - text; dropdown - dropdown selection box with text * 3 insert "<{$smarty.const.XLANGUAGE_SWITCH_CODE}>" into your theme html anywhere you would like to see it present */ -$xlanguage_theme_enable = true; +$xlanguage_theme_enable = true; if(!empty($xlanguage_theme_enable)){ - $options = array("dropdown", " ", 5); // display mode, delimitor, number per line - xlanguage_select_show($options); -} -?> + $options = array("dropdown", " ", 5); // display mode, delimitor, number per line + xlanguage_select_show($options); +} Modified: XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -1,108 +1,108 @@ -<?php -// $Id$ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // - -function b_xlanguage_select_show($options) -{ - global $xlanguage; - - $block = array(); - - $xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage'); - $xlanguage_handler->loadConfig(); - $lang_list = $xlanguage_handler->getAllList(); - if ( !is_array($lang_list) || count($lang_list)<1 ) return $block; - - $languages = array(); - foreach( $lang_list as $lang_name => $lang ) { - if(!isset($lang['base'])) continue; - $languages[$lang_name]['name'] = $lang_name; - $languages[$lang_name]['desc'] = $lang['base']->getVar('lang_desc'); - $languages[$lang_name]['image'] = XOOPS_URL."/modules/xlanguage/images/".$lang['base']->getVar('lang_image'); - if( !isset($lang['ext']) || count($lang['ext']) < 1 ) continue; - foreach($lang['ext'] as $ext){ - $languages[$ext->getVar('lang_name')]['name'] = $ext->getVar('lang_name'); - $languages[$ext->getVar('lang_name')]['desc'] = $ext->getVar('lang_desc'); - $languages[$ext->getVar('lang_name')]['image'] = XOOPS_URL."/modules/xlanguage/images/".$ext->getVar('lang_image'); - } - } - - $QUERY_STRING_array = array_filter(explode("&",xoops_getenv('QUERY_STRING'))); - $QUERY_STRING_new = array(); - foreach ($QUERY_STRING_array as $QUERY){ - if(substr($QUERY, 0, (strlen(XLANGUAGE_LANG_TAG)+1)) != XLANGUAGE_LANG_TAG."=") { - $vals = explode("=", $QUERY); - foreach(array_keys($vals) as $key){ - if(preg_match("/^a-z0-9$/i", $vals[$key])) $vals[$key] = urlencode($vals[$key]); - } - $QUERY_STRING_new[] = implode("=", $vals); - } - } - - $block["display"] = $options[0]; - $block["delimitor"] = $options[1]; - $block["number"] = $options[2]; - $block["selected"] = $xlanguage["lang"]; - if ( $options[0] == "images" || $options[0] == "text" ) { - $query_string = htmlSpecialChars(implode("&", $QUERY_STRING_new)); - $query_string .= empty($query_string)? "" : "&"; - }else{ - $query_string = implode("&", array_map("htmlspecialchars", $QUERY_STRING_new)); - $query_string .= empty($query_string)? "" : "&"; - } - $block["url"] = xoops_getenv('PHP_SELF')."?".$query_string.XLANGUAGE_LANG_TAG."="; - $block["languages"] =& $languages; - - return $block; -} - -function b_xlanguage_select_edit($options) -{ - $form = _MB_XLANGUAGE_DISPLAY_METHOD." <select name='options[]'>"; - $form .= "<option value='images'"; - if ( $options[0] == "images" ) { - $form .= " selected='selected'"; - } - $form .= ">"._MB_XLANGUAGE_DISPLAY_FLAGLIST."</option>\n"; - $form .= "<option value='text'"; - if($options[0] == "text"){ - $form .= " selected='selected'"; - } - $form .= ">"._MB_XLANGUAGE_DISPLAY_TEXTLIST."</option>\n"; - $form .= "<option value='dropdown'"; - if($options[0] == "dropdown"){ - $form .= " selected='selected'"; - } - $form .= ">"._MB_XLANGUAGE_DISPLAY_DROPDOWNLIST."</option>\n"; - $form .= "</select>\n"; - $form .= "<br />"._MB_XLANGUAGE_IMAGE_SEPARATOR." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[1]."' />"; - $form .= "<br />"._MB_XLANGUAGE_IMAGE_PERROW." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[2]."' />"; - return $form; -} -?> \ No newline at end of file +<?php +// $Id$ +// ------------------------------------------------------------------------ // +// Xlanguage: eXtensible Language Management For Xoops // +// Copyright (c) 2004 Xoops China Community // +// <http://www.xoops.org.cn/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Author: D.J.(phppp) ph...@ho... // +// URL: http://www.xoops.org.cn // +// ------------------------------------------------------------------------- // + +function b_xlanguage_select_show($options) +{ + global $xlanguage; + + $block = array(); + + $xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage'); + $xlanguage_handler->loadConfig(); + $lang_list = $xlanguage_handler->getAllList(); + if ( !is_array($lang_list) || count($lang_list)<1 ) return $block; + + $languages = array(); + foreach( $lang_list as $lang_name => $lang ) { + if(!isset($lang['base'])) continue; + $languages[$lang_name]['name'] = $lang_name; + $languages[$lang_name]['desc'] = $lang['base']->getVar('lang_desc'); + $languages[$lang_name]['image'] = XOOPS_URL."/modules/xlanguage/images/".$lang['base']->getVar('lang_image'); + if( !isset($lang['ext']) || count($lang['ext']) < 1 ) continue; + foreach($lang['ext'] as $ext){ + $languages[$ext->getVar('lang_name')]['name'] = $ext->getVar('lang_name'); + $languages[$ext->getVar('lang_name')]['desc'] = $ext->getVar('lang_desc'); + $languages[$ext->getVar('lang_name')]['image'] = XOOPS_URL."/modules/xlanguage/images/".$ext->getVar('lang_image'); + } + } + + $QUERY_STRING_array = array_filter(explode("&",xoops_getenv('QUERY_STRING'))); + $QUERY_STRING_new = array(); + foreach ($QUERY_STRING_array as $QUERY){ + if(substr($QUERY, 0, (strlen(XLANGUAGE_LANG_TAG)+1)) != XLANGUAGE_LANG_TAG."=") { + $vals = explode("=", $QUERY); + foreach(array_keys($vals) as $key){ + if(preg_match("/^a-z0-9$/i", $vals[$key])) $vals[$key] = urlencode($vals[$key]); + } + $QUERY_STRING_new[] = implode("=", $vals); + } + } + + $block["display"] = $options[0]; + $block["delimitor"] = $options[1]; + $block["number"] = $options[2]; + $block["selected"] = $xlanguage["lang"]; + if ( $options[0] == "images" || $options[0] == "text" ) { + $query_string = htmlSpecialChars(implode("&", $QUERY_STRING_new)); + $query_string .= empty($query_string)? "" : "&"; + }else{ + $query_string = implode("&", array_map("htmlspecialchars", $QUERY_STRING_new)); + $query_string .= empty($query_string)? "" : "&"; + } + $block["url"] = xoops_getenv('PHP_SELF')."?".$query_string.XLANGUAGE_LANG_TAG."="; + $block["languages"] =& $languages; + + return $block; +} + +function b_xlanguage_select_edit($options) +{ + $form = _MB_XLANGUAGE_DISPLAY_METHOD." <select name='options[]'>"; + $form .= "<option value='images'"; + if ( $options[0] == "images" ) { + $form .= " selected='selected'"; + } + $form .= ">"._MB_XLANGUAGE_DISPLAY_FLAGLIST."</option>\n"; + $form .= "<option value='text'"; + if($options[0] == "text"){ + $form .= " selected='selected'"; + } + $form .= ">"._MB_XLANGUAGE_DISPLAY_TEXTLIST."</option>\n"; + $form .= "<option value='dropdown'"; + if($options[0] == "dropdown"){ + $form .= " selected='selected'"; + } + $form .= ">"._MB_XLANGUAGE_DISPLAY_DROPDOWNLIST."</option>\n"; + $form .= "</select>\n"; + $form .= "<br />"._MB_XLANGUAGE_IMAGE_SEPARATOR." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[1]."' />"; + $form .= "<br />"._MB_XLANGUAGE_IMAGE_PERROW." ("._MB_XLANGUAGE_OPTIONAL."): <input type='text' name='options[]' value='".$options[2]."' />"; + + return $form; +} Modified: XoopsModules/xlanguage/trunk/xlanguage/class/language.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/class/language.php 2015-09-22 13:04:40 UTC (rev 13151) +++ XoopsModules/xlanguage/trunk/xlanguage/class/language.php 2015-09-25 09:26:23 UTC (rev 13152) @@ -33,7 +33,7 @@ class Blanguage extends XoopsObject { - var $isBase; + var $isBase; function Blanguage() { $this -> db = & XoopsDatabaseFactory::getDatabaseConnection(); @@ -50,7 +50,7 @@ function prepareVars() { foreach ($this->vars as $k => $v) { - $cleanv = $this->cleanVars[$k]; + $cleanv = $this->cleanVars[$k]; switch ($v['data_type']) { case XOBJ_DTYPE_TXTBOX: case XOBJ_DTYPE_TXTAREA: @@ -63,7 +63,7 @@ break; case XOBJ_DTYPE_INT: $cleanv = ($v['changed'])?intval($cleanv):0; - break; + break; case XOBJ_DTYPE_ARRAY: $cleanv = ($v['changed'])?$cleanv:serialize(array()); break; @@ -79,25 +79,25 @@ $this->cleanVars[$k] =& $cleanv; unset($cleanv); } + return true; } function setBase() { - $this->isBase = true; + $this->isBase = true; } function isBase() { - return $this->isBase; + return $this->isBase; } } - class Xlanguage extends Blanguage { function Xlanguage() { - $this->Blanguage(); + $this->Blanguage(); $this->table = $this -> db -> prefix( "xlanguage_ext" ); $this->initVar('lang_base', XOBJ_DTYPE_TXTBOX); $this->isBase = false; @@ -106,126 +106,131 @@ class XlanguageLanguageHandler extends XoopsObjectHandler { - var $cached_config; + var $cached_config; - function loadConfig() - { - $this->cached_config =& $this->loadFileConfig(); - } + function loadConfig() + { + $this->cached_config =& $this->loadFileConfig(); + } function &get($id, $isBase =true) { - $lang = null; - $id = intval($id); - if(!$id) { - return $lang; - } - $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext"; - if(isset($this->cached_config[$prefix][$id])) { - $array = $this->cached_config[$prefix][$id]; - }else{ - $sql = 'SELECT * FROM '.$this->db->prefix($prefix).' WHERE lang_id='.$id; - $array = $this->db->fetchArray($this->db->query($sql)); + $lang = null; + $id = intval($id); + if(!$id) { + return $lang; } + $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext"; + if(isset($this->cached_config[$prefix][$id])) { + $array = $this->cached_config[$prefix][$id]; + }else{ + $sql = 'SELECT * FROM '.$this->db->prefix($prefix).' WHERE lang_id='.$id; + $array = $this->db->fetchArray($this->db->query($sql)); + } if(!is_array($array) || count($array)==0){ - return $lang; - } + return $lang; + } $lang =& $this->create(false, $isBase); $lang->assignVars($array); if($isBase) $lang->isBase = true; + return $lang; } function &getByName($name) { - $lang = null; - if(empty($name) || preg_match("/[^a-zA-Z0-9\_\-]/", $name)) { - return $lang; - } - $isBase = false; - if(isset($this->cached_config['xlanguage_base'][$name])) { - $array = $this->cached_config['xlanguage_base'][$name]; - $isBase = true; - }elseif(isset($this->cached_config['xlanguage_ext'][$name])) { - $array = $this->cached_config['xlanguage_ext'][$name]; - }elseif(!isset($this->cached_config)){ - $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_base').' WHERE lang_name=\''.$name.'\''; - $result=$this->db->query($sql); - $array = $this->db->fetchArray($result); - if(!is_array($array) || count($array)==0){ - $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_ext').' WHERE lang_name=\''.$name.'\''; - $result=$this->db->query($sql); - $array = $this->db->fetchArray($result); - if(!is_array($array) || count($array)==0){ - return $lang; - } - }else{ - $isBase = true; - } + $lang = null; + if(empty($name) || preg_match("/[^a-zA-Z0-9\_\-]/", $name)) { + return $lang; } + $isBase = false; + if(isset($this->cached_config['xlanguage_base'][$name])) { + $array = $this->cached_config['xlanguage_base'][$name]; + $isBase = true; + }elseif(isset($this->cached_config['xlanguage_ext'][$name])) { + $array = $this->cached_config['xlanguage_ext'][$name]; + }elseif(!isset($this->cached_config)){ + $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_base').' WHERE lang_name=\''.$name.'\''; + $result=$this->db->query($sql); + $array = $this->db->fetchArray($result); + if(!is_array($array) || count($array)==0){ + $sql = 'SELECT * FROM '.$this->db->prefix('xlanguage_ext').' WHERE lang_name=\''.$name.'\''; + $result=$this->db->query($sql); + $array = $this->db->fetchArray($result); + if(!is_array($array) || count($array)==0){ + return $lang; + } + }else{ + $isBase = true; + } + } if(empty($array)) { - return $lang; + return $lang; } $lang =& $this->create(false, $isBase); $lang->assignVars($array); if(!isset($array['lang_base'])) $lang->isBase = true; + return $lang; } function &getAll($isBase = true) { - $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext"; + $prefix = ($isBase) ? "xlanguage_base" : "xlanguage_ext"; $ret = array(); - if(isset($this->cached_config[$prefix])) { - $array = $this->cached_config[$prefix]; - foreach($array as $lang_name=>$myrow){ - $lang =& $this->create(false,$isBase); - $lang->assignVars($myrow); - $ret[$myrow['lang_name']] = $lang; - unset($lang); - } - }elseif(!isset($this->cached_config)){ - $sql = 'SELECT * FROM '.$this->db->prefix($prefix); - $result = $this->db->query($sql); - while ($myrow = $this->db->fetchArray($result)) { - $lang =& $this->create(false,$isBase); - $lang->assignVars($myrow); - $ret[$myrow['lang_name']] = $lang; - unset($lang); - } + if(isset($this->cached_config[$prefix])) { + $array = $this->cached_config[$prefix]; + foreach($array as $lang_name=>$myrow){ + $lang =& $this->create(false,$isBase); + $lang->assignVars($myrow); + $ret[$myrow['lang_name']] = $lang; + unset($lang); + } + }elseif(!isset($this->cached_config)){ + $sql = 'SELECT * FROM '.$this->db->prefix($prefix); + $result = $this->db->que... [truncated message content] |
From: <be...@us...> - 2015-09-25 10:12:30
|
Revision: 13153 http://sourceforge.net/p/xoops/svn/13153 Author: beckmi Date: 2015-09-25 10:12:26 +0000 (Fri, 25 Sep 2015) Log Message: ----------- add /assets Modified Paths: -------------- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php XoopsModules/xlanguage/trunk/xlanguage/admin/index.php XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php XoopsModules/xlanguage/trunk/xlanguage/admin/main.php XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php XoopsModules/xlanguage/trunk/xlanguage/api.php XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php XoopsModules/xlanguage/trunk/xlanguage/class/language.php XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt XoopsModules/xlanguage/trunk/xlanguage/docs/credits.txt XoopsModules/xlanguage/trunk/xlanguage/docs/install.txt XoopsModules/xlanguage/trunk/xlanguage/docs/readme.txt XoopsModules/xlanguage/trunk/xlanguage/include/functions.php XoopsModules/xlanguage/trunk/xlanguage/include/vars.php XoopsModules/xlanguage/trunk/xlanguage/language/english/admin.php XoopsModules/xlanguage/trunk/xlanguage/language/english/help/help.html XoopsModules/xlanguage/trunk/xlanguage/language/english/help/index.html XoopsModules/xlanguage/trunk/xlanguage/language/english/index.html XoopsModules/xlanguage/trunk/xlanguage/language/index.html XoopsModules/xlanguage/trunk/xlanguage/preloads/core.php XoopsModules/xlanguage/trunk/xlanguage/preloads/index.html XoopsModules/xlanguage/trunk/xlanguage/sql/index.html XoopsModules/xlanguage/trunk/xlanguage/sql/mysql.sql XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php Added Paths: ----------- XoopsModules/xlanguage/trunk/xlanguage/assets/ XoopsModules/xlanguage/trunk/xlanguage/assets/css/ XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html XoopsModules/xlanguage/trunk/xlanguage/assets/images/ XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/canada.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/china.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/cyprus.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/czech.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/danish.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/english.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/french.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/german.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/greece.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/index.html XoopsModules/xlanguage/trunk/xlanguage/assets/images/ireland.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/italian.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/japan.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/korea.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/lebanon.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/luxemburg.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/malta.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/mexico.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/nederlands.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/noflag.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/norway.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/poland.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/russia.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/slovakia.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/spanish.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/sweden.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/swiss.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/taiwan(Chinese Taipei).gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/taiwan(Republic of China).gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/turkey.gif XoopsModules/xlanguage/trunk/xlanguage/assets/images/usa.gif XoopsModules/xlanguage/trunk/xlanguage/assets/index.html XoopsModules/xlanguage/trunk/xlanguage/assets/js/ XoopsModules/xlanguage/trunk/xlanguage/assets/js/index.html XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/index.html XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/xlanguage_block.tpl Removed Paths: ------------- XoopsModules/xlanguage/trunk/xlanguage/images/ XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/xlanguage_block.html Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -9,7 +9,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright The XOOPS Project (http://www.xoops.org) + * @copyright XOOPS Project (http://xoops.org) * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} * @package xlanguage * @since 2.0 @@ -17,7 +17,7 @@ * @version $Id $ **/ -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; xoops_cp_header(); @@ -26,4 +26,4 @@ echo $aboutAdmin->addNavigation('about.php'); echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); -include 'admin_footer.php'; +include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,33 +1,23 @@ <?php -// $Id: about2.php 8203 2011-11-07 03:55:46Z beckmi $ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // -include '../../../include/cp_header.php'; +/** + * xLanguage module (eXtensible Language Management For XOOPS) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author D.J.(phppp) ph...@ho... + * @version $Id $ + **/ + +include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; xoops_cp_header(); $myts = &MyTextSanitizer::getInstance(); @@ -37,20 +27,22 @@ // Left headings... echo "<a href='index.php'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/" . $versioninfo -> getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>"; -echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " . $versioninfo->getInfo('version') . "</div>"; +echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . " ver " + . $versioninfo->getInfo('version') . "</div>"; echo "</div>"; echo "<div>" . _MI_XLANG_RELEASE . ": " . $versioninfo -> getInfo('releasedate') . "</div>"; // Author Information $sform = new XoopsThemeForm(_MI_XLANG_AUTHOR_INFO, "", ""); -if ( $versioninfo->getInfo('author_realname')) +if ($versioninfo->getInfo('author_realname')) { $author_name = $versioninfo->getInfo('author') . " (" . $versioninfo->getInfo('author_realname') . ")"; -else +} else { $author_name = $versioninfo->getInfo('author'); +} $sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_NAME, $author_name)); $author_sites = $versioninfo -> getInfo('author_website'); $author_site_info = ""; -foreach($author_sites as $site){ +foreach ($author_sites as $site) { $author_site_info .= "<a href='" . $site['url'] . "' target='blank'>" . $site['name'] . "</a>; "; } $sform -> addElement(new XoopsFormLabel(_MI_XLANG_AUTHOR_WEBSITE, $author_site_info)); @@ -66,8 +58,7 @@ $sform -> display(); $file = "../bugfixlist.txt"; -if (@file_exists($file)) -{ +if (@file_exists($file)) { $fp = @fopen($file, "r"); $bugtext = @fread($fp, filesize($file)); @fclose($file); Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -2,7 +2,7 @@ echo "<div class='adminfooter'>\n" ." <div style='text-align: center;'>\n" - ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" + ." <a href='http://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" ." </div>\n" ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" ."</div>"; Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,6 +1,6 @@ <?php /** - * XoopsPartners module + * xLanguage module (eXtensible Language Management For XOOPS) * * You may not change or alter any portion of this comment or credits * of supporting developers from this source code or any supporting source code @@ -9,38 +9,33 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} - * @package:: XoopsPartners - * @subpackage:: admin - * @since:: 2.5.0 - * @author:: XOOPS Team - * @version:: $Id $ -**/ + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author XOOPS Development Team + * @version $Id $ + **/ -$path = dirname(dirname(dirname(dirname(__FILE__)))); +$path = dirname(dirname(dirname(__DIR__))); include_once $path . '/mainfile.php'; include_once $path . '/include/cp_functions.php'; require_once $path . '/include/cp_header.php'; global $xoopsModule; -$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); +$moduleDirName = $GLOBALS['xoopsModule']->getVar('dirname'); //if functions.php file exist -require_once dirname(dirname(__FILE__)) . '/include/functions.php'; +require_once dirname(__DIR__) . '/include/functions.php'; // Load language files -xoops_loadLanguage('admin', $thisModuleDir); -xoops_loadLanguage('modinfo', $thisModuleDir); -xoops_loadLanguage('main', $thisModuleDir); +xoops_loadLanguage('admin', $moduleDirName); +xoops_loadLanguage('modinfo', $moduleDirName); +xoops_loadLanguage('main', $moduleDirName); $pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); $pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); $pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); -if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ - include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); - }else{ - redirect_header("../../../admin.php", 5, _AM_XLANG_MODULEADMIN_MISSING, false); - } +include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/index.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,32 +1,25 @@ <?php -// $Id$ -// ------------------------------------------------------------------------ // -// XOOPS - PHP Content Management System // -// Copyright (c) 2000 XOOPS.org // -// <http://www.xoops.org/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -include '../../../include/cp_header.php'; +/** + * xLanguage module (eXtensible Language Management For XOOPS) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author XOOPS Team + * @version $Id $ + **/ -include 'admin_header.php'; +include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; + +include_once __DIR__ . '/admin_header.php'; xoops_cp_header(); $indexAdmin = new ModuleAdmin(); @@ -34,4 +27,4 @@ echo $indexAdmin->addNavigation('index.php'); echo $indexAdmin->renderIndex(); -include "admin_footer.php"; +include_once __DIR__ . '/admin_footer.php'; Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,41 +1,30 @@ <?php -// $Id$ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // +/** + * xLanguage module (eXtensible Language Management For XOOPS) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author D.J.(phppp) ph...@ho... + * @version $Id $ + **/ include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; $sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, "langform", xoops_getenv('PHP_SELF')); -if($isBase){ +if ($isBase) { $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name); $lang_select->addOptionArray($xlanguage_handler->getXoopsLangList()); $sform->addElement($lang_select, true); -}else{ +} else { $sform->addElement(new XoopsFormText(_AM_XLANG_NAME, 'lang_name', 50, 255, $lang_name), true); } @@ -51,13 +40,13 @@ $lang_charset->setDescription(_AM_XLANG_CHARSET_DESC); $sform->addElement($lang_charset, true); -if(!$isBase){ +if (!$isBase) { $baseList =& $xlanguage_handler->getAll(); $base_list = array(); - foreach($baseList as $base => $baselang){ + foreach ($baseList as $base => $baselang) { $base_list[$base] = $base; } - + $base_select = new XoopsFormSelect(_AM_XLANG_BASE, 'lang_base', $lang_base); $base_select->addOptionArray($base_list); $sform->addElement($base_select, true); @@ -65,22 +54,24 @@ $sform->addElement(new XoopsFormText(_AM_XLANG_WEIGHT, 'weight', 10, 10, $weight)); $image_option_tray = new XoopsFormElementTray(_AM_XLANG_IMAGE, ''); -$image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule -> dirname() . "/images/"); +$image_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule -> dirname() . "/assets/images/"); $lang_image =(empty($lang_image))?'noflag.gif':$lang_image; $image_select = new XoopsFormSelect('', 'lang_image', $lang_image); $image_select->addOptionArray($image_array); -$image_select->setExtra("onchange='showImgSelected(\"image\", \"lang_image\", \"/modules/" . $xoopsModule -> dirname() . "/images/\", \"\", \"" . XOOPS_URL . "\")'"); +$image_select->setExtra("onchange='showImgSelected(\"image\", \"lang_image\", \"/modules/" . $xoopsModule -> dirname() . "/assets/images/\", \"\", \"" . XOOPS_URL . "\")'"); $image_tray = new XoopsFormElementTray('', ' '); $image_tray->addElement($image_select); -if (!empty($lang_image)){ - $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/images/" . $lang_image . "' name='image' id='image' alt='' /></div>")); -}else{ +if (!empty($lang_image)) { + $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/modules/" . $xoopsModule -> dirname() . "/assets/images/" . $lang_image . "' name='image' id='image' alt='' /></div>")); +} else { $image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/images/blank.gif' name='image' id='image' alt='' /></div>")); } $image_option_tray->addElement($image_tray); $sform->addElement($image_option_tray); -if(isset($lang_id)) $sform->addElement(new XoopsFormHidden('lang_id', $lang_id)); +if (isset($lang_id)) { + $sform->addElement(new XoopsFormHidden('lang_id', $lang_id)); +} $sform->addElement(new XoopsFormHidden('type', $type)); $button_tray = new XoopsFormElementTray('', ''); Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/main.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,94 +1,89 @@ <?php -// $Id: main.php 8586 2011-12-27 12:03:19Z beckmi $ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // -include '../../../include/cp_header.php'; -include_once 'admin_header.php'; +/** + * xLanguage module (eXtensible Language Management For XOOPS) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author D.J.(phppp) ph...@ho... + * @version $Id $ + **/ +include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; +include_once __DIR__ . '/admin_header.php'; + include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php'); include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/functions.php'); $op = ""; -if ( isset( $_POST ) ){ - foreach ( $_POST as $k => $v ) { +if (isset($_POST)) { + foreach ($_POST as $k => $v) { ${$k} = $v; } } -if ( isset( $_GET ) ){ - foreach ( $_GET as $k => $v ) { +if (isset($_GET)) { + foreach ($_GET as $k => $v) { ${$k} = $v; } } -define("XLANG_CONFIG_LINK","<a href='main.php' target='_self'>"._AM_XLANG_CONFIG."</a>"); +define("XLANG_CONFIG_LINK", "<a href='main.php' target='_self'>"._AM_XLANG_CONFIG."</a>"); $xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage'); $xlanguage_handler->loadConfig(); -switch ( $op ) -{ +switch ($op) { case "del": - if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){ + if (!isset($_POST['ok']) || $_POST['ok'] != 1) { xoops_cp_header(); -$aboutAdmin = new ModuleAdmin(); -echo $aboutAdmin->addNavigation('main.php'); -// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; - xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM ); - }else{ - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; + $aboutAdmin = new ModuleAdmin(); + echo $aboutAdmin->addNavigation('main.php'); +// echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; + xoops_confirm(array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => (int)($_GET['lang_id']), 'ok' => 1 ), 'main.php', _AM_XLANG_DELETE_CFM); + } else { + if (isset($type) && $type == 'ext') { + $isBase = false; + } else { + $isBase = true; + } $lang =& $xlanguage_handler->get($lang_id, $isBase); $xlanguage_handler->delete($lang); - redirect_header("main.php",2,_AM_XLANG_DELETED); + redirect_header("main.php", 2, _AM_XLANG_DELETED); } break; case "save": - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - if(isset($lang_id)&&$lang_id>0){ + if (isset($type) && $type == 'ext') { + $isBase = false; + } else { + $isBase = true; + } + if (isset($lang_id)&&$lang_id>0) { $lang =& $xlanguage_handler->get($lang_id, $isBase); - }else{ + } else { $lang =& $xlanguage_handler->create(true, $isBase); } $lang_name = preg_replace("/[^a-zA-Z0-9\_\-]/", "", $lang_name); - - $lang->setVar('lang_name',$lang_name); - $lang->setVar('lang_desc',$lang_desc); - $lang->setVar('lang_code',$lang_code); - $lang->setVar('lang_charset',$lang_charset); - $lang->setVar('lang_image',$lang_image); - if(!$isBase){ - $lang->setVar('lang_base',$lang_base); + + $lang->setVar('lang_name', $lang_name); + $lang->setVar('lang_desc', $lang_desc); + $lang->setVar('lang_code', $lang_code); + $lang->setVar('lang_charset', $lang_charset); + $lang->setVar('lang_image', $lang_image); + if (!$isBase) { + $lang->setVar('lang_base', $lang_base); } - $lang->setVar('weight',$weight); + $lang->setVar('weight', $weight); $xlanguage_handler->insert($lang); - redirect_header("main.php",2,_AM_XLANG_SAVED); + redirect_header("main.php", 2, _AM_XLANG_SAVED); break; case "edit": @@ -98,13 +93,16 @@ // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; // echo "<br />"; echo "<h4>" . _AM_XLANG_EDITLANG . "</h4>"; - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - if(isset($lang_id)&&$lang_id>0){ + if (isset($type) && $type == 'ext') { + $isBase = false; + } else { + $isBase = true; + } + if (isset($lang_id)&&$lang_id>0) { $lang =& $xlanguage_handler->get($lang_id, $isBase); - }elseif(isset($lang_name)){ + } elseif (isset($lang_name)) { $lang =& $xlanguage_handler->getByName($lang_name, $isBase); - }else{ + } else { $lang =& $xlanguage_handler->create(true, $isBase); } $lang_name = $lang->getVar('lang_name'); @@ -113,10 +111,10 @@ $lang_charset = $lang->getVar('lang_charset'); $lang_image = $lang->getVar('lang_image'); $weight = $lang->getVar('weight'); - if(!$isBase){ + if (!$isBase) { $lang_base = $lang->getVar('lang_base'); } - include "langform.inc.php"; + include __DIR__ . '/langform.inc.php'; break; case "add": @@ -125,12 +123,12 @@ // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; // echo "<br />"; // echo "<h4>" . _AM_XLANG_ADDLANG . "</h4>"; - if(isset($type)&&$type=='ext') { - $isBase = false; - echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); } - else { - $isBase = true; - echo $aboutAdmin->addNavigation('main.php?op=add&type=base'); + if (isset($type)&&$type=='ext') { + $isBase = false; + echo $aboutAdmin->addNavigation('main.php?op=add&type=ext'); + } else { + $isBase = true; + echo $aboutAdmin->addNavigation('main.php?op=add&type=base'); } $lang_name = ''; $lang_desc = ''; @@ -139,13 +137,13 @@ $lang_image = ''; $weight = 1; $lang_base = ''; - include "langform.inc.php"; + include 'langform.inc.php'; break; - + case 'createconfig': xlanguage_createConfig(); - redirect_header( 'main.php', 1, _AM_XLANG_CREATED ); - exit(); + redirect_header('main.php', 1, _AM_XLANG_CREATED); + break; case "default": @@ -154,7 +152,7 @@ $mainAdmin = new ModuleAdmin(); echo $mainAdmin->addNavigation('main.php'); - // if (TDMDownloads_checkModuleAdmin()){ + // if (TDMDownloads_checkModuleAdmin()) { // $mainAdmin = new ModuleAdmin(); // echo $mainAdmin->addNavigation('downloads.php'); $mainAdmin->addItemButton(_MI_XLANGUAGE_ADMENU1, 'main.php?op=add&type=base', 'add'); @@ -162,14 +160,15 @@ echo $mainAdmin->renderButton(); // } - + // echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; languageList(); $configfile_status = (@is_readable(XLANGUAGE_CONFIG_FILE))?_AM_XLANG_CONFIGOK:_AM_XLANG_CONFIGNOTOK; echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\"><br />"; // echo " - <b><a href='index.php?op=add&type=base'>" . _AM_XLANG_ADDBASE . "</a></b><br /><br />\n"; // echo " - <b><a href='index.php?op=add&type=ext'>" . _AM_XLANG_ADDEXT . "</a></b><br /><br />\n"; - echo "<b>".$configfile_status."</b>: ".XLANGUAGE_CONFIG_FILE." (<a href='main.php?op=createconfig' title='"._AM_XLANG_CREATECONFIG."'>" . _AM_XLANG_CREATECONFIG . "</a>)<br /><br />\n"; + echo "<b>" . $configfile_status . "</b>: " . XLANGUAGE_CONFIG_FILE . " (<a href='main.php?op=createconfig' title='" . _AM_XLANG_CREATECONFIG . "'>" . _AM_XLANG_CREATECONFIG + . "</a>)<br /><br />\n"; // echo " - <b><a href='about.php'>" . _AM_XLANG_ABOUT . "</a></b>"; echo"</td></tr></table>"; break; @@ -180,59 +179,63 @@ { global $xlanguage_handler, $xoopsModule; -global $pathIcon16; - + global $pathIcon16; + $lang_list =& $xlanguage_handler->getAllList(); - if ( is_array($lang_list)&&count( $lang_list ) > 0 ){ + if (is_array($lang_list)&&count($lang_list) > 0) { echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; echo "<div style='text-align: center;'><b><h4>" . _AM_XLANG_LANGLIST . "</h4></b><br />"; - echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>" . _AM_XLANG_DESC . "</th><th align='center'>" . _AM_XLANG_NAME . "</th><th align='center'>" . _AM_XLANG_CHARSET . "</th><th align='center'>" . _AM_XLANG_CODE . "</th><th align='center'>" . _AM_XLANG_IMAGE . "</th><th align='center'>" . _AM_XLANG_WEIGHT . "</th><th align='center'>" . _AM_XLANG_BASE . "</th><th align='center'>" . _AM_XLANG_ACTION . "</th></tr>\n"; + echo "<table class='outer' width='100%' border='0' cellpadding='0' cellspacing='0' ><tr class='bg2'><th align='center'>" . _AM_XLANG_DESC . "</th><th align='center'>" . _AM_XLANG_NAME + . "</th><th align='center'>" . _AM_XLANG_CHARSET . "</th><th align='center'>" . _AM_XLANG_CODE . "</th><th align='center'>" . _AM_XLANG_IMAGE . "</th><th align='center'>" + . _AM_XLANG_WEIGHT . "</th><th align='center'>" . _AM_XLANG_BASE . "</th><th align='center'>" . _AM_XLANG_ACTION . "</th></tr>\n"; $class = 'even'; - foreach( array_keys($lang_list) as $lang_name ) { + foreach (array_keys($lang_list) as $lang_name) { $lang =& $lang_list[$lang_name]; $isOrphan = true; - if(isset($lang['base'])){ + if (isset($lang['base'])) { echo "<tr>\n"; - echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n"; - echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n"; - echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n"; - echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n"; - if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$lang['base'] -> getVar('lang_image'))){ - $lang_image = $lang['base'] -> getVar('lang_image'); - }else{ - $lang_image = 'noflag.gif'; - } - echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n"; - echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n"; - echo "<td class='$class' >Ø</td>\n"; + echo "<td class='$class' >" . $lang['base'] -> getVar('lang_desc') . "</td>\n"; + echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n"; + echo "<td class='$class' ><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n"; + echo "<td class='$class' >" . $lang['base'] -> getVar('lang_code') . "</td>\n"; + if (is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/assets/images/'.$lang['base'] -> getVar('lang_image'))) { + $lang_image = $lang['base'] -> getVar('lang_image'); + } else { + $lang_image = 'noflag.gif'; + } + echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/assets/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n"; + echo "<td class='$class' >" . $lang['base'] -> getVar('weight') . "</td>\n"; + echo "<td class='$class' >Ø</td>\n"; echo "<td class='$class' ><a href='main.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n". "<a href='main.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n"; echo "</tr>\n"; $isOrphan = false; - $class = ($class == 'odd') ? 'even' : 'odd'; + $class = ($class == 'odd') ? 'even' : 'odd'; } - if(!isset($lang['ext'])||count($lang['ext'])<1) continue; - foreach($lang['ext'] as $ext){ + if (!isset($lang['ext']) || count($lang['ext']) < 1) { + continue; + } + foreach ($lang['ext'] as $ext) { echo "<tr>\n"; - echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n"; - echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n"; - echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n"; - echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n"; - if(is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/images/'.$ext -> getVar('lang_image'))){ - $lang_image = $ext -> getVar('lang_image'); - }else{ - $lang_image = 'noflag.gif'; - } - echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n"; - echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n"; - $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base'); - echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n"; - echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/edit.png title=' . _EDIT . "></a>\n". - "<a href='main.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'><img src=".$pathIcon16.'/delete.png title=' . _DELETE ."></td>\n"; + echo "<td class='$class' >" . $ext -> getVar('lang_desc') . "</td>\n"; + echo "<td class='$class' >" . $ext -> getVar('lang_name') . "</td>\n"; + echo "<td class='$class' ><b>" . $ext -> getVar('lang_charset') . "</b></td>\n"; + echo "<td class='$class' >" . $ext -> getVar('lang_code') . "</td>\n"; + if (is_readable(XOOPS_ROOT_PATH.'/modules/xlanguage/assets/images/'.$ext -> getVar('lang_image'))) { + $lang_image = $ext -> getVar('lang_image'); + } else { + $lang_image = 'noflag.gif'; + } + echo "<td class='$class' ><img src='" . XOOPS_URL.'/modules/xlanguage/assets/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n"; + echo "<td class='$class' >" . $ext -> getVar('weight') . "</td>\n"; + $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base'); + echo "<td class='$class' ><b>" . $lang_base . "</b></td>\n"; + echo "<td class='$class' ><a href='main.php?op=edit&type=ext&lang_id=" . $ext->getVar('lang_id') . "'><img src=" . $pathIcon16 . '/edit.png title=' . _EDIT . "></a>\n" + . "<a href='main.php?op=del&type=ext&lang_id=" . $ext->getVar('lang_id') . "'><img src=" . $pathIcon16 . '/delete.png title=' . _DELETE . "></td>\n"; echo "</tr>\n"; } - echo "<tr><td colspan='9' ></td></tr>\n"; - $class = ($class == 'odd') ? 'even' : 'odd'; + echo "<tr><td colspan='9' ></td></tr>\n"; + $class = ($class == 'odd') ? 'even' : 'odd'; } echo "</table></div>\n"; Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,60 +1,51 @@ -<?php -// $Id$ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // -$module_handler =& xoops_gethandler('module'); -$xoopsModule =& XoopsModule::getByDirname('xlanguage'); -$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); -$pathIcon32 = $moduleInfo->getInfo('icons32'); - -$adminmenu = array(); - -$i = 1; -$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU_HOME ; -$adminmenu[$i]['link'] = 'admin/index.php' ; -$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ; -$i++; -$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU0 ; -$adminmenu[$i]['link'] = 'admin/main.php' ; -$adminmenu[$i]['icon'] = $pathIcon32.'/manage.png' ; -$i++; -$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU1 ; -$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=base' ; -$adminmenu[$i]['icon'] = $pathIcon32.'/add.png' ; -$i++; -$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU2 ; -$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=ext'; -$adminmenu[$i]['icon'] = $pathIcon32.'/insert_table_row.png' ; -$i++; -$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3 ; -$adminmenu[$i]['link'] = 'admin/about.php' ; -$adminmenu[$i]['icon'] = $pathIcon32.'/about.png' ; -// $i++; -// $adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3; -// $adminmenu[$i]['link'] = "admin/about2.php"; -// $adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; +<?php +/** + * xLanguage module (eXtensible Language Management For XOOPS) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author D.J.(phppp) ph...@ho... + * @version $Id $ + **/ + +$module_handler =& xoops_gethandler('module'); +$xoopsModule =& XoopsModule::getByDirname('xlanguage'); +$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); +$pathIcon32 = $moduleInfo->getInfo('icons32'); + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU_HOME ; +$adminmenu[$i]['link'] = 'admin/index.php' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ; +++$i; +$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU0 ; +$adminmenu[$i]['link'] = 'admin/main.php' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/manage.png' ; +++$i; +$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU1 ; +$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=base' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/add.png' ; +++$i; +$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU2 ; +$adminmenu[$i]['link'] = 'admin/main.php?op=add&type=ext'; +$adminmenu[$i]['icon'] = $pathIcon32.'/insert_table_row.png' ; +++$i; +$adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3 ; +$adminmenu[$i]['link'] = 'admin/about.php' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/about.png' ; +// ++$i; +// $adminmenu[$i]['title'] = _MI_XLANGUAGE_ADMENU3; +// $adminmenu[$i]['link'] = "admin/about2.php"; +// $adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; + Modified: XoopsModules/xlanguage/trunk/xlanguage/api.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/api.php 2015-09-25 10:12:26 UTC (rev 13153) @@ -1,32 +1,22 @@ <?php -// $Id$ -// ------------------------------------------------------------------------ // -// Xlanguage: eXtensible Language Management For Xoops // -// Copyright (c) 2004 Xoops China Community // -// <http://www.xoops.org.cn/> // -// ------------------------------------------------------------------------ // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation; either version 2 of the License, or // -// (at your option) any later version. // -// // -// You may not change or alter any portion of this comment or credits // -// of supporting developers from this source code or any supporting // -// source code which is considered copyrighted (c) material of the // -// original comment or credit authors. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program; if not, write to the Free Software // -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// ------------------------------------------------------------------------ // -// Author: D.J.(phppp) ph...@ho... // -// URL: http://www.xoops.org.cn // -// ------------------------------------------------------------------------- // +/** + * xLanguage module (eXtensible Language Management For XOOPS) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright XOOPS Project (http://xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xlanguage + * @since 2.0 + * @author D.J.(phppp) ph...@ho... + * @version $Id $ + **/ + global $xlanguage; include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php'); include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/functions.php'); @@ -39,62 +29,66 @@ $cookie_path = "/"; setcookie($cookie_var, $_GET[XLANGUAGE_LANG_TAG], time()+3600*24*30, $cookie_path, '', 0); $xlanguage["lang"] = $_GET[XLANGUAGE_LANG_TAG]; -}elseif (!empty($_COOKIE[$cookie_var])) { +} elseif (!empty($_COOKIE[$cookie_var])) { $xlanguage["lang"] = $_COOKIE[$cookie_var]; /* FIXME: shall we remove it? */ /* - if(preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])){ - }elseif (strpos($_SERVER['REQUEST_URI'], "?")) { + if (preg_match("/[&|\?]\b".XLANGUAGE_LANG_TAG."\b=/i",$_SERVER['REQUEST_URI'])) { + } elseif (strpos($_SERVER['REQUEST_URI'], "?")) { $_SERVER['REQUEST_URI'] .= "&".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"]; - }else{ + } else { $_SERVER['REQUEST_URI'] .= "?".XLANGUAGE_LANG_TAG."=".$xlanguage["lang"]; } */ -}elseif($lang = xlanguage_detectLang()) { +} elseif ($lang = xlanguage_detectLang()) { $xlanguage["lang"] = $lang; -}else{ +} else { $xlanguage["lang"] = $xoopsConfig['language']; } $xlanguage_handler=& xoops_getmodulehandler('language', 'xlanguage'); $xlanguage_handler->loadConfig(); $lang = $xlanguage_handler->getByName($xlanguage["lang"]); -if(is_object($lang) && strcasecmp($lang->getVar('lang_name'),$xoopsConfig['language'])){ - if($lang->isBase()){ +if (is_object($lang) && strcasecmp($lang->getVar('lang_name'), $xoopsConfig['language'])) { + if ($lang->isBase()) { $xoopsConfig['language'] = $lang->getVar('lang_name'); - }else{ + } else { $lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base')); - if(is_object($lang_base)){ + if (is_object($lang_base)) { $xlanguage['charset_base'] = $lang_base->getVar('lang_charset'); $xlanguage["action"] = true; $xoopsConfig['language'] = $lang_base->getVar('lang_name'); unset($lang_base); } } - if($lang->getVar('lang_charset')) $xlanguage['charset'] = $lang->getVar('lang_charset'); - if($lang->getVar('lang_code')) $xlanguage['code'] = $lang->getVar('lang_code'); + if ($lang->getVar('lang_charset')) { + $xlanguage['charset'] = $lang->getVar('lang_charset'); + } + if ($lang->getVar('lang_code')) { + $xlanguage['code'] = $lang->getVar('lang_code'); + } } unset($lang); $GLOBALS['xlanguage_handler'] =& $xlanguage_handler; -if($xlanguage["action"]){ - //if(CONV_REQUEST && (!empty($_GET)||!empty($_POST))){ - if(!empty($_POST)){ +if ($xlanguage["action"]) { + //if (CONV_REQUEST && (!empty($_GET)||!empty($_POST))) { + if (!empty($_POST)) { $in_charset = $xlanguage["charset"]; $out_charset = $xlanguage["charset_base"]; //$CONV_REQUEST_array=array("_GET", "_POST"); $CONV_REQUEST_array=array("_POST"); - foreach ($CONV_REQUEST_array as $HV){ - if(!empty(${$HV})) { + foreach ($CONV_REQUEST_array as $HV) { + if (!empty(${$HV})) { ${$HV} = xlanguage_convert_encoding(${$HV}, $out_charset, $in_charset); } $GLOBALS["HTTP".$HV."_VARS"] = ${$HV}; } } ob_start("xlanguage_encoding"); -}else{ +} else { ob_start("xlanguage_ml"); } @@ -107,7 +101,7 @@ * 3 insert "<{$smarty.const.XLANGUAGE_SWITCH_CODE}>" into your theme html anywhere you would like to see it present */ $xlanguage_theme_enable = true; -if(!empty($xlanguage_theme_enable)){ +if (!empty($xlanguage_theme_enable)) { $options = array("dropdown", " ", 5); // display mode, delimitor, number per line xlanguage_select_show($options); } Added: XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html (rev 0) +++ XoopsModules/xlanguage/trunk/xlanguage/assets/css/index.html 2015-09-25 10:12:26 UTC (rev 13153) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif =================================================================== (Binary files differ) Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif 2015-09-25 10:12:26 UTC (rev 13153) Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/albania.gif ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif =================================================================== (Binary files differ) Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif 2015-09-25 10:12:26 UTC (rev 13153) Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/austria.gif ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif =================================================================== (Binary files differ) Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif 2015-09-25 10:12:26 UTC (rev 13153) Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/belgium.gif ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif =================================================================== (Binary files differ) Index: XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif 2015-09-25 09:26:23 UTC (rev 13152) +++ XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif 2015-09-25 10:12:26 UTC (rev 13153) Property changes on: XoopsModules/xlanguage/trunk/xlanguage/assets/images/brazil.gif ________________________________... [truncated message content] |