From: <txm...@us...> - 2012-05-21 19:31:33
|
Revision: 9571 http://xoops.svn.sourceforge.net/xoops/?rev=9571&view=rev Author: txmodxoops Date: 2012-05-21 19:31:22 +0000 (Mon, 21 May 2012) Log Message: ----------- Initial update to 2.6.0 Added Paths: ----------- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/about.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/bbs.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/header.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/languages.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/menu.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/wizard.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/blocks/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/blocks/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/files.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/googleprovider.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/iobase.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/languages.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/provider.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/translator.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/css/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/css/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/changelog.txt XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/credits.txt XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/install.txt XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/lang_diff.txt XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/licence.txt XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/docs/readme.txt XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/analysis.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/edit.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/export.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/import.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/16/traslate.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/32/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/32/dashboard.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/32/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/32/languages.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/32/translations.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/32/wizard.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/about.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/help.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/home.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/permissions.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/admin/xoopsmicrobutton.gif XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/about.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/arrow.gif XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/delete.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/edit.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/index.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/off.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/on.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/permissions.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/pref.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/deco/update.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/icons/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/icons/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/icons/off.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/icons/on.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/languages.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/left_both.gif XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/menu/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/menu/bg.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/menu/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/menu/left_both.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/menu/right_both.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/right_both.gif XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/translations.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/wizard.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/images/xtransam_slogo.png XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/JSON.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/charset_utf-8.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/forms.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/functions.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/install.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/include/update.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/admin.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/google.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/help/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/help/help.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/help/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/english/modinfo.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/admin.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/google.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/help/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/help/help.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/help/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/language/italian/modinfo.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/providers/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/providers/bing.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/providers/google.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/providers/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/providers/mymemory.php XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/sql/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/sql/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/sql/mysql.sql XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/admin/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/admin/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/admin/xtransam_about.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/admin/xtransam_help.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/blocks/ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/blocks/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/templates/index.html XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/xoops_version.php Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/about.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/about.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/about.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,34 @@ +<?php +/* + 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. +*/ + +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Mamba + * @author Simon Roberts <si...@ch...> + * @version $Id: about.php 8469 2011-12-12 14:13:34Z beckmi $ + * @version $Id: about.php 9400 2012-12-04 12:58:28Z timgno $ + */ + +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); + +$aboutAdmin = new XoopsModuleAdmin(); +$aboutAdmin->renderNavigation('about.php'); +$aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); + +$xoops->footer(); \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/bbs.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/bbs.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/bbs.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,238 @@ +<?php +/* + 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. +*/ + +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Simon Roberts <si...@ch...> + * @author Timgno <in...@tx...> + * @version $Id: index.php 9400 2012-04-28 12:53:34Z timgno $ + */ +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); + +include_once '../include/forms.php'; +define ("_CHARSET","UTF-8"); +define ("_CHARSET_ISO","ISO-8859-1"); +error_reporting(E_ALL); +global $xoopsDB, $xoopsModuleConfig; + + if (isset($_GET)) { + foreach ($_GET as $k => $v) { + ${$k} = $v; + } + } + + if (isset($_POST)) { + foreach ($_POST as $k => $v) { + ${$k} = $v; + } + } + + +ini_set("max_execution_time", "300"); + +switch ($op){ +case "deletebuffer": + $sql[0] = "DELETE FROM ".$xoopsDB->prefix('xtransam_files')." WHERE ioid = $id"; + $sql[1] = "DELETE FROM ".$xoopsDB->prefix('xtransam_translator')." WHERE ioid = $id"; + $sql[2] = "DELETE FROM ".$xoopsDB->prefix('xtransam_iobase')." WHERE id = $id"; + + foreach($sql as $fquestion) + $xoopsDB->queryF($fquestion); + + redirect_header("index.php", 4, _XT_IODELETED); + break; +case "save-languages": + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + foreach($id as $key => $value) + { + switch($value){ + case "new": + $lang = $lang_handler->create(); + break; + default: + $lang = $lang_handler->get($value); + } + + if (!empty($name[$key])&&!empty($code[$key])) { + $lang->setVar('name', $name[$key]); + $lang->setVar('code', $code[$key]); + $lang->setVar('foldername', $folder[$key]); + $lang->setVar('provider', $provider[$key]); + @$lang_handler->insert($lang); + } + } + redirect_header("index.php?op=languages",2,_XT_LANGSAVEOK); + break; +case "languages": + languagesForm_display(); + break; +case "export": + global $xoopsUser; + + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $io = $io_handler->get($id); + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + $files = $files_handler->getObjects($criteria); + + $from_folder = $lang_handler->folder($io->getvar('languagefrom')); + $to_folder = $lang_handler->folder($io->getvar('languageto')); + + foreach($files as $file) { + $path = explode('/', $file->getVar('path')); + + foreach($path as $key => $value) + if (strtolower($value) == strtolower($from_folder)) { + $path[$key] = $to_folder; + } + + //$wpath = implode('/', $path).'/'; + $wpath = implode(DIRECTORY_SEPARATOR, $path); + mkdir($wpath, 0777); + + if($wpath!=$file->getVar('path')){ + $bfile = file($file->getVar('path').$file->getVar('filename')); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + $criteria->add(new Criteria('fileid', $file->getVar('id'))); + $trans = $trans_handler->getObjects($criteria); + // Changed & Added by TXMod Xoops + $bfile[1] = "\n// Translation done by xtransam & ".$xoopsUser->uname()." TXMod Xoops - ".date('Y-m-d H:i')."\n\n"; + + foreach($trans as $tran) { + $search = xtransam_convert_decode($tran->getVar('replacestr'), $tran->getVar('sm')); + $name = xtransam_convert_decode($tran->getVar('name'), $tran->getVar('sm')); + $translation = xtransam_convert_decode($tran->getVar('translation'), $tran->getVar('sm')); + + // Changed & Added by TXMod Xoops + //include_once '../include/charset_utf-8.php'; + //$translation = preg_replace($search, $replace, $translation); + $translation = str_replace('"', '\"', $translation); + $translation = str_replace('\"', "'", $translation); + $translation = str_replace('="', "='", $translation); + $translation = str_replace('">', "'>", $translation); + $translation = str_replace('È', 'E'', $translation); + $translation = str_replace('ì', 'ì', $translation); + $translation = str_replace('ò', 'ò', $translation); + $translation = str_replace('è', 'è', $translation); + $translation = str_replace('ù', 'ù', $translation); + $translation = str_replace('à', 'à', $translation); + $translation = str_replace('% S', '%s', $translation); + $translation = str_replace('%s ', '%s ', $translation); + $translation = str_replace('%s "', '%s"', $translation); + $translation = str_replace(' / ', '/', $translation); + + $replace = 'define("'.$name.'", "'.$translation.'");'; + $bfile[$tran->getVar('line')] = str_replace($search, $replace, $bfile[$tran->getVar('line')]); + } + @makeWritable($wpath, true); + if (file_exists($wpath.$file->getVar('filename'))) + unlink($wpath.$file->getVar('filename')); + $file = @fopen($wpath.$file->getVar('filename'), 'w'); + $buffer = implode('', $bfile); + fwrite($file, $buffer, strlen($buffer)); + fclose($file); + } + } + // Added by TXMod Xoops + if (file_exists($indexFile = XOOPS_ROOT_PATH."/modules/xtransam/language/index.html")) + copy($indexFile, $wpath."index.html"); + + redirect_header("index.php?op=bbs",2,_XT_EXPORTCOMPLETE); + break; +case "save": + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + foreach($trans as $key => $value) { + $tran = $trans_handler->get($key); + $tran->setVar('translation', xtransam_convert_encode($value, $tran->getVar('sm'))); + $trans_handler->insert($tran); + } + redirect_header("index.php?op=manage&id=$id&fileid=$fileid",2,_XT_SAVECOMPLETE); + break; +case "manage": + managerForm_display($id, $fileid); + break; + +case "analysis": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $io = $io_handler->get($id); + @$files_handler->analysepath($io); + redirect_header("index.php?op=bbs",2,_XT_ANLYSISCOMPLETE); + break; + +case "import": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $io = $io_handler->get($id); + @$files_handler->importfiles($io); + redirect_header("index.php?op=bbs",2,_XT_IMPORTCOMPLETE); + break; + +case "translate": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $io = $io_handler->get($id); + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + if ($trans_handler->getCount($criteria)>0) { + $trans = $trans_handler->getObjects($criteria); + $start = time(); + foreach($trans as $tran) { + if ($tran->isempty()){ + $from = $lang_handler->code($io->getVar('languagefrom')); + $to = $lang_handler->code($io->getVar('languageto')); + $provider = $lang_handler->provider($tran->getVar('toid')); + if (strlen($provider)>0) { + $provider_handler = xoops_getmodulehandler($provider.'provider', 'xtransam'); + $translation = $provider_handler->translate($from,$to, xtransam_convert_decode($tran->getVar('orginal'), $tran->getVar('sm'))); + $tran->setVar('translation', xtransam_convert_encode($translation, $tran->getVar('sm'))); + if (strlen($translation)>0) + $tran->setVar('auto', 1); + else + $tran->setVar('auto', 0); + + $trans_handler->insert($tran); + } + if ($start+28<time()) + { + $restart++; + redirect_header("index.php?op=translate&id=$id&restart=$restart",2,sprintf(_XT_30SECONDSCONTINUING, $restart)); + } + } + } + } + redirect_header("index.php?op=bbs",2,_XT_TRANSLATIONCOMPLETE); + break; + +case "languages": + + break; +case "bbs": + translationForm_display(false); + break; + +case "wizard": +default: + wizardForm_display($step); + translationForm_display(true); + break; +} +$xoops->footer(); \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/header.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/header.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/header.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,26 @@ +<?php +/* + 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. +*/ + +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Taiwen Jiang <ph...@us...> + * @author Simon Roberts <si...@ch...> + * @version $Id: header.php 9400 2012-04-28 10:25:22Z timgno $ + */ +require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; + +$xoops = Xoops::getInstance(); +XoopsLoad::load('xtransam', 'xtransam'); \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.html =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.html (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.html 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/index.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,263 @@ +<?php +/* + 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. +*/ + +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Simon Roberts <si...@ch...> + * @author Timgno <in...@tx...> + * @version $Id: index.php 9400 2012-04-28 12:53:34Z timgno $ + */ +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); + +$indexAdmin = new XoopsModuleAdmin(); +$indexAdmin->renderNavigation('index.php'); +$indexAdmin->renderIndex(); + +/*error_reporting(E_ALL); +global $xoopsDB, $xoopsModuleConfig; + +$op = isset($_REQUEST['op'])?$_REQUEST['op']:'dashboard'; + +switch ($op){ +case "deletebuffer": + $sql[0] = "DELETE FROM ".$xoopsDB->prefix('xtransam_files')." WHERE ioid = $id"; + $sql[1] = "DELETE FROM ".$xoopsDB->prefix('xtransam_translator')." WHERE ioid = $id"; + $sql[2] = "DELETE FROM ".$xoopsDB->prefix('xtransam_iobase')." WHERE id = $id"; + + foreach($sql as $fquestion) + $xoopsDB->queryF($fquestion); + + redirect_header("index.php", 4, _AM_XTRANSAM_IODELETED); + break; +case "save-languages": + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + foreach($id as $key => $value) + { + switch($value){ + case "new": + $lang = $lang_handler->create(); + break; + default: + $lang = $lang_handler->get($value); + } + + if (!empty($name[$key])&&!empty($code[$key])) { + $lang->setVar('name', $name[$key]); + $lang->setVar('code', $code[$key]); + $lang->setVar('foldername', $folder[$key]); + $lang->setVar('providers', $providers[$key]); + @$lang_handler->insert($lang); + } + } + redirect_header("index.php?op=languages",2,_AM_XTRANSAM_LANGSAVEOK); + break; +case "languages": + + echo $indexAdmin->addNavigation('index.php?op=languages'); + languagesForm_display(); + include "admin_footer.php"; + + break; +case "export": + global $xoopsUser; + + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $io = $io_handler->get($id); + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + $files = $files_handler->getObjects($criteria); + + $from_folder = $lang_handler->folder($io->getvar('languagefrom')); + $to_folder = $lang_handler->folder($io->getvar('languageto')); + + // Changed by Chronolabs - Removed Code by Timgo - ansi conversion - 08/11/2011 + //include($GLOBALS['xoops']->path('modules'.DS.'xtransam'.DS.'include'.DS.'charset_utf-8.php')); + + foreach($files as $file) { + $path = array(); + foreach(explode('\\', $file->getVar('path')) as $nodea) + foreach(explode('/', $nodea) as $nodeb) + $path[] = $nodeb; + foreach($path as $key => $value) { + if (strtolower($value) == strtolower($from_folder)) { + $path[$key] = $to_folder; + } + $pdir = DS.$path[$key]; + mkdir($pdir, 0777); + } + $wpath = implode(DS, $path); + if($wpath!=$file->getVar('path')){ + $bfile = file($file->getVar('path').$file->getVar('filename')); + // Changed by TXMod Xoops back to Header + $bfile[] = "<?php\n\n// Translation done by XTransam & ".$GLOBALS['xoopsUser']->getVar('uname')." (".$GLOBALS['xoopsUser']->getVar('email').")\n// XTransam ".($GLOBALS['xtransamModule']->getVar('version')/100)." is written by Chronolabs Co-op & The XOOPS Project - File Dumped on ".date('Y-m-d H:i')."\n\n?>"; + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + $criteria->add(new Criteria('fileid', $file->getVar('id'))); + $trans = $trans_handler->getObjects($criteria); + foreach($trans as $tran) { + $search = xtransam_convert_decode($tran->getVar('replacestr'), $tran->getVar('sm')); + $name = xtransam_convert_decode($tran->getVar('name'), $tran->getVar('sm')); + $translation = xtransam_convert_decode($tran->getVar('translation'), $tran->getVar('sm')); + *//*foreach($GLOBALS['charset_utf8'] as $search => $replace) + $translation = str_replace($search, $replace, $translation); + $translation = htmlspecialchars($translation, ENT_QUOTES); *//* + $trans = get_html_translation_table(HTML_ENTITIES); + $str = $translation; + $encoded = strtr($str, $trans); + //$translation = htmlentities($translation, ENT_COMPAT, "UTF-8"); + $replace = 'define("'.$name.'", "'.$encoded.'");'."\n"; + $bfile[$tran->getVar('line')] = $replace; + } + @makeWritable($wpath, true); + if (file_exists($wpath.$file->getVar('filename'))) + unlink($wpath.$file->getVar('filename')); + $file = @fopen($wpath.$file->getVar('filename'), 'w'); + $buffer = implode("", $bfile); + fwrite($file, $buffer, strlen($buffer)); + fclose($file); + } + // Changed by Chronolabs to be recursive + if (file_exists($indexFile = XOOPS_ROOT_PATH."modules/xtransam/language/index.html")) + copy($indexFile, $wpath."/index.html"); + } + redirect_header("index.php?op=bbs",2,_AM_XTRANSAM_EXPORTCOMPLETE); + break; +case "save": + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + foreach($trans as $key => $value) { + $tran = $trans_handler->get($key); + $tran->setVar('translation', xtransam_convert_encode($value, $tran->getVar('sm'))); + $trans_handler->insert($tran); + } + redirect_header("index.php?op=manage&id=$id&fileid=$fileid",2,_AM_XTRANSAM_SAVECOMPLETE); + break; +case "manage": + + echo $indexAdmin->addNavigation('index.php?op=manage'); + //echo $indexAdmin->renderIndex(); + managerForm_display($id, $fileid); + + break; + +case "analysis": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $io = $io_handler->get($id); + @$files_handler->analysepath($io); + redirect_header("index.php?op=bbs",2,_AM_XTRANSAM_ANLYSISCOMPLETE); + break; + +case "import": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $io = $io_handler->get($id); + @$files_handler->importfiles($io); + redirect_header("index.php?op=bbs",2,_AM_XTRANSAM_IMPORTCOMPLETE); + break; + +case "translate": + + echo sprintf(_AM_XTRANSAM_TRANSLATION_IN_PROCESS, $GLOBALS['xtransamModuleConfig']['php_execute_for'], isset($restart)?$restart:1); + include "admin_footer.php"; + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $io = $io_handler->get($id); + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + if ($trans_handler->getCount($criteria)>0) { + $trans = $trans_handler->getObjects($criteria); + $start = time(); + foreach($trans as $tran) { + if ($tran->isempty()){ + $from = $lang_handler->code($io->getVar('languagefrom')); + $to = $lang_handler->code($io->getVar('languageto')); + $GLOBALS['provider'] = $lang_handler->provider($tran->getVar('toid')); + if (strlen($GLOBALS['provider'])>0) { + $provider_handler = xoops_getmodulehandler('provider', 'xtransam'); + $translation = $provider_handler->provider->translate($from,$to, xtransam_convert_decode($tran->getVar('orginal'), $tran->getVar('sm'))); + $tran->setVar('translation', xtransam_convert_encode($translation, $tran->getVar('sm'))); + if (strlen($translation)>0) + $tran->setVar('auto', 1); + else + $tran->setVar('auto', 0); + + $trans_handler->insert($tran); + } + if ($start+$GLOBALS['xtransamModuleConfig']['php_execute_for']-3<time()) + { + $restart++; + redirect_header("index.php?op=translate&id=$id&restart=$restart"); + exit(0); + } + } + } + } + redirect_header("index.php?op=bbs",2,_AM_XTRANSAM_TRANSLATIONCOMPLETE); + break; + +case "bbs": + + echo $indexAdmin->addNavigation('index.php?op=bbs'); + //echo $indexAdmin->renderIndex(); + translationForm_display(false); + + break; + +case "wizard": + echo $indexAdmin->addNavigation('index.php?op=wizard'); + //echo $indexAdmin->renderIndex(); + wizardForm_display($step); + translationForm_display(true); + break; +case "dashboard": +default: + + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $iobase_handler = xoops_getmodulehandler('iobase', 'xtransam'); + + $indexAdmin->addInfoBox(_AM_XTRANSAM_ADMIN_NUMTRASL); + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>"._AM_XTRANSAM_THEREARE_NUMFILES."</label>", $files_handler->getCount(NULL), 'Green'); + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>"._AM_XTRANSAM_THEREARE_NUMLINES."</label>", $trans_handler->getCount(NULL), 'Green'); + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>"._AM_XTRANSAM_THEREARE_NUMPROJECTS."</label>", $iobase_handler->getCount(NULL), 'Green'); + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>"._AM_XTRANSAM_THEREARE_NUMLANG."</label>", $lang_handler->getCount(NULL), 'Green'); + xoops_load('xoopscache'); + if (!class_exists('XoopsCache')) { + // XOOPS 2.4 Compliance + xoops_load('cache'); + if (!class_exists('XoopsCache')) { + include_once XOOPS_ROOT_PATH.DS.'class'.DS.'cache'.DS.'xoopscache.php'; + } + } + + if ($googlecodes = XoopsCache::read('xtransam_google_pause')) { + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>"._AM_XTRANSAM_THEREARE_GOOGLEAVAILABLE."</label>", _YES, 'Green'); + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>".sprintf(_AM_XTRANSAM_THEREARE_GOOGLEERROR, $googlecodes['code'], $googlecodes['message'])."</label>", '', 'Green'); + } else { + $indexAdmin->addInfoBoxLine(_AM_XTRANSAM_ADMIN_NUMTRASL, "<label>"._AM_XTRANSAM_THEREARE_GOOGLEAVAILABLE."</label>", _NO, 'Green'); + } + + echo $indexAdmin->addNavigation("index.php") ; + echo $indexAdmin->renderIndex(); + + break; +}*/ +$xoops->footer(); Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/languages.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/languages.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/languages.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,91 @@ +<?php +/* + 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. +*/ + +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Simon Roberts <si...@ch...> + * @author Timgno <in...@tx...> + * @version $Id: index.php 9400 2012-04-28 12:53:34Z timgno $ + */ +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); + +include_once '../include/forms.php'; +define ("_CHARSET","UTF-8"); +define ("_CHARSET_ISO","ISO-8859-1"); +error_reporting(E_ALL); +global $xoopsDB, $xoopsModuleConfig; + + if (isset($_GET)) { + foreach ($_GET as $k => $v) { + ${$k} = $v; + } + } + + if (isset($_POST)) { + foreach ($_POST as $k => $v) { + ${$k} = $v; + } + } + + +ini_set("max_execution_time", "300"); + +switch ($op){ +case "save-languages": + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + foreach($id as $key => $value) + { + switch($value){ + case "new": + $lang = $lang_handler->create(); + break; + default: + $lang = $lang_handler->get($value); + } + + if (!empty($name[$key])&&!empty($code[$key])) { + $lang->setVar('name', $name[$key]); + $lang->setVar('code', $code[$key]); + $lang->setVar('foldername', $folder[$key]); + $lang->setVar('provider', $provider[$key]); + @$lang_handler->insert($lang); + } + } + redirect_header("index.php?op=languages",2,_XT_LANGSAVEOK); + break; + +case "save": + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + foreach($trans as $key => $value) { + $tran = $trans_handler->get($key); + $tran->setVar('translation', xtransam_convert_encode($value, $tran->getVar('sm'))); + $trans_handler->insert($tran); + } + redirect_header("index.php?op=manage&id=$id&fileid=$fileid",2,_XT_SAVECOMPLETE); + break; +case "languages": +default: + xoops_cp_header(); + adminMenu(3); + languagesForm_display(); + footer_adminMenu(); + xoops_cp_footer(); + break; +} +$xoops->footer(); \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/menu.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/menu.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/menu.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,37 @@ +<?php +/* + 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. +*/ +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Taiwen Jiang <ph...@us...> + * @author Simon Roberts <si...@ch...> + * @version $Id: menu.php 9400 2012-04-28 10:40:24Z timgno $ + */ +$adminmenu = array(); $i = 1; +$adminmenu[$i]["title"] = _MI_XTRANSAM_ADMENU1; +$adminmenu[$i]["link"] = 'admin/index.php'; +$adminmenu[$i]["icon"] = 'home.png'; $i++; +$adminmenu[$i]["title"] = _MI_XTRANSAM_ADMENU2; +$adminmenu[$i]["link"] = 'admin/index.php?op=wizard'; +$adminmenu[$i]["icon"] = 'wizard.png'; $i++; +$adminmenu[$i]["title"] = _MI_XTRANSAM_ADMENU3; +$adminmenu[$i]["link"] = 'admin/index.php?op=bbs'; +$adminmenu[$i]["icon"] = 'translations.png'; $i++; +$adminmenu[$i]["title"] = _MI_XTRANSAM_ADMENU4; +$adminmenu[$i]["link"] = 'admin/index.php?op=languages'; +$adminmenu[$i]["icon"] = 'languages.png'; $i++; +$adminmenu[$i]["title"] = _MI_XTRANSAM_ADMENU5; +$adminmenu[$i]["link"] = 'admin/about.php'; +$adminmenu[$i]["icon"] = 'about.png'; unset($i); \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/wizard.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/wizard.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/admin/wizard.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,243 @@ +<?php +/* + 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. +*/ + +/** + * Traslation Languages + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xtransam + * @since 1.3.0 + * @author Simon Roberts <si...@ch...> + * @author Timgno <in...@tx...> + * @version $Id: index.php 9400 2012-04-28 12:53:34Z timgno $ + */ +include dirname(__FILE__) . '/header.php'; + +$xoops = Xoops::getInstance(); +$xoops->header(); + +include_once '../include/forms.php'; +define ("_CHARSET","UTF-8"); +define ("_CHARSET_ISO","ISO-8859-1"); +error_reporting(E_ALL); +global $xoopsDB, $xoopsModuleConfig; + + if (isset($_GET)) { + foreach ($_GET as $k => $v) { + ${$k} = $v; + } + } + + if (isset($_POST)) { + foreach ($_POST as $k => $v) { + ${$k} = $v; + } + } + + +ini_set("max_execution_time", "300"); + +switch ($op){ +case "deletebuffer": + $sql[0] = "DELETE FROM ".$xoopsDB->prefix('xtransam_files')." WHERE ioid = $id"; + $sql[1] = "DELETE FROM ".$xoopsDB->prefix('xtransam_translator')." WHERE ioid = $id"; + $sql[2] = "DELETE FROM ".$xoopsDB->prefix('xtransam_iobase')." WHERE id = $id"; + + foreach($sql as $fquestion) + $xoopsDB->queryF($fquestion); + + redirect_header("index.php", 4, _XT_IODELETED); + break; +case "save-languages": + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + foreach($id as $key => $value) + { + switch($value){ + case "new": + $lang = $lang_handler->create(); + break; + default: + $lang = $lang_handler->get($value); + } + + if (!empty($name[$key])&&!empty($code[$key])) { + $lang->setVar('name', $name[$key]); + $lang->setVar('code', $code[$key]); + $lang->setVar('foldername', $folder[$key]); + $lang->setVar('provider', $provider[$key]); + @$lang_handler->insert($lang); + } + } + redirect_header("index.php?op=languages",2,_XT_LANGSAVEOK); + break; +case "languages": + xoops_cp_header(); + adminMenu(3); + languagesForm_display(); + footer_adminMenu(); + xoops_cp_footer(); + + break; +case "export": + global $xoopsUser; + + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $io = $io_handler->get($id); + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + $files = $files_handler->getObjects($criteria); + + $from_folder = $lang_handler->folder($io->getvar('languagefrom')); + $to_folder = $lang_handler->folder($io->getvar('languageto')); + + foreach($files as $file) { + $path = explode('/', $file->getVar('path')); + + foreach($path as $key => $value) + if (strtolower($value) == strtolower($from_folder)) { + $path[$key] = $to_folder; + } + + //$wpath = implode('/', $path).'/'; + $wpath = implode(DIRECTORY_SEPARATOR, $path); + mkdir($wpath, 0777); + + if($wpath!=$file->getVar('path')){ + $bfile = file($file->getVar('path').$file->getVar('filename')); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + $criteria->add(new Criteria('fileid', $file->getVar('id'))); + $trans = $trans_handler->getObjects($criteria); + // Changed & Added by TXMod Xoops + $bfile[1] = "\n// Translation done by xtransam & ".$xoopsUser->uname()." TXMod Xoops - ".date('Y-m-d H:i')."\n\n"; + + foreach($trans as $tran) { + $search = xtransam_convert_decode($tran->getVar('replacestr'), $tran->getVar('sm')); + $name = xtransam_convert_decode($tran->getVar('name'), $tran->getVar('sm')); + $translation = xtransam_convert_decode($tran->getVar('translation'), $tran->getVar('sm')); + + // Changed & Added by TXMod Xoops + //include_once '../include/charset_utf-8.php'; + //$translation = preg_replace($search, $replace, $translation); + $translation = str_replace('"', '\"', $translation); + $translation = str_replace('\"', "'", $translation); + $translation = str_replace('="', "='", $translation); + $translation = str_replace('">', "'>", $translation); + $translation = str_replace('È', 'E'', $translation); + $translation = str_replace('ì', 'ì', $translation); + $translation = str_replace('ò', 'ò', $translation); + $translation = str_replace('è', 'è', $translation); + $translation = str_replace('ù', 'ù', $translation); + $translation = str_replace('à', 'à', $translation); + $translation = str_replace('% S', '%s', $translation); + $translation = str_replace('%s ', '%s ', $translation); + $translation = str_replace('%s "', '%s"', $translation); + $translation = str_replace(' / ', '/', $translation); + + $replace = 'define("'.$name.'", "'.$translation.'");'; + $bfile[$tran->getVar('line')] = str_replace($search, $replace, $bfile[$tran->getVar('line')]); + } + @makeWritable($wpath, true); + if (file_exists($wpath.$file->getVar('filename'))) + unlink($wpath.$file->getVar('filename')); + $file = @fopen($wpath.$file->getVar('filename'), 'w'); + $buffer = implode('', $bfile); + fwrite($file, $buffer, strlen($buffer)); + fclose($file); + } + } + // Added by TXMod Xoops + if (file_exists($indexFile = XOOPS_ROOT_PATH."/modules/xtransam/language/index.html")) + copy($indexFile, $wpath."index.html"); + + redirect_header("index.php?op=bbs",2,_XT_EXPORTCOMPLETE); + break; +case "save": + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + foreach($trans as $key => $value) { + $tran = $trans_handler->get($key); + $tran->setVar('translation', xtransam_convert_encode($value, $tran->getVar('sm'))); + $trans_handler->insert($tran); + } + redirect_header("index.php?op=manage&id=$id&fileid=$fileid",2,_XT_SAVECOMPLETE); + break; +case "manage": + managerForm_display($id, $fileid); + break; + +case "analysis": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $io = $io_handler->get($id); + @$files_handler->analysepath($io); + redirect_header("index.php?op=bbs",2,_XT_ANLYSISCOMPLETE); + break; + +case "import": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $files_handler = xoops_getmodulehandler('files', 'xtransam'); + $io = $io_handler->get($id); + @$files_handler->importfiles($io); + redirect_header("index.php?op=bbs",2,_XT_IMPORTCOMPLETE); + break; + +case "translate": + $io_handler = xoops_getmodulehandler('iobase', 'xtransam'); + $io = $io_handler->get($id); + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + $lang_handler = xoops_getmodulehandler('languages', 'xtransam'); + $criteria = new CriteriaCompo(new Criteria('ioid', $io->getVar('id'))); + if ($trans_handler->getCount($criteria)>0) { + $trans = $trans_handler->getObjects($criteria); + $start = time(); + foreach($trans as $tran) { + if ($tran->isempty()){ + $from = $lang_handler->code($io->getVar('languagefrom')); + $to = $lang_handler->code($io->getVar('languageto')); + $provider = $lang_handler->provider($tran->getVar('toid')); + if (strlen($provider)>0) { + $provider_handler = xoops_getmodulehandler($provider.'provider', 'xtransam'); + $translation = $provider_handler->translate($from,$to, xtransam_convert_decode($tran->getVar('orginal'), $tran->getVar('sm'))); + $tran->setVar('translation', xtransam_convert_encode($translation, $tran->getVar('sm'))); + if (strlen($translation)>0) + $tran->setVar('auto', 1); + else + $tran->setVar('auto', 0); + + $trans_handler->insert($tran); + } + if ($start+28<time()) + { + $restart++; + redirect_header("index.php?op=translate&id=$id&restart=$restart",2,sprintf(_XT_30SECONDSCONTINUING, $restart)); + } + } + } + } + redirect_header("index.php?op=bbs",2,_XT_TRANSLATIONCOMPLETE); + break; + +case "languages": + + break; +case "bbs": + translationForm_display(false); + break; + +case "wizard": +default: + wizardForm_display($step); + translationForm_display(true); + break; +} +$xoops->footer(); \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/blocks/index.html =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/blocks/index.html (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/blocks/index.html 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/files.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/files.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/files.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,210 @@ +<?php +// $Autho: wishcraft $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2009 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 // +// ------------------------------------------------------------------------ // +// -- Author: Simon Roberts (si...@ch...) -- // +// ------------------------------------------------------------------------ // + +if (!defined('XOOPS_ROOT_PATH')) { + exit(); +} +/** + * Class for policies + * @author Simon Roberts <on...@xo...> + * @copyright copyright (c) 2009-2003 XOOPS.org + * @package kernel + */ +class XtransamFiles extends XoopsObject +{ + + function XtransamFiles($id = null) + { + $this->initVar('id', XOBJ_DTYPE_INT, null, false); + $this->initVar('ioid', XOBJ_DTYPE_INT); + $this->initVar('filename', XOBJ_DTYPE_TXTBOX, null, true, 255); + $this->initVar('path', XOBJ_DTYPE_TXTBOX, null, true, 255); + $this->initVar('imported', XOBJ_DTYPE_INT, 0); + } + +} + + +/** +* XOOPS policies handler class. +* This class is responsible for providing data access mechanisms to the data source +* of XOOPS user class objects. +* +* @author Simon Roberts <si...@ch...> +* @package kernel +*/ +class XtransamFilesHandler extends XoopsPersistableObjectHandler +{ + + var $db; + var $regex = '/define\((.*) \);|define \((.*) \);|define \((.*) \);|define \( ([\"\', \ta-zA-Z0-9_]+)\);|define\( (.*) \);|define\((.*)\);|define \((.*)\);|define \((.*)\);|define \( ([\"\', \ta-zA-Z0-9_]+)\);|define\( (.*)\);|define\((.*) \);|define \((.*) \);|define \((.*) \);|define \( (.*) \);|define\( (.*) \);/'; + var $seperator = array('", "', '","', '" , "', '" , "', '", "', '" , "', + '", \'', '",\'', '" , \'', '" , \'', '", \'', '" , \'' , + '\', \'', '\',\'', '\' , \'', '\' , \'', '\', \'', '\' , \'', + '\', "', '\',"', '\' , "', '\' , "', '\', "', '\' , "'); + + function __construct(&$db) + { + $this->db = $db; + parent::__construct($db, "xtransam_files", 'XtransamFiles', "id", "path"); + } + + function importfiles($io) + { + if (!is_a($io, 'XtransamIobase')) + return false; + + global $xoopsModuleConfig; + + $trans_handler = xoops_getmodulehandler('translator', 'xtransam'); + + $criteria = new CriteriaCompo(new Criteria('`ioid`', $io->getVar('id')), 'AND'); + $criteria->add(new Criteria('`imported`', 0), 'AND'); + $files = $this->getObjects($criteria); + + foreach ($files as $file) { + $content = file_get_contents($file->getVar('path').DS.$file->getVar('filename')); + $lines = explode("\n", $content); + foreach($lines as $key => $line) { + if (strpos(' '.$line,'define')>0) { + @preg_match_all($this->regex, $line, $matches); + + $def = array(); + foreach($matches as $match) + foreach($match as $result) { + if (!empty($result)&&substr($result,0,6)!='define') { + foreach($this->seperator as $sep) + if (strpos($result, $sep)>0) + if (count(explode($sep, $result))==2) + $result = explode($sep, $result); + + $def[0] = substr(trim($result[0]),1); + $def[1] = substr(trim($result[1]),0, strlen(trim($result[1]))-1); + } elseif (substr($result,0,6)=='define') { + $def[3] = $result; + } + } + + + if (!empty($def[0])&&!empty($def[1])) { + $trans = $trans_handler->create(); + $trans->setVar('ioid',$io->getVar('id')); + $trans->setVar('fromid',$io->getVar('languagefrom')); + $trans->setVar('toid',$io->getVar('languageto')); + $trans->setVar('fileid',$file->getVar('id')); + $trans->setVar('linetype','define'); + $trans->setVar('line', $key); + $trans->setVar('name',xtransam_convert_encode($def[0], $xoopsModuleConfig['store_method'])); + $trans->setVar('orginal',xtransam_convert_encode($def[1], $xoopsModuleConfig['store_method'])); + $trans->setVar('replacestr',xtransam_convert_encode($def[3], $xoopsModuleConfig['store_method'])); + $trans->setVar('sm', $xoopsModuleConfig['store_method']); + if (!$trans_handler->exists($trans)) + $trans_handler->insert($trans); + } + } + } + + $file->setVar('imported', '1'); + $this->insert($file); + + } + } + + + function analysepath($io) + { + if (!is_a($io, 'XtransamIobase')) + return false; + + switch ($io->getVar('point')) + { + case "core": + $files = $this->dirToArray(XOOPS_ROOT_PATH.DS.'language'.DS.$io->getVar('path'), true); + $path = XOOPS_ROOT_PATH.DS.'language'.DS.$io->getVar('path'); + break; + case "module": + $files = $this->dirToArray(XOOPS_ROOT_PATH.DS.'modules'.DS.$io->getVar('path'), true); + $path = XOOPS_ROOT_PATH.DS.'modules'.DS.$io->getVar('path'); + break; + } + + foreach($files as $key => $file) + { + if (file_exists($file)) { + $tfile = $this->create(); + $tfile->setVar('filename', basename($file)); + $tfile->setVar('path', str_replace(basename($file),'',$file)); + $tfile->setVar('ioid', $io->getVar('id')); + if (!$this->exists($tfile)) + @$this->insert($tfile); + } + } + + } + + private function dirToArray($directory, $recursive, $fileext = 'php') { + $array_items = array(); + if ($handle = opendir($directory)) { + while (false !== ($file = readdir($handle))) { + $filecomp = explode('.', $file); + if ($file != "." && $file != "..") { + if (is_dir($directory. "/" . $file)) { + if($recursive) { + $array_items = array_merge($array_items, $this->dirToArray($directory. "/" . $file, $recursive)); + } + $file = $directory . "/" . $file; + if (in_array($fileext, $filecomp)) + $array_items[] = preg_replace("/\/\//si", "/", $file); + } else { + $file = $directory . "/" . $file; + if (in_array($fileext, $filecomp)) + $array_items[] = preg_replace("/\/\//si", "/", $file); + } + } + } + closedir($handle); + } + return $array_items; + } + + function exists($file) + { + if (!is_a($file, 'XtransamFiles')) + return true; + + $criteria = new CriteriaCompo(new Criteria('`ioid`', $file->getVar('ioid')), 'AND'); + $criteria->add(new Criteria('`path`', $file->getVar('path')), 'AND'); + $criteria->add(new Criteria('`filename`', $file->getVar('filename')), 'AND'); + if ($this->getCount($criteria)>0) + return true; + else + return false; + } +} +?> \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/googleprovider.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/googleprovider.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/xtransam/class/googleprovider.php 2012-05-21 19:31:22 UTC (rev 9571) @@ -0,0 +1,112 @@ +<?php +// $Autho: wishcraft $ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2009 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 // +// ------------------------------------------------------------------------ // +// -- Author: Simon Roberts (si...@ch...) -- // +// ------------------------------------------------------------------------ // + +if (!defined('XOOPS_ROOT_PATH')) { + exit(); +} +/** + * Class for policies + * @author Simon Roberts <on...@xo...> + * @copyright copyright (c) 2009-2003 XOOPS.org + * @package kernel + */ +class XtransamGoogleprovider extends XoopsObject +{ + + function XtransamGoogleprovider($id = null) + { + + } + +} + + +/** +* XOOPS policies handler class. +* This class is responsible for providing data access mechanisms to the data source +* of XOOPS user class objects. +* +* @author Simon Roberts <si...@ch...> +* @package kernel +*/ +class XtransamGoogleproviderHandler extends XoopsPersistableObjectHandler +{ + + var $url = "http://ajax.googleapis.com/ajax/services/language/translate"; + var $retrieve = array('start' => '<textarea name=utrans wrap=SOFT dir="ltr" rows=5 id=suggestion>', + 'end' => '</textarea>'); + + function __construct(&$db) + { } + + function translate($fromcode, $tocode, $value) + { + + $response = $this->send_post($this->url, $value, $fromcode, $tocode, XOOPS_URL); + if (preg_match("/{\"translatedText\":\"([^\"]+)\"/i", $response, $matches)) { + return self::_unescapeUTF8EscapeSeq($this->clean($matches[1])); + } + } + + private function _unescapeUTF8EscapeSeq($str) { + return preg_replace_callback("/\\\u([0-9a-f]{4})/i", create_function('$matches', 'return html_entity_decode(\'&#x\'.$matches[1].\';\', ENT_NOQUOTES, \'UTF-8\');'), $str); + } + + private function clean($var) + { + $var = htmlspecialchars_decode($var); + $var = str_replace('% s', ' %s ', $var); + $var = str_replace('% u', ' %u ', $var); + $var = str_replace('% d', ' %d ', $var); + if (strpos($var, 'text/css')) ... [truncated message content] |
From: <txm...@us...> - 2012-07-01 13:08:15
|
Revision: 9762 http://xoops.svn.sourceforge.net/xoops/?rev=9762&view=rev Author: txmodxoops Date: 2012-07-01 13:08:07 +0000 (Sun, 01 Jul 2012) Log Message: ----------- Added barsocials and fbcomments file in system module Added Paths: ----------- XoopsCore/tags/2.6 timgno/htdocs/modules/system/ XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/ XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_barsocials.html XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_fbcomments.html XoopsCore/tags/2.6 timgno/htdocs/modules/system/xoops_version.php Added: XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_barsocials.html =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_barsocials.html (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_barsocials.html 2012-07-01 13:08:07 UTC (rev 9762) @@ -0,0 +1,11 @@ +<div id="bar-social"> + <ul id="style-social"> + <li class="fb-like"><fb:like href="<{$xoops_mpageurl}>" send="false" layout="button_count" show_faces="false"></fb:like></li> + <li class="fb-send"><fb:send href="<{$xoops_mpageurl}>" font="verdana"></fb:send></li> + <li class="tw-tweets"><a href="https://twitter.com/share" class="twitter-share-button" data-url="<{$xoops_mpageurl}>" data-via="txmodxoops" data-lang="en">Tweet</a></li> + <li class="gl-button"><g:plus action="share" annotation="bubble" href="<{$xoops_mpageurl}>"></g:plus></li> + <li class="send-email"><a href="<{$xoops_url}>/modules/tellafriend/index.php?target_uri=<{$xoops_mpageurl}>" title="Send Email"><img src="<{$xoops_url}>/images/email_send.png" alt="Send Email" /></a></li> + <li class="pin-it"><a href="http://pinterest.com/pin/create/button/?url=<{$xoops_mpageurl}>" class="pin-it-button" always-show-count="true" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></li> + </ul> + <div class="clear"></div> +</div> \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_fbcomments.html =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_fbcomments.html (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/system/templates/system_fbcomments.html 2012-07-01 13:08:07 UTC (rev 9762) @@ -0,0 +1,4 @@ +<div id="fb-comments"> + <div class="fb-comments"><fb:comments href="<{$xoops_mpageurl}>" num_posts="2" width="<{$fbcomments_width}>"></fb:comments></div> + <div class="clear"></div> +</div> \ No newline at end of file Added: XoopsCore/tags/2.6 timgno/htdocs/modules/system/xoops_version.php =================================================================== --- XoopsCore/tags/2.6 timgno/htdocs/modules/system/xoops_version.php (rev 0) +++ XoopsCore/tags/2.6 timgno/htdocs/modules/system/xoops_version.php 2012-07-01 13:08:07 UTC (rev 9762) @@ -0,0 +1,458 @@ +<?php +// $Id: xoops_version.php 8066 2011-11-06 05:09:33Z beckmi $ +// ------------------------------------------------------------------------ // +// 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 // +// ------------------------------------------------------------------------ // +// Author: Kazumi Ono (AKA onokazu) // +// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ // +// Project: The XOOPS Project // +// ------------------------------------------------------------------------- // + +$modversion['name'] = _MI_SYSTEM_NAME; +$modversion['version'] = 2.10; +$modversion['description'] = _MI_SYSTEM_DESC; +$modversion['author'] = ''; +$modversion['credits'] = 'The XOOPS Project; MusS, Kraven30, Mage'; +$modversion['help'] = 'system.html'; +$modversion['license'] = "GPL see LICENSE"; +$modversion['official'] = 1; +$modversion['image'] = 'images/system_slogo.png'; +$modversion['dirname'] = 'system'; + +// Admin things +$modversion['hasAdmin'] = 1; +$modversion['adminindex'] = 'admin.php'; +$modversion['adminmenu'] = 'menu.php'; + +$modversion['onUpdate'] = 'include/update.php'; + +// Templates +$modversion['templates'][] = array( 'file' => 'system_imagemanager.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_imagemanager2.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_userinfo.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_userform.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_rss.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_redirect.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_comment.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_comments_flat.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_comments_thread.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_comments_nest.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_siteclosed.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_dummy.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_notification_list.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_notification_select.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_block_dummy.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_homepage.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_bannerlogin.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_banner.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_bannerdisplay.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_barsocials.html', 'description' => '' ); +$modversion['templates'][] = array( 'file' => 'system_fbcomments.html', 'description' => '' ); + +// Admin Templates +$modversion['templates'][] = array( 'file' => 'system_header.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_banners.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_modules.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_modules_install.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_modules_confirm.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_modules_result.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_avatars.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_smilies.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_blocks.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_blocks_item.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_comments.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_comments_list.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_userrank.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_users.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_preferences.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_mailusers.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_groups.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_images.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_templates.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_filemanager.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_index.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_maintenance.html', 'description' => '', 'type' => 'admin' ); +$modversion['templates'][] = array( 'file' => 'system_help.html', 'description' => '', 'type' => 'admin' ); + +// Blocks +$modversion['blocks'][] = array( + 'file' => 'system_blocks.php', + 'name' => _MI_SYSTEM_BNAME2, + 'description' => 'Shows user block', + 'show_func' => 'b_system_user_show', + 'template' => 'system_block_user.html'); + +$modversion['blocks'][2]['file'] = 'system_blocks.php'; +$modversion['blocks'][2]['name'] = _MI_SYSTEM_BNAME3; +$modversion['blocks'][2]['description'] = 'Shows login form'; +$modversion['blocks'][2]['show_func'] = 'b_system_login_show'; +$modversion['blocks'][2]['template'] = 'system_block_login.html'; + +$modversion['blocks'][3]['file'] = 'system_blocks.php'; +$modversion['blocks'][3]['name'] = _MI_SYSTEM_BNAME4; +$modversion['blocks'][3]['description'] = 'Shows search form block'; +$modversion['blocks'][3]['show_func'] = 'b_system_search_show'; +$modversion['blocks'][3]['template'] = 'system_block_search.html'; + +$modversion['blocks'][4]['file'] = 'system_blocks.php'; +$modversion['blocks'][4]['name'] = _MI_SYSTEM_BNAME5; +$modversion['blocks'][4]['description'] = 'Shows contents waiting for approval'; +$modversion['blocks'][4]['show_func'] = 'b_system_waiting_show'; +$modversion['blocks'][4]['template'] = 'system_block_waiting.html'; + +$modversion['blocks'][5]['file'] = 'system_blocks.php'; +$modversion['blocks'][5]['name'] = _MI_SYSTEM_BNAME6; +$modversion['blocks'][5]['description'] = 'Shows the main navigation menu of the site'; +$modversion['blocks'][5]['show_func'] = 'b_system_main_show'; +$modversion['blocks'][5]['template'] = 'system_block_mainmenu.html'; + +$modversion['blocks'][6]['file'] = 'system_blocks.php'; +$modversion['blocks'][6]['name'] = _MI_SYSTEM_BNAME7; +$modversion['blocks'][6]['description'] = 'Shows basic info about the site and a link to Recommend Us pop up window'; +$modversion['blocks'][6]['show_func'] = 'b_system_info_show'; +$modversion['blocks'][6]['edit_func'] = 'b_system_info_edit'; +$modversion['blocks'][6]['options'] = '320|190|s_poweredby.gif|1'; +$modversion['blocks'][6]['template'] = 'system_block_siteinfo.html'; + +$modversion['blocks'][7]['file'] = 'system_blocks.php'; +$modversion['blocks'][7]['name'] = _MI_SYSTEM_BNAME8; +$modversion['blocks'][7]['description'] = 'Displays users/guests currently online'; +$modversion['blocks'][7]['show_func'] = 'b_system_online_show'; +$modversion['blocks'][7]['template'] = 'system_block_online.html'; + +$modversion['blocks'][8]['file'] = 'system_blocks.php'; +$modversion['blocks'][8]['name'] = _MI_SYSTEM_BNAME9; +$modversion['blocks'][8]['description'] = 'Top posters'; +$modversion['blocks'][8]['show_func'] = 'b_system_topposters_show'; +$modversion['blocks'][8]['options'] = '10|1'; +$modversion['blocks'][8]['edit_func'] = 'b_system_topposters_edit'; +$modversion['blocks'][8]['template'] = 'system_block_topusers.html'; + +$modversion['blocks'][9]['file'] = 'system_blocks.php'; +$modversion['blocks'][9]['name'] = _MI_SYSTEM_BNAME10; +$modversion['blocks'][9]['description'] = 'Shows most recent users'; +$modversion['blocks'][9]['show_func'] = 'b_system_newmembers_show'; +$modversion['blocks'][9]['options'] = '10|1'; +$modversion['blocks'][9]['edit_func'] = 'b_system_newmembers_edit'; +$modversion['blocks'][9]['template'] = 'system_block_newusers.html'; + +$modversion['blocks'][10]['file'] = 'system_blocks.php'; +$modversion['blocks'][10]['name'] = _MI_SYSTEM_BNAME11; +$modversion['blocks'][10]['description'] = 'Shows most recent comments'; +$modversion['blocks'][10]['show_func'] = 'b_system_comments_show'; +$modversion['blocks'][10]['options'] = '10'; +$modversion['blocks'][10]['edit_func'] = 'b_system_comments_edit'; +$modversion['blocks'][10]['template'] = 'system_block_comments.html'; + +// RMV-NOTIFY: +// Adding a block... +$modversion['blocks'][11]['file'] = 'system_blocks.php'; +$modversion['blocks'][11]['name'] = _MI_SYSTEM_BNAME12; +$modversion['blocks'][11]['description'] = 'Shows notification options'; +$modversion['blocks'][11]['show_func'] = 'b_system_notification_show'; +$modversion['blocks'][11]['template'] = 'system_block_notification.html'; + +$modversion['blocks'][12]['file'] = 'system_blocks.php'; +$modversion['blocks'][12]['name'] = _MI_SYSTEM_BNAME13; +$modversion['blocks'][12]['description'] = 'Shows theme selection box'; +$modversion['blocks'][12]['show_func'] = 'b_system_themes_show'; +$modversion['blocks'][12]['options'] = '0|80'; +$modversion['blocks'][12]['edit_func'] = 'b_system_themes_edit'; +$modversion['blocks'][12]['template'] = 'system_block_themes.html'; + +// Menu +$modversion['hasMain'] = 0; + +// Préférences +$i = 0; +$modversion['config'][$i]['name'] = 'break1'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BREAK_GENERAL'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'line_break'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'head'; +$i++; +$modversion['config'][$i]['name'] = 'usetips'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_TIPS'; +$modversion['config'][$i]['description'] = '_MI_SYSTEM_PREFERENCE_TIPS_DSC'; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 1; +$i++; +include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; +$icons = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/system/images/icons'); +$modversion['config'][$i]['name'] = 'typeicons'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ICONS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'text'; +$modversion['config'][$i]['default'] = 'default'; +$modversion['config'][$i]['options'] = $icons; +$modversion['config'][$i]['category'] = 'global'; +$i++; +$breadcrumb = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/system/images/breadcrumb'); +$modversion['config'][$i]['name'] = 'typebreadcrumb'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BREADCRUMB'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'text'; +$modversion['config'][$i]['default'] = 'default'; +$modversion['config'][$i]['options'] = $breadcrumb; +$modversion['config'][$i]['category'] = 'global'; +$i++; +$jquery_theme = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/system/css/ui'); +$modversion['config'][$i]['name'] = 'jquery_theme'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_JQUERY_THEME'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'text'; +$modversion['config'][$i]['default'] = 'base'; +$modversion['config'][$i]['options'] = $jquery_theme; +$modversion['config'][$i]['category'] = 'global'; +$i++; +$modversion['config'][$i]['name'] = 'break2'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BREAK_ACTIVE'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'line_break'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'head'; +$i++; +$modversion['config'][$i]['name'] = 'active_avatars'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_AVATARS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_banners'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_BANNERS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_blocksadmin'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_BLOCKSADMIN'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 1; +$i++; +$modversion['config'][$i]['name'] = 'active_comments'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_COMMENTS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_filemanager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_FILEMANAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_groups'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_GROUPS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 1; +$i++; +$modversion['config'][$i]['name'] = 'active_images'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_IMAGES'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_mailusers'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_MAILUSERS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_maintenance'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_MAINTENANCE'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_modulesadmin'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_MODULESADMIN'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 1; +$i++; +$modversion['config'][$i]['name'] = 'active_preferences'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_PREFERENCES'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 1; +$i++; +$modversion['config'][$i]['name'] = 'active_smilies'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_SMILIES'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_tplsets'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_TPLSETS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 1; +$i++; +$modversion['config'][$i]['name'] = 'active_userrank'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_USERRANK'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'active_users'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ACTIVE_USERS'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'yesno'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = '1'; +$i++; +$modversion['config'][$i]['name'] = 'break3'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BREAK_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'line_break'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'head'; +$i++; +$modversion['config'][$i]['name'] = 'avatars_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_AVATARS_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 10; +$i++; +$modversion['config'][$i]['name'] = 'banners_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BANNERS_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 10; +$i++; +$modversion['config'][$i]['name'] = 'comments_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_COMMENTS_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 20; +$i++; +$modversion['config'][$i]['name'] = 'groups_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_GROUPS_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 15; +$i++; +$modversion['config'][$i]['name'] = 'images_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_IMAGES_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 15; +$i++; +$modversion['config'][$i]['name'] = 'smilies_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_SMILIES_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 20; +$i++; +$modversion['config'][$i]['name'] = 'userranks_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_USERRANKS_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 20; +$i++; +$modversion['config'][$i]['name'] = 'users_pager'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_USERS_PAGER'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'textbox'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 20; +$i++; +$modversion['config'][$i]['name'] = 'break4'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BREAK_EDITOR'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'line_break'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'head'; +$i++; +$editors = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor'); +$modversion['config'][$i]['name'] = 'blocks_editor'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_BLOCKS_EDITOR'; +$modversion['config'][$i]['description'] = '_MI_SYSTEM_PREFERENCE_BLOCKS_EDITOR_DSC'; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'text'; +$modversion['config'][$i]['default'] = 'dhtmltextarea'; +$modversion['config'][$i]['options'] = $editors; +$modversion['config'][$i]['category'] = 'global'; +$i++; +$modversion['config'][$i]['name'] = 'comments_editor'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_COMMENTS_EDITOR'; +$modversion['config'][$i]['description'] = '_MI_SYSTEM_PREFERENCE_COMMENTS_EDITOR_DSC'; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'text'; +$modversion['config'][$i]['default'] = 'dhtmltextarea'; +$modversion['config'][$i]['options'] = $editors; +$modversion['config'][$i]['category'] = 'global'; +$i++; +$modversion['config'][$i]['name'] = 'general_editor'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_GENERAL_EDITOR'; +$modversion['config'][$i]['description'] = '_MI_SYSTEM_PREFERENCE_GENERAL_EDITOR_DSC'; +$modversion['config'][$i]['formtype'] = 'select'; +$modversion['config'][$i]['valuetype'] = 'text'; +$modversion['config'][$i]['default'] = 'dhtmltextarea'; +$modversion['config'][$i]['options'] = $editors; +$modversion['config'][$i]['category'] = 'global'; +$i++; +$modversion['config'][$i]['name'] = 'redirect'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_REDIRECT'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'admin.php?fct=preferences'; +$i++; +$modversion['config'][$i]['name'] = 'com_anonpost'; +$modversion['config'][$i]['title'] = '_MI_SYSTEM_PREFERENCE_ANONPOST'; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'hidden'; +$modversion['config'][$i]['valuetype'] = 'int'; +$modversion['config'][$i]['default'] = 0; + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |