Skip to content

Commit f21ca4e

Browse files
committed
Merge branch 'master' of https://github.com/txmodxoops/tdmcreate
2 parents 515c7d0 + c30da62 commit f21ca4e

689 files changed

Lines changed: 41850 additions & 5565 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.

_TODO.txt

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
1+
****************************************************************************************
2+
3+
IMPORTANT:
4+
I moved files, where I do not know whether they are still needed into folder _archive
5+
6+
****************************************************************************************
7+
8+
9+
10+
TODOs:
11+
12+
implement constants interface
13+
14+
15+
16+
17+
118
Notifications:
219
there are too much notification, which are not needed/working
3-
TODO:
420
- reduce xoops_version.php to needed
5-
- adapt language/modinfo.php
21+
- adapt language/modinfo.php (make nice text of e.g.: Global newcategory notify caption)
22+
23+
24+
rate.php:
25+
this file currently is not rating
26+
27+
28+
29+
30+
*****************************
31+
Open questions:
32+
***************
33+
Addfiles:
34+
are the files class/Addfiles.php and Addfileshandler.php still needed?
35+
36+
search.php:
37+
what should this file do, additionally to regular search?
38+
UserSearch has to be adapted
39+
40+
41+
single.php:
42+
what should this file show?
43+
what should it be used for?
44+
45+
46+
visit.php:
47+
what should this file show?
48+
what should it be used for?
49+
50+
51+
File renamed without changes.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/**
3131
* Class UserObjects.
3232
*/
33-
class UserObjects extends Files\CreateFile
33+
class UserObjects_old extends Files\CreateFile
3434
{
3535
/**
3636
* @public function constructor
@@ -167,8 +167,8 @@ public function getUrlFileSetVar($moduleDirname, $tableName, $fieldName)
167167
// Set Var {$fieldName}
168168
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
169169
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
170-
\$uploader = new \XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
171-
\${$moduleDirname}->getConfig('maxsize'), null, null);
170+
\$uploader = new \XoopsMediaUploader(\$uploaddir, \$helper->getConfig('mimetypes_file'),
171+
\$helper->getConfig('maxsize_file'), null, null);
172172
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
173173
\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);
174174
if (!\$uploader->upload()) {
@@ -196,8 +196,8 @@ public function getImageListSetVar($moduleDirname, $tableName, $fieldName)
196196
// Set Var {$fieldName}
197197
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
198198
\$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
199-
\$uploader = new \XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
200-
\${$moduleDirname}->getConfig('maxsize'), null, null);
199+
\$uploader = new \XoopsMediaUploader(\$uploaddir, \$helper->getConfig('mimetypes_image'),
200+
\$helper->getConfig('maxsize_image'), null, null);
201201
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
202202
//\$uploader->setPrefix('{$fieldName}_');
203203
//\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);
@@ -230,8 +230,8 @@ public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName, $fp
230230
// Set Var {$fieldName}
231231
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
232232
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}';
233-
\$uploader = new \XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
234-
\${$moduleDirname}->getConfig('maxsize'), null, null);
233+
\$uploader = new \XoopsMediaUploader(\$uploaddir, \$helper->getConfig('mimetypes_image'),
234+
\$helper->getConfig('maxsize_image'), null, null);
235235
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
236236
\$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , \$_FILES['attachedfile']['name']);
237237
\$imgName = str_replace(' ', '', \$_POST['{$fpmf}']).'.'.\$extension;
@@ -265,8 +265,8 @@ public function getUploadFileSetVar($moduleDirname, $tableName, $fieldName)
265265
// Set Var {$fieldName}
266266
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
267267
\$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
268-
\$uploader = new \XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
269-
\${$moduleDirname}->getConfig('maxsize'), null, null);
268+
\$uploader = new \XoopsMediaUploader(\$uploaddir, \$helper->getConfig('mimetypes_file'),
269+
\$helper->getConfig('maxsize_file'), null, null);
270270
if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][])) {
271271
//\$uploader->setPrefix('{$fieldName}_') ;
272272
//\$uploader->fetchMedia(\$_POST['xoops_upload_file'][]);

admin/PUBLISHER_ROOT_PATH

Whitespace-only changes.

admin/addmymodule.php

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?php
2+
3+
/*
4+
You may not change or alter any portion of this comment or credits
5+
of supporting developers from this source code or any supporting source code
6+
which is considered copyrighted (c) material of the original comment or credit authors.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
*/
12+
13+
/**
14+
* tdmcreate module.
15+
*
16+
* @copyright XOOPS Project (https://xoops.org)
17+
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
18+
*
19+
* @since 2.5.5
20+
*
21+
* @author Txmod Xoops <support@txmodxoops.org>
22+
*
23+
*/
24+
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_addmymodule.tpl';
25+
26+
include __DIR__ . '/header.php';
27+
// Recovered value of argument op in the URL $
28+
$op = \Xmf\Request::getString('op', 'list');
29+
30+
$fileId = \Xmf\Request::getInt('file_id');
31+
32+
switch ($op) {
33+
case 'list':
34+
default:
35+
$start = \Xmf\Request::getInt('start', 0);
36+
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('addmymodule_adminpager'));
37+
// Define main template
38+
// $templateMain = 'tdmcreate_addmymodule.tpl';
39+
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
40+
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
41+
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('addmymodule.php'));
42+
$adminObject->addItemButton(_AM_TDMCREATE_ADD_FILE, 'addmymodule.php?op=new', 'add');
43+
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
44+
$GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
45+
$GLOBALS['xoopsTpl']->assign('tdmc_upload_imgfile_url', TDMC_UPLOAD_IMGMOD_URL);
46+
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
47+
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
48+
$modulesCount = $helper->getHandler('Modules')->getCountModules();
49+
// Redirect if there aren't modules
50+
if (0 == $modulesCount) {
51+
redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOT_MODULES);
52+
}
53+
$addmymoduleCount = $helper->getHandler('Addmymodule')->getCountAddMymodule();
54+
$addmymoduleAll = $helper->getHandler('Addmymodule')->getAllAddMymodule($start, $limit);
55+
// Display addmymodule list
56+
if ($addmymoduleCount > 0) {
57+
foreach (array_keys($addmymoduleAll) as $i) {
58+
$mymodule = $addmymoduleAll[$i]->getAddMymoduleValues();
59+
$GLOBALS['xoopsTpl']->append('mymodule_list', $mymodule);
60+
unset($mymodule);
61+
}
62+
if ($addmymoduleCount > $limit) {
63+
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
64+
$pagenav = new \XoopsPageNav($addmymoduleCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
65+
$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
66+
}
67+
} else {
68+
$GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
69+
}
70+
break;
71+
case 'new':
72+
// Define main template
73+
// $templateMain = 'tdmcreate_addmymodule.tpl';
74+
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
75+
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('addmymodule.php'));
76+
$adminObject->addItemButton(_AM_TDMCREATE_ADDMYMODULE_LIST, 'addmymodule.php', 'list');
77+
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
78+
79+
$addmymoduleObj = $helper->getHandler('Addmymodule')->create();
80+
$form = $addmymoduleObj->getFormAddMymodule();
81+
$GLOBALS['xoopsTpl']->assign('form', $form->render());
82+
break;
83+
case 'save':
84+
if (!$GLOBALS['xoopsSecurity']->check()) {
85+
redirect_header('addmymodule.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
86+
}
87+
if (isset($fileId)) {
88+
$addmymoduleObj = $helper->getHandler('Addmymodule')->get($fileId);
89+
} else {
90+
$addmymoduleObj = $helper->getHandler('Addmymodule')->create();
91+
}
92+
// Form file save
93+
$addmymoduleObj->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+
);
101+
102+
if ($helper->getHandler('Addmymodule')->insert($addmymoduleObj)) {
103+
if ($addmymoduleObj->isNew()) {
104+
redirect_header('addmymodule.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_CREATED_OK, \Xmf\Request::getString('file_name', '', 'POST')));
105+
} else {
106+
redirect_header('addmymodule.php', 5, sprintf(_AM_TDMCREATE_FILE_FORM_UPDATED_OK, \Xmf\Request::getString('file_name', '', 'POST')));
107+
}
108+
}
109+
110+
$GLOBALS['xoopsTpl']->assign('error', $addmymoduleObj->getHtmlErrors());
111+
$form = $addmymoduleObj->getFormAddMymodule();
112+
$GLOBALS['xoopsTpl']->assign('form', $form->render());
113+
break;
114+
case 'edit':
115+
// Define main template
116+
// $templateMain = 'tdmcreate_addmymodule.tpl';
117+
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
118+
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('addmymodule.php'));
119+
$adminObject->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'addmymodule.php?op=new', 'add');
120+
$adminObject->addItemButton(_AM_TDMCREATE_ADDMYMODULE_LIST, 'addmymodule.php', 'list');
121+
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
122+
123+
$addmymoduleObj = $helper->getHandler('Addmymodule')->get($fileId);
124+
$form = $addmymoduleObj->getFormAddMymodule();
125+
$GLOBALS['xoopsTpl']->assign('form', $form->render());
126+
break;
127+
case 'delete':
128+
$addmymoduleObj = $helper->getHandler('Addmymodule')->get($fileId);
129+
if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) {
130+
if (!$GLOBALS['xoopsSecurity']->check()) {
131+
redirect_header('addmymodule.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
132+
}
133+
if ($helper->getHandler('Addmymodule')->delete($addmymoduleObj)) {
134+
redirect_header('addmymodule.php', 3, _AM_TDMCREATE_FORM_DELETED_OK);
135+
} else {
136+
$GLOBALS['xoopsTpl']->assign('error', $addmymoduleObj->getHtmlErrors());
137+
}
138+
} else {
139+
xoops_confirm(['ok' => 1, 'file_id' => $fileId, 'op' => 'delete'], \Xmf\Request::getString('REQUEST_URI', '', 'SERVER'), sprintf(_AM_TDMCREATE_FORM_SURE_DELETE, $addmymoduleObj->getVar('file_name')));
140+
}
141+
break;
142+
}
143+
144+
include __DIR__ . '/footer.php';

admin/building.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@
8181
$GLOBALS['xoopsTpl']->append('builds', $build);
8282
}
8383
unset($build);
84+
85+
// Get common files
86+
$resCommon = $handler->setCommonFiles($moduleObj);
87+
$build['list'] = _AM_TDMCREATE_BUILDING_COMMON;
88+
$GLOBALS['xoopsTpl']->append('builds', $build);
89+
unset($build);
90+
91+
8492
// Directory to saved all files
8593
$building_directory = sprintf(_AM_TDMCREATE_BUILDING_DIRECTORY, $moduleDirname);
8694

admin/fields.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
break;
111111
case 'new':
112112
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
113+
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
114+
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
113115
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php'));
114116
$adminObject->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
115117
$adminObject->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
@@ -182,6 +184,8 @@
182184
break;
183185
case 'edit':
184186
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
187+
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
188+
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
185189
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php'));
186190
$adminObject->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
187191
$adminObject->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');

admin/modules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
//Form mod_image
114114
include_once XOOPS_ROOT_PATH . '/class/uploader.php';
115115
$uploader = new \XoopsMediaUploader(
116-
TDMC_UPLOAD_IMGMOD_PATH, $helper->getConfig('mimetypes'), $helper->getConfig('maxsize'), null, null
116+
TDMC_UPLOAD_IMGMOD_PATH, $helper->getConfig('mimetypes_image'), $helper->getConfig('maxsize_image'), null, null
117117
);
118118
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
119119
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);

0 commit comments

Comments
 (0)