|
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' =...
[truncated message content] |
|
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...
[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...
[truncated message content] |