Skip to content

Commit c94053a

Browse files
authored
Merge pull request #144 from mambax7/master
3.01 Alpha 1
2 parents 4674d53 + 2eb4f5d commit c94053a

302 files changed

Lines changed: 17210 additions & 12078 deletions

File tree

Some content is hidden

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

.scrutinizer.yml

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,20 @@
1-
# .scrutinizer.yml
2-
filter:
3-
excluded_paths:
4-
- assets/*
1+
# language: php
52
build:
6-
environment:
7-
php:
8-
version: 5.4.41 # Common versions: 5.4, 5.5, 5.6 or hhvm
9-
checks:
10-
php:
11-
code_rating: true
12-
duplication: true
13-
tools:
14-
php_cs_fixer:
15-
extensions:
16-
# Default:
17-
- php
18-
fixers: []
19-
enabled: false
20-
filter:
21-
paths: []
22-
excluded_paths: []
23-
config:
24-
level: all
25-
filter:
26-
paths: ["admin/*", "class/*", "include/*", "language/*", "templates/*"]
27-
php_cpd:
28-
enabled: true
29-
excluded_dirs: ["assets", "docs", "sql", "language", "templates"]
30-
php_loc:
31-
enabled: true
32-
excluded_dirs: ["assets", "docs", "sql", "language", "templates"]
33-
php_mess_detector:
34-
enabled: true
35-
filter:
36-
paths: ["src/*"]
37-
php_pdepend:
38-
enabled: true
39-
excluded_dirs: ["assets", "docs", "sql", "language", "templates"]
40-
php_analyzer: true
41-
php_analyzer:
42-
filter:
43-
paths: ["admin/*", "class/*", "include/*", "language/*"]
44-
sensiolabs_security_checker: true
3+
nodes:
4+
tests: true
5+
analysis:
6+
dependencies:
7+
after:
8+
# The following installs the most recent XOOPS CMS version, you might want
9+
# to install a specific release tag or branch instead.
10+
- git clone --depth=1 https://github.com/XOOPS/XoopsCore25
11+
- git clone --depth=1 https://github.com/mambax7/tag
12+
project_setup:
13+
override: true
14+
tests:
15+
override:
16+
- php-scrutinizer-run --enable-security-analysis
17+
filter:
18+
dependency_paths:
19+
- XoopsCore25/*
20+
- tag/*

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
language: php
22

33
php:
4-
- 5.3
5-
- 5.4
64
- 5.5
7-
5+
- 5.6
6+
- 7.0
7+
- 7.1
8+
- 7.2
9+
- 7.3
10+
- 7.4
811
env:
9-
- DB=mysql
12+
- DB=mysql
1013

1114
before_script:
1215
- mysql -e 'create database tdmcreate_settings'

admin/about.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*/
12+
1213
/**
1314
* tdmcreate module.
1415
*
@@ -18,14 +19,11 @@
1819
* @since 2.5.0
1920
*
2021
* @author Txmod Xoops http://www.txmodxoops.org
21-
*
22-
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
2322
*/
24-
include __DIR__.'/header.php';
25-
$templateMain = 'tdmcreate_about.tpl';
26-
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('about.php'));
27-
$about = $adminObject->renderAbout($adminObject->setPaypal('7LFE862PGJN88'), false);
28-
$aboutRes = TDMCreate_MakeDonationForm($about);
29-
$GLOBALS['xoopsTpl']->assign('maintained', sprintf(_AM_TDMCREATE_MAINTAINED, $GLOBALS['xoopsModule']->getVar('name')));
30-
$GLOBALS['xoopsTpl']->assign('about', $aboutRes);
31-
include __DIR__.'/footer.php';
23+
include __DIR__ . '/header.php';
24+
25+
$adminObject->displayNavigation(basename(__FILE__));
26+
$adminObject::setPaypal('xoopsfoundation@gmail.com');
27+
$adminObject->displayAbout(false);
28+
29+
include __DIR__ . '/footer.php';

admin/addfiles.php

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
but WITHOUT ANY WARRANTY; without even the implied warranty of
1010
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1111
*/
12+
1213
/**
1314
* tdmcreate module.
1415
*
@@ -19,21 +20,22 @@
1920
*
2021
* @author Txmod Xoops <support@txmodxoops.org>
2122
*
22-
* @version $Id: 1.59 addfiles.php 11297 2013-03-24 10:58:10Z timgno $
2323
*/
24-
include __DIR__.'/header.php';
24+
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_addfiles.tpl';
25+
26+
include __DIR__ . '/header.php';
2527
// Recovered value of argument op in the URL $
26-
$op = XoopsRequest::getString('op', 'list');
28+
$op = \Xmf\Request::getString('op', 'list');
2729

28-
$fileId = XoopsRequest::getInt('file_id');
30+
$fileId = \Xmf\Request::getInt('file_id');
2931

3032
switch ($op) {
3133
case 'list':
3234
default:
33-
$start = XoopsRequest::getInt('start', 0);
34-
$limit = XoopsRequest::getInt('limit', $tdmcreate->getConfig('addfiles_adminpager'));
35+
$start = \Xmf\Request::getInt('start', 0);
36+
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('addfiles_adminpager'));
3537
// Define main template
36-
$templateMain = 'tdmcreate_addfiles.tpl';
38+
// $templateMain = 'tdmcreate_addfiles.tpl';
3739
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
3840
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
3941
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('addfiles.php'));
@@ -43,13 +45,13 @@
4345
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgfile_url', TDMC_UPLOAD_IMGMOD_URL);
4446
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
4547
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
46-
$modulesCount = $tdmcreate->getHandler('modules')->getCountModules();
48+
$modulesCount = $helper->getHandler('Modules')->getCountModules();
4749
// Redirect if there aren't modules
4850
if (0 == $modulesCount) {
4951
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOT_MODULES);
5052
}
51-
$addfilesCount = $tdmcreate->getHandler('addfiles')->getCountAddFiles();
52-
$addfilesAll = $tdmcreate->getHandler('addfiles')->getAllAddFiles($start, $limit);
53+
$addfilesCount = $helper->getHandler('Addfiles')->getCountAddFiles();
54+
$addfilesAll = $helper->getHandler('Addfiles')->getAllAddFiles($start, $limit);
5355
// Display addfiles list
5456
if ($addfilesCount > 0) {
5557
foreach (array_keys($addfilesAll) as $i) {
@@ -58,87 +60,85 @@
5860
unset($files);
5961
}
6062
if ($addfilesCount > $limit) {
61-
include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
62-
$pagenav = new XoopsPageNav($addfilesCount, $limit, $start, 'start', 'op=list&limit='.$limit);
63+
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
64+
$pagenav = new \XoopsPageNav($addfilesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
6365
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
6466
}
6567
} else {
6668
$GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
6769
}
6870
break;
69-
7071
case 'new':
7172
// Define main template
72-
$templateMain = 'tdmcreate_addfiles.tpl';
73+
// $templateMain = 'tdmcreate_addfiles.tpl';
7374
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
7475
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('addfiles.php'));
7576
$adminObject->addItemButton(_AM_TDMCREATE_ADDFILES_LIST, 'addfiles.php', 'list');
7677
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
7778

78-
$addfilesObj = &$tdmcreate->getHandler('addfiles')->create();
79-
$form = $addfilesObj->getFormAddFiles();
79+
$addfilesObj = $helper->getHandler('Addfiles')->create();
80+
$form = $addfilesObj->getFormAddFiles();
8081
$GLOBALS['xoopsTpl']->assign('form', $form->render());
8182
break;
82-
8383
case 'save':
8484
if (!$GLOBALS['xoopsSecurity']->check()) {
8585
redirect_header('addfiles.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
8686
}
8787
if (isset($fileId)) {
88-
$addfilesObj = &$tdmcreate->getHandler('addfiles')->get($fileId);
88+
$addfilesObj = $helper->getHandler('Addfiles')->get($fileId);
8989
} else {
90-
$addfilesObj = &$tdmcreate->getHandler('addfiles')->create();
90+
$addfilesObj = $helper->getHandler('Addfiles')->create();
9191
}
9292
// Form file save
93-
$addfilesObj->setVars([
94-
'file_mid' => $_POST['file_mid'],
95-
'file_name' => $_POST['file_name'],
96-
'file_extension' => $_POST['file_extension'],
97-
'file_infolder' => $_POST['file_infolder'],
98-
]);
93+
$addfilesObj->setVars(
94+
[
95+
'file_mid' => \Xmf\Request::getString('file_mid', '', 'POST'),
96+
'file_name' => \Xmf\Request::getString('file_name', '', 'POST'),
97+
'file_extension' => \Xmf\Request::getString('file_extension', '', 'POST'),
98+
'file_infolder' => \Xmf\Request::getString('file_infolder', '', 'POST'),
99+
]
100+
);
99101

100-
if ($tdmcreate->getHandler('addfiles')->insert($addfilesObj)) {
102+
if ($helper->getHandler('Addfiles')->insert($addfilesObj)) {
101103
if ($addfilesObj->isNew()) {
102-
redirect_header('addfiles.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_CREATED_OK, $_POST['file_name']));
104+
redirect_header('addfiles.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_CREATED_OK, \Xmf\Request::getString('file_name', '', 'POST')));
103105
} else {
104-
redirect_header('addfiles.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_UPDATED_OK, $_POST['file_name']));
106+
redirect_header('addfiles.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_UPDATED_OK, \Xmf\Request::getString('file_name', '', 'POST')));
105107
}
106108
}
107109

108110
$GLOBALS['xoopsTpl']->assign('error', $addfilesObj->getHtmlErrors());
109-
$form = &$addfilesObj->getFormAddFiles();
111+
$form = $addfilesObj->getFormAddFiles();
110112
$GLOBALS['xoopsTpl']->assign('form', $form->render());
111113
break;
112-
113114
case 'edit':
114115
// Define main template
115-
$templateMain = 'tdmcreate_addfiles.tpl';
116+
// $templateMain = 'tdmcreate_addfiles.tpl';
116117
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
117118
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('addfiles.php'));
118119
$adminObject->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'addfiles.php?op=new', 'add');
119120
$adminObject->addItemButton(_AM_TDMCREATE_ADDFILES_LIST, 'addfiles.php', 'list');
120121
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
121122

122-
$addfilesObj = $tdmcreate->getHandler('addfiles')->get($fileId);
123-
$form = $addfilesObj->getFormAddFiles();
123+
$addfilesObj = $helper->getHandler('Addfiles')->get($fileId);
124+
$form = $addfilesObj->getFormAddFiles();
124125
$GLOBALS['xoopsTpl']->assign('form', $form->render());
125126
break;
126-
127127
case 'delete':
128-
$addfilesObj = &$tdmcreate->getHandler('addfiles')->get($fileId);
128+
$addfilesObj = $helper->getHandler('Addfiles')->get($fileId);
129129
if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
130130
if (!$GLOBALS['xoopsSecurity']->check()) {
131131
redirect_header('addfiles.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
132132
}
133-
if ($tdmcreate->getHandler('addfiles')->delete($addfilesObj)) {
133+
if ($helper->getHandler('Addfiles')->delete($addfilesObj)) {
134134
redirect_header('addfiles.php', 3, _AM_TDMCREATE_FORM_DELETED_OK);
135135
} else {
136136
$GLOBALS['xoopsTpl']->assign('error', $addfilesObj->getHtmlErrors());
137137
}
138138
} else {
139-
xoops_confirm(['ok' => 1, 'file_id' => $fileId, 'op' => 'delete'], $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORM_SURE_DELETE, $addfilesObj->getVar('file_name')));
139+
xoops_confirm(['ok' => 1, 'file_id' => $fileId, 'op' => 'delete'], \Xmf\Request::getString('REQUEST_URI', '', 'SERVER'), sprintf(_AM_TDMCREATE_FORM_SURE_DELETE, $addfilesObj->getVar('file_name')));
140140
}
141141
break;
142142
}
143143

144-
include __DIR__.'/footer.php';
144+
include __DIR__ . '/footer.php';

admin/building.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use XoopsModules\Tdmcreate;
4+
35
/*
46
You may not change or alter any portion of this comment or credits
57
of supporting developers from this source code or any supporting source code
@@ -19,12 +21,13 @@
1921
*
2022
* @author Txmod Xoops http://www.txmodxoops.org
2123
*
22-
* @version $Id: building.php 12258 2014-01-02 09:33:29Z timgno $
2324
*/
25+
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_building.tpl';
26+
2427
include __DIR__ . '/header.php';
25-
$op = XoopsRequest::getString('op', 'default');
26-
$mid = XoopsRequest::getInt('mod_id');
27-
$moduleObj = $tdmcreate->getHandler('modules')->get($mid);
28+
$op = \Xmf\Request::getString('op', 'default');
29+
$mid = \Xmf\Request::getInt('mod_id');
30+
$moduleObj = $helper->getHandler('Modules')->get($mid);
2831
$cachePath = XOOPS_VAR_PATH . '/caches/tdmcreate_cache';
2932
// Clear cache
3033
if (file_exists($cache = $cachePath . '/classpaths.cache')) {
@@ -36,24 +39,24 @@
3639
// Switch option
3740
switch ($op) {
3841
case 'build':
39-
$templateMain = 'tdmcreate_building.tpl';
42+
// $templateMain = 'tdmcreate_building.tpl';
4043
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('building.php'));
4144
// Get var module dirname
4245
$moduleDirname = $moduleObj->getVar('mod_dirname');
4346
// Directories for copy from to
4447
$fromDir = TDMC_UPLOAD_REPOSITORY_PATH . '/' . mb_strtolower($moduleDirname);
45-
$toDir = XOOPS_ROOT_PATH . '/modules/' . mb_strtolower($moduleDirname);
46-
include_once TDMC_CLASS_PATH . '/building.php';
48+
$toDir = XOOPS_ROOT_PATH . '/modules/' . mb_strtolower($moduleDirname);
49+
// include_once TDMC_CLASS_PATH . '/building.php';
4750
if (isset($moduleDirname)) {
4851
// Clear this module if it's in repository
49-
$building = TDMCreateBuilding::getInstance();
52+
$building = Tdmcreate\Building::getInstance();
5053
if (is_dir($fromDir)) {
5154
$building->clearDir($fromDir);
5255
}
5356
}
5457
// Structure
55-
include_once TDMC_CLASS_PATH . '/files/TDMCreateArchitecture.php';
56-
$handler = TDMCreateArchitecture::getInstance();
58+
// include_once TDMC_CLASS_PATH . '/files/Architecture.php';
59+
$handler = Tdmcreate\Files\CreateArchitecture::getInstance();
5760
// Creation of the structure of folders and files
5861
$baseArchitecture = $handler->setBaseFoldersFiles($moduleObj);
5962
if (false !== $baseArchitecture) {
@@ -75,7 +78,7 @@
7578
$GLOBALS['xoopsTpl']->assign('building_directory', sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname));
7679
// Copy this module in root modules
7780
if (1 == $moduleObj->getVar('mod_inroot_copy')) {
78-
$building = TDMCreateBuilding::getInstance();
81+
$building = Tdmcreate\Building::getInstance();
7982
if (isset($moduleDirname)) {
8083
// Clear this module if it's in root/modules
8184
// Warning: If you have an older operating module with the same name,
@@ -90,17 +93,17 @@
9093
break;
9194
case 'default':
9295
default:
93-
$templateMain = 'tdmcreate_building.tpl';
96+
// $templateMain = 'tdmcreate_building.tpl';
9497
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('building.php'));
9598
// Redirect if there aren't modules
96-
$nbModules = $tdmcreate->getHandler('modules')->getCount();
99+
$nbModules = $helper->getHandler('Modules')->getCount();
97100
if (0 == $nbModules) {
98101
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES);
99102
}
100103
unset($nbModules);
101-
include_once TDMC_CLASS_PATH . '/building.php';
102-
$building = TDMCreateBuilding::getInstance();
103-
$form = $building->getForm();
104+
// include_once TDMC_CLASS_PATH . '/building.php';
105+
$building = Tdmcreate\Building::getInstance();
106+
$form = $building->getForm();
104107
$GLOBALS['xoopsTpl']->assign('form', $form->render());
105108
break;
106109
}

0 commit comments

Comments
 (0)