From: <be...@us...> - 2012-06-19 15:12:56
|
Revision: 9674 http://xoops.svn.sourceforge.net/xoops/?rev=9674&view=rev Author: beckmi Date: 2012-06-19 15:12:44 +0000 (Tue, 19 Jun 2012) Log Message: ----------- Updating to 3.03 Final Modified Paths: -------------- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php XoopsModules/xlanguage/trunk/xlanguage/admin/index.php XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.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/images/albania.gif XoopsModules/xlanguage/trunk/xlanguage/images/austria.gif XoopsModules/xlanguage/trunk/xlanguage/images/belgium.gif XoopsModules/xlanguage/trunk/xlanguage/images/brazil.gif XoopsModules/xlanguage/trunk/xlanguage/images/canada.gif XoopsModules/xlanguage/trunk/xlanguage/images/cyprus.gif XoopsModules/xlanguage/trunk/xlanguage/images/czech.gif XoopsModules/xlanguage/trunk/xlanguage/images/danish.gif XoopsModules/xlanguage/trunk/xlanguage/images/english.gif XoopsModules/xlanguage/trunk/xlanguage/images/french.gif XoopsModules/xlanguage/trunk/xlanguage/images/german.gif XoopsModules/xlanguage/trunk/xlanguage/images/greece.gif XoopsModules/xlanguage/trunk/xlanguage/images/ireland.gif XoopsModules/xlanguage/trunk/xlanguage/images/italian.gif XoopsModules/xlanguage/trunk/xlanguage/images/korea.gif XoopsModules/xlanguage/trunk/xlanguage/images/lebanon.gif XoopsModules/xlanguage/trunk/xlanguage/images/luxemburg.gif XoopsModules/xlanguage/trunk/xlanguage/images/malta.gif XoopsModules/xlanguage/trunk/xlanguage/images/mexico.gif XoopsModules/xlanguage/trunk/xlanguage/images/nederlands.gif XoopsModules/xlanguage/trunk/xlanguage/images/noflag.gif XoopsModules/xlanguage/trunk/xlanguage/images/norway.gif XoopsModules/xlanguage/trunk/xlanguage/images/poland.gif XoopsModules/xlanguage/trunk/xlanguage/images/russia.gif XoopsModules/xlanguage/trunk/xlanguage/images/slovakia.gif XoopsModules/xlanguage/trunk/xlanguage/images/spanish.gif XoopsModules/xlanguage/trunk/xlanguage/images/sweden.gif XoopsModules/xlanguage/trunk/xlanguage/images/swiss.gif XoopsModules/xlanguage/trunk/xlanguage/images/turkey.gif XoopsModules/xlanguage/trunk/xlanguage/images/usa.gif XoopsModules/xlanguage/trunk/xlanguage/include/functions.php XoopsModules/xlanguage/trunk/xlanguage/language/english/admin.php XoopsModules/xlanguage/trunk/xlanguage/language/english/modinfo.php XoopsModules/xlanguage/trunk/xlanguage/preloads/core.php XoopsModules/xlanguage/trunk/xlanguage/readme.txt XoopsModules/xlanguage/trunk/xlanguage/templates/blocks/xlanguage_block.html XoopsModules/xlanguage/trunk/xlanguage/xlanguage_logo.png XoopsModules/xlanguage/trunk/xlanguage/xoops_version.php Added Paths: ----------- 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/main.php XoopsModules/xlanguage/trunk/xlanguage/docs/ XoopsModules/xlanguage/trunk/xlanguage/docs/changelog.txt XoopsModules/xlanguage/trunk/xlanguage/docs/credits.txt XoopsModules/xlanguage/trunk/xlanguage/docs/index.html XoopsModules/xlanguage/trunk/xlanguage/docs/install.txt XoopsModules/xlanguage/trunk/xlanguage/docs/lang_diff.txt XoopsModules/xlanguage/trunk/xlanguage/docs/licence.txt XoopsModules/xlanguage/trunk/xlanguage/docs/readme.txt XoopsModules/xlanguage/trunk/xlanguage/extra/ XoopsModules/xlanguage/trunk/xlanguage/extra/index.html XoopsModules/xlanguage/trunk/xlanguage/extra/readme.txt XoopsModules/xlanguage/trunk/xlanguage/extra/smarty-plugin-xoLanguage.zip XoopsModules/xlanguage/trunk/xlanguage/images/china.gif XoopsModules/xlanguage/trunk/xlanguage/images/japan.gif XoopsModules/xlanguage/trunk/xlanguage/images/taiwan(Republic of China).gif XoopsModules/xlanguage/trunk/xlanguage/language/english/help/ XoopsModules/xlanguage/trunk/xlanguage/language/english/help/help.html XoopsModules/xlanguage/trunk/xlanguage/language/english/help/index.html XoopsModules/xlanguage/trunk/xlanguage/language/italian/ XoopsModules/xlanguage/trunk/xlanguage/language/italian/italian/ XoopsModules/xlanguage/trunk/xlanguage/language/italian/italian/admin.php XoopsModules/xlanguage/trunk/xlanguage/language/italian/italian/blocks.php XoopsModules/xlanguage/trunk/xlanguage/language/italian/italian/index.html XoopsModules/xlanguage/trunk/xlanguage/language/italian/italian/modinfo.php XoopsModules/xlanguage/trunk/xlanguage/language/tchinese_utf8/ XoopsModules/xlanguage/trunk/xlanguage/language/tchinese_utf8/admin.php XoopsModules/xlanguage/trunk/xlanguage/language/tchinese_utf8/blocks.php XoopsModules/xlanguage/trunk/xlanguage/language/tchinese_utf8/index.html XoopsModules/xlanguage/trunk/xlanguage/language/tchinese_utf8/modinfo.php XoopsModules/xlanguage/trunk/xlanguage/readme.tchinese.txt Removed Paths: ------------- XoopsModules/xlanguage/trunk/xlanguage/images/japanese.gif XoopsModules/xlanguage/trunk/xlanguage/images/schinese.gif XoopsModules/xlanguage/trunk/xlanguage/images/taiwan.gif XoopsModules/xlanguage/trunk/xlanguage/images/tchinese.gif XoopsModules/xlanguage/trunk/xlanguage/images/unknown.gif XoopsModules/xlanguage/trunk/xlanguage/language/tchinese/ XoopsModules/xlanguage/trunk/xlanguage/readme.schinese.txt Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/about.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2012-06-19 14:53:13 UTC (rev 9673) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/about.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -1,84 +1,29 @@ -<?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 // -// ------------------------------------------------------------------------- // -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 +/** + * xLanguage module + * + * 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 The XOOPS Project (http://www.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 $ + **/ + +include_once dirname(__FILE__) . '/admin_header.php'; + +xoops_cp_header(); + +$aboutAdmin = new ModuleAdmin(); + +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); + +include 'admin_footer.php'; \ No newline at end of file Added: XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php (rev 0) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/about2.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -0,0 +1,84 @@ +<?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 Added: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php (rev 0) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_footer.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -0,0 +1,10 @@ +<?php + +echo "<div class='adminfooter'>\n" + ." <div style='text-align: center;'>\n" + ." <a href='http://www.xoops.org' target='_blank'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" + ." </div>\n" + ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" + ."</div>"; + +xoops_cp_footer(); \ No newline at end of file Added: XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php (rev 0) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/admin_header.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -0,0 +1,46 @@ +<?php +/** + * XoopsPartners module + * + * 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:: 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 $ +**/ + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +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'); + +//if functions.php file exist +require_once dirname(dirname(__FILE__)) . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); + +$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); + } \ No newline at end of file Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/index.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2012-06-19 14:53:13 UTC (rev 9673) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/index.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -1,213 +1,37 @@ -<?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 // -// ------------------------------------------------------------------------- // -include '../../../include/cp_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 ) { - ${$k} = $v; - } -} -if ( isset( $_GET ) ){ - foreach ( $_GET as $k => $v ) { - ${$k} = $v; - } -} - -define("XLANG_CONFIG_LINK","<a href='index.php' target='_self'>"._AM_XLANG_CONFIG."</a>"); - -$GLOBALS['xlanguage_handler'] =& xoops_getmodulehandler('language', 'xlanguage'); -$GLOBALS['xlanguage_handler']->loadConfig(); - -switch ( $op ) -{ - case "del": - if (!isset($_POST['ok']) || $_POST['ok'] != 1 ){ - xoops_cp_header(); - echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; - xoops_confirm( array( 'op' => 'del', 'type' => $_GET['type'], 'lang_id' => intval( $_GET['lang_id'] ), 'ok' => 1 ), 'index.php', _AM_XLANG_DELETE_CFM ); - }else{ - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - $lang =& $GLOBALS['xlanguage_handler']->get($lang_id, $isBase); - $GLOBALS['xlanguage_handler']->delete($lang); - redirect_header("index.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 =& $GLOBALS['xlanguage_handler']->get($lang_id, $isBase); - }else{ - $lang =& $GLOBALS['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); - $GLOBALS['xlanguage_handler']->insert($lang); - redirect_header("index.php",2,_AM_XLANG_SAVED); - break; - - case "edit": - xoops_cp_header(); - 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 =& $GLOBALS['xlanguage_handler']->get($lang_id, $isBase); - }elseif(isset($lang_name)){ - $lang =& $GLOBALS['xlanguage_handler']->getByName($lang_name, $isBase); - }else{ - $lang =& $GLOBALS['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(); - echo "<h4>" . XLANG_CONFIG_LINK . "</h4>"; - echo "<br />"; - echo "<h4>" . _AM_XLANG_ADDLANG . "</h4>"; - if(isset($type)&&$type=='ext') $isBase = false; - else $isBase = true; - $lang_name = ''; - $lang_desc = ''; - $lang_code = ''; - $lang_charset = ''; - $lang_image = ''; - $weight = 1; - $lang_base = ''; - include "langform.inc.php"; - break; - - case 'createconfig': - xlanguage_createConfig(); - redirect_header( 'index.php', 1, _AM_XLANG_CREATED ); - exit(); - break; - - case "default": - default: - xoops_cp_header(); - 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\">"; - 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='index.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; -} -xoops_cp_footer(); - - -function languageList() -{ - $lang_list =& $GLOBALS['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>" . _AM_XLANG_LANGLIST . "</b><br />"; - echo "<table width='100%' border='1'><tr class='bg2'><td align='center'>" . _AM_XLANG_DESC . "</td><td align='center'>" . _AM_XLANG_NAME . "</td><td align='center'>" . _AM_XLANG_CHARSET . "</td><td align='center'>" . _AM_XLANG_CODE . "</td><td align='center'>" . _AM_XLANG_IMAGE . "</td><td align='center'>" . _AM_XLANG_WEIGHT . "</td><td align='center'>" . _AM_XLANG_BASE . "</td><td align='center'>" . _EDIT . "</td><td align='center'>" . _DELETE . "</td></tr>\n"; - foreach( array_keys($lang_list) as $lang_name ) { - $lang =& $lang_list[$lang_name]; - $isOrphan = true; - if(isset($lang['base'])){ - echo "<tr>\n"; - echo "<td>" . $lang['base'] -> getVar('lang_desc') . "</td>\n"; - echo "<td><b>" . $lang['base'] -> getVar('lang_name') . "</b></td>\n"; - echo "<td><b>" . $lang['base'] -> getVar('lang_charset') . "</b></td>\n"; - echo "<td>" . $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><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$lang['base'] -> getVar('lang_desc')."' /></td>\n"; - echo "<td>" . $lang['base'] -> getVar('weight') . "</td>\n"; - echo "<td>Ø</td>\n"; - echo "<td><a href='index.php?op=edit&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'>" . _EDIT . "</a></td>\n"; - echo "<td><a href='index.php?op=del&type=base&lang_id=" . $lang['base'] -> getVar('lang_id') . "'>" . _DELETE ."</td>\n"; - echo "</tr>\n"; - $isOrphan = false; - } - if(!isset($lang['ext'])||count($lang['ext'])<1) continue; - foreach($lang['ext'] as $ext){ - echo "<tr>\n"; - echo "<td>" . $ext -> getVar('lang_desc') . "</td>\n"; - echo "<td>" . $ext -> getVar('lang_name') . "</td>\n"; - echo "<td><b>" . $ext -> getVar('lang_charset') . "</b></td>\n"; - echo "<td>" . $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><img src='" . XOOPS_URL.'/modules/xlanguage/images/'.$lang_image . "' alt='".$ext -> getVar('lang_desc')."' /></td>\n"; - echo "<td>" . $ext -> getVar('weight') . "</td>\n"; - $lang_base = ($isOrphan)?"<font color='red'>".$ext -> getVar('lang_base')."</font>":$ext -> getVar('lang_base'); - echo "<td><b>" . $lang_base . "</b></td>\n"; - echo "<td><a href='index.php?op=edit&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'>" . _EDIT . "</a></td>\n"; - echo "<td><a href='index.php?op=del&type=ext&lang_id=" . $ext -> getVar('lang_id') . "'>" . _DELETE ."</td>\n"; - echo "</tr>\n"; - } - echo "<tr><td colspan='9' height='2px'></td></tr>\n"; - } - echo "</table></div>\n"; - echo"</td></tr></table>"; - echo "<br />"; - } -} -?> +<?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 Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2012-06-19 14:53:13 UTC (rev 9673) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/langform.inc.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -33,17 +33,28 @@ if($isBase){ $lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name); - $lang_select->addOptionArray($GLOBALS['xlanguage_handler']->getXoopsLangList()); + $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_DESC, 'lang_desc', 50, 255, $lang_desc)); -$sform->addElement(new XoopsFormText(_AM_XLANG_CHARSET, 'lang_charset', 50, 255, $lang_charset), true); -$sform->addElement(new XoopsFormText(_AM_XLANG_CODE, 'lang_code', 50, 255, $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); + +//$sform->addElement(new XoopsFormText(_AM_XLANG_CODE, 'lang_code', 50, 255, $lang_code), true); +$lang_code = new XoopsFormText(_AM_XLANG_CODE, 'lang_charset', 50, 255, $lang_code); +$lang_code->setDescription(_AM_XLANG_CODE_DESC); +$sform->addElement($lang_code, true); + + if(!$isBase){ - $baseList =& $GLOBALS['xlanguage_handler']->getAll(); + $baseList =& $xlanguage_handler->getAll(); $base_list = array(); foreach($baseList as $base => $baselang){ $base_list[$base] = $base; Added: XoopsModules/xlanguage/trunk/xlanguage/admin/main.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/main.php (rev 0) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/main.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -0,0 +1,245 @@ +<?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'; + +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 ) { + ${$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>"); + +$xlanguage_handler =& xoops_getmodulehandler('language', 'xlanguage'); +$xlanguage_handler->loadConfig(); + +switch ( $op ) +{ + case "del": + 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; + $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("index.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 "<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'); + } + include "langform.inc.php"; + break; + + case "add": + xoops_cp_header(); +$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 = ''; + include "langform.inc.php"; + break; + + case 'createconfig': + xlanguage_createConfig(); + redirect_header( 'main.php', 1, _AM_XLANG_CREATED ); + exit(); + break; + + case "default": + default: + xoops_cp_header(); +$mainAdmin = new ModuleAdmin(); +echo $mainAdmin->addNavigation('main.php'); + + + // if (TDMDownloads_checkModuleAdmin()){ + // $mainAdmin = new ModuleAdmin(); + // echo $mainAdmin->addNavigation('downloads.php'); + $mainAdmin->addItemButton(_MI_XLANGUAGE_ADMENU1, 'main.php?op=add&type=base', 'add'); + $mainAdmin->addItemButton(_MI_XLANGUAGE_ADMENU2, 'main.php?op=add&type=ext', 'insert_table_row'); + + 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><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'; + 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'; + } + 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><td colspan='9' ></td></tr>\n"; + $class = ($class == 'odd') ? 'even' : 'odd'; + } + + echo "</table></div>\n"; + echo"</td></tr></table>"; + echo "<br />"; + } +} +?> Modified: XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php 2012-06-19 14:53:13 UTC (rev 9673) +++ XoopsModules/xlanguage/trunk/xlanguage/admin/menu.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -27,12 +27,34 @@ // Author: D.J.(phppp) ph...@ho... // // URL: http://www.xoops.org.cn // // ------------------------------------------------------------------------- // -$adminmenu[0]['title'] = _MI_XLANGUAGE_ADMENU0; -$adminmenu[0]['link'] = "admin/index.php"; -$adminmenu[1]['title'] = _MI_XLANGUAGE_ADMENU1; -$adminmenu[1]['link'] = "admin/index.php?op=add&type=base"; -$adminmenu[2]['title'] = _MI_XLANGUAGE_ADMENU2; -$adminmenu[2]['link'] = "admin/index.php?op=add&type=ext"; -$adminmenu[3]['title'] = _MI_XLANGUAGE_ADMENU3; -$adminmenu[3]['link'] = "about.php"; -?> \ No newline at end of file +$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 2012-06-19 14:53:13 UTC (rev 9673) +++ XoopsModules/xlanguage/trunk/xlanguage/api.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -31,10 +31,10 @@ include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php'); include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/functions.php'); -$cookie_prefix = preg_replace("/[^a-z_0-9]+/i", "_", preg_replace("/(http(s)?:\/\/)?(www.)?/i","",XOOPS_URL)); -$cookie_var = $cookie_prefix."_".XLANGUAGE_LANG_TAG; +//$cookie_prefix = preg_replace("/[^a-z_0-9]+/i", "_", preg_replace("/(http(s)?:\/\/)?(www.)?/i","",XOOPS_URL)); +$cookie_var = XLANGUAGE_LANG_TAG; -$xlanguage["action"]=false; +$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); @@ -56,26 +56,28 @@ $xlanguage["lang"] = $xoopsConfig['language']; } -$GLOBALS['xlanguage_handler']=& xoops_getmodulehandler('language', 'xlanguage'); -$GLOBALS['xlanguage_handler']->loadConfig(); -$lang = $GLOBALS['xlanguage_handler']->getByName($xlanguage["lang"]); +$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 = $GLOBALS['xlanguage_handler']->getByName($lang->getVar('lang_base')); + $lang_base = $xlanguage_handler->getByName($lang->getVar('lang_base')); if(is_object($lang_base)){ $xlanguage['charset_base'] = $lang_base->getVar('lang_charset'); - $xlanguage['charset'] = $lang->getVar('lang_charset'); - $xlanguage['code'] = $lang->getVar('lang_code'); $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); +$GLOBALS['xlanguage_handler'] =& $xlanguage_handler; + if($xlanguage["action"]){ //if(CONV_REQUEST && (!empty($_GET)||!empty($_POST))){ if(!empty($_POST)){ @@ -102,12 +104,12 @@ * * To use it: * 1 set "$xlanguage_theme_enable = true;" - * 2 config options "$options = array("images", " ", 5); // display mode, delimitor, number per line"; + * 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 = false; +$xlanguage_theme_enable = true; if(!empty($xlanguage_theme_enable)){ - $options = array("images", " ", 5); // display mode, delimitor, number per line + $options = array("dropdown", " ", 5); // display mode, delimitor, number per line xlanguage_select_show($options); } -?> \ No newline at end of file +?> Modified: XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php =================================================================== --- XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php 2012-06-19 14:53:13 UTC (rev 9673) +++ XoopsModules/xlanguage/trunk/xlanguage/blocks/xlanguage_blocks.php 2012-06-19 15:12:44 UTC (rev 9674) @@ -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(); - - $GLOBALS['xlanguage_handler'] =& xoops_getmodulehandler('language', 'xlanguage'); - $GLOBALS['xlanguage_handler']->loadConfig(); - $lang_list = $GLOBALS['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; -} +<?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 s... [truncated message content] |