Skip to content

Commit 9ddf3af

Browse files
authored
Merge pull request #20 from mambax7/master
A few lines to add in /event.php in order to use navigation-bar in theme/extcal/templates/extcal_event.tpl
2 parents 79f3f97 + cd1280a commit 9ddf3af

File tree

426 files changed

+15011
-10348
lines changed

Some content is hidden

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

426 files changed

+15011
-10348
lines changed

.scrutinizer.yml

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,20 @@
1-
checks:
2-
php:
3-
code_rating: true
4-
variable_existence: true
5-
useless_calls: true
6-
use_statement_alias_conflict: true
7-
unused_variables: true
8-
unused_properties: true
9-
unused_parameters: true
10-
unused_methods: true
11-
unreachable_code: true
12-
sql_injection_vulnerabilities: true
13-
security_vulnerabilities: true
14-
precedence_mistakes: true
15-
precedence_in_conditions: true
16-
parameter_non_unique: true
17-
no_property_on_interface: true
18-
no_non_implemented_abstract_methods: true
19-
deprecated_code_usage: true
20-
closure_use_not_conflicting: true
21-
closure_use_modifiable: true
22-
avoid_useless_overridden_methods: true
23-
avoid_conflicting_incrementers: true
24-
assignment_of_null_return: true
25-
verify_property_names: true
26-
verify_argument_usable_as_reference: true
27-
verify_access_scope_valid: true
28-
use_self_instead_of_fqcn: true
29-
too_many_arguments: true
30-
single_namespace_per_use: true
31-
return_doc_comment_if_not_inferrable: true
32-
return_doc_comments: true
33-
require_scope_for_methods: true
34-
require_scope_for_properties: true
35-
require_php_tag_first: true
36-
require_braces_around_control_structures: true
37-
psr2_control_structure_declaration: true
38-
psr2_switch_declaration: true
39-
psr2_class_declaration: true
40-
no_eval: true
41-
no_else_if_statements: true
42-
avoid_corrupting_byteorder_marks: true
43-
argument_type_checks: true
44-
php5_style_constructor: true
45-
parameter_doc_comments: true
46-
no_duplicate_arguments: true
47-
missing_arguments: true
48-
instanceof_class_exists: true
49-
foreach_traversable: true
50-
no_unnecessary_function_call_in_for_loop: true
1+
# language: php
2+
build:
3+
nodes:
4+
tests: true
5+
analysis:
6+
project_setup:
7+
override: true
8+
tests:
9+
override:
10+
- php-scrutinizer-run --enable-security-analysis
11+
dependencies:
12+
after:
13+
# The following installs the most recent XOOPS CMS version, you might want
14+
# to install a specific release tag or branch instead.
15+
- git clone --depth=1 https://github.com/XOOPS/XoopsCore25
16+
- git clone --depth=1 https://github.com/mambax7/tag
17+
filter:
18+
dependency_paths:
19+
- XoopsCore25/*
20+
- tag/*

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)](https://www.gnu.org/licenses/gpl-2.0.html)
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 providing tests for your contributions.
14+
- **Document any change in behavior** - Make sure the `/docs/changelog.txt` and any other relevant documentation are 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: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
![alt XOOPS CMS](http://xoops.org/images/logoXoops4GithubRepository.png)
2-
## extCal module for [XOOPS CMS 2.5.8+](https://xoops.org)
3-
[![Software License](https://img.shields.io/badge/license-GPL-brightgreen.svg?style=flat)](LICENSE)
1+
![alt XOOPS CMS](https://xoops.org/images/logoXoops4GithubRepository.png)
2+
## extCal module for [XOOPS CMS 2.5.9+](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)](https://www.gnu.org/licenses/gpl-2.0.html)
5+
46
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/extcal.svg?style=flat)](https://scrutinizer-ci.com/g/mambax7/extcal/?branch=master)
57
[![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/mambax7/extcal)
68
[![Code Climate](https://img.shields.io/codeclimate/github/mambax7/extcal.svg?style=flat)](https://codeclimate.com/github/mambax7/extcal)
79
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5e5473b5-e39d-4e88-8e5c-321b6e261852/mini.png)](https://insight.sensiolabs.com/projects/5e5473b5-e39d-4e88-8e5c-321b6e261852)
810
[![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/extcal.svg?style=flat)](https://github.com/XoopsModules25x/extcal/tags/)
911
[![Latest Version](https://img.shields.io/github/release/XoopsModules25x/extcal.svg?style=flat)](https://github.com/XoopsModules25x/extcal/releases/)
1012

11-
extCal for [XOOPS CMS](http://xoops.org) is a module for Event/Calendar Management
13+
**extCal** for [XOOPS CMS](https://xoops.org) is a module for Event/Calendar Management
1214

13-
[![Tutorial Available](http://xoops.org/images/tutorial-available-blue.svg)](https://www.gitbook.com/book/xoops/xoops-extcal-module/) Tutorial: see [here](https://www.gitbook.com/book/xoops/xoops-extcal-module/).
15+
[![Tutorial Available](https://xoops.org/images/tutorial-available-blue.svg)](https://xoops.gitbook.io/xoops-extcal-module/) Tutorial: see [here](https://xoops.gitbook.io/xoops-extcal-module/).
1416
To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/extcal-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
20+
Please visit us on 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 crafted on GitHub at: https://github.com/XOOPS

admin/about.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* extCal module.
45
*
@@ -9,17 +10,21 @@
910
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1011
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1112
*
12-
* @copyright XOOPS Project (http://xoops.org)
13-
* @license GNU GPL (http://www.gnu.org/licenses/gpl-2.0.html/)
13+
* @copyright XOOPS Project (https://xoops.org)
14+
* @license GNU GPL (https://www.gnu.org/licenses/gpl-2.0.html/)
1415
*
1516
* @since 2.5.0
1617
*
1718
* @author Mage, Mamba
1819
**/
19-
include_once __DIR__ . '/admin_header.php';
20+
21+
/** @var Xmf\Module\Admin $adminObject */
22+
23+
require_once __DIR__ . '/admin_header.php';
2024
xoops_cp_header();
2125

