Skip to content

Commit 22887c9

Browse files
authored
Merge pull request #7 from mambax7/master
Updates
2 parents 98eeb4a + e02937a commit 22887c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1623
-349
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
![alt XOOPS CMS](https://xoops.org/images/logoXoops4GithubRepository.png)
2+
# Contributing to [XOOPS CMS](https://xoops.org)
3+
[![XOOPS CMS Module](https://img.shields.io/badge/XOOPS%20CMS-Module-blue.svg)](https://xoops.org)
4+
[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE)
5+
6+
Contributions are **welcome** and will be fully **credited**.
7+
8+
We accept contributions via Pull Requests on [Github](https://github.com/XoopsModules25x/xoopseditors).
9+
10+
## Pull Requests
11+
12+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
13+
- **Add tests!** - We encourage to provide tests for your contributions.
14+
- **Document any change in behavior** - Make sure the `/docs/changelog.txt` and any other relevant documentation are kept up-to-date.
15+
- **Consider our release cycle** - We try to follow [Semantic Versioning v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
16+
- **Create feature branches** - Don't ask us to pull from your master branch.
17+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
18+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
19+
20+
**Happy coding, and _May the Source be with You_!**

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
![alt XOOPS CMS](http://xoops.org/images/logoXoops4GithubRepository.png)
2-
##xLanguage module for [XOOPS CMS 2.5.8+](https://xoops.org)
1+
![alt XOOPS CMS](https://xoops.org/images/logoXoops4GithubRepository.png)
2+
## xLanguage module for [XOOPS CMS 2.5.8+](https://xoops.org)
3+
[![XOOPS CMS Module](https://img.shields.io/badge/XOOPS%20CMS-Module-blue.svg)](https://xoops.org)
34
[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE)
5+
46
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/XoopsModules25x/xlanguage.svg?style=flat)](https://scrutinizer-ci.com/g/XoopsModules25x/xlanguage/?branch=master)
57
[![Codacy Badge](https://api.codacy.com/project/badge/grade/177664bcc7874ab7bddc1192c59e480d)](https://www.codacy.com/app/mambax7/xlanguage_2)
68
[![Code Climate](https://img.shields.io/codeclimate/github/XoopsModules25x/xlanguage.svg?style=flat)](https://codeclimate.com/github/XoopsModules25x/xlanguage)
79
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/f9b47b9f-9d03-4d6f-a639-badc6e3b1475/mini.png)](https://insight.sensiolabs.com/projects/f9b47b9f-9d03-4d6f-a639-badc6e3b1475)
810
[![Latest Pre-Release](https://img.shields.io/github/tag/XoopsModules25x/xlanguage.svg?style=flat)](https://github.com/XoopsModules25x/xlanguage/tags/)
911
[![Latest Version](https://img.shields.io/github/release/XoopsModules25x/xlanguage.svg?style=flat)](https://github.com/XoopsModules25x/xlanguage/releases/)
1012

11-
xLanguage module for [XOOPS CMS](http://xoops.org) handles displaying contents in different languages, like English, French and Chinese. If you want to switch between languages, this module is for you.
13+
**xLanguage** module for [XOOPS CMS](https://xoops.org) handles displaying contents in different languages, like English, French and Chinese. If you want to switch between languages, this module is for you.
1214

13-
[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xlanguage-tutorial/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xlanguage-tutorial/).
15+
[![Tutorial Available](https://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xlanguage-tutorial/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xlanguage-tutorial/).
1416
To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/xlanguage-tutorial)
1517

16-
[![Translations on Transifex](http://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops)
18+
[![Translations on Transifex](https://xoops.org/images/translations-transifex-blue.svg)](https://www.transifex.com/xoops)
1719

18-
Please visit us on [http://xoops.org](http://xoops.org)
20+
Please visit us on [https://xoops.org](https://xoops.org)
1921

20-
The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS
22+
Current and upcoming "next generation" versions of XOOPS CMS are being crafted on GitHub at: https://github.com/XOOPS
2123

admin/about.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@
99
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*
12-
* @copyright XOOPS Project (http://xoops.org)
12+
* @copyright XOOPS Project (https://xoops.org)
1313
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
1414
* @package xlanguage
1515
* @since 2.0
1616
* @author XOOPS Development Team
1717
**/
1818

19-
include_once __DIR__ . '/admin_header.php';
20-
19+
require_once __DIR__ . '/admin_header.php';
2120
xoops_cp_header();
2221

23-
$aboutAdmin = new ModuleAdmin();
24-
25-
echo $aboutAdmin->addNavigation(basename(__FILE__));
26-
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
22+
$adminObject->displayNavigation(basename(__FILE__));
23+
$adminObject->setPaypal('xoopsfoundation@gmail.com');
24+
$adminObject->displayAbout(false);
2725

28-
include_once __DIR__ . '/admin_footer.php';
26+
require_once __DIR__ . '/admin_footer.php';

admin/about2.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@
99
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*
12-
* @copyright XOOPS Project (http://xoops.org)
12+
* @copyright XOOPS Project (https://xoops.org)
1313
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
1414
* @package xlanguage
1515
* @since 2.0
1616
* @author D.J.(phppp) php_pp@hotmail.com
1717
**/
1818

19-
include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
20-
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
19+
require_once __DIR__ . '/../../../include/cp_header.php';
20+
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
2121
xoops_cp_header();
2222
$myts = MyTextSanitizer::getInstance();
2323

24+
/** @var XoopsModuleHandler $moduleHandler */
2425
$moduleHandler = xoops_getHandler('module');
2526
$versioninfo = $moduleHandler->get($xoopsModule->getVar('mid'));
2627

2728
// Left headings...
2829
echo "<a href='index.php'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/' . $versioninfo->getInfo('image') . "' alt='' hspace='10' vspace='0' align='left'></a>";
29-
echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . ' ver '
30-
. $versioninfo->getInfo('version') . '</div>';
30+
echo "<div style='margin-top: 10px; color: #33538e; margin-bottom: 4px; font-size: 18px; line-height: 18px; font-weight: bold; display: block;'>" . $versioninfo->getInfo('name') . ' ver ' . $versioninfo->getInfo('version') . '</div>';
3131
echo '</div>';
3232
echo '<div>' . _MI_XLANG_RELEASE . ': ' . $versioninfo->getInfo('releasedate') . '</div>';
3333

admin/admin_footer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

3-
echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n"
4-
. " <a href='http://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
5-
. '</div>';
3+
$pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32);
4+
echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>';
65

76
xoops_cp_footer();

admin/admin_header.php

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,39 @@
99
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*
12-
* @copyright XOOPS Project (http://xoops.org)
12+
* @copyright XOOPS Project (https://xoops.org)
1313
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
1414
* @package xlanguage
1515
* @since 2.0
1616
* @author XOOPS Development Team
1717
**/
1818

19-
$path = dirname(dirname(dirname(__DIR__)));
20-
include_once $path . '/mainfile.php';
21-
include_once $path . '/include/cp_functions.php';
22-
require_once $path . '/include/cp_header.php';
19+
require_once __DIR__ . '/../../../include/cp_header.php';
20+
//require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
2321

24-
global $xoopsModule;
22+
require_once __DIR__ . '/../class/utility.php';
23+
//require_once __DIR__ . '/../include/common.php';
2524

26-
$moduleDirName = $GLOBALS['xoopsModule']->getVar('dirname');
25+
$moduleDirName = basename(dirname(__DIR__));
2726

28-
//if functions.php file exist
29-
require_once dirname(__DIR__) . '/include/functions.php';
27+
if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) {
28+
} else {
29+
$moduleHelper = Xmf\Module\Helper::getHelper('system');
30+
}
31+
$adminObject = \Xmf\Module\Admin::getInstance();
32+
33+
$pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16);
34+
$pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32);
35+
$pathModIcon32 = $moduleHelper->getModule()->getInfo('modicons32');
3036

3137
// Load language files
32-
xoops_loadLanguage('admin', $moduleDirName);
33-
xoops_loadLanguage('modinfo', $moduleDirName);
34-
xoops_loadLanguage('main', $moduleDirName);
38+
$moduleHelper->loadLanguage('admin');
39+
$moduleHelper->loadLanguage('modinfo');
40+
$moduleHelper->loadLanguage('main');
3541

36-
$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
37-
$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
38-
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
42+
$myts = MyTextSanitizer::getInstance();
3943

40-
include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
44+
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
45+
require_once $GLOBALS['xoops']->path('class/template.php');
46+
$xoopsTpl = new XoopsTpl();
47+
}

admin/index.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*
12-
* @copyright XOOPS Project (http://xoops.org)
12+
* @copyright XOOPS Project (https://xoops.org)
1313
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
1414
* @package xlanguage
1515
* @since 2.0
1616
* @author XOOPS Team
1717
**/
1818

19-
include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
19+
require_once __DIR__ . '/../../../include/cp_header.php';
2020

21-
include_once __DIR__ . '/admin_header.php';
21+
require_once __DIR__ . '/admin_header.php';
2222
xoops_cp_header();
2323

24-
$indexAdmin = new ModuleAdmin();
24+
$adminObject = \Xmf\Module\Admin::getInstance();
2525

26-
echo $indexAdmin->addNavigation(basename(__FILE__));
27-
echo $indexAdmin->renderIndex();
26+
$adminObject->displayNavigation(basename(__FILE__));
27+
$adminObject->displayIndex();
2828

29-
include_once __DIR__ . '/admin_footer.php';
29+
require_once __DIR__ . '/admin_footer.php';

admin/langform.inc.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*
12-
* @copyright XOOPS Project (http://xoops.org)
12+
* @copyright XOOPS Project (https://xoops.org)
1313
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
1414
* @package xlanguage
1515
* @since 2.0
1616
* @author D.J.(phppp) php_pp@hotmail.com
1717
**/
1818

1919
include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
20-
$sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, 'langform', xoops_getenv('PHP_SELF'));
20+
$sform = new XoopsThemeForm(_AM_XLANG_EDITLANG, 'langform', xoops_getenv('PHP_SELF'), 'post', true);
2121

2222
if ($isBase) {
2323
$lang_select = new XoopsFormSelect(_AM_XLANG_NAME, 'lang_name', $lang_name);
@@ -57,14 +57,13 @@
5757
$lang_image = empty($lang_image) ? 'noflag.gif' : $lang_image;
5858
$image_select = new XoopsFormSelect('', 'lang_image', $lang_image);
5959
$image_select->addOptionArray($image_array);
60-
$image_select->setExtra("onchange='showImgSelected(\"image\", \"lang_image\", \"/modules/" . $xoopsModule->dirname() . "/assets/images/\", \"\", \"" . XOOPS_URL . "\")'");
60+
$image_select->setExtra("onchange='showImgSelected(\"image\", \"lang_image\", \"/modules/" . $xoopsModule->dirname() . '/assets/images/", "", "' . XOOPS_URL . "\")'");
6161
$image_tray = new XoopsFormElementTray('', '&nbsp;');
6262
$image_tray->addElement($image_select);
6363
if (!empty($lang_image)) {
64-
$image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/' . $lang_image
65-
. "' name='image' id='image' alt='' /></div>"));
64+
$image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/' . $lang_image . "' name='image' id='image' alt=''></div>"));
6665
} else {
67-
$image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/images/blank.gif' name='image' id='image' alt='' /></div>"));
66+
$image_tray->addElement(new XoopsFormLabel('', "<div style='padding: 8px;'><img src='" . XOOPS_URL . "/images/blank.gif' name='image' id='image' alt=''></div>"));
6867
}
6968
$image_option_tray->addElement($image_tray);
7069
$sform->addElement($image_option_tray);

0 commit comments

Comments
 (0)