Skip to content

Commit 1b4a7ef

Browse files
committed
cosmetics admin area
1 parent c94053a commit 1b4a7ef

13 files changed

Lines changed: 34 additions & 46 deletions

File tree

admin/building.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
* @author Txmod Xoops http://www.txmodxoops.org
2323
*
2424
*/
25-
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_building.tpl';
25+
26+
$templateMain = 'tdmcreate_building.tpl';
2627

2728
include __DIR__ . '/header.php';
2829
$op = \Xmf\Request::getString('op', 'default');
@@ -39,7 +40,6 @@
3940
// Switch option
4041
switch ($op) {
4142
case 'build':
42-
// $templateMain = 'tdmcreate_building.tpl';
4343
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('building.php'));
4444
// Get var module dirname
4545
$moduleDirname = $moduleObj->getVar('mod_dirname');
@@ -93,7 +93,6 @@
9393
break;
9494
case 'default':
9595
default:
96-
// $templateMain = 'tdmcreate_building.tpl';
9796
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('building.php'));
9897
// Redirect if there aren't modules
9998
$nbModules = $helper->getHandler('Modules')->getCount();

admin/fields.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
* @author Txmod Xoops http://www.txmodxoops.org
3131
*
3232
*/
33-
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_fields.tpl';
33+
34+
// Define main template
35+
$templateMain = 'tdmcreate_fields.tpl';
3436

3537
include __DIR__ . '/header.php';
3638
// Recovered value of arguments op in the URL $
@@ -46,8 +48,6 @@
4648
default:
4749
$start = \Xmf\Request::getInt('start', 0);
4850
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('tables_adminpager'));
49-
// Define main template
50-
// $templateMain = 'tdmcreate_fields.tpl';
5151
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
5252
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
5353
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
@@ -109,8 +109,6 @@
109109
}
110110
break;
111111
case 'new':
112-
// Define main template
113-
// $templateMain = 'tdmcreate_fields.tpl';
114112
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
115113
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php'));
116114
$adminObject->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
@@ -183,8 +181,6 @@
183181
$GLOBALS['xoopsTpl']->assign('form', $form->render());
184182
break;
185183
case 'edit':
186-
// Define main template
187-
// $templateMain = 'tdmcreate_fields.tpl';
188184
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
189185
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('fields.php'));
190186
$adminObject->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');

admin/footer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
$pathIcon32 = Xmf\Module\Admin::iconUrl('', 32);
2525

26-
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>';
27-
26+
if (isset($templateMain)) {
27+
$GLOBALS['xoopsTpl']->display("db:{$templateMain}");
28+
}
2829
xoops_cp_footer();

admin/modules.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
* @author Txmod Xoops <support@txmodxoops.org>
2222
*
2323
*/
24-
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_modules.tpl';
24+
25+
// Define main template
26+
$templateMain = 'tdmcreate_modules.tpl';
2527

2628
include __DIR__ . '/header.php';
2729
// Recovered value of argument op in the URL $
@@ -34,8 +36,6 @@
3436
default:
3537
$start = \Xmf\Request::getInt('start', 0);
3638
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('modules_adminpager'));
37-
// Define main template
38-
// $templateMain = 'tdmcreate_modules.tpl';
3939
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
4040
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
4141
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('modules.php'));
@@ -68,8 +68,6 @@
6868

6969
break;
7070
case 'new':
71-
// Define main template
72-
// $templateMain = 'tdmcreate_modules.tpl';
7371
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
7472
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('modules.php'));
7573
$adminObject->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'list');
@@ -167,8 +165,6 @@
167165
$GLOBALS['xoopsTpl']->assign('form', $form->render());
168166
break;
169167
case 'edit':
170-
// Define main template
171-
// $templateMain = 'tdmcreate_modules.tpl';
172168
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
173169
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('modules.php'));
174170
$adminObject->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'modules.php?op=new', 'add');

admin/morefiles.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
* @author Txmod Xoops <support@txmodxoops.org>
2222
*
2323
*/
24-
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_morefiles.tpl';
24+
25+
// Define main template
26+
$templateMain = 'tdmcreate_morefiles.tpl';
2527

2628
include __DIR__ . '/header.php';
2729
// Recovered value of argument op in the URL $
@@ -34,8 +36,6 @@
3436
default:
3537
$start = \Xmf\Request::getInt('start', 0);
3638
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('morefiles_adminpager'));
37-
// Define main template
38-
// $templateMain = 'tdmcreate_morefiles.tpl';
3939
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
4040
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
4141
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('morefiles.php'));
@@ -69,8 +69,6 @@
6969
}
7070
break;
7171
case 'new':
72-
// Define main template
73-
// $templateMain = 'tdmcreate_morefiles.tpl';
7472
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
7573
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('morefiles.php'));
7674
$adminObject->addItemButton(_AM_TDMCREATE_MORE_FILES_LIST, 'morefiles.php', 'list');

admin/settings.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,21 @@
2121
* @author Txmod Xoops <support@txmodxoops.org>
2222
*
2323
*/
24-
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_settings.tpl';
24+
25+
// Define main template
26+
$templateMain = 'tdmcreate_settings.tpl';
2527

2628
include __DIR__ . '/header.php';
2729

2830
// Recovered value of argument op in the URL $
29-
$op = \Xmf\Request::getString('op', 'list');
30-
31+
$op = \Xmf\Request::getString('op', 'list');
3132
$setId = \Xmf\Request::getInt('set_id');
3233

3334
switch ($op) {
3435
case 'list':
3536
default:
3637
$start = \Xmf\Request::getInt('start', 0);
3738
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('settings_adminpager'));
38-
// Define main template
39-
// $templateMain = 'tdmcreate_settings.tpl';
4039
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
4140
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
4241
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('settings.php'));
@@ -65,8 +64,6 @@
6564
}
6665
break;
6766
case 'new':
68-
// Define main template
69-
// $templateMain = 'tdmcreate_settings.tpl';
7067
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
7168
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('settings.php'));
7269
$adminObject->addItemButton(_AM_TDMCREATE_SETTINGS_LIST, 'settings.php', 'list');
@@ -149,8 +146,6 @@
149146
$GLOBALS['xoopsTpl']->assign('form', $form->render());
150147
break;
151148
case 'edit':
152-
// Define main template
153-
// $templateMain = 'tdmcreate_settings.tpl';
154149
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('settings.php'));
155150
$adminObject->addItemButton(_AM_TDMCREATE_ADD_SETTING, 'settings.php?op=new', 'add');
156151
$adminObject->addItemButton(_AM_TDMCREATE_SETTINGS_LIST, 'settings.php', 'list');

admin/tables.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
* @author Txmod Xoops http://www.txmodxoops.org
2222
*
2323
*/
24-
$GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_tables.tpl';
24+
25+
// Define main template
26+
$templateMain = 'tdmcreate_tables.tpl';
2527

2628
include __DIR__ . '/header.php';
2729
// Recovered value of arguments op in the URL $
@@ -40,8 +42,6 @@
4042
default:
4143
$start = \Xmf\Request::getInt('start', 0);
4244
$limit = \Xmf\Request::getInt('limit', $helper->getConfig('modules_adminpager'));
43-
// Define main template
44-
// $templateMain = 'tdmcreate_tables.tpl';
4545
$GLOBALS['xoTheme']->addStylesheet('modules/tdmcreate/assets/css/admin/style.css');
4646
$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
4747
$GLOBALS['xoTheme']->addScript('modules/tdmcreate/assets/js/functions.js');
@@ -98,13 +98,14 @@
9898
}
9999
break;
100100
case 'new':
101-
// Define main template
102-
// $templateMain = 'tdmcreate_tables.tpl';
103101
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('tables.php'));
104102
$adminObject->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
105103
$GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
106104

107105
$tablesObj = $helper->getHandler('Tables')->create();
106+
if ($tableMid > 0) {
107+
$tablesObj->setVar('table_mid', $tableMid);
108+
}
108109
$form = $tablesObj->getFormTables();
109110
$GLOBALS['xoopsTpl']->assign('form', $form->render());
110111
break;
@@ -208,8 +209,6 @@
208209
$GLOBALS['xoopsTpl']->assign('form', $form->render());
209210
break;
210211
case 'edit':
211-
// Define main template
212-
// $templateMain = 'tdmcreate_tables.tpl';
213212
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('tables.php'));
214213
$adminObject->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
215214
$adminObject->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list');

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<hr>
33
- code cosmetics (mamba)
44
- added "Build" icons to Modules and Tables tabs - time saver (mamba)
5+
- cosmetics admin area (goffy)
56

67
<h5>3.01 Alpha 1 [2020-01-01]</h5> Dev: XOOPS 2.5.11, PHP 7.4.1
78
<hr>

language/english/admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@
117117
define(
118118
'_AM_TDMCREATE_MODULE_NAME_DESC',
119119
"The module name can contain spaces and special characters such as accents.<br />
120-
An example would be: <b class='white'>My Simple Module</b>"
120+
An example would be: <b class='red'>My Simple Module</b>"
121121
);
122122
// Added in version 1.91
123123
define('_AM_TDMCREATE_MODULE_DIRNAME', 'Directory Name');
124124
// ---------------------
125125
define(
126126
'_AM_TDMCREATE_MODULE_DIRNAME_DESC',
127127
"The module directory can not contain spaces or special characters such as accents.<br />
128-
An example would be: <b class='white'>mysimplemodule</b>.<br />In case you write the module directory with uppercase characters, they are replaced automatically with lowercase, and if there are spaces they will also be automatically deleted."
128+
An example would be: <b class='red'>mysimplemodule</b>.<br />In case you write the module directory with uppercase characters, they are replaced automatically with lowercase, and if there are spaces they will also be automatically deleted."
129129
);
130130
define('_AM_TDMCREATE_MODULE_VERSION', 'Version');
131131
define('_AM_TDMCREATE_MODULE_SINCE', 'Since');

sql/mysql.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CREATE TABLE `tdmcreate_settings` (
1717
`set_dirname` VARCHAR(100) NOT NULL DEFAULT 'mymoduledirname',
1818
`set_version` VARCHAR(5) NOT NULL DEFAULT '1.0',
1919
`set_since` VARCHAR(5) NOT NULL DEFAULT '1.0',
20-
`set_min_php` VARCHAR(5) NOT NULL DEFAULT '5.6',
20+
`set_min_php` VARCHAR(5) NOT NULL DEFAULT '7.0',
2121
`set_min_xoops` VARCHAR(8) NOT NULL DEFAULT '2.5.10',
2222
`set_min_admin` VARCHAR(8) NOT NULL DEFAULT '1.2',
2323
`set_min_mysql` VARCHAR(8) NOT NULL DEFAULT '5.5',
@@ -60,7 +60,7 @@ CREATE TABLE `tdmcreate_settings` (
6060

6161
INSERT INTO `tdmcreate_settings` (`set_id`, `set_name`, `set_dirname`, `set_version`, `set_since`, `set_min_php`, `set_min_xoops`, `set_min_admin`, `set_min_mysql`, `set_description`, `set_author`, `set_author_mail`, `set_author_website_url`, `set_author_website_name`, `set_credits`, `set_license`, `set_release_info`, `set_release_file`, `set_manual`, `set_manual_file`, `set_image`, `set_demo_site_url`, `set_demo_site_name`, `set_support_url`, `set_support_name`, `set_website_url`, `set_website_name`, `set_release`, `set_status`, `set_admin`, `set_user`, `set_blocks`, `set_search`, `set_comments`, `set_notifications`, `set_permissions`, `set_inroot_copy`, `set_donations`, `set_subversion`, `set_type`)
6262
VALUES
63-
(1, 'My Module', 'mymoduledirname', '1.0', '1.0', '5.6', '2.5.9', '1.2', '5.6', 'This module is for doing following...', 'TDM XOOPS', 'info@email.com', 'http://xoops.org', 'XOOPS Project', 'XOOPS Development Team', 'GPL 2.0 or later', 'release_info', 'release_info file', 'link to manual file',
63+
(1, 'My Module', 'mymoduledirname', '1.0', '1.0', '7.0', '2.5.9', '1.2', '5.6', 'This module is for doing following...', 'TDM XOOPS', 'info@email.com', 'http://xoops.org', 'XOOPS Project', 'XOOPS Development Team', 'GPL 2.0 or later', 'release_info', 'release_info file', 'link to manual file',
6464
'install.txt', 'empty.png', 'https://xoops.org', 'XOOPS Demo Site', 'https://xoops.org/modules/newbb', 'Support Forum', 'www.xoops.org', 'XOOPS Project',
6565
'2017-12-02', 'Beta 1', '1', '1', '1', '0', '0', '0', '0', '0', '6KJ7RW5DR3VTJ', '13070', 1);
6666

0 commit comments

Comments
 (0)