22-
echo $adminObject->addNavigation(basename(__FILE__));
23-
echo $adminObject->renderAbout('xoopsfoundation@gmail.com', false);
26+
$adminObject->displayNavigation(basename(__FILE__));
27+
$adminObject::setPaypal('xoopsfoundation@gmail.com');
28+
$adminObject->displayAbout(false);
2429

25-
include_once __DIR__ . '/admin_footer.php';
30+
require_once __DIR__ . '/admin_footer.php';

admin/admin_footer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* extCal module.
45
*
@@ -9,16 +10,15 @@
910
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1011
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1112
*
12-
* @copyright :: XOOPS Project (http://xoops.org)
13+
* @copyright :: XOOPS Project (https://xoops.org)
1314
* @license :: http://www.fsf.org/copyleft/gpl.html GNU public license
1415
* @subpackage:: admin
1516
*
1617
* @since : 2.5.0
1718
*
1819
* @author Mamba (www.xoops.org)
1920
**/
20-
21-
echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='http://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' '
22-
. _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>';
21+
$pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32);
22+
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>';
2323

2424
xoops_cp_footer();

admin/admin_header.php

Lines changed: 73 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,79 @@
11
<?php
2-
//
3-
// ------------------------------------------------------------------------ //
4-
// XOOPS - PHP Content Management System //
5-
// Copyright (c) 2000-2016 XOOPS.org //
6-
// <http://xoops.org/> //
7-
// ------------------------------------------------------------------------ //
8-
// This program is free software; you can redistribute it and/or modify //
9-
// it under the terms of the GNU General Public License as published by //
10-
// the Free Software Foundation; either version 2 of the License, or //
11-
// (at your option) any later version. //
12-
// //
13-
// You may not change or alter any portion of this comment or credits //
14-
// of supporting developers from this source code or any supporting //
15-
// source code which is considered copyrighted (c) material of the //
16-
// original comment or credit authors. //
17-
// //
18-
// This program is distributed in the hope that it will be useful, //
19-
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
20-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
21-
// GNU General Public License for more details. //
22-
// //
23-
// You should have received a copy of the GNU General Public License //
24-
// along with this program; if not, write to the Free Software //
25-
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
26-
// ------------------------------------------------------------------------ //
27-
28-
$path = dirname(dirname(dirname(__DIR__)));
29-
include_once $path . '/mainfile.php';
30-
include_once $path . '/include/cp_functions.php';
31-
require_once $path . '/include/cp_header.php';
32-
33-
global $xoopsModule;
2+
/*
3+
* You may not change or alter any portion of this comment or credits
4+
* of supporting developers from this source code or any supporting source code
5+
* which is considered copyrighted (c) material of the original comment or credit authors.
6+
*
7+
* This program is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
*/
11+
12+
/**
13+
* @copyright {@link https://xoops.org/ XOOPS Project}
14+
* @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
15+
* @package extcal
16+
* @since
17+
* @author XOOPS Development Team,
18+
*/
19+
20+
use XoopsModules\Extcal\{
21+
Helper,
22+
Utility,
23+
CategoryHandler,
24+
EventHandler,
25+
EventmemberHandler,
26+
EventNotMemberHandler,
27+
FileHandler,
28+
LocationHandler
29+
};
30+
31+
require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
32+
require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
33+
require_once dirname(__DIR__) . '/include/constantes.php';
34+
35+
require_once dirname(__DIR__) . '/preloads/autoloader.php';
3436

3537
$moduleDirName = basename(dirname(__DIR__));
38+
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
39+
40+
/** @var Helper $helper */
41+
$helper = Helper::getInstance();
42+
/** @var Xmf\Module\Admin $adminObject */
43+
$adminObject = \Xmf\Module\Admin::getInstance();
44+
$utility = new Utility();
45+
46+
require_once dirname(__DIR__) . '/include/common.php';
3647

37-
xoops_load('XoopsRequest');
48+
$adminObject = \Xmf\Module\Admin::getInstance();
49+
50+
$pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16);
51+
$pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32);
52+
$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
3853

