From: <tr...@us...> - 2012-12-10 14:09:21
|
Revision: 10349 http://sourceforge.net/p/xoops/svn/10349 Author: trabis Date: 2012-12-10 14:09:17 +0000 (Mon, 10 Dec 2012) Log Message: ----------- Fixing language issues on installer Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_extensioninstaller.php XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php 2012-12-10 13:48:43 UTC (rev 10348) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/include/makedata.php 2012-12-10 14:09:17 UTC (rev 10349) @@ -9,22 +9,21 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** -* Installer data generation file -* -* See the enclosed file license.txt for licensing information. -* If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html -* -* @copyright The XOOPS project http://www.xoops.org/ -* @license http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL) -* @package installer -* @since 2.3.0 -* @author Haruki Setoyama <ha...@pl...> -* @author Kazumi Ono <web...@my...> -* @author Skalpa Keo <sk...@xo...> -* @author Taiwen Jiang <ph...@us...> -* @author DuGris (aka L. JEN) <du...@fr...> -* @version $Id$ -*/ + * Installer data generation file + * See the enclosed file license.txt for licensing information. + * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html + * + * @copyright The XOOPS project http://www.xoops.org/ + * @license http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL) + * @package installer + * @since 2.3.0 + * @author Haruki Setoyama <ha...@pl...> + * @author Kazumi Ono <web...@my...> + * @author Skalpa Keo <sk...@xo...> + * @author Taiwen Jiang <ph...@us...> + * @author DuGris (aka L. JEN) <du...@fr...> + * @version $Id$ + */ // include_once './class/dbmanager.php'; // RMV // TODO: Shouldn't we insert specific field names?? That way we can use @@ -33,7 +32,7 @@ function make_groups($dbm) { $gruops['XOOPS_GROUP_ADMIN'] = $dbm->insert('groups', " VALUES (1, '" . addslashes(_INSTALL_WEBMASTER) . "', '" . addslashes(_INSTALL_WEBMASTERD) . "', 'Admin')"); - $gruops['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (2, '" . addslashes(_INSTALL_REGUSERS) . "', '" . addslashes(_INSTALL_REGUSERSD) . "', 'User')" ); + $gruops['XOOPS_GROUP_USERS'] = $dbm->insert('groups', " VALUES (2, '" . addslashes(_INSTALL_REGUSERS) . "', '" . addslashes(_INSTALL_REGUSERSD) . "', 'User')"); $gruops['XOOPS_GROUP_ANONYMOUS'] = $dbm->insert('groups', " VALUES (3, '" . addslashes(_INSTALL_ANONUSERS) . "', '" . addslashes(_INSTALL_ANONUSERSD) . "', 'Anonymous')"); if (!$gruops['XOOPS_GROUP_ADMIN'] || !$gruops['XOOPS_GROUP_USERS'] || !$gruops['XOOPS_GROUP_ANONYMOUS']) { return false; @@ -77,7 +76,7 @@ $time = time(); $dbm->insert('tplset', " VALUES (1, 'default', 'XOOPS Default Template Set', '', " . $time . ")"); // system modules - if (file_exists($file = $root .'/modules/system/language/' . $language . '/modinfo.php')) { + if (file_exists($file = $root . '/modules/system/language/' . $language . '/modinfo.php')) { include $file; } else { include $root . '/modules/system/language/english/modinfo.php'; @@ -92,45 +91,55 @@ foreach ($modversion['templates'] as $tplfile) { // Main templates - if ($fp = fopen($root . '/modules/system/templates/' . $tplfile['file'], 'r')) { - $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'module')"); - // $newtplid = $xoopsDB->getInsertId(); - $tplsource = fread($fp, filesize($root . '/modules/system/templates/' . $tplfile['file'])); - fclose($fp); - $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')"); + if (file_exists($file = $root . '/modules/system/templates/' . $tplfile['file'])) { + if ($fp = fopen($file, 'r')) { + $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'module')"); + // $newtplid = $xoopsDB->getInsertId(); + $tplsource = fread($fp, filesize($root . '/modules/system/templates/' . $tplfile['file'])); + fclose($fp); + $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')"); + } } // Admin templates - if ($fp = fopen($root . '/modules/system/templates/admin/' . $tplfile['file'], 'r')) { - $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'admin')"); - // $newtplid = $xoopsDB->getInsertId(); - $tplsource = fread($fp, filesize($root . '/modules/system/templates/admin/' . $tplfile['file'])); - fclose($fp); - $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')"); + if (file_exists($file = $root . '/modules/system/admin/templates/' . $tplfile['file'])) { + if ($fp = fopen($file, 'r')) { + $newtplid = $dbm->insert('tplfile', " VALUES (0, 1, 'system', 'default', '" . addslashes($tplfile['file']) . "', '" . addslashes($tplfile['description']) . "', " . $time . ", " . $time . ", 'admin')"); + // $newtplid = $xoopsDB->getInsertId(); + $tplsource = fread($fp, filesize($root . '/modules/system/templates/admin/' . $tplfile['file'])); + fclose($fp); + $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')"); + } } } foreach ($modversion['blocks'] as $func_num => $newblock) { - if ($fp = fopen($root . '/modules/system/templates/blocks/' . $newblock['template'], 'r')) { - if (in_array($newblock['template'], array('system_block_user.html', 'system_block_login.html', 'system_block_mainmenu.html'))) { - $visible = 1; - } else { - $visible = 0; + if (file_exists($file = $root . '/modules/system/templates/blocks/' . $newblock['template'])) { + if ($fp = fopen($file, 'r')) { + if (in_array($newblock['template'], array( + 'system_block_user.html', 'system_block_login.html', 'system_block_mainmenu.html' + )) + ) { + $visible = 1; + } else { + $visible = 0; + } + $options = !isset($newblock['options']) ? '' : trim($newblock['options']); + $edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']); + $newbid = $dbm->insert('newblocks', " VALUES (0, 1, " . $func_num . ", '" . addslashes($options) . "', '" . addslashes($newblock['name']) . "', '" . addslashes($newblock['name']) . "', '', 0, 0, " . $visible . ", 'S', 'H', 1, 'system', '" . addslashes($newblock['file']) . "', '" . addslashes($newblock['show_func']) . "', '" . addslashes($edit_func) . "', '" . addslashes($newblock['template']) . "', 0, " . $time . ")"); + // $newbid = $xoopsDB->getInsertId(); + $newtplid = $dbm->insert('tplfile', " VALUES (0, " . $newbid . ", 'system', 'default', '" . addslashes($newblock['template']) . "', '" . addslashes($newblock['description']) . "', " . $time . ", " . $time . ", 'block')"); + // $newtplid = $xoopsDB->getInsertId(); + $tplsource = fread($fp, filesize($root . '/modules/system/templates/blocks/' . $newblock['template'])); + fclose($fp); + $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')"); + $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_ADMIN'] . ", " . $newbid . ", 1, 'block_read')"); + // $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')"); + $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_USERS'] . ", " . $newbid . ", 1, 'block_read')"); + $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_ANONYMOUS'] . ", " . $newbid . ", 1, 'block_read')"); } - $options = !isset($newblock['options']) ? '' : trim($newblock['options']); - $edit_func = !isset($newblock['edit_func']) ? '' : trim($newblock['edit_func']); - $newbid = $dbm->insert('newblocks', " VALUES (0, 1, " . $func_num . ", '" . addslashes($options) . "', '" . addslashes($newblock['name']) . "', '" . addslashes($newblock['name']) . "', '', 0, 0, " . $visible . ", 'S', 'H', 1, 'system', '" . addslashes($newblock['file']) . "', '" . addslashes($newblock['show_func']) . "', '" . addslashes($edit_func) . "', '" . addslashes($newblock['template']) . "', 0, " . $time . ")"); - // $newbid = $xoopsDB->getInsertId(); - $newtplid = $dbm->insert('tplfile', " VALUES (0, " . $newbid . ", 'system', 'default', '" . addslashes($newblock['template']) . "', '" . addslashes($newblock['description']) . "', " . $time . ", " . $time . ", 'block')"); - // $newtplid = $xoopsDB->getInsertId(); - $tplsource = fread($fp, filesize($root . '/modules/system/templates/blocks/' . $newblock['template'])); - fclose($fp); - $dbm->insert('tplsource', " (tpl_id, tpl_source) VALUES (" . $newtplid . ", '" . addslashes($tplsource) . "')"); - $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_ADMIN'] . ", " . $newbid . ", 1, 'block_read')"); - // $dbm->insert("group_permission", " VALUES (0, ".$gruops['XOOPS_GROUP_ADMIN'].", ".$newbid.", 'xoops_blockadmiin')"); - $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_USERS'] . ", " . $newbid . ", 1, 'block_read')"); - $dbm->insert("group_permission", " VALUES (0, " . $gruops['XOOPS_GROUP_ANONYMOUS'] . ", " . $newbid . ", 1, 'block_read')"); } } + // data for table 'users' $temp = md5($adminpass); $regdate = time(); @@ -174,14 +183,18 @@ $dbm->insert('config', " VALUES (31, 0, 2, 'self_delete', '_MD_AM_SELFDELETE', '0', '_MD_AM_SELFDELETEDSC', 'yesno', 'int', 22)"); $dbm->insert('config', " VALUES (32, 0, 1, 'com_mode', '_MD_AM_COMMODE', 'flat', '_MD_AM_COMMODEDSC', 'select', 'text', 34)"); $dbm->insert('config', " VALUES (33, 0, 1, 'com_order', '_MD_AM_COMORDER', '0', '_MD_AM_COMORDERDSC', 'select', 'int', 36)"); - $dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '" . addslashes(serialize(array('webmaster', '^xoops', '^admin'))) . "', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)"); + $dbm->insert('config', " VALUES (34, 0, 2, 'bad_unames', '_MD_AM_BADUNAMES', '" . addslashes(serialize(array( + 'webmaster', '^xoops', '^admin' + ))) . "', '_MD_AM_BADUNAMESDSC', 'textarea', 'array', 24)"); $dbm->insert('config', " VALUES (35, 0, 2, 'bad_emails', '_MD_AM_BADEMAILS', '" . addslashes(serialize(array('xoops.org$'))) . "', '_MD_AM_BADEMAILSDSC', 'textarea', 'array', 26)"); $dbm->insert('config', " VALUES (36, 0, 2, 'maxuname', '_MD_AM_MAXUNAME', '10', '_MD_AM_MAXUNAMEDSC', 'textbox', 'int', 3)"); $dbm->insert('config', " VALUES (37, 0, 1, 'bad_ips', '_MD_AM_BADIPS', '" . addslashes(serialize(array('127.0.0.1'))) . "', '_MD_AM_BADIPSDSC', 'textarea', 'array', 42)"); $dbm->insert('config', " VALUES (38, 0, 3, 'meta_keywords', '_MD_AM_METAKEY', 'xoops, web applications, web 2.0, sns, news, technology, headlines, linux, software, download, downloads, free, community, forum, bulletin board, bbs, php, survey, polls, kernel, comment, comments, portal, odp, open source, opensource, FreeSoftware, gnu, gpl, license, Unix, *nix, mysql, sql, database, databases, web site, blog, wiki, module, modules, theme, themes, cms, content management', '_MD_AM_METAKEYDSC', 'textarea', 'text', 0)"); $dbm->insert('config', " VALUES (39, 0, 3, 'footer', '_MD_AM_FOOTER', 'Powered by XOOPS © 2001-" . date('Y', time()) . " <a href=\"http://xoops.sourceforge.net\" rel=\"external\" title=\"The XOOPS Project\">The XOOPS Project</a>', '_MD_AM_FOOTERDSC', 'textarea', 'text', 20)"); $dbm->insert('config', " VALUES (40, 0, 4, 'censor_enable', '_MD_AM_DOCENSOR', '0', '_MD_AM_DOCENSORDSC', 'yesno', 'int', 0)"); - $dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '" . addslashes(serialize(array('fuck', 'shit'))) . "', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)"); + $dbm->insert('config', " VALUES (41, 0, 4, 'censor_words', '_MD_AM_CENSORWRD', '" . addslashes(serialize(array( + 'fuck', 'shit' + ))) . "', '_MD_AM_CENSORWRDDSC', 'textarea', 'array', 1)"); $dbm->insert('config', " VALUES (42, 0, 4, 'censor_replace', '_MD_AM_CENSORRPLC', '#OOPS#', '_MD_AM_CENSORRPLCDSC', 'textbox', 'text', 2)"); $dbm->insert('config', " VALUES (43, 0, 3, 'meta_robots', '_MD_AM_METAROBOTS', 'index,follow', '_MD_AM_METAROBOTSDSC', 'select', 'text', 2)"); $dbm->insert('config', " VALUES (44, 0, 5, 'enable_search', '_MD_AM_DOSEARCH', '1', '_MD_AM_DOSEARCHDSC', 'yesno', 'int', 0)"); @@ -256,7 +269,7 @@ $dbm->insert('config', " VALUES (107, 1, 0, 'active_images', '_MI_SYSTEM_PREFERENCE_ACTIVE_IMAGES', '1', '', 'yesno', 'int', 110)"); $dbm->insert('config', " VALUES (108, 1, 0, 'active_mailusers', '_MI_SYSTEM_PREFERENCE_ACTIVE_MAILUSERS', '1', '', 'yesno', 'int', 120)"); $dbm->insert('config', " VALUES (109, 1, 0, 'active_modulesadmin', '_MI_SYSTEM_PREFERENCE_ACTIVE_MODULESADMIN', '1', '', 'hidden', 'int', 130)"); - $dbm->insert('config', " VALUES (110, 1, 0, 'active_maintenance', '_MI_SYSTEM_PREFERENCE_ACTIVE_MAINTENANCE', '1', '', 'yesno', 'int', 140)"); + $dbm->insert('config', " VALUES (110, 1, 0, 'active_maintenance', '_MI_SYSTEM_PREFERENCE_ACTIVE_MAINTENANCE', '1', '', 'yesno', 'int', 140)"); $dbm->insert('config', " VALUES (111, 1, 0, 'active_preferences', '_MI_SYSTEM_PREFERENCE_ACTIVE_PREFERENCES', '1', '', 'hidden', 'int', 150)"); $dbm->insert('config', " VALUES (112, 1, 0, 'active_smilies', '_MI_SYSTEM_PREFERENCE_ACTIVE_SMILIES', '1', '', 'yesno', 'int', 160)"); $dbm->insert('config', " VALUES (113, 1, 0, 'active_tplsets', '_MI_SYSTEM_PREFERENCE_ACTIVE_TPLSETS', '1', '', 'hidden', 'int', 170)"); @@ -281,34 +294,34 @@ $dbm->insert('config', " VALUES (134, 0, 1, 'redirect_message_ajax', '_MD_AM_CUSTOM_REDIRECT', '1', '_MD_AM_CUSTOM_REDIRECT_DESC', 'yesno', 'int', 12)"); - require_once $root . '/class/xoopslists.php'; - $editors = XoopsLists::getDirListAsArray( $root . '/class/xoopseditor' ); - $conf=35; - foreach ( $editors as $dir ) { - $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 126)"); + require_once $root . '/class/xoopslists.php'; + $editors = XoopsLists::getDirListAsArray($root . '/class/xoopseditor'); + $conf = 35; + foreach ($editors as $dir) { + $dbm->insert('configoption', " VALUES (" . $conf . ", '" . $dir . "', '" . $dir . "', 126)"); $conf++; } - foreach ( $editors as $dir ) { - $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 127)"); + foreach ($editors as $dir) { + $dbm->insert('configoption', " VALUES (" . $conf . ", '" . $dir . "', '" . $dir . "', 127)"); $conf++; } - foreach ( $editors as $dir ) { - $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 128)"); + foreach ($editors as $dir) { + $dbm->insert('configoption', " VALUES (" . $conf . ", '" . $dir . "', '" . $dir . "', 128)"); $conf++; } $icons = XoopsLists::getDirListAsArray($root . '/modules/system/images/icons'); - foreach ( $icons as $dir ) { - $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 98)"); + foreach ($icons as $dir) { + $dbm->insert('configoption', " VALUES (" . $conf . ", '" . $dir . "', '" . $dir . "', 98)"); $conf++; } $breadcrumb = XoopsLists::getDirListAsArray($root . '/modules/system/images/breadcrumb'); - foreach ( $breadcrumb as $dir ) { - $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 99)"); + foreach ($breadcrumb as $dir) { + $dbm->insert('configoption', " VALUES (" . $conf . ", '" . $dir . "', '" . $dir . "', 99)"); $conf++; } $jqueryui = XoopsLists::getDirListAsArray($root . '/modules/system/css/ui'); - foreach ( $jqueryui as $dir ) { - $dbm->insert('configoption', " VALUES (".$conf.", '".$dir."', '".$dir."', 133)"); + foreach ($jqueryui as $dir) { + $dbm->insert('configoption', " VALUES (" . $conf . ", '" . $dir . "', '" . $dir . "', 133)"); $conf++; } Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_extensioninstaller.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_extensioninstaller.php 2012-12-10 13:48:43 UTC (rev 10348) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_extensioninstaller.php 2012-12-10 14:09:17 UTC (rev 10349) @@ -35,7 +35,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { include_once XOOPS_ROOT_PATH . "/modules/system/class/module.php"; + include_once XOOPS_ROOT_PATH . "/modules/system/class/system.php"; + $system = System::getInstance(); + $system->loadLanguage('modulesadmin','system'); + $system_module = new SystemModule(); $msgs = array(); @@ -66,6 +70,11 @@ } include_once XOOPS_ROOT_PATH . "/modules/system/class/module.php"; include_once XOOPS_ROOT_PATH . "/modules/system/class/extension.php"; + include_once XOOPS_ROOT_PATH . "/modules/system/class/system.php"; + + $system = System::getInstance(); + $system->loadLanguage('modulesadmin','system'); + // Get installed modules $system_module = new SystemExtension(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php 2012-12-10 13:48:43 UTC (rev 10348) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/install/page_moduleinstaller.php 2012-12-10 14:09:17 UTC (rev 10349) @@ -40,8 +40,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { include_once XOOPS_ROOT_PATH . "/modules/system/class/module.php"; + include_once XOOPS_ROOT_PATH . "/modules/system/class/system.php"; $system_module = new SystemModule(); + $system = System::getInstance(); + $system->loadLanguage('modulesadmin','system'); $msgs = array(); foreach ($_REQUEST['modules'] as $dirname => $installmod) { @@ -69,7 +72,13 @@ if (!$xoops->getConfig('language')) { $xoops->setConfig('language', $_COOKIE['xo_install_lang']); } + include_once XOOPS_ROOT_PATH . "/modules/system/class/module.php"; + include_once XOOPS_ROOT_PATH . "/modules/system/class/system.php"; + + $system_module = new SystemModule(); + $system = System::getInstance(); + $system->loadLanguage('modulesadmin','system'); // Get installed modules $system_module = new SystemModule(); |