3954
// Load language files
40-
xoops_loadLanguage('admin', $moduleDirName);
41-
xoops_loadLanguage('modinfo', $moduleDirName);
42-
xoops_loadLanguage('main', $moduleDirName);
43-
44-
$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('sysicons16'));
45-
$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('sysicons32'));
46-
$xoopsModuleAdminPath = $GLOBALS['xoops']->path('www/' . $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'));
47-
require_once $xoopsModuleAdminPath . '/moduleadmin.php';
48-
49-
/** @var ExtcalCatHandler $catHandler */
50-
$catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
51-
/** @var ExtcalEventHandler $eventHandler */
52-
$eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE);
53-
/** @var ExtcalEventmemberHandler $eventMemberHandler */
54-
$eventMemberHandler = xoops_getModuleHandler(_EXTCAL_CLS_MEMBER, _EXTCAL_MODULE);
55-
//xoops_cp_header();
56-
$adminObject = new ModuleAdmin();
55+
$helper->loadLanguage('admin');
56+
$helper->loadLanguage('modinfo');
57+
$helper->loadLanguage('main');
58+
$helper->loadLanguage('common');
59+
60+
61+
$myts = \MyTextSanitizer::getInstance();
62+
63+
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) {
64+
require_once $GLOBALS['xoops']->path('class/template.php');
65+
$xoopsTpl = new \XoopsTpl();
66+
}
67+
68+
/** @var CategoryHandler $categoryHandler */
69+
$categoryHandler = $helper->getHandler(_EXTCAL_CLN_CAT);
70+
/** @var EventHandler $eventHandler */
71+
$eventHandler = $helper->getHandler(_EXTCAL_CLN_EVENT);
72+
/** @var EventmemberHandler $eventmemberHandler */
73+
$eventmemberHandler = $helper->getHandler(_EXTCAL_CLN_MEMBER);
74+
/** @var EventNotMemberHandler $eventNotMemberHandler */
75+
$eventNotMemberHandler = $helper->getHandler(_EXTCAL_CLN_NOT_MEMBER);
76+
/** @var FileHandler $fileHandler */
77+
$fileHandler = $helper->getHandler(_EXTCAL_CLN_FILE);
78+
/** @var LocationHandler $locationHandler */
79+
$locationHandler = $helper->getHandler(_EXTCAL_CLN_LOCATION);

0 commit comments

Comments
 (0)