├── _TODO.txt ├── assets ├── js │ ├── debug.log │ ├── index.php │ └── sortable.js ├── fonts │ ├── xcvLogo.txt │ ├── index.php │ ├── red.png │ ├── VeraBd.ttf │ ├── green.png │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── css │ ├── index.php │ ├── admin │ │ └── index.php │ └── style.css ├── index.php └── images │ ├── index.php │ ├── icons │ ├── 16 │ │ ├── index.php │ │ ├── 0.png │ │ ├── 1.png │ │ ├── ok.png │ │ ├── drag.png │ │ ├── rss.gif │ │ ├── arrow.gif │ │ ├── blocks.png │ │ ├── error.png │ │ ├── fields.png │ │ ├── spinner.gif │ │ ├── submenu.png │ │ ├── tables.png │ │ ├── toggle.png │ │ ├── warning.png │ │ ├── nb_fields.png │ │ ├── editfields.png │ │ └── left_right.png │ ├── 24 │ │ ├── index.php │ │ ├── next.png │ │ └── previous.png │ ├── 32 │ │ ├── index.php │ │ ├── builder.png │ │ ├── fields.png │ │ ├── files.png │ │ ├── loading.gif │ │ ├── addmodule.png │ │ ├── addtable.png │ │ ├── dashboard.png │ │ ├── devtools.png │ │ ├── edittable.png │ │ ├── mymodule.png │ │ ├── page_copy.png │ │ └── settings.png │ ├── index.php │ └── blank.gif │ ├── logos │ ├── index.php │ ├── empty.png │ ├── tdmxoops_logo.gif │ ├── tdmxoops_logo.png │ ├── txmodxoops_logo.gif │ ├── txmodxoops_logo.png │ ├── xoopsdevelopmentteam_logo.gif │ └── xoopsdevelopmentteam_logo.png │ ├── modules │ ├── index.php │ └── empty.png │ ├── blank.gif │ ├── blank.png │ └── logoModule.png ├── docs ├── manual.txt ├── index.php ├── install.txt ├── lang_diff.txt ├── lang.diff ├── credits.txt ├── readme.txt └── license.txt ├── config ├── admin.yml ├── index.php ├── paths.php └── icons.php ├── testdata ├── english │ ├── group_permission.yml │ ├── modulebuilder_languages.yml │ ├── index.php │ ├── modulebuilder_fieldnull.yml │ ├── modulebuilder_morefiles.yml │ ├── modulebuilder_fieldkey.yml │ ├── modulebuilder_fieldattributes.yml │ ├── modulebuilder_fieldtype.yml │ ├── modulebuilder_modules.yml │ └── modulebuilder_settings.yml ├── .gitignore └── images │ ├── index.php │ ├── modules │ ├── index.php │ ├── blank.gif │ ├── blank.png │ ├── empty.png │ ├── logoModule.png │ ├── wedega_logo.png │ ├── MyModule_logo.png │ ├── tdmxoops_logo.png │ └── xoopsdevelopmentteam_logo.png │ ├── tables │ ├── index.php │ ├── blank.gif │ ├── blank.png │ └── empty.png │ ├── repository │ ├── index.php │ ├── blank.gif │ └── empty.png │ ├── blank.gif │ ├── blank.png │ └── empty.png ├── preloads ├── index.html ├── core.php └── autoloader.php ├── .coveralls.yml ├── .gitignore ├── index.php ├── class ├── index.php ├── Form │ ├── index.php │ ├── FormRaw.php │ ├── SimpleForm.php │ ├── ThemeForm.php │ ├── FormTab.php │ └── FormRadio.php ├── Html │ ├── index.php │ └── FormLabel.php ├── Common │ ├── index.php │ ├── ModuleStats.php │ ├── Configurator.php │ └── Breadcrumb.php ├── Files │ ├── Sql │ │ └── index.php │ ├── index.php │ ├── Admin │ │ └── index.php │ ├── Assets │ │ ├── index.php │ │ ├── Css │ │ │ ├── index.php │ │ │ ├── Admin │ │ │ │ ├── index.php │ │ │ │ └── CssAdminStyles.php │ │ │ ├── CssSelectors.php │ │ │ └── CssStyles.php │ │ └── Js │ │ │ ├── index.php │ │ │ └── JsJquery.php │ ├── Blocks │ │ └── index.php │ ├── Classes │ │ └── index.php │ ├── Config │ │ └── index.php │ ├── Docs │ │ ├── index.php │ │ ├── license.txt │ │ └── DocsChangelog.php │ ├── Includes │ │ ├── index.php │ │ └── IncludeJquery.php │ ├── Language │ │ ├── index.php │ │ └── LanguageDefines.php │ ├── User │ │ ├── index.php │ │ ├── UserNotificationUpdate.php │ │ ├── UserListTag.php │ │ └── UserViewTag.php │ ├── Templates │ │ ├── index.php │ │ ├── Admin │ │ │ ├── index.php │ │ │ └── TemplatesAdminHeader.php │ │ ├── Blocks │ │ │ ├── index.php │ │ │ └── Defstyle │ │ │ │ └── index.php │ │ └── User │ │ │ ├── index.php │ │ │ └── Defstyle │ │ │ └── MoreFiles.php │ ├── CreateCodeIndents.php │ ├── CreateClone.php │ └── admin │ │ └── AdminFooter.php ├── FieldkeyHandler.php ├── FieldnullHandler.php ├── FieldtypeHandler.php ├── FieldattributesHandler.php ├── Fieldkey.php ├── Fieldnull.php ├── Fieldtype.php ├── Fieldattributes.php ├── Helper.php ├── Constants.php ├── Session.php └── autoload.php ├── sql └── index.php ├── include ├── index.php └── common.php ├── language ├── index.php ├── english │ ├── index.php │ ├── help │ │ └── index.php │ ├── mail_template │ │ └── index.php │ ├── directorychecker.php │ ├── filechecker.php │ └── feedback.php ├── lang.diff ├── update language 1.0 to 1.1.txt ├── update language 1.1 to 1.15.txt ├── update language 1.1 to 1.37.txt └── update language 1.15 to 1.37.txt ├── templates ├── index.php └── admin │ ├── index.php │ ├── modulebuilder_about.tpl │ ├── modulebuilder_index.tpl │ ├── modulebuilder_header.tpl │ ├── modulebuilder_footer.tpl │ ├── modulebuilder_morefiles.tpl │ └── modulebuilder_building.tpl ├── files ├── commonfiles │ ├── .gitignore │ ├── assets │ │ └── icons │ │ │ ├── 16 │ │ │ ├── status0.png │ │ │ ├── status1.png │ │ │ ├── status2.png │ │ │ ├── status3.png │ │ │ └── status4.png │ │ │ └── 32 │ │ │ └── broken.png │ ├── testdata │ │ └── images │ │ │ ├── blank.gif │ │ │ └── blank.png │ ├── .gitattributes │ ├── templates │ │ └── admin │ │ │ └── modulebuilder_admin_clone.tpl │ ├── .scrutinizer.yml │ ├── preloads │ │ ├── core.php │ │ └── autoloader.php │ ├── include │ │ ├── xoops_version.inc.php │ │ ├── uninstall.php │ │ └── install.php │ ├── class │ │ ├── Common │ │ │ ├── ModuleStats.php │ │ │ ├── Configurator.php │ │ │ └── Breadcrumb.php │ │ └── Helper.php │ └── language │ │ └── english │ │ └── feedback.php └── ratingfiles │ ├── assets │ ├── icons │ │ ├── 16 │ │ │ ├── like.png │ │ │ ├── rate.png │ │ │ ├── votes.png │ │ │ └── dislike.png │ │ └── 32 │ │ │ ├── like.png │ │ │ └── dislike.png │ └── images │ │ └── starrating.png │ └── class │ └── Ratings.php ├── History.md ├── .atoum.php ├── .gitattributes ├── .scrutinizer.yml ├── .travis.yml └── admin ├── footer.php ├── about.php ├── logo.php ├── header.php ├── migrate.php └── import_module.php /_TODO.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/js/debug.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/manual.txt: -------------------------------------------------------------------------------- 1 | Under Construction -------------------------------------------------------------------------------- /config/admin.yml: -------------------------------------------------------------------------------- 1 | displaySampleButton: 1 2 | -------------------------------------------------------------------------------- /testdata/english/group_permission.yml: -------------------------------------------------------------------------------- 1 | { } -------------------------------------------------------------------------------- /testdata/english/modulebuilder_languages.yml: -------------------------------------------------------------------------------- 1 | { } -------------------------------------------------------------------------------- /preloads/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | repo_token: x3U0mpkL7A9PgaGSUa3tDl3qU9D6wo67y 2 | -------------------------------------------------------------------------------- /assets/fonts/xcvLogo.txt: -------------------------------------------------------------------------------- 1 | display:table-cell; vertical-align:middle; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # no backup files, editor temp 2 | *~ 3 | \#* 4 | *.bak 5 | .idea/ 6 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | <{include file="db:modulebuilder_header.tpl"}> 3 | 4 |
<{$about}>
5 | 6 | <{include file="db:modulebuilder_footer.tpl"}> 7 | -------------------------------------------------------------------------------- /templates/admin/modulebuilder_index.tpl: -------------------------------------------------------------------------------- 1 | 2 | <{include file="db:modulebuilder_header.tpl"}> 3 | 4 |
<{$index|default:''}>
5 | 6 | <{*<{include file="db:modulebuilder_footer.tpl"}>*}> 7 | -------------------------------------------------------------------------------- /docs/credits.txt: -------------------------------------------------------------------------------- 1 | Read Me First 2 | ============= 3 | 4 | Originally created by the TDM Team. 5 | 6 | Modified by Timgno (http://www.txmodxoops.org) 7 | 8 | Contributors: Mamba (https://xoops.org), Goffy (German Xoops) 9 | 10 | Included ideas for Logo Generator from Trabis (Publisher module) and Suin (Koins module) -------------------------------------------------------------------------------- /testdata/english/modulebuilder_fieldnull.yml: -------------------------------------------------------------------------------- 1 | - 2 | fieldnull_id: '1' 3 | fieldnull_name: ... 4 | fieldnull_value: '' 5 | - 6 | fieldnull_id: '2' 7 | fieldnull_name: 'NOT NULL' 8 | fieldnull_value: 'NOT NULL' 9 | - 10 | fieldnull_id: '3' 11 | fieldnull_name: 'NULL' 12 | fieldnull_value: 'NULL' 13 | -------------------------------------------------------------------------------- /.atoum.php: -------------------------------------------------------------------------------- 1 | addWriter(); 10 | $runner->addReport($coveralls); 11 | 12 | $script->addDefaultReport(); 13 | -------------------------------------------------------------------------------- /templates/admin/modulebuilder_header.tpl: -------------------------------------------------------------------------------- 1 |
2 | <{$navigation|default:''}> 3 | <{if $buttons|default:''}><{$buttons}> <{/if}> 4 |
5 | 9 | -------------------------------------------------------------------------------- /testdata/english/modulebuilder_morefiles.yml: -------------------------------------------------------------------------------- 1 | - 2 | file_id: '1' 3 | file_mid: '1' 4 | file_type: '0' 5 | file_name: test 6 | file_extension: txt 7 | file_upload: '' 8 | file_infolder: admin 9 | - 10 | file_id: '2' 11 | file_mid: '1' 12 | file_type: '0' 13 | file_name: testphp 14 | file_extension: php 15 | file_upload: '' 16 | file_infolder: admin 17 | -------------------------------------------------------------------------------- /class/Files/Docs/license.txt: -------------------------------------------------------------------------------- 1 | You may not change or alter any portion of this comment or credits 2 | of supporting developers from this source code or any supporting source code 3 | which is considered copyrighted (c) material of the original comment or credit authors. 4 | 5 | This program is distributed in the hope that it will be useful, 6 | but WITHOUT ANY WARRANTY; without even the implied warranty of 7 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /templates/admin/modulebuilder_footer.tpl: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Xoops Logo 5 |
6 |
7 | 8 | <{$smarty.const._AM_MODULEBUILDER_SUPPORT_FORUM}> 9 |
10 | -------------------------------------------------------------------------------- /files/commonfiles/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /files/commonfiles/templates/admin/modulebuilder_admin_clone.tpl: -------------------------------------------------------------------------------- 1 | 2 | <{include file='db:modulebuilder_admin_header.tpl' }> 3 | 4 | <{if $form|default:''}> 5 | <{$form|default:false}> 6 | <{/if}> 7 | <{if $result|default:''}> 8 | <{$result|default:false}> 9 | <{/if}> 10 | <{if $error|default:''}> 11 |
<{$error|default:false}>
12 | <{/if}> 13 | 14 | 15 | <{include file='db:modulebuilder_admin_footer.tpl' }> 16 | -------------------------------------------------------------------------------- /testdata/english/modulebuilder_fieldkey.yml: -------------------------------------------------------------------------------- 1 | - 2 | fieldkey_id: '1' 3 | fieldkey_name: ... 4 | fieldkey_value: '' 5 | - 6 | fieldkey_id: '2' 7 | fieldkey_name: PRIMARY 8 | fieldkey_value: PRIMARY 9 | - 10 | fieldkey_id: '3' 11 | fieldkey_name: UNIQUE 12 | fieldkey_value: UNIQUE 13 | - 14 | fieldkey_id: '4' 15 | fieldkey_name: KEY 16 | fieldkey_value: KEY 17 | - 18 | fieldkey_id: '5' 19 | fieldkey_name: INDEX 20 | fieldkey_value: INDEX 21 | - 22 | fieldkey_id: '6' 23 | fieldkey_name: FULLTEXT 24 | fieldkey_value: FULLTEXT 25 | -------------------------------------------------------------------------------- /files/commonfiles/.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | # language: php 2 | build: 3 | environment: 4 | php: 8.0.11 5 | nodes: 6 | tests: true 7 | analysis: 8 | dependencies: 9 | after: 10 | # The following installs the most recent XOOPS CMS version, you might want 11 | # to install a specific release tag or branch instead. 12 | - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 13 | project_setup: 14 | override: true 15 | tests: 16 | override: 17 | - php-scrutinizer-run --enable-security-analysis 18 | filter: 19 | dependency_paths: 20 | - XoopsCore25/* 21 | -------------------------------------------------------------------------------- /testdata/english/modulebuilder_fieldattributes.yml: -------------------------------------------------------------------------------- 1 | - 2 | fieldattribute_id: '1' 3 | fieldattribute_name: ... 4 | fieldattribute_value: '' 5 | - 6 | fieldattribute_id: '2' 7 | fieldattribute_name: BINARY 8 | fieldattribute_value: BINARY 9 | - 10 | fieldattribute_id: '3' 11 | fieldattribute_name: UNSIGNED 12 | fieldattribute_value: UNSIGNED 13 | - 14 | fieldattribute_id: '4' 15 | fieldattribute_name: UNSIGNED_ZEROFILL 16 | fieldattribute_value: UNSIGNED_ZEROFILL 17 | - 18 | fieldattribute_id: '5' 19 | fieldattribute_name: CURRENT_TIMESTAMP 20 | fieldattribute_value: CURRENT_TIMESTAMP 21 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | # language: php 2 | build: 3 | environment: 4 | php: 8.0.11 5 | nodes: 6 | tests: true 7 | analysis: 8 | dependencies: 9 | after: 10 | # The following installs the most recent XOOPS CMS version, you might want 11 | # to install a specific release tag or branch instead. 12 | - git clone --depth=1 https://github.com/XOOPS/XoopsCore25 13 | - git clone --depth=1 https://github.com/mambax7/tag 14 | project_setup: 15 | override: true 16 | tests: 17 | override: 18 | - php-scrutinizer-run --enable-security-analysis 19 | filter: 20 | dependency_paths: 21 | - XoopsCore25/* 22 | - tag/* 23 | -------------------------------------------------------------------------------- /docs/readme.txt: -------------------------------------------------------------------------------- 1 | Read Me First 2 | ============= 3 | 4 | Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory 5 | Read the table in admin help for the accurate description of the functionality of this module 6 | 7 | Using the new class xoopsrequest.php 8 | 9 | Version of xoops 10 | ---------------- 11 | ModuleBuilder is a module that create other basic modules for CMS Xoops. 12 | 13 | Tested with xoops 2.5.7, you can not use it with earlier versions, unless because you do not fit some core files in the background and after some tests. 14 | 15 | Now that is ahead xoops versions, and goes to 2.6.0, you should download xoops 2.5.7 and use with this latest version. 16 | 17 | Therefore recommended not to use ModuleBuilder 1.91, with previous versions, to xoops 2.5.7 18 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.5 5 | - 5.6 6 | - 7.0 7 | - 7.1 8 | - 7.2 9 | - 7.3 10 | - 7.4 11 | env: 12 | - DB=mysql 13 | 14 | before_script: 15 | - mysql -e 'create database modulebuilder_settings' 16 | - mysql -e 'create database modulebuilder_modules' 17 | - mysql -e 'create database modulebuilder_tables' 18 | - mysql -e 'create database modulebuilder_fields' 19 | - mysql -e 'create database modulebuilder_languages' 20 | - mysql -e 'create database modulebuilder_fieldtype' 21 | - mysql -e 'create database modulebuilder_fieldattributes' 22 | - mysql -e 'create database modulebuilder_fieldnull' 23 | - mysql -e 'create database modulebuilder_fieldkey' 24 | - mysql -e 'create database modulebuilder_fieldelements' 25 | - mysql -e 'create database modulebuilder_morefiles' 26 | -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | You may not change or alter any portion of this comment or credits 3 | of supporting developers from this source code or any supporting source code 4 | which is considered copyrighted (c) material of the original comment or credit authors. 5 | 6 | This program is distributed in the hope that it will be useful, 7 | but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 | */ 10 | /** 11 | * modulebuilder module 12 | * 13 | * @copyright XOOPS Project (https://xoops.org) 14 | * @license GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) 15 | * @package modulebuilder 16 | * @since 2.5.0 17 | * @author Txmod Xoops http://www.txmodxoops.org 18 | */ 19 | @import url(admin/style.css); 20 | -------------------------------------------------------------------------------- /admin/footer.php: -------------------------------------------------------------------------------- 1 | display("db:{$templateMain}"); 28 | } 29 | xoops_cp_footer(); 30 | -------------------------------------------------------------------------------- /admin/about.php: -------------------------------------------------------------------------------- 1 | displayNavigation(\basename(__FILE__)); 27 | $adminObject::setPaypal('xoopsfoundation@gmail.com'); 28 | $adminObject->displayAbout(false); 29 | 30 | require __DIR__ . '/footer.php'; 31 | -------------------------------------------------------------------------------- /config/paths.php: -------------------------------------------------------------------------------- 1 | \mb_strtoupper($moduleDirName) . ' PathConfigurator', 10 | 'paths' => [ 11 | 'dirname' => $moduleDirName, 12 | 'admin' => \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', 13 | 'modPath' => \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, 14 | 'modUrl' => \XOOPS_URL . '/modules/' . $moduleDirName, 15 | 'uploadPath' => \XOOPS_UPLOAD_PATH . '/' . $moduleDirName, 16 | 'uploadUrl' => \XOOPS_UPLOAD_URL . '/' . $moduleDirName, 17 | ], 18 | 'uploadFolders' => [ 19 | \XOOPS_UPLOAD_PATH . '/' . $moduleDirName, 20 | \XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', 21 | \XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', 22 | //\XOOPS_UPLOAD_PATH . '/flags' 23 | ], 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /language/lang.diff: -------------------------------------------------------------------------------- 1 | Legend : 2 | + Added 3 | - Removed 4 | * Modified 5 | 6 | ******* 7 | v1.0 8 | ******* 9 | admin.php 10 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_ELEMENTS 11 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_ADMIN 12 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_USER 13 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_BLOC 14 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_MAIN_FIELD 15 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_SEARCH 16 | + _AM_MODULEBUILDER_TABLES_FIELDS_MORE_REQUIRED 17 | + _AM_MODULEBUILDER_FORMEDIT 18 | + _AM_MODULEBUILDER_FORMDEL 19 | + _AM_MODULEBUILDER_FORMFIELDS 20 | + _AM_MODULEBUILDER_FORM_INFO_TABLE 21 | + _AM_MODULEBUILDER_FORM_INFO_TABLE_FIELD 22 | + _AM_MODULEBUILDER_CONST_OK_COMMENTS 23 | + _AM_MODULEBUILDER_CONST_NOTOK_COMMENTS 24 | + _AM_MODULEBUILDER_TABLES_COMMENTS 25 | modinfo.php 26 | //Menu 27 | + _MI_MODULEBUILDER_ADMIN_INDEX 28 | + _MI_MODULEBUILDER_ADMIN_MODULES 29 | + _MI_MODULEBUILDER_ADMIN_TABLES 30 | + _MI_MODULEBUILDER_ADMIN_CONST 31 | + _MI_MODULEBUILDER_ADMIN_ABOUT 32 | + _MI_MODULEBUILDER_ADMIN_PREFERENCES 33 | + _MI_MODULEBUILDER_ADMIN_UPDATE 34 | + _MI_MODULEBUILDER_DESC 35 | -------------------------------------------------------------------------------- /preloads/core.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | \defined('XOOPS_ROOT_PATH') || die('Restricted access.'); 18 | 19 | /** 20 | * Class ModulebuilderCorePreload 21 | */ 22 | class ModulebuilderCorePreload extends \XoopsPreloadItem 23 | { 24 | // to add PSR-4 autoloader 25 | /** 26 | * @param $args 27 | */ 28 | public static function eventCoreIncludeCommonEnd($args): void 29 | { 30 | require __DIR__ . '/autoloader.php'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /files/commonfiles/preloads/core.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | \defined('XOOPS_ROOT_PATH') || die('Restricted access.'); 18 | 19 | /** 20 | * Class ModulebuilderCorePreload 21 | */ 22 | class ModulebuilderCorePreload extends \XoopsPreloadItem 23 | { 24 | // to add PSR-4 autoloader 25 | /** 26 | * @param $args 27 | */ 28 | public static function eventCoreIncludeCommonEnd($args): void 29 | { 30 | require __DIR__ . '/autoloader.php'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /preloads/autoloader.php: -------------------------------------------------------------------------------- 1 | '; 25 | echo nl() . '' . nl(1) . '' . nl(2) . 'This is a title' . nl(1) . '' . nl(1) . '' . nl(2) . '
'; 26 | if ($show_table) { 27 | echo nl(3) . '' . nl(4) . '' . nl(5) . '' . nl(4) . '' . nl(3) . '
This is a cell in a table
'; 28 | } 29 | echo nl(2) . '
' . nl(2) . '

This is some text in a paragraph

' . nl(1) . '' . nl() . ''; 30 | ?> 31 | 32 | 33 | 34 | This is a title 35 | 36 | 37 |
38 | 39 | 40 | 41 | 42 |
This is a cell in a table
43 |
44 |

This is some text in a paragraph

45 | 46 | 47 | -------------------------------------------------------------------------------- /class/FieldkeyHandler.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | 27 | /** 28 | * Class FieldkeyHandler. 29 | */ 30 | class FieldkeyHandler extends \XoopsPersistableObjectHandler 31 | { 32 | /** 33 | * @param null|\XoopsDatabase|\XoopsMySQLDatabase $db 34 | */ 35 | public function __construct(\XoopsDatabase $db) 36 | { 37 | parent::__construct($db, 'modulebuilder_fieldkey', Fieldkey::class, 'fieldkey_id', 'fieldkey_name'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /class/FieldnullHandler.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | 27 | /** 28 | * Class FieldnullHandler. 29 | */ 30 | class FieldnullHandler extends \XoopsPersistableObjectHandler 31 | { 32 | /** 33 | * @param null|\XoopsDatabase|\XoopsMySQLDatabase $db 34 | */ 35 | public function __construct(\XoopsDatabase $db) 36 | { 37 | parent::__construct($db, 'modulebuilder_fieldnull', Fieldnull::class, 'fieldnull_id', 'fieldnull_name'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /class/FieldtypeHandler.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | 27 | /** 28 | * Class FieldtypeHandler. 29 | */ 30 | class FieldtypeHandler extends \XoopsPersistableObjectHandler 31 | { 32 | /** 33 | * @param null|\XoopsDatabase|\XoopsMySQLDatabase $db 34 | */ 35 | public function __construct(\XoopsDatabase $db) 36 | { 37 | parent::__construct($db, 'modulebuilder_fieldtype', Fieldtype::class, 'fieldtype_id', 'fieldtype_name'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /config/icons.php: -------------------------------------------------------------------------------- 1 | \mb_strtoupper($moduleDirName) . ' IconConfigurator', 10 | 'icons' => [ 11 | 'edit' => " . \_EDIT . ", 12 | 'delete' => "" . \_DELETE . "", 13 | 'clone' => "" . \_CLONE . "", 14 | 'preview' => "" . \_PREVIEW . "", 15 | 'print' => "" . \_CLONE . "", 16 | 'pdf' => "" . \_CLONE . "", 17 | 'add' => "" . \_ADD . "", 18 | '0' => "" . 0 . "", 19 | '1' => "" . 1 . "", 20 | ], 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /class/FieldattributesHandler.php: -------------------------------------------------------------------------------- 1 | - 25 | */ 26 | 27 | /** 28 | * Class FieldattributesHandler 29 | */ 30 | class FieldattributesHandler extends \XoopsPersistableObjectHandler 31 | { 32 | /** 33 | * @param null|\XoopsDatabase|\XoopsMySQLDatabase $db 34 | */ 35 | public function __construct(\XoopsDatabase $db) 36 | { 37 | parent::__construct($db, 'modulebuilder_fieldattributes', Fieldattributes::class, 'fieldattribute_id', 'fieldattribute_name'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /class/Html/FormLabel.php: -------------------------------------------------------------------------------- 1 | setCaption($caption); 35 | } 36 | 37 | /** 38 | * Prepare HTML for output. 39 | * 40 | * @return string 41 | */ 42 | public function render() 43 | { 44 | return $this->getCaption(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /class/Common/ModuleStats.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | trait ModuleStats 23 | { 24 | /** 25 | * @param \XoopsModules\Modulebuilder\Common\Configurator $configurator 26 | * @param array $moduleStats 27 | * @return array 28 | */ 29 | public static function getModuleStats($configurator, $moduleStats) 30 | { 31 | if (\count($configurator->moduleStats) > 0) { 32 | foreach (\array_keys($configurator->moduleStats) as $i) { 33 | $moduleStats[$i] = $configurator->moduleStats[$i]; 34 | } 35 | } 36 | 37 | return $moduleStats; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /files/commonfiles/class/Common/ModuleStats.php: -------------------------------------------------------------------------------- 1 | 21 | */ 22 | trait ModuleStats 23 | { 24 | /** 25 | * @param \XoopsModules\Modulebuilder\Common\Configurator $configurator 26 | * @param array $moduleStats 27 | * @return array 28 | */ 29 | public static function getModuleStats($configurator, $moduleStats) 30 | { 31 | if (\count($configurator->moduleStats) > 0) { 32 | foreach (\array_keys($configurator->moduleStats) as $i) { 33 | $moduleStats[$i] = $configurator->moduleStats[$i]; 34 | } 35 | } 36 | 37 | return $moduleStats; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /admin/logo.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | require __DIR__ . '/header.php'; 25 | $funct = \Xmf\Request::getString('funct', '', 'GET'); 26 | $iconName = \Xmf\Request::getString('iconName', '', 'GET'); 27 | $caption = \Xmf\Request::getString('caption', '', 'GET'); 28 | if (\function_exists($funct)) { 29 | $ret = Modulebuilder\Logo::getInstance()->createLogo($iconName, $caption); 30 | phpFunction($ret); 31 | } else { 32 | \redirect_header('logo.php', 3, 'Method Not Exist'); 33 | } 34 | // phpFunction 35 | /** 36 | * @param string $val 37 | */ 38 | function phpFunction($val = ''): void 39 | { 40 | // create php function here 41 | echo $val; 42 | } 43 | -------------------------------------------------------------------------------- /assets/js/sortable.js: -------------------------------------------------------------------------------- 1 | // Jquery function for order fields 2 | // When the page is loaded define the current order and items to reorder 3 | $(document).ready(function () { 4 | /* Call the container items to reorder tables */ 5 | $('.table-list').sortable({ 6 | accept: 'tables', 7 | opacity: 0.6, 8 | handle: '.move', 9 | cursor: 'move', 10 | connectWith: '.table-list', 11 | update: function (event, ui) { 12 | var list = $(this).sortable('serialize'); 13 | $.post('tables.php?op=order', list); 14 | }, 15 | receive: function (event, ui) { 16 | var list = $(this).sortable('serialize'); 17 | $.post('tables.php?op=order', list); 18 | } 19 | } 20 | ).disableSelection(); 21 | /* Call the container items to reorder fields */ 22 | $('.field-list').sortable({ 23 | accept: 'fields', 24 | opacity: 0.6, 25 | handle: '.move', 26 | cursor: 'move', 27 | connectWith: '.field-list', 28 | update: function (event, ui) { 29 | var list = $(this).sortable('serialize'); 30 | $.post('fields.php?op=order', list); 31 | }, 32 | receive: function (event, ui) { 33 | var list = $(this).sortable('serialize'); 34 | $.post('fields.php?op=order', list); 35 | } 36 | } 37 | ).disableSelection(); 38 | }); 39 | -------------------------------------------------------------------------------- /class/Form/FormRaw.php: -------------------------------------------------------------------------------- 1 | 24 | * @copyright 2012-2014 XOOPS Project (https://xoops.org) 25 | * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) 26 | * 27 | * @link https://xoops.org 28 | * @since 2.6.0 29 | */ 30 | class FormRaw extends \XoopsFormElement 31 | { 32 | /** 33 | * __construct. 34 | * 35 | * @param string $value value 36 | */ 37 | public function __construct($value = '') 38 | { 39 | $this->setValue($value); 40 | } 41 | 42 | /** 43 | * render. 44 | * 45 | * @return string rendered form element 46 | */ 47 | public function render() 48 | { 49 | return $this->getValue(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /language/english/directorychecker.php: -------------------------------------------------------------------------------- 1 | Available"); 16 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTAVAILABLE', "Not available"); 17 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTWRITABLE', " should have permission ( %d ), but it has ( %d )"); 18 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_CREATETHEDIR', 'Create it'); 19 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_SETMPERM', 'Set the permission'); 20 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRCREATED', 'The directory has been created'); 21 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRNOTCREATED', 'The directory cannot be created'); 22 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMSET', 'The permission has been set'); 23 | \define('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMNOTSET', 'The permission cannot be set'); 24 | -------------------------------------------------------------------------------- /language/english/filechecker.php: -------------------------------------------------------------------------------- 1 | Available"); 16 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTAVAILABLE', "Not available"); 17 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTWRITABLE', "Should have permission ( %d ), but it has ( %d )"); 18 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_COPYTHEFILE', 'Copy it'); 19 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_CREATETHEFILE', 'Create it'); 20 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_SETMPERM', 'Set the permission'); 21 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_FILECOPIED', 'The file has been copied'); 22 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_FILENOTCOPIED', 'The file cannot be copied'); 23 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_PERMSET', 'The permission has been set'); 24 | \define('CO_' . $moduleDirNameUpper . '_' . 'FC_PERMNOTSET', 'The permission cannot be set'); 25 | -------------------------------------------------------------------------------- /language/update language 1.0 to 1.1.txt: -------------------------------------------------------------------------------- 1 | admin.php 2 | 3 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_ELEMENTS","Form : Elements"); 4 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_ADMIN","Page : Display admin"); 5 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_USER","Page :Display user"); 6 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_BLOC","Block : Display"); 7 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_MAIN_FIELD","Table : Main Field"); 8 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_SEARCH","Search : Index"); 9 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_REQUIRED","Form : Required field"); 10 | 11 | define("_AM_MODULEBUILDER_FORMEDIT","Edit"); 12 | define("_AM_MODULEBUILDER_FORMDEL","Delete"); 13 | define("_AM_MODULEBUILDER_FORMFIELDS","Edit fields"); 14 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE","Information on the table"); 15 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); 16 | 17 | define("_AM_MODULEBUILDER_CONST_OK_COMMENTS","Creation files for the coms"); 18 | define("_AM_MODULEBUILDER_CONST_NOTOK_COMMENTS","Problems : Creation files for the coms"); 19 | 20 | define("_AM_MODULEBUILDER_TABLES_COMMENTS","Activer les commentaires pour cette table
Le module peut gerer pour l'instant les coms que sur une table
L'option commentaire sera desactivee si vous validez
"); 21 | 22 | modinfo.php 23 | 24 | //Menu 25 | define("_MI_MODULEBUILDER_ADMIN_INDEX","Index"); 26 | define("_MI_MODULEBUILDER_ADMIN_MODULES","Add a module"); 27 | define("_MI_MODULEBUILDER_ADMIN_TABLES","Add a table"); 28 | define("_MI_MODULEBUILDER_ADMIN_CONST","Build the module"); 29 | define("_MI_MODULEBUILDER_ADMIN_ABOUT","Short About"); 30 | define("_MI_MODULEBUILDER_ADMIN_PREFERENCES","Preferences"); 31 | define("_MI_MODULEBUILDER_ADMIN_UPDATE","Update"); 32 | 33 | define("_MI_MODULEBUILDER_DESC","Module create of module made by TDM"); 34 | -------------------------------------------------------------------------------- /class/Form/SimpleForm.php: -------------------------------------------------------------------------------- 1 | getTitle() ? '
' . $this->getTitle() . '
' : ''); 43 | $ret .= '
getExtra() . '>' . NWLINE; 44 | foreach ($this->getElements() as $ele) { 45 | if (!$ele->isHidden()) { 46 | $ret .= '
' . $ele->getCaption() . '' . $ele->render() . '
' . NWLINE; 47 | } else { 48 | $ret .= $ele->render(); 49 | } 50 | } 51 | $ret .= NWLINE . '
'; 52 | 53 | return $ret; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /class/Common/Configurator.php: -------------------------------------------------------------------------------- 1 | name = $config->name; 48 | $this->paths = $config->paths; 49 | $this->uploadFolders = $config->uploadFolders; 50 | $this->copyBlankFiles = $config->copyBlankFiles; 51 | $this->copyTestFolders = $config->copyTestFolders; 52 | $this->templateFolders = $config->templateFolders; 53 | $this->oldFiles = $config->oldFiles; 54 | $this->oldFolders = $config->oldFolders; 55 | $this->renameTables = $config->renameTables; 56 | $this->moduleStats = $config->moduleStats; 57 | $this->modCopyright = $config->modCopyright; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /files/commonfiles/class/Common/Configurator.php: -------------------------------------------------------------------------------- 1 | name = $config->name; 48 | $this->paths = $config->paths; 49 | $this->uploadFolders = $config->uploadFolders; 50 | $this->copyBlankFiles = $config->copyBlankFiles; 51 | $this->copyTestFolders = $config->copyTestFolders; 52 | $this->templateFolders = $config->templateFolders; 53 | $this->oldFiles = $config->oldFiles; 54 | $this->oldFolders = $config->oldFolders; 55 | $this->renameTables = $config->renameTables; 56 | $this->moduleStats = $config->moduleStats; 57 | $this->modCopyright = $config->modCopyright; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /testdata/english/modulebuilder_fieldtype.yml: -------------------------------------------------------------------------------- 1 | - 2 | fieldtype_id: '1' 3 | fieldtype_name: ... 4 | fieldtype_value: '' 5 | - 6 | fieldtype_id: '2' 7 | fieldtype_name: INT 8 | fieldtype_value: INT 9 | - 10 | fieldtype_id: '3' 11 | fieldtype_name: TINYINT 12 | fieldtype_value: TINYINT 13 | - 14 | fieldtype_id: '4' 15 | fieldtype_name: MEDIUMINT 16 | fieldtype_value: MEDIUMINT 17 | - 18 | fieldtype_id: '5' 19 | fieldtype_name: SMALLINT 20 | fieldtype_value: SMALLINT 21 | - 22 | fieldtype_id: '6' 23 | fieldtype_name: FLOAT 24 | fieldtype_value: FLOAT 25 | - 26 | fieldtype_id: '7' 27 | fieldtype_name: DOUBLE 28 | fieldtype_value: DOUBLE 29 | - 30 | fieldtype_id: '8' 31 | fieldtype_name: DECIMAL 32 | fieldtype_value: DECIMAL 33 | - 34 | fieldtype_id: '9' 35 | fieldtype_name: SET 36 | fieldtype_value: SET 37 | - 38 | fieldtype_id: '10' 39 | fieldtype_name: ENUM 40 | fieldtype_value: ENUM 41 | - 42 | fieldtype_id: '11' 43 | fieldtype_name: EMAIL 44 | fieldtype_value: EMAIL 45 | - 46 | fieldtype_id: '12' 47 | fieldtype_name: URL 48 | fieldtype_value: URL 49 | - 50 | fieldtype_id: '13' 51 | fieldtype_name: CHAR 52 | fieldtype_value: CHAR 53 | - 54 | fieldtype_id: '14' 55 | fieldtype_name: VARCHAR 56 | fieldtype_value: VARCHAR 57 | - 58 | fieldtype_id: '15' 59 | fieldtype_name: TEXT 60 | fieldtype_value: TEXT 61 | - 62 | fieldtype_id: '16' 63 | fieldtype_name: TINYTEXT 64 | fieldtype_value: TINYTEXT 65 | - 66 | fieldtype_id: '17' 67 | fieldtype_name: MEDIUMTEXT 68 | fieldtype_value: MEDIUMTEXT 69 | - 70 | fieldtype_id: '18' 71 | fieldtype_name: LONGTEXT 72 | fieldtype_value: LONGTEXT 73 | - 74 | fieldtype_id: '19' 75 | fieldtype_name: DATE 76 | fieldtype_value: DATE 77 | - 78 | fieldtype_id: '20' 79 | fieldtype_name: DATETIME 80 | fieldtype_value: DATETIME 81 | - 82 | fieldtype_id: '21' 83 | fieldtype_name: TIMESTAMP 84 | fieldtype_value: TIMESTAMP 85 | - 86 | fieldtype_id: '22' 87 | fieldtype_name: TIME 88 | fieldtype_value: TIME 89 | - 90 | fieldtype_id: '23' 91 | fieldtype_name: YEAR 92 | fieldtype_value: YEAR 93 | -------------------------------------------------------------------------------- /class/Fieldkey.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | 27 | /** 28 | * Class Fieldkey. 29 | */ 30 | class Fieldkey extends \XoopsObject 31 | { 32 | /** 33 | * @public function constructor class 34 | * @param null 35 | */ 36 | public function __construct() 37 | { 38 | $this->initVar('fieldkey_id', XOBJ_DTYPE_INT); 39 | $this->initVar('fieldkey_name', XOBJ_DTYPE_TXTBOX); 40 | $this->initVar('fieldkey_value', XOBJ_DTYPE_TXTBOX); 41 | } 42 | 43 | /** 44 | * @static function getInstance 45 | * @param null 46 | * @return Fieldkey 47 | */ 48 | public static function getInstance() 49 | { 50 | static $instance = false; 51 | if (!$instance) { 52 | $instance = new self(); 53 | } 54 | 55 | return $instance; 56 | } 57 | 58 | /** 59 | * Get Values. 60 | * @param null $keys 61 | * @param null $format 62 | * @param null $maxDepth 63 | * @return array 64 | */ 65 | public function getValuesFieldkey($keys = null, $format = null, $maxDepth = null) 66 | { 67 | $ret = $this->getValues($keys, $format, $maxDepth); 68 | // Values 69 | $ret['id'] = $this->getVar('fieldkey_id'); 70 | $ret['name'] = $this->getVar('fieldkey_name'); 71 | $ret['value'] = $this->getVar('fieldkey_value'); 72 | 73 | return $ret; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /class/Fieldnull.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | 27 | /** 28 | * Class Fieldnull. 29 | */ 30 | class Fieldnull extends \XoopsObject 31 | { 32 | /** 33 | * @public function constructor class 34 | * @param null 35 | */ 36 | public function __construct() 37 | { 38 | $this->initVar('fieldnull_id', XOBJ_DTYPE_INT); 39 | $this->initVar('fieldnull_name', XOBJ_DTYPE_TXTBOX); 40 | $this->initVar('fieldnull_value', XOBJ_DTYPE_TXTBOX); 41 | } 42 | 43 | /** 44 | * @static function getInstance 45 | * @param null 46 | * @return Fieldnull 47 | */ 48 | public static function getInstance() 49 | { 50 | static $instance = false; 51 | if (!$instance) { 52 | $instance = new self(); 53 | } 54 | 55 | return $instance; 56 | } 57 | 58 | /** 59 | * Get Values. 60 | * @param null $keys 61 | * @param null $format 62 | * @param null $maxDepth 63 | * @return array 64 | */ 65 | public function getValuesFieldnull($keys = null, $format = null, $maxDepth = null) 66 | { 67 | $ret = $this->getValues($keys, $format, $maxDepth); 68 | // Values 69 | $ret['id'] = $this->getVar('fieldnull_id'); 70 | $ret['name'] = $this->getVar('fieldnull_name'); 71 | $ret['value'] = $this->getVar('fieldnull_value'); 72 | 73 | return $ret; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /class/Fieldtype.php: -------------------------------------------------------------------------------- 1 | 25 | */ 26 | 27 | /** 28 | * Class Fieldtype. 29 | */ 30 | class Fieldtype extends \XoopsObject 31 | { 32 | /** 33 | * @public function constructor class 34 | * @param null 35 | */ 36 | public function __construct() 37 | { 38 | $this->initVar('fieldtype_id', XOBJ_DTYPE_INT); 39 | $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX); 40 | $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX); 41 | } 42 | 43 | /** 44 | * @static function getInstance 45 | * @param null 46 | * @return Fieldtype 47 | */ 48 | public static function getInstance() 49 | { 50 | static $instance = false; 51 | if (!$instance) { 52 | $instance = new self(); 53 | } 54 | 55 | return $instance; 56 | } 57 | 58 | /** 59 | * Get Values. 60 | * @param null $keys 61 | * @param null $format 62 | * @param null $maxDepth 63 | * @return array 64 | */ 65 | public function getValuesFieldtype($keys = null, $format = null, $maxDepth = null) 66 | { 67 | $ret = $this->getValues($keys, $format, $maxDepth); 68 | // Values 69 | $ret['id'] = $this->getVar('fieldtype_id'); 70 | $ret['name'] = $this->getVar('fieldtype_name'); 71 | $ret['value'] = $this->getVar('fieldtype_value'); 72 | 73 | return $ret; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /language/update language 1.1 to 1.15.txt: -------------------------------------------------------------------------------- 1 | admin.php 2 | 3 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_ELEMENTS","Form : Elements"); 4 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_ADMIN","Page : Display admin"); 5 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_USER","Page :Display user"); 6 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_BLOC","Block : Display"); 7 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_MAIN_FIELD","Table : Main Field"); 8 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_SEARCH","Search : Index"); 9 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_REQUIRED","Form : Required field"); 10 | 11 | define("_AM_MODULEBUILDER_FORMEDIT","Edit"); 12 | define("_AM_MODULEBUILDER_FORMDEL","Delete"); 13 | define("_AM_MODULEBUILDER_FORMFIELDS","Edit fields"); 14 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE","Information on the table"); 15 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); 16 | // 1.15 17 | define("_AM_MODULEBUILDER_MODULES_AUTHOR_MAIL", "Author Email"); 18 | define("_AM_MODULEBUILDER_MODULES_FORUM_SITE_URL","Category URL"); 19 | define("_AM_MODULEBUILDER_MODULES_FORUM_SITE_NAME","Category URL title"); 20 | 21 | define("_AM_MODULEBUILDER_CONST_OK_COMMENTS","Creation files for the coms"); 22 | define("_AM_MODULEBUILDER_CONST_NOTOK_COMMENTS","Problems : Creation files for the coms"); 23 | // 1.15 24 | define("_AM_MODULEBUILDER_CONST_OK_MAIN_LANGUAGE", "Creation of main.php file into language folder"); 25 | define("_AM_MODULEBUILDER_CONST_NOTOK_MAIN_LANGUAGE", "Problems: Creation of main.php file into language folder"); 26 | 27 | define("_AM_MODULEBUILDER_TABLES_COMMENTS","Activer les commentaires pour cette table
Le module peut gerer pour l'instant les coms que sur une table
L'option commentaire sera desactivee si vous validez
"); 28 | 29 | modinfo.php 30 | 31 | //Menu 32 | define("_MI_MODULEBUILDER_ADMIN_INDEX","Index"); 33 | define("_MI_MODULEBUILDER_ADMIN_MODULES","Add a module"); 34 | define("_MI_MODULEBUILDER_ADMIN_TABLES","Add a table"); 35 | define("_MI_MODULEBUILDER_ADMIN_CONST","Build the module"); 36 | define("_MI_MODULEBUILDER_ADMIN_ABOUT","Short About"); 37 | define("_MI_MODULEBUILDER_ADMIN_PREFERENCES","Preferences"); 38 | define("_MI_MODULEBUILDER_ADMIN_UPDATE","Update"); 39 | 40 | define("_MI_MODULEBUILDER_DESC","Module create of module made by TDM"); 41 | -------------------------------------------------------------------------------- /class/Files/Assets/Css/CssSelectors.php: -------------------------------------------------------------------------------- 1 | - 25 | */ 26 | 27 | /** 28 | * @Class Fieldattributes 29 | * @extends \XoopsObject 30 | */ 31 | 32 | /** 33 | * Class Fieldattributes. 34 | */ 35 | class Fieldattributes extends \XoopsObject 36 | { 37 | /** 38 | * @public function constructor class 39 | * @param null 40 | */ 41 | public function __construct() 42 | { 43 | $this->initVar('fieldattribute_id', XOBJ_DTYPE_INT); 44 | $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX); 45 | $this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX); 46 | } 47 | 48 | /** 49 | * @static function getInstance 50 | * @param null 51 | * @return Fieldattributes 52 | */ 53 | public static function getInstance() 54 | { 55 | static $instance = false; 56 | if (!$instance) { 57 | $instance = new self(); 58 | } 59 | 60 | return $instance; 61 | } 62 | 63 | /** 64 | * Get Values. 65 | * @param null $keys 66 | * @param null $format 67 | * @param null $maxDepth 68 | * @return array 69 | */ 70 | public function getValuesFieldattributes($keys = null, $format = null, $maxDepth = null) 71 | { 72 | $ret = $this->getValues($keys, $format, $maxDepth); 73 | // Values 74 | $ret['id'] = $this->getVar('fieldattribute_id'); 75 | $ret['name'] = $this->getVar('fieldattribute_name'); 76 | $ret['value'] = $this->getVar('fieldattribute_value'); 77 | 78 | return $ret; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /admin/header.php: -------------------------------------------------------------------------------- 1 | getVar('dirname'); 29 | // Link System Icons 30 | $sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16'); 31 | $sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32'); 32 | // Link Local Icons 33 | $modPathIcon16 = $GLOBALS['xoopsModule']->getInfo('modicons16'); 34 | $modPathIcon32 = $GLOBALS['xoopsModule']->getInfo('modicons32'); 35 | //$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); 36 | 37 | $helper = \XoopsModules\Modulebuilder\Helper::getInstance(); 38 | $utility = new \XoopsModules\Modulebuilder\Utility(); 39 | 40 | // MyTextSanitizer 41 | $myts = MyTextSanitizer::getInstance(); 42 | if (!isset($xoopsTpl) || !\is_object($xoopsTpl)) { 43 | require_once \XOOPS_ROOT_PATH . '/class/template.php'; 44 | $xoopsTpl = new \XoopsTpl(); 45 | } 46 | // System Icons 47 | $GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16); 48 | $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32); 49 | // Local Icons 50 | $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16); 51 | $GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32); 52 | 53 | // Load language files 54 | $helper->loadLanguage('admin'); 55 | $helper->loadLanguage('modinfo'); 56 | $helper->loadLanguage('common'); 57 | 58 | xoops_cp_header(); 59 | /** @var \Xmf\Module\Admin $adminObject */ 60 | $adminObject = \Xmf\Module\Admin::getInstance(); 61 | -------------------------------------------------------------------------------- /language/english/feedback.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | $moduleDirName = \basename(\dirname(__DIR__, 2)); 22 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); 23 | 24 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE', 'Send a feedback'); 25 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT', 'Recipient'); 26 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME', 'Name'); 27 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER', 'Please enter your name'); 28 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE', 'Website'); 29 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER', 'Please enter your website'); 30 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL', 'Email'); 31 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER', 'Please enter your email'); 32 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE', 'Type of feedback'); 33 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION', 'Suggestions'); 34 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS', 'Bugs'); 35 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL', 'Testimonials'); 36 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES', 'Features'); 37 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS', 'Misc'); 38 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT', 'Feedback content'); 39 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR', 'Feedback for module '); 40 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_SUCCESS', 'Feedback successfully sent'); 41 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_ERROR', 'An errror occured when feedback was sent!'); 42 | -------------------------------------------------------------------------------- /files/commonfiles/language/english/feedback.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | $moduleDirName = \basename(\dirname(__DIR__, 2)); 22 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); 23 | 24 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE', 'Send a feedback'); 25 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT', 'Recipient'); 26 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME', 'Name'); 27 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER', 'Please enter your name'); 28 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE', 'Website'); 29 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER', 'Please enter your website'); 30 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL', 'Email'); 31 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER', 'Please enter your email'); 32 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE', 'Type of feedback'); 33 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION', 'Suggestions'); 34 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS', 'Bugs'); 35 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL', 'Testimonials'); 36 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES', 'Features'); 37 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS', 'Misc'); 38 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT', 'Feedback content'); 39 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR', 'Feedback for module '); 40 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_SUCCESS', 'Feedback successfully sent'); 41 | \define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_ERROR', 'An errror occured when feedback was sent!'); 42 | -------------------------------------------------------------------------------- /class/Helper.php: -------------------------------------------------------------------------------- 1 | debug = $debug; 36 | $moduleDirName = \basename(\dirname(__DIR__)); 37 | parent::__construct($moduleDirName); 38 | } 39 | 40 | /** 41 | * @param bool $debug 42 | * 43 | * @return \XoopsModules\Modulebuilder\Helper 44 | */ 45 | public static function getInstance($debug = false) 46 | { 47 | static $instance; 48 | if (null === $instance) { 49 | $instance = new static($debug); 50 | } 51 | 52 | return $instance; 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getDirname() 59 | { 60 | return $this->dirname; 61 | } 62 | 63 | /** 64 | * Get an Object Handler 65 | * 66 | * @param string $name name of handler to load 67 | * 68 | * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler 69 | */ 70 | public function getHandler($name) 71 | { 72 | $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; 73 | if (!\class_exists($class)) { 74 | throw new \RuntimeException("Class '$class' not found"); 75 | } 76 | /** @var \XoopsMySQLDatabase $db */ 77 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); 78 | $helper = self::getInstance(); 79 | $ret = new $class($db, $helper); 80 | $this->addLog("Getting Handler '{$name}'"); 81 | 82 | return $ret; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /class/Common/Breadcrumb.php: -------------------------------------------------------------------------------- 1 | 21 | * @package Modulebuilder 22 | * 23 | * Example: 24 | * $breadcrumb = new Common\Breadcrumb(); 25 | * $breadcrumb->addLink( 'bread 1', 'index1.php' ); 26 | * $breadcrumb->addLink( 'bread 2', '' ); 27 | * $breadcrumb->addLink( 'bread 3', 'index3.php' ); 28 | * echo $breadcrumb->render(); 29 | */ 30 | 31 | use XoopsModules\Modulebuilder; 32 | use XoopsModules\Modulebuilder\Common; 33 | 34 | \defined('XOOPS_ROOT_PATH') || exit('XOOPS Root Path not defined'); 35 | 36 | /** 37 | * Class Breadcrumb 38 | */ 39 | class Breadcrumb 40 | { 41 | public string $dirname; 42 | private array $bread = []; 43 | 44 | public function __construct() 45 | { 46 | $this->dirname = \basename(\dirname(__DIR__, 2)); 47 | } 48 | 49 | /** 50 | * Add link to breadcrumb 51 | * 52 | * @param string $title 53 | * @param string $link 54 | */ 55 | public function addLink($title = '', $link = ''): void 56 | { 57 | $this->bread[] = [ 58 | 'link' => $link, 59 | 'title' => $title, 60 | ]; 61 | } 62 | 63 | /** 64 | * Render BreadCrumb 65 | */ 66 | public function render() 67 | { 68 | if (!isset($GLOBALS['xoTheme']) || !\is_object($GLOBALS['xoTheme'])) { 69 | require $GLOBALS['xoops']->path('class/theme.php'); 70 | $GLOBALS['xoTheme'] = new \xos_opal_Theme(); 71 | } 72 | 73 | require $GLOBALS['xoops']->path('class/template.php'); 74 | $breadcrumbTpl = new \XoopsTpl(); 75 | $breadcrumbTpl->assign('breadcrumb', $this->bread); 76 | $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); 77 | unset($breadcrumbTpl); 78 | 79 | return $html; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /files/commonfiles/class/Helper.php: -------------------------------------------------------------------------------- 1 | debug = $debug; 36 | $moduleDirName = \basename(\dirname(__DIR__)); 37 | parent::__construct($moduleDirName); 38 | } 39 | 40 | /** 41 | * @param bool $debug 42 | * 43 | * @return \XoopsModules\Modulebuilder\Helper 44 | */ 45 | public static function getInstance($debug = false) 46 | { 47 | static $instance; 48 | if (null === $instance) { 49 | $instance = new static($debug); 50 | } 51 | 52 | return $instance; 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getDirname() 59 | { 60 | return $this->dirname; 61 | } 62 | 63 | /** 64 | * Get an Object Handler 65 | * 66 | * @param string $name name of handler to load 67 | * 68 | * @return bool|\XoopsObjectHandler|\XoopsPersistableObjectHandler 69 | */ 70 | public function getHandler($name) 71 | { 72 | $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; 73 | if (!\class_exists($class)) { 74 | throw new \RuntimeException("Class '$class' not found"); 75 | } 76 | /** @var \XoopsMySQLDatabase $db */ 77 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); 78 | $helper = self::getInstance(); 79 | $ret = new $class($db, $helper); 80 | $this->addLog("Getting handler '{$name}'"); 81 | 82 | return $ret; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /files/commonfiles/class/Common/Breadcrumb.php: -------------------------------------------------------------------------------- 1 | 21 | * @package Modulebuilder 22 | * 23 | * Example: 24 | * $breadcrumb = new Common\Breadcrumb(); 25 | * $breadcrumb->addLink( 'bread 1', 'index1.php' ); 26 | * $breadcrumb->addLink( 'bread 2', '' ); 27 | * $breadcrumb->addLink( 'bread 3', 'index3.php' ); 28 | * echo $breadcrumb->render(); 29 | */ 30 | 31 | use XoopsModules\Modulebuilder; 32 | use XoopsModules\Modulebuilder\Common; 33 | 34 | \defined('XOOPS_ROOT_PATH') || exit('XOOPS Root Path not defined'); 35 | 36 | /** 37 | * Class Breadcrumb 38 | */ 39 | class Breadcrumb 40 | { 41 | public string $dirname; 42 | private array $bread = []; 43 | 44 | public function __construct() 45 | { 46 | $this->dirname = \basename(\dirname(__DIR__, 2)); 47 | } 48 | 49 | /** 50 | * Add link to breadcrumb 51 | * 52 | * @param string $title 53 | * @param string $link 54 | */ 55 | public function addLink($title = '', $link = ''): void 56 | { 57 | $this->bread[] = [ 58 | 'link' => $link, 59 | 'title' => $title, 60 | ]; 61 | } 62 | 63 | /** 64 | * Render BreadCrumb 65 | */ 66 | public function render() 67 | { 68 | if (!isset($GLOBALS['xoTheme']) || !\is_object($GLOBALS['xoTheme'])) { 69 | require $GLOBALS['xoops']->path('class/theme.php'); 70 | $GLOBALS['xoTheme'] = new \xos_opal_Theme(); 71 | } 72 | 73 | require $GLOBALS['xoops']->path('class/template.php'); 74 | $breadcrumbTpl = new \XoopsTpl(); 75 | $breadcrumbTpl->assign('breadcrumb', $this->bread); 76 | $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); 77 | unset($breadcrumbTpl); 78 | 79 | return $html; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /class/Files/Assets/Css/Admin/CssAdminStyles.php: -------------------------------------------------------------------------------- 1 | setModule($module); 65 | $this->setFileName($filename); 66 | } 67 | 68 | /** 69 | * @public function render 70 | * @param null 71 | * @return bool|string 72 | */ 73 | public function render() 74 | { 75 | $module = $this->getModule(); 76 | $filename = $this->getFileName(); 77 | $moduleDirname = $module->getVar('mod_dirname'); 78 | $content = $this->getHeaderFilesComments($module, '@charset "UTF-8";'); 79 | $content .= <<<'EOT' 80 | img { 81 | max-width: 200px; 82 | } 83 | EOT; 84 | $this->create($moduleDirname, 'assets/css/admin', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 85 | 86 | return $this->renderFile(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /class/Form/ThemeForm.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | defined('XOOPS_ROOT_PATH') || die('Restricted access'); 25 | 26 | \XoopsLoad::load('XoopsFormLoader'); 27 | 28 | /** 29 | * Form that will output as a theme-enabled HTML table. 30 | * 31 | * Also adds JavaScript to validate required fields 32 | */ 33 | class ThemeForm extends \XoopsForm 34 | { 35 | /** 36 | * create HTML to output the form as a theme-enabled table with validation. 37 | * 38 | * YOU SHOULD AVOID TO USE THE FOLLOWING Nocolspan METHOD, IT WILL BE REMOVED 39 | * 40 | * To use the noColspan simply use the following example: 41 | * 42 | * $colspan = new \XoopsFormDhtmlTextArea( '', 'key', $value, '100%', '100%' ); 43 | * $colspan->setNocolspan(); 44 | * $form->addElement( $colspan ); 45 | * 46 | * @return string 47 | */ 48 | public function render() 49 | { 50 | $ele_name = $this->getName(); 51 | //$ret = ($this->getTitle() ? '
' . $this->getTitle() . '
' : ''); 52 | $ret = NWLINE . '
getExtra() . '>' . NWLINE; 53 | $hidden = ''; 54 | $class = 'even'; 55 | foreach ($this->getElements() as $ele) { 56 | if (!is_object($ele)) { 57 | $ret .= $ele; 58 | } else { 59 | if (!$ele->isHidden()) { 60 | $ret .= $ele->render(); 61 | } else { 62 | $hidden .= $ele->render(); 63 | } 64 | } 65 | } 66 | $ret .= NWLINE . ' ' . $hidden . NWLINE . '
'; 67 | $ret .= $this->renderValidationJS(true); 68 | 69 | return $ret; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /files/commonfiles/include/uninstall.php: -------------------------------------------------------------------------------- 1 | loadLanguage('admin'); 41 | 42 | //------------------------------------------------------------------ 43 | // Rename uploads folder to BAK and add date to name 44 | //------------------------------------------------------------------ 45 | $uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName"); 46 | $dirInfo = new \SplFileInfo($uploadDirectory); 47 | if ($dirInfo->isDir()) { 48 | // The directory exists so rename it 49 | $date = date('Y-m-d'); 50 | if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) { 51 | $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $uploadDirectory)); 52 | $success = false; 53 | } 54 | } 55 | unset($dirInfo); 56 | /* 57 | //------------ START ---------------- 58 | //------------------------------------------------------------------ 59 | // Remove xsitemap.xml from XOOPS root folder if it exists 60 | //------------------------------------------------------------------ 61 | $xmlfile = $GLOBALS['xoops']->path('xsitemap.xml'); 62 | if (is_file($xmlfile)) { 63 | if (false === ($delOk = \unlink($xmlfile))) { 64 | $module->setErrors(\sprintf(\_AM_MODULEBUILDER_ERROR_BAD_REMOVE, $xmlfile)); 65 | } 66 | } 67 | // return $success && $delOk; // use this if you're using this routine 68 | */ 69 | 70 | return $success; 71 | //------------ END ---------------- 72 | } 73 | -------------------------------------------------------------------------------- /testdata/english/modulebuilder_modules.yml: -------------------------------------------------------------------------------- 1 | - 2 | mod_id: '1' 3 | mod_name: 'My Module' 4 | mod_dirname: mymodule 5 | mod_version: 1.0.0 6 | mod_since: 1.0.0 7 | mod_min_php: '7.3' 8 | mod_min_xoops: '2.5.11 Beta1' 9 | mod_min_admin: '1.2' 10 | mod_min_mysql: '5.6' 11 | mod_description: 'This module is for doing following...' 12 | mod_author: 'TDM XOOPS' 13 | mod_author_mail: info@email.com 14 | mod_author_website_url: 'https://xoops.org' 15 | mod_author_website_name: 'XOOPS Project' 16 | mod_credits: 'XOOPS Development Team' 17 | mod_license: 'GPL 2.0 or later' 18 | mod_release_info: release_info 19 | mod_release_file: 'release_info file' 20 | mod_manual: 'link to manual file' 21 | mod_manual_file: install.txt 22 | mod_image: MyModule_logo.png 23 | mod_demo_site_url: 'https://xoops.org' 24 | mod_demo_site_name: 'XOOPS Demo Site' 25 | mod_support_url: 'https://xoops.org/modules/newbb' 26 | mod_support_name: 'Support Forum' 27 | mod_website_url: www.xoops.org 28 | mod_website_name: 'XOOPS Project' 29 | mod_release: '2017-12-02' 30 | mod_status: 'Beta 1' 31 | mod_admin: '1' 32 | mod_user: '1' 33 | mod_blocks: '1' 34 | mod_search: '1' 35 | mod_comments: '1' 36 | mod_notifications: '1' 37 | mod_permissions: '1' 38 | mod_inroot_copy: '1' 39 | mod_donations: 6KJ7RW5DR3VTJ 40 | mod_subversion: '13070' 41 | - 42 | mod_id: '2' 43 | mod_name: 'My Module dirty' 44 | mod_dirname: mymoduledirty 45 | mod_version: '1.0' 46 | mod_since: '1.0' 47 | mod_min_php: '7.3' 48 | mod_min_xoops: 2.5.11 49 | mod_min_admin: '1.2' 50 | mod_min_mysql: '5.6' 51 | mod_description: 'This module is for doing following...' 52 | mod_author: 'TDM XOOPS' 53 | mod_author_mail: info@email.com 54 | mod_author_website_url: 'https://xoops.org' 55 | mod_author_website_name: 'XOOPS Project' 56 | mod_credits: 'XOOPS Development Team' 57 | mod_license: 'GPL 2.0 or later' 58 | mod_release_info: release_info 59 | mod_release_file: 'release_info file' 60 | mod_manual: 'link to manual file' 61 | mod_manual_file: install.txt 62 | mod_image: MyModule_logo.png 63 | mod_demo_site_url: 'https://xoops.org' 64 | mod_demo_site_name: 'XOOPS Demo Site' 65 | mod_support_url: 'https://xoops.org/modules/newbb' 66 | mod_support_name: 'Support Forum' 67 | mod_website_url: www.xoops.org 68 | mod_website_name: 'XOOPS Project' 69 | mod_release: '2017-12-02' 70 | mod_status: 'Beta 1' 71 | mod_admin: '1' 72 | mod_user: '1' 73 | mod_blocks: '1' 74 | mod_search: '1' 75 | mod_comments: '1' 76 | mod_notifications: '1' 77 | mod_permissions: '1' 78 | mod_inroot_copy: '1' 79 | mod_donations: 6KJ7RW5DR3VTJ 80 | mod_subversion: '13070' 81 | -------------------------------------------------------------------------------- /class/Files/Docs/DocsChangelog.php: -------------------------------------------------------------------------------- 1 | setModule($module); 66 | $this->setFileName($filename); 67 | } 68 | 69 | /** 70 | * @public function render 71 | * @param null 72 | * @return bool|string 73 | */ 74 | public function render() 75 | { 76 | $module = $this->getModule(); 77 | $filename = $this->getFileName(); 78 | $moduleDirname = $module->getVar('mod_dirname'); 79 | $date = date('Y/m/d G:i:s'); 80 | $content = <<getVar('mod_version')} [{$date}] 83 | ============================================================== 84 | - Original release {$moduleDirname} ({$module->getVar('mod_author')}) 85 | EOT; 86 | $this->create($moduleDirname, 'docs', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 87 | 88 | return $this->renderFile(); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /class/Form/FormTab.php: -------------------------------------------------------------------------------- 1 | 20 | * @copyright 2012-2014 XOOPS Project (https://xoops.org) 21 | * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) 22 | * 23 | * @link https://xoops.org 24 | * @since 2.0.0 25 | */ 26 | \XoopsLoad::load('XoopsFormElementTray'); 27 | 28 | /** 29 | * Class Modulebuilder\FormTab. 30 | */ 31 | class FormTab extends \XoopsFormElementTray 32 | { 33 | /** 34 | * __construct. 35 | * 36 | * @param string $caption tab caption 37 | * @param string $name unique identifier for this tab 38 | */ 39 | public function __construct($caption, $name) 40 | { 41 | $this->setName($name); 42 | $this->setCaption($caption); 43 | } 44 | 45 | /** 46 | * render. 47 | * 48 | * @return string 49 | */ 50 | public function render() 51 | { 52 | $ret = ''; 53 | /** @var \XoopsFormElement $ele */ 54 | foreach ($this->getElements() as $ele) { 55 | $ret .= NWLINE; 56 | $ret .= '' . NWLINE; 57 | $ret .= '' . NWLINE; 58 | $required = $ele->isRequired() ? '-required' : ''; 59 | $ret .= '
' . NWLINE; 60 | $ret .= '' . $ele->getCaption() . '' . NWLINE; 61 | $ret .= '*' . NWLINE; 62 | $ret .= '
' . NWLINE; 63 | $description = $ele->getDescription(); 64 | if ($description) { 65 | $ret .= '
' . NWLINE; 66 | $ret .= $description . NWLINE; 67 | $ret .= '
' . NWLINE; 68 | } 69 | $ret .= '' . NWLINE; 70 | $ret .= '' . NWLINE; 71 | $ret .= $ele->render() . NWLINE; 72 | $ret .= '' . $ele->getDescription() . ''; 73 | $ret .= '' . NWLINE; 74 | $ret .= '' . NWLINE; 75 | } 76 | 77 | return $ret; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /templates/admin/modulebuilder_morefiles.tpl: -------------------------------------------------------------------------------- 1 | 2 | <{include file="db:modulebuilder_header.tpl"}> 3 | 4 | <{if $files_list|default:''}> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <{foreach item=file from=$files_list key=file_id}> 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | <{/foreach}> 35 |
<{$smarty.const._AM_MODULEBUILDER_FILE_ID}><{$smarty.const._AM_MODULEBUILDER_FILE_MID_LIST}><{$smarty.const._AM_MODULEBUILDER_FILE_TYPE_LIST}><{$smarty.const._AM_MODULEBUILDER_FILE_INFOLDER_LIST}><{$smarty.const._AM_MODULEBUILDER_FILE_NAME_LIST}><{$smarty.const._AM_MODULEBUILDER_FILE_EXTENSION_LIST}><{$smarty.const._AM_MODULEBUILDER_FILE_UPLOAD_LIST}><{$smarty.const._AM_MODULEBUILDER_FORM_ACTION}>
<{$file.id}><{$file.mid}><{$file.type}><{$file.infolder}><{$file.name}><{$file.extension}><{$file.upload}> 26 | 27 | <{$smarty.const._EDIT}> 28 | 29 | 30 | <{$smarty.const._DELETE}> 31 | 32 |
36 |
37 |
38 | 39 |
 
40 | <{if $pagenav|default:''}> 41 |
<{$pagenav}>
42 |
43 | <{/if}> 44 | <{else}> 45 | 46 | <{if $form|default:''}> 47 |
<{$form}>
48 | <{/if}> 49 | <{/if}> 50 | <{if $error|default:''}> 51 |
52 | <{$error}> 53 |
54 | <{/if}> 55 | 56 | <{include file="db:modulebuilder_footer.tpl"}> 57 | -------------------------------------------------------------------------------- /language/update language 1.1 to 1.37.txt: -------------------------------------------------------------------------------- 1 | admin.php 2 | 3 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_ELEMENTS","Form : Elements"); 4 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_ADMIN","Page : Display admin"); 5 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_USER","Page :Display user"); 6 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_BLOC","Block : Display"); 7 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_MAIN_FIELD","Table : Main Field"); 8 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_SEARCH","Search : Index"); 9 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_REQUIRED","Form : Required field"); 10 | 11 | define("_AM_MODULEBUILDER_FORMEDIT","Edit"); 12 | define("_AM_MODULEBUILDER_FORMDEL","Delete"); 13 | define("_AM_MODULEBUILDER_FORMFIELDS","Edit fields"); 14 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE","Information on the table"); 15 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); 16 | // 1.15 17 | define("_AM_MODULEBUILDER_MODULES_AUTHOR_MAIL", "Author Email"); 18 | define("_AM_MODULEBUILDER_MODULES_FORUM_SITE_URL","Category URL"); 19 | define("_AM_MODULEBUILDER_MODULES_FORUM_SITE_NAME","Category URL title"); 20 | 21 | define("_AM_MODULEBUILDER_CONST_OK_COMMENTS","Creation files for the coms"); 22 | define("_AM_MODULEBUILDER_CONST_NOTOK_COMMENTS","Problems : Creation files for the coms"); 23 | // 1.15 24 | define("_AM_MODULEBUILDER_CONST_OK_MAIN_LANGUAGE", "Creation of main.php file into language folder"); 25 | define("_AM_MODULEBUILDER_CONST_NOTOK_MAIN_LANGUAGE", "Problemes: Creation of main.php file into language folder"); 26 | 27 | define("_AM_MODULEBUILDER_TABLES_COMMENTS","Activer les commentaires pour cette table
Le module peut gerer pour l'instant les coms que sur une table
L'option commentaire sera desactivee si vous validez
"); 28 | 29 | // 1.37 30 | define("_AM_MODULEBUILDER_MODULES_LIST", "Modules List"); 31 | define("_AM_MODULEBUILDER_MODULE_NEW", "New Module"); 32 | 33 | define("_AM_MODULEBUILDER_MODULES_ACTIVE_COMMENTS", "Enable comments"); 34 | 35 | modinfo.php 36 | 37 | //Menu 38 | define("_MI_MODULEBUILDER_ADMIN_INDEX","Index"); 39 | define("_MI_MODULEBUILDER_ADMIN_MODULES","Add a module"); 40 | define("_MI_MODULEBUILDER_ADMIN_TABLES","Add a table"); 41 | define("_MI_MODULEBUILDER_ADMIN_CONST","Build the module"); 42 | define("_MI_MODULEBUILDER_ADMIN_ABOUT","Short About"); 43 | define("_MI_MODULEBUILDER_ADMIN_PREFERENCES","Preferences"); 44 | define("_MI_MODULEBUILDER_ADMIN_UPDATE","Update"); 45 | 46 | define("_MI_MODULEBUILDER_DESC","Module create of module made by TDM"); 47 | 48 | define("_MI_MODULEBUILDER_EDITOR", "Editor"); 49 | define("_MI_MODULEBUILDER_EDITORDSC", "Select an editor to write"); 50 | define("_MI_MODULEBUILDER_IDPAYPAL", "Paypal ID"); 51 | define("_MI_MODULEBUILDER_IDPAYPAL_DESC", "ID Paypal for donations."); 52 | -------------------------------------------------------------------------------- /testdata/english/modulebuilder_settings.yml: -------------------------------------------------------------------------------- 1 | - 2 | set_id: '1' 3 | set_name: 'My setting for project 1' 4 | set_dirname: mysetting1 5 | set_version: '1.0' 6 | set_since: '1.0' 7 | set_min_php: '7.0' 8 | set_min_xoops: 2.5.9 9 | set_min_admin: '1.2' 10 | set_min_mysql: '5.6' 11 | set_description: 'This module is for doing following...' 12 | set_author: 'TDM XOOPS' 13 | set_author_mail: info@email.com 14 | set_author_website_url: 'http://xoops.org' 15 | set_author_website_name: 'XOOPS Project' 16 | set_credits: 'XOOPS Development Team' 17 | set_license: 'GPL 2.0 or later' 18 | set_release_info: release_info 19 | set_release_file: 'release_info file' 20 | set_manual: 'link to manual file' 21 | set_manual_file: install.txt 22 | set_image: empty.png 23 | set_demo_site_url: 'https://xoops.org' 24 | set_demo_site_name: 'XOOPS Demo Site' 25 | set_support_url: 'https://xoops.org/modules/newbb' 26 | set_support_name: 'Support Forum' 27 | set_website_url: www.xoops.org 28 | set_website_name: 'XOOPS Project' 29 | set_release: 05/25/2020 30 | set_status: 'Beta 1' 31 | set_admin: '1' 32 | set_user: '1' 33 | set_blocks: '1' 34 | set_search: '0' 35 | set_comments: '0' 36 | set_notifications: '0' 37 | set_permissions: '0' 38 | set_inroot_copy: '0' 39 | set_donations: 6KJ7RW5DR3VTJ 40 | set_subversion: '13070' 41 | set_type: '1' 42 | - 43 | set_id: '2' 44 | set_name: 'My setting for project 2' 45 | set_dirname: mysetting2 46 | set_version: '1.0' 47 | set_since: '1.0' 48 | set_min_php: '5.5' 49 | set_min_xoops: 2.5.9 50 | set_min_admin: '1.2' 51 | set_min_mysql: '5.5' 52 | set_description: 'This module is for doing following...' 53 | set_author: 'XOOPS Development Team' 54 | set_author_mail: name@site.com 55 | set_author_website_url: 'https://xoops.org' 56 | set_author_website_name: 'XOOPS Project' 57 | set_credits: 'XOOPS Development Team' 58 | set_license: 'GPL 2.0 or later' 59 | set_release_info: release_info 60 | set_release_file: 'release_info file' 61 | set_manual: 'link to manual file' 62 | set_manual_file: install.txt 63 | set_image: empty.png 64 | set_demo_site_url: 'https://xoops.org' 65 | set_demo_site_name: 'XOOPS Demo Site' 66 | set_support_url: 'https://xoops.org/modules/newbb' 67 | set_support_name: 'Support Forum' 68 | set_website_url: www.xoops.org 69 | set_website_name: 'XOOPS Project' 70 | set_release: 05/25/2020 71 | set_status: 'Beta 1' 72 | set_admin: '1' 73 | set_user: '1' 74 | set_blocks: '1' 75 | set_search: '0' 76 | set_comments: '0' 77 | set_notifications: '0' 78 | set_permissions: '0' 79 | set_inroot_copy: '0' 80 | set_donations: 6KJ7RW5DR3VTJ 81 | set_subversion: '13040' 82 | set_type: '0' 83 | -------------------------------------------------------------------------------- /class/Files/User/UserNotificationUpdate.php: -------------------------------------------------------------------------------- 1 | pc = Modulebuilder\Files\CreatePhpCode::getInstance(); 47 | } 48 | 49 | /** 50 | * @static function getInstance 51 | * @param null 52 | * @return UserNotificationUpdate 53 | */ 54 | public static function getInstance() 55 | { 56 | static $instance = false; 57 | if (!$instance) { 58 | $instance = new self(); 59 | } 60 | 61 | return $instance; 62 | } 63 | 64 | /** 65 | * @public function write 66 | * @param string $module 67 | * @param string $filename 68 | */ 69 | public function write($module, $filename): void 70 | { 71 | $this->setModule($module); 72 | $this->setFileName($filename); 73 | } 74 | 75 | /** 76 | * @public function render 77 | * @param null 78 | * @return bool|string 79 | */ 80 | public function render() 81 | { 82 | $module = $this->getModule(); 83 | $filename = $this->getFileName(); 84 | $moduleDirname = $module->getVar('mod_dirname'); 85 | $content = $this->getHeaderFilesComments($module); 86 | $content .= $this->pc->getPhpCodeIncludeDir('\dirname(__DIR__, 2)', 'mainfile'); 87 | $content .= $this->pc->getPhpCodeIncludeDir('\XOOPS_ROOT_PATH', 'include/notification_update'); 88 | 89 | $this->create($moduleDirname, '/', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 90 | 91 | return $this->renderFile(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /class/Constants.php: -------------------------------------------------------------------------------- 1 | - Website: 23 | */ 24 | 25 | /** 26 | * Interface Constants 27 | */ 28 | interface Constants 29 | { 30 | // Constants for morefiles 31 | public const MORE_FILES_TYPE_EMPTY = 1; 32 | public const MORE_FILES_TYPE_COPY = 2; 33 | 34 | // ------------------- Field elements --------------------------------- 35 | // --------- The values MUST BE IDENTICAL to fieldelement_id ---------- 36 | public const FIELD_ELE_TEXT = 2; 37 | public const FIELD_ELE_TEXTAREA = 3; 38 | public const FIELD_ELE_DHTMLTEXTAREA = 4; 39 | public const FIELD_ELE_CHECKBOX = 5; 40 | public const FIELD_ELE_RADIOYN = 6; 41 | public const FIELD_ELE_SELECTBOX = 7; 42 | public const FIELD_ELE_SELECTUSER = 8; 43 | public const FIELD_ELE_COLORPICKER = 9; 44 | public const FIELD_ELE_IMAGELIST = 10; 45 | public const FIELD_ELE_SELECTFILE = 11; 46 | public const FIELD_ELE_URLFILE = 12; 47 | public const FIELD_ELE_UPLOADIMAGE = 13; 48 | public const FIELD_ELE_UPLOADFILE = 14; 49 | public const FIELD_ELE_TEXTDATESELECT = 15; 50 | public const FIELD_ELE_SELECTSTATUS = 16; 51 | public const FIELD_ELE_PASSWORD = 17; 52 | public const FIELD_ELE_SELECTCOUNTRY = 18; 53 | public const FIELD_ELE_SELECTLANG = 19; 54 | public const FIELD_ELE_RADIO = 20; 55 | public const FIELD_ELE_DATETIME = 21; 56 | public const FIELD_ELE_SELECTCOMBO = 22; 57 | public const FIELD_ELE_TEXTUUID = 23; 58 | public const FIELD_ELE_TEXTIP = 24; 59 | public const FIELD_ELE_TEXTCOMMENTS = 25; 60 | public const FIELD_ELE_TEXTRATINGS = 26; 61 | public const FIELD_ELE_TEXTVOTES = 27; 62 | public const FIELD_ELE_TEXTREADS = 28; 63 | public const FIELD_ELE_TEXTINTEGER = 29; 64 | public const FIELD_ELE_TEXTFLOAT = 30; 65 | public const FIELD_ELE_RADIO_ONOFFLINE = 31; 66 | // FIRST_FIELDELEMENT_TABLE must be +1 higher than the highest FIELD_ELE... constant 67 | public const FIRST_FIELDELEMENT_TABLE = 32; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /language/update language 1.15 to 1.37.txt: -------------------------------------------------------------------------------- 1 | admin.php 2 | 3 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_ELEMENTS","Form : Elements"); 4 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_ADMIN","Page : Display admin"); 5 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_DISPLAY_USER","Page :Display user"); 6 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_BLOC","Block : Display"); 7 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_MAIN_FIELD","Table : Main Field"); 8 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_SEARCH","Search : Index"); 9 | define("_AM_MODULEBUILDER_TABLES_FIELDS_MORE_REQUIRED","Form : Required field"); 10 | 11 | define("_AM_MODULEBUILDER_FORMEDIT","Edit"); 12 | define("_AM_MODULEBUILDER_FORMDEL","Delete"); 13 | define("_AM_MODULEBUILDER_FORMFIELDS","Edit fields"); 14 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE","Information on the table"); 15 | define("_AM_MODULEBUILDER_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); 16 | // 1.15 17 | define("_AM_MODULEBUILDER_MODULES_AUTHOR_MAIL", "Author Email"); 18 | define("_AM_MODULEBUILDER_MODULES_FORUM_SITE_URL","Category URL"); 19 | define("_AM_MODULEBUILDER_MODULES_FORUM_SITE_NAME","Category URL title"); 20 | 21 | define("_AM_MODULEBUILDER_CONST_OK_COMMENTS","Creation files for the coms"); 22 | define("_AM_MODULEBUILDER_CONST_NOTOK_COMMENTS","Problems : Creation files for the coms"); 23 | // 1.15 24 | define("_AM_MODULEBUILDER_CONST_OK_MAIN_LANGUAGE", "Creation of main.php file into language folder"); 25 | define("_AM_MODULEBUILDER_CONST_NOTOK_MAIN_LANGUAGE", "Problemes: Creation of main.php file into language folder"); 26 | 27 | define("_AM_MODULEBUILDER_TABLES_COMMENTS","Activer les commentaires pour cette table
Le module peut gerer pour l'instant les coms que sur une table
L'option commentaire sera desactivee si vous validez
"); 28 | 29 | // 1.37 30 | define("_AM_MODULEBUILDER_MODULES_LIST", "Modules List"); 31 | define("_AM_MODULEBUILDER_MODULE_NEW", "New Module"); 32 | 33 | define("_AM_MODULEBUILDER_TABLES_SUBMITTER", "Add submitter"); 34 | define("_AM_MODULEBUILDER_TABLES_DATE_CREATED", "Add date created"); 35 | define("_AM_MODULEBUILDER_TABLES_ONLINE", "Add online"); 36 | 37 | modinfo.php 38 | 39 | //Menu 40 | define("_MI_MODULEBUILDER_ADMIN_INDEX","Index"); 41 | define("_MI_MODULEBUILDER_ADMIN_MODULES","Add a module"); 42 | define("_MI_MODULEBUILDER_ADMIN_TABLES","Add a table"); 43 | define("_MI_MODULEBUILDER_ADMIN_CONST","Build the module"); 44 | define("_MI_MODULEBUILDER_ADMIN_ABOUT","Short About"); 45 | define("_MI_MODULEBUILDER_ADMIN_PREFERENCES","Preferences"); 46 | define("_MI_MODULEBUILDER_ADMIN_UPDATE","Update"); 47 | 48 | define("_MI_MODULEBUILDER_DESC","Module create of module made by TDM"); 49 | 50 | define("_MI_MODULEBUILDER_EDITOR", "Editor"); 51 | define("_MI_MODULEBUILDER_EDITORDSC", "Select an editor to write"); 52 | define("_MI_MODULEBUILDER_IDPAYPAL", "Paypal ID"); 53 | define("_MI_MODULEBUILDER_IDPAYPAL_DESC", "ID Paypal for donations."); 54 | -------------------------------------------------------------------------------- /class/Session.php: -------------------------------------------------------------------------------- 1 | 25 | * @author Harry Fuecks (PHP Anthology Volume II) 26 | */ 27 | 28 | /** 29 | * Class Session. 30 | */ 31 | class Session 32 | { 33 | /** 34 | * Session constructor
35 | * Starts the session with session_start() 36 | * Note: that if the session has already started, 37 | * session_start() does nothing. 38 | */ 39 | public function __construct() 40 | { 41 | if (!isset($_SESSION)) { 42 | session_start(); 43 | } 44 | } 45 | 46 | /* 47 | * @static function getInstance 48 | * @param null 49 | */ 50 | 51 | /** 52 | * @return bool 53 | */ 54 | public static function getInstance() 55 | { 56 | static $instance = false; 57 | if (!isset($instance)) { 58 | $class = __CLASS__; 59 | $instance = new $class(); 60 | } 61 | 62 | return $instance; 63 | } 64 | 65 | /** 66 | * Sets a session variable. 67 | * 68 | * @param string $name name of variable 69 | * @param mixed $value value of variable 70 | */ 71 | public function setSession($name, $value): void 72 | { 73 | $_SESSION[$name] = $value; 74 | } 75 | 76 | /** 77 | * Fetches a session variable. 78 | * 79 | * @param string $name name of variable 80 | * 81 | * @return mixed value of session variable 82 | */ 83 | public function getSession($name) 84 | { 85 | if (isset($_SESSION[$name])) { 86 | return $_SESSION[$name]; 87 | } 88 | 89 | return false; 90 | } 91 | 92 | /** 93 | * Deletes a session variable. 94 | * 95 | * @param string $name name of variable 96 | */ 97 | public function deleteSession($name): void 98 | { 99 | unset($_SESSION[$name]); 100 | } 101 | 102 | /** 103 | * Destroys the whole session. 104 | */ 105 | public function destroySession(): void 106 | { 107 | $_SESSION = []; 108 | session_destroy(); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /class/autoload.php: -------------------------------------------------------------------------------- 1 | getFilename() == $classFilename) { 62 | $fullPath = $file->getRealPath(); 63 | $pathCache[$class] = $fullPath; 64 | require_once $fullPath; 65 | break; 66 | } 67 | } 68 | } 69 | 70 | $serialized_paths = serialize($pathCache); 71 | if ($serialized_paths != $pathCache) { 72 | file_put_contents($cacheFile, serialize($pathCache)); 73 | } 74 | } 75 | 76 | spl_autoload_register('application_autoloader'); 77 | } 78 | -------------------------------------------------------------------------------- /docs/license.txt: -------------------------------------------------------------------------------- 1 | End User License Agreement for Xoops Modules 2 | 3 | IMPORTANT NOTICE Read and understand this License 4 | Agreement carefully before installing and using this Software. 5 | It contains extremely important information. 6 | 7 | BY USING THIS SOFTWARE IN ANY WAY YOU ACKNOWLEDGE 8 | THAT YOU HAVE READ, UNDERSTAND AND AGREE TO THE 9 | TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO 10 | THESE TERMS, DO NOT USE THIS SOFTWARE IN ANY WAY, 11 | AND PROMPTLY RETURN IT OR DELETE ANY COPIES OF 12 | THIS SOFTWARE IN YOUR POSSESSION. 13 | 14 | LICENSE GRANT the copyright holder grants you a non-exclusive 15 | license to use this software, and any associated documentation 16 | ("The Software"), as indicated herein. 17 | 18 | You may install and use the Software on two computers for your use 19 | only. 20 | 21 | RESTRICTIONS You MAY NOT: (a) sell or distribute this Software 22 | package without prior written approval (b) cause or permit reverse 23 | engineering, disassembly, decompilation or alteration of this 24 | Software; (c) remove any product identification, copyright notices, 25 | or other notices or proprietary restrictions from this Software; 26 | 27 | TERM: This License is effective until terminated. You may terminate 28 | it at any time by destroying the Software, together with all copies 29 | thereof. This License will also terminate if you fail to comply with any 30 | term or condition of this Agreement. Upon such termination, you 31 | agree to destroy the Software, together with all copies thereof. 32 | 33 | COPYRIGHT/OWNERSHIP This Software and its source 34 | code are proprietary products of Pablo Software Solutions 35 | and are protected by copyright, trade secret and other intellectual 36 | property laws. 37 | 38 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 39 | HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 40 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 41 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 42 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 43 | IN NO EVENT SHALL THE COPYRIGHT OWNER OR 44 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 45 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 46 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 47 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 48 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 49 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 50 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 51 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 52 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 53 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 54 | POSSIBILITY OF SUCH DAMAGE. 55 | 56 | This software was created to be free of defects and is designed to 57 | function on PC computers only. While this software has been tested 58 | and proven to run accurately, in the unlikely event of any user or 59 | computer incompatibility issues, the end user assumes complete 60 | liability of usage. This software contains no adware, scumware or 61 | spyware. The maker of this software does not support any 62 | questionable forms of use where this software could be misused in 63 | any way. 64 | 65 | http://www.txmodxoops.org 66 | https://xoops.org 67 | -------------------------------------------------------------------------------- /admin/migrate.php: -------------------------------------------------------------------------------- 1 | 18 | * @author Michael Beck 19 | */ 20 | 21 | use Xmf\Request; 22 | use XoopsModules\Modulebuilder; 23 | 24 | require_once __DIR__ . '/header.php'; 25 | //xoops_cp_header(); 26 | 27 | $adminObject->displayNavigation(\basename(__FILE__)); 28 | 29 | echo << 31 |
32 | 33 |
34 |
35 | 36 |
37 |
38 | 39 |
40 | 41 | EOF; 42 | 43 | //XoopsLoad::load('migrate', 'newbb'); 44 | 45 | $configurator = new Modulebuilder\Common\Configurator(); 46 | 47 | $migrator = new \XoopsModules\Modulebuilder\Common\Migrate($configurator); 48 | 49 | $op = Request::getCmd('op', 'default'); 50 | $opShow = Request::getCmd('show', null, 'POST'); 51 | $opMigrate = Request::getCmd('migrate', null, 'POST'); 52 | $opSchema = Request::getCmd('schema', null, 'POST'); 53 | $op = !empty($opShow) ? 'show' : $op; 54 | $op = !empty($opMigrate) ? 'migrate' : $op; 55 | $op = !empty($opSchema) ? 'schema' : $op; 56 | 57 | $message = ''; 58 | 59 | switch ($op) { 60 | case 'show': 61 | $queue = $migrator->getSynchronizeDDL(); 62 | if (!empty($queue)) { 63 | echo "
\n";
64 |             foreach ($queue as $line) {
65 |                 echo $line . ";\n";
66 |             }
67 |             echo "
\n"; 68 | } 69 | break; 70 | case 'migrate': 71 | $migrator->synchronizeSchema(); 72 | $message = 'Database migrated to current schema.'; 73 | break; 74 | case 'schema': 75 | xoops_confirm(['op' => 'confirmwrite'], 'migrate.php', 'Warning! This is intended for developers only. Confirm write schema file from current database.', 'Confirm'); 76 | break; 77 | case 'confirmwrite': 78 | if ($GLOBALS['xoopsSecurity']->check()) { 79 | $migrator->saveCurrentSchema(); 80 | $message = 'Current schema file written'; 81 | } 82 | break; 83 | } 84 | 85 | echo "
$message
"; 86 | 87 | require_once __DIR__ . '/footer.php'; 88 | -------------------------------------------------------------------------------- /files/commonfiles/include/install.php: -------------------------------------------------------------------------------- 1 | - Website: XOOPS Project (www.xoops.org) $ 20 | */ 21 | 22 | use XoopsModules\Modulebuilder; 23 | use XoopsModules\Modulebuilder\Common; 24 | 25 | /** 26 | * @param \XoopsModule $module 27 | * @return bool 28 | */ 29 | function xoops_module_pre_install_modulebuilder(\XoopsModule $module) 30 | { 31 | require \dirname(__DIR__) . '/preloads/autoloader.php'; 32 | 33 | $utility = new Modulebuilder\Utility(); 34 | 35 | //check for minimum XOOPS version 36 | $xoopsSuccess = $utility::checkVerXoops($module); 37 | 38 | // check for minimum PHP version 39 | $phpSuccess = $utility::checkVerPhp($module); 40 | 41 | if ($xoopsSuccess && $phpSuccess) { 42 | $moduleTables = &$module->getInfo('tables'); 43 | foreach ($moduleTables as $table) { 44 | $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); 45 | } 46 | } 47 | 48 | return $xoopsSuccess && $phpSuccess; 49 | } 50 | 51 | /** 52 | * @param \XoopsModule $module 53 | * @return bool 54 | */ 55 | function xoops_module_install_modulebuilder(\XoopsModule $module) 56 | { 57 | require \dirname(__DIR__) . '/preloads/autoloader.php'; 58 | 59 | $helper = Modulebuilder\Helper::getInstance(); 60 | $utility = new Modulebuilder\Utility(); 61 | $configurator = new Common\Configurator(); 62 | 63 | // Load language files 64 | $helper->loadLanguage('admin'); 65 | $helper->loadLanguage('modinfo'); 66 | $helper->loadLanguage('common'); 67 | 68 | // --- CREATE FOLDERS --------------- 69 | if ($configurator->uploadFolders && \is_array($configurator->uploadFolders)) { 70 | foreach (\array_keys($configurator->uploadFolders) as $i) { 71 | $utility::createFolder($configurator->uploadFolders[$i]); 72 | chmod($configurator->uploadFolders[$i], 0777); 73 | } 74 | } 75 | 76 | // --- COPY blank.gif FILES --------------- 77 | if ($configurator->copyBlankFiles && \is_array($configurator->copyBlankFiles)) { 78 | $file = \dirname(__DIR__) . '/assets/images/blank.gif'; 79 | foreach (\array_keys($configurator->copyBlankFiles) as $i) { 80 | $dest = $configurator->copyBlankFiles[$i] . '/blank.gif'; 81 | $utility::copyFile($file, $dest); 82 | } 83 | } 84 | 85 | return true; 86 | } 87 | -------------------------------------------------------------------------------- /class/Files/User/UserListTag.php: -------------------------------------------------------------------------------- 1 | pc = Modulebuilder\Files\CreatePhpCode::getInstance(); 47 | } 48 | 49 | /** 50 | * @static function getInstance 51 | * @param null 52 | * @return UserListTag 53 | */ 54 | public static function getInstance() 55 | { 56 | static $instance = false; 57 | if (!$instance) { 58 | $instance = new self(); 59 | } 60 | 61 | return $instance; 62 | } 63 | 64 | /** 65 | * @public function write 66 | * @param string $module 67 | * @param string $filename 68 | */ 69 | public function write($module, $filename): void 70 | { 71 | $this->setModule($module); 72 | $this->setFileName($filename); 73 | } 74 | 75 | /** 76 | * @public function getUserListTag 77 | * @param null 78 | * @return string 79 | */ 80 | public function getUserListTag() 81 | { 82 | $ret = $this->getRequire(); 83 | $ret .= $this->pc->getPhpCodeIncludeDir('\XOOPS_ROOT_PATH', 'modules/tag/list.tag'); 84 | 85 | return $ret; 86 | } 87 | 88 | /** 89 | * @public function render 90 | * @param null 91 | * @return bool|string 92 | */ 93 | public function render() 94 | { 95 | $module = $this->getModule(); 96 | $filename = $this->getFileName(); 97 | $moduleDirname = $module->getVar('mod_dirname'); 98 | $content = $this->getHeaderFilesComments($module); 99 | $content .= $this->getUserListTag(); 100 | 101 | $this->create($moduleDirname, '/', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 102 | 103 | return $this->renderFile(); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /class/Files/User/UserViewTag.php: -------------------------------------------------------------------------------- 1 | pc = Modulebuilder\Files\CreatePhpCode::getInstance(); 47 | } 48 | 49 | /** 50 | * @static function getInstance 51 | * @param null 52 | * @return UserViewTag 53 | */ 54 | public static function getInstance() 55 | { 56 | static $instance = false; 57 | if (!$instance) { 58 | $instance = new self(); 59 | } 60 | 61 | return $instance; 62 | } 63 | 64 | /** 65 | * @public function write 66 | * @param string $module 67 | * @param string $filename 68 | */ 69 | public function write($module, $filename): void 70 | { 71 | $this->setModule($module); 72 | $this->setFileName($filename); 73 | } 74 | 75 | /** 76 | * @public function getUserViewTag 77 | * @param null 78 | * @return string 79 | */ 80 | public function getUserViewTag() 81 | { 82 | $ret = $this->getRequire(); 83 | $ret .= $this->pc->getPhpCodeIncludeDir('\XOOPS_ROOT_PATH', 'modules/tag/view.tag'); 84 | 85 | return $ret; 86 | } 87 | 88 | /** 89 | * @public function render 90 | * @param null 91 | * @return bool|string 92 | */ 93 | public function render() 94 | { 95 | $module = $this->getModule(); 96 | $filename = $this->getFileName(); 97 | $moduleDirname = $module->getVar('mod_dirname'); 98 | $content = $this->getHeaderFilesComments($module); 99 | $content .= $this->getUserViewTag(); 100 | 101 | $this->create($moduleDirname, '/', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 102 | 103 | return $this->renderFile(); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /class/Files/Assets/Css/CssStyles.php: -------------------------------------------------------------------------------- 1 | setModule($module); 65 | $this->setFileName($filename); 66 | } 67 | 68 | /** 69 | * @public function render 70 | * @param null 71 | * @return bool|string 72 | */ 73 | public function render() 74 | { 75 | $module = $this->getModule(); 76 | $filename = $this->getFileName(); 77 | $moduleDirname = $module->getVar('mod_dirname'); 78 | $content = $this->getHeaderFilesComments($module, '@charset "UTF-8";'); 79 | $content .= << li { 87 | display: inline-block; 88 | } 89 | 90 | ul.menu > li + li:before { 91 | content: "|\a0"; 92 | } 93 | 94 | .printOnly { 95 | display: none; 96 | } 97 | 98 | img { 99 | max-width: 300px; 100 | } 101 | EOT; 102 | $this->create($moduleDirname, 'assets/css', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 103 | 104 | return $this->renderFile(); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /class/Files/Includes/IncludeJquery.php: -------------------------------------------------------------------------------- 1 | tdmcfile = Modulebuilder\Files\CreateFile::getInstance(); 47 | } 48 | 49 | /** 50 | * @static function getInstance 51 | * @param null 52 | * @return IncludeJquery 53 | */ 54 | public static function getInstance() 55 | { 56 | static $instance = false; 57 | if (!$instance) { 58 | $instance = new self(); 59 | } 60 | 61 | return $instance; 62 | } 63 | 64 | /** 65 | * @public function write 66 | * @param string $module 67 | * @param string $filename 68 | */ 69 | public function write($module, $filename): void 70 | { 71 | $this->setModule($module); 72 | $this->setFileName($filename); 73 | } 74 | 75 | /** 76 | * @public function render 77 | * @param null 78 | * @return bool|string 79 | */ 80 | public function render() 81 | { 82 | $module = $this->getModule(); 83 | $filename = $this->getFileName(); 84 | $moduleDirname = $module->getVar('mod_dirname'); 85 | //$content = $this->getHeaderFilesComments($module, $filename); 86 | $content = <<<'EOT' 87 | $(document).ready(function(){ 88 | $( "button, input:button, input:submit, input:file, input:reset" ).css("color","inherit").button(); 89 | $( ".check" ).css("color","#fff").button(); 90 | $( ".radio" ).css("color","#fff").buttonset(); 91 | $( ".toolbar" ).css("color","#000").buttonset(); 92 | }); 93 | EOT; 94 | $this->tdmcfile->create($moduleDirname, 'assets/js', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 95 | 96 | return $this->tdmcfile->renderFile(); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /class/Form/FormRadio.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | class FormRadio extends \XoopsFormRadio 24 | { 25 | /** 26 | * Prepare HTML for output. 27 | * 28 | * @return string HTML 29 | */ 30 | public function render() 31 | { 32 | $ret = ''; 33 | $ele_name = $this->getName(); 34 | $ele_title = (string)$this->getTitle(); 35 | $ele_value = (string)$this->getValue(); 36 | $ele_options = $this->getOptions(); 37 | $ele_extra = $this->getExtra(); 38 | $ele_delimeter = empty($this->columns) ? $this->getDelimeter() : ''; 39 | if (!empty($this->columns)) { 40 | $ret .= ''; 41 | } 42 | $i = 0; 43 | $id_ele = 0; 44 | if ('' != $ele_title) { 45 | $ele_title = htmlspecialchars($ele_title, ENT_QUOTES); 46 | } 47 | if ('' != $ele_value) { 48 | $ele_value = htmlspecialchars($ele_value, ENT_QUOTES); 49 | } 50 | foreach ($ele_options as $value => $name) { 51 | ++$id_ele; 52 | if (!empty($this->columns)) { 53 | if (0 == $i % $this->columns) { 54 | $ret .= ''; 55 | } 56 | $ret .= ''; 65 | if (0 == ++$i % $this->columns) { 66 | $ret .= ''; 67 | } 68 | } 69 | } 70 | if (!empty($this->columns)) { 71 | $span = $i % $this->columns; 72 | if ($span) { 73 | $ret .= ''; 74 | } 75 | $ret .= '
'; 57 | } 58 | $ret .= '' . "' . $ele_delimeter; 63 | if (!empty($this->columns)) { 64 | $ret .= '
'; 76 | } 77 | 78 | return $ret; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /class/Files/Assets/Js/JsJquery.php: -------------------------------------------------------------------------------- 1 | tdmcfile = Files\CreateFile::getInstance(); 48 | } 49 | 50 | /** 51 | * @static function getInstance 52 | * @param null 53 | * @return JsJquery 54 | */ 55 | public static function getInstance() 56 | { 57 | static $instance = false; 58 | if (!$instance) { 59 | $instance = new self(); 60 | } 61 | 62 | return $instance; 63 | } 64 | 65 | /** 66 | * @public function write 67 | * @param string $module 68 | * @param string $filename 69 | */ 70 | public function write($module, $filename): void 71 | { 72 | $this->setModule($module); 73 | $this->setFileName($filename); 74 | } 75 | 76 | /** 77 | * @public function render 78 | * @param null 79 | * @return bool|string 80 | */ 81 | public function render() 82 | { 83 | $module = $this->getModule(); 84 | $filename = $this->getFileName(); 85 | $moduleDirname = $module->getVar('mod_dirname'); 86 | $content = $this->getHeaderFilesComments($module, true); 87 | $content .= <<<'EOT' 88 | $(document).ready(function(){ 89 | $( "button, input:button, input:submit, input:file, input:reset" ).css("color","inherit").button(); 90 | $( ".check" ).css("color","#fff").button(); 91 | $( ".radio" ).css("color","#fff").buttonset(); 92 | $( ".toolbar" ).css("color","#000").buttonset(); 93 | }); 94 | EOT; 95 | 96 | $this->tdmcfile->create($moduleDirname, 'assets/js', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 97 | 98 | return $this->tdmcfile->renderFile(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /class/Files/CreateClone.php: -------------------------------------------------------------------------------- 1 | $path) { 23 | * self::deleteFileFolder($path); 24 | * } 25 | * return @\rmdir($path); 26 | * } 27 | * }*/ 28 | 29 | // recursive cloning script 30 | 31 | /** 32 | * @param $src_path 33 | * @param $dst_path 34 | * @param bool $replace_code 35 | * @param array $patKeys 36 | * @param array $patValues 37 | */ 38 | public static function cloneFileFolder($src_path, $dst_path, $replace_code = false, $patKeys = [], $patValues = []): void 39 | { 40 | // open the source directory 41 | $dir = \opendir($src_path); 42 | // Make the destination directory if not exist 43 | @\mkdir($dst_path); 44 | // Loop through the files in source directory 45 | while ($file = \readdir($dir)) { 46 | if (($file != '.') && ($file != '..')) { 47 | if (\is_dir($src_path . '/' . $file)) { 48 | // Recursively calling custom copy function for sub directory 49 | self::cloneFileFolder($src_path . '/' . $file, $dst_path . '/' . $file, $replace_code, $patKeys, $patValues); 50 | } else { 51 | self::cloneFile($src_path . '/' . $file, $dst_path . '/' . $file, $replace_code, $patKeys, $patValues); 52 | } 53 | } 54 | } 55 | \closedir($dir); 56 | } 57 | 58 | /** 59 | * @param $src_file 60 | * @param $dst_file 61 | * @param bool $replace_code 62 | * @param array $patKeys 63 | * @param array $patValues 64 | */ 65 | public static function cloneFile($src_file, $dst_file, $replace_code = false, $patKeys = [], $patValues = []): void 66 | { 67 | if ($replace_code) { 68 | $noChangeExtensions = ['jpeg', 'jpg', 'gif', 'png', 'zip', 'ttf']; 69 | if (\in_array(\mb_strtolower(\pathinfo($src_file, PATHINFO_EXTENSION)), $noChangeExtensions)) { 70 | // image 71 | \copy($src_file, $dst_file); 72 | } else { 73 | // file, read it and replace text 74 | $content = file_get_contents($src_file); 75 | $content = \str_replace($patKeys, $patValues, $content); 76 | //check file name whether it contains replace code 77 | $path_parts = \pathinfo($dst_file); 78 | $path = $path_parts['dirname']; 79 | $file = $path_parts['basename']; 80 | $dst_file = $path . '/' . \str_replace($patKeys, $patValues, $file); 81 | file_put_contents($dst_file, $content); 82 | } 83 | } else { 84 | \copy($src_file, $dst_file); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /include/common.php: -------------------------------------------------------------------------------- 1 | getVar('dirname'); 33 | // Root Frameworks icons 32x32 directory 34 | if (!\defined('XOOPS_ICONS32_PATH')) { 35 | \define('XOOPS_ICONS32_PATH', \XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'); 36 | } 37 | if (!\defined('XOOPS_ICONS32_URL')) { 38 | \define('XOOPS_ICONS32_URL', \XOOPS_URL . '/Frameworks/moduleclasses/icons/32'); 39 | } 40 | // Local Directories 41 | \define('TDMC_PATH', \XOOPS_ROOT_PATH . '/modules/' . $dirname); 42 | \define('TDMC_URL', \XOOPS_URL . '/modules/' . $dirname); 43 | \define('TDMC_CLASS_PATH', TDMC_PATH . '/class'); 44 | \define('TDMC_CLASS_URL', TDMC_URL . '/class'); 45 | \define('TDMC_DOCS_PATH', TDMC_PATH . '/docs'); 46 | \define('TDMC_DOCS_URL', TDMC_URL . '/docs'); 47 | \define('TDMC_FONTS_PATH', TDMC_PATH . '/assets/fonts'); 48 | \define('TDMC_FONTS_URL', TDMC_URL . '/assets/fonts'); 49 | \define('TDMC_IMAGE_PATH', TDMC_PATH . '/assets/images'); 50 | \define('TDMC_IMAGE_URL', TDMC_URL . '/assets/images'); 51 | \define('TDMC_IMAGES_LOGOS_PATH', TDMC_PATH . '/assets/images/logos'); 52 | \define('TDMC_IMAGES_LOGOS_URL', TDMC_URL . '/assets/images/logos'); 53 | \define('TDMC_ICONS_PATH', TDMC_PATH . '/assets/icons'); 54 | \define('TDMC_ICONS_URL', TDMC_URL . '/assets/icons'); 55 | \define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', TDMC_URL . '/assets/images/logoModule.png'); 56 | // Uploads Directories 57 | \define('TDMC_UPLOAD_PATH', \XOOPS_UPLOAD_PATH . '/' . $dirname); 58 | \define('TDMC_UPLOAD_URL', \XOOPS_UPLOAD_URL . '/' . $dirname); 59 | \define('TDMC_UPLOAD_REPOSITORY_PATH', TDMC_UPLOAD_PATH . '/repository'); 60 | \define('TDMC_UPLOAD_REPOSITORY_URL', TDMC_UPLOAD_URL . '/repository'); 61 | \define('TDMC_UPLOAD_IMGMOD_PATH', TDMC_UPLOAD_PATH . '/images/modules'); 62 | \define('TDMC_UPLOAD_IMGMOD_URL', TDMC_UPLOAD_URL . '/images/modules'); 63 | \define('TDMC_UPLOAD_IMGTAB_PATH', TDMC_UPLOAD_PATH . '/images/tables'); 64 | \define('TDMC_UPLOAD_IMGTAB_URL', TDMC_UPLOAD_URL . '/images/tables'); 65 | \define('TDMC_UPLOAD_TEMP_PATH', TDMC_UPLOAD_PATH . '/temp'); 66 | \define('TDMC_UPLOAD_FILES_PATH', TDMC_UPLOAD_PATH . '/files'); 67 | // Xoops Request 68 | require_once \XOOPS_ROOT_PATH . '/class/xoopsrequest.php'; 69 | -------------------------------------------------------------------------------- /class/Files/Templates/User/Defstyle/MoreFiles.php: -------------------------------------------------------------------------------- 1 | setModule($module); 71 | $this->setFileName($filename); 72 | $this->folder = $folder; 73 | $this->extension = $extension; 74 | } 75 | 76 | /** 77 | * @private function getTemplatesUserMoreFile 78 | * @param null 79 | * 80 | * @return string 81 | */ 82 | private function getTemplatesUserMoreFile() 83 | { 84 | $ret = <<<'EOT' 85 |
86 | Pleace! Enter here your template code here 87 |
88 | EOT; 89 | 90 | return $ret; 91 | } 92 | 93 | /** 94 | * @public function render 95 | * @param null 96 | * @return bool|string 97 | */ 98 | public function render() 99 | { 100 | $module = $this->getModule(); 101 | $filename = $this->getFileName(); 102 | $moduleDirname = $module->getVar('mod_dirname'); 103 | $content = $this->getTemplatesUserMoreFile(); 104 | 105 | $this->create($moduleDirname, $this->folder, $filename . '.' . $this->extension, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 106 | 107 | return $this->renderFile(); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /class/Files/Templates/Admin/TemplatesAdminHeader.php: -------------------------------------------------------------------------------- 1 | hc = Modulebuilder\Files\CreateHtmlCode::getInstance(); 51 | $this->sc = Modulebuilder\Files\CreateSmartyCode::getInstance(); 52 | } 53 | 54 | /** 55 | * @static function getInstance 56 | * @return TemplatesAdminHeader 57 | */ 58 | public static function getInstance() 59 | { 60 | static $instance = false; 61 | if (!$instance) { 62 | $instance = new self(); 63 | } 64 | 65 | return $instance; 66 | } 67 | 68 | /** 69 | * @public function write 70 | * @param string $module 71 | * @param string $filename 72 | */ 73 | public function write($module, $filename): void 74 | { 75 | $this->setModule($module); 76 | $this->setFileName($filename); 77 | } 78 | 79 | /** 80 | * @public function render 81 | * @param null 82 | * @return bool|string 83 | */ 84 | public function render() 85 | { 86 | $module = $this->getModule(); 87 | $filename = $this->getFileName(); 88 | $moduleDirname = $module->getVar('mod_dirname'); 89 | 90 | $navigation = $this->sc->getSmartySingleVar('navigation'); 91 | $due = $this->hc->getHtmlSpan($navigation, 'left', "\t"); 92 | $buttons = $this->sc->getSmartySingleVar('buttons'); 93 | $right = $this->hc->getHtmlSpan($buttons, 'left', "\t\t"); 94 | $due .= $this->sc->getSmartyConditions('buttons', '', '', $right, '', '', '', "\t"); 95 | $content = $this->hc->getHtmlDiv($due, 'top'); 96 | 97 | $this->create($moduleDirname, 'templates/admin', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 98 | 99 | return $this->renderFile(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /class/Files/admin/AdminFooter.php: -------------------------------------------------------------------------------- 1 | xc = Modulebuilder\Files\CreateXoopsCode::getInstance(); 51 | $this->pc = Modulebuilder\Files\CreatePhpCode::getInstance(); 52 | } 53 | 54 | /** 55 | * @static function getInstance 56 | * @return AdminFooter 57 | */ 58 | public static function getInstance() 59 | { 60 | static $instance = false; 61 | if (!$instance) { 62 | $instance = new self(); 63 | } 64 | 65 | return $instance; 66 | } 67 | 68 | /** 69 | * @public function write 70 | * @param string $module 71 | * @param string $filename 72 | */ 73 | public function write($module, $filename): void 74 | { 75 | $this->setModule($module); 76 | $this->setFileName($filename); 77 | } 78 | 79 | /** 80 | * @public function render 81 | * @param null 82 | * @return bool|string 83 | */ 84 | public function render() 85 | { 86 | $module = $this->getModule(); 87 | $filename = $this->getFileName(); 88 | $moduleDirname = $module->getVar('mod_dirname'); 89 | $content = $this->getHeaderFilesComments($module); 90 | $content .= $this->getSimpleString(''); 91 | $isset = $this->pc->getPhpCodeIsset('templateMain'); 92 | $display = "\t" . $this->xc->getXcXoopsTplAssign('maintainedby', "\$helper->getConfig('maintainedby')"); 93 | $display .= "\t" . $this->xc->getXcXoopsTplDisplay(); 94 | $content .= $this->pc->getPhpCodeConditions($isset, '', '', $display, false) . PHP_EOL; 95 | $content .= $this->xc->getXcXoopsCPFooter(); 96 | 97 | $this->create($moduleDirname, 'admin', $filename, $content, \_AM_MODULEBUILDER_FILE_CREATED, \_AM_MODULEBUILDER_FILE_NOTCREATED); 98 | 99 | return $this->renderFile(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /templates/admin/modulebuilder_building.tpl: -------------------------------------------------------------------------------- 1 | 2 | <{include file="db:modulebuilder_header.tpl"}> 3 | 4 |
5 | <{if $building_directory|default:''}> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <{if $base_architecture}> 17 | 18 | 19 | 20 | <{else}> 21 | 22 | 23 | 24 | <{/if}> 25 | 26 | <{foreach item=build from=$builds}> 27 | 28 | <{if $created}> 29 | 30 | 31 | 32 | <{else}> 33 | 34 | 35 | 36 | <{/if}> 37 | 38 | <{/foreach}> 39 | 40 | 41 | 42 | 43 |
<{$smarty.const._AM_MODULEBUILDER_BUILDING_FILES}><{$smarty.const._AM_MODULEBUILDER_BUILDING_SUCCESS}><{$smarty.const._AM_MODULEBUILDER_BUILDING_FAILED}>
<{$smarty.const._AM_MODULEBUILDER_OK_ARCHITECTURE}> <{$smarty.const._AM_MODULEBUILDER_NOTOK_ARCHITECTURE}> 
<{$build.list}> <{$build.list}> 
<{$building_directory}>
44 |
45 | <{else}> 46 | <{if $checkResults|default:''}> 47 |

<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_RESULT}>

48 |

<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_FOUND}>

49 | <{foreach item=check from=$checkResults}> 50 |

<{$check.info}>

51 | <{/foreach}> 52 |

<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_SOLVE}>

53 |



------------------------------------------------------------------------------------------------------------------ 54 |
<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_ERROR_DESC}>
<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_WARNING_DESC}>
55 |

56 | <{/if}> 57 | <{if $checkResultsNice|default:''}> 58 |

<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_RESULT}>

59 |

<{$smarty.const._AM_MODULEBUILDER_BUILDING_CHECK_NOERRORS}>

60 | <{/if}> 61 | <{if $form|default:''}> 62 | <{$form}> 63 | <{/if}> 64 | <{/if}> 65 | 66 | <{include file="db:modulebuilder_footer.tpl"}> 67 | -------------------------------------------------------------------------------- /admin/import_module.php: -------------------------------------------------------------------------------- 1 | displayNavigation('modules.php'); 26 | $adminObject->addItemButton(_MI_MODULEBUILDER_ADMIN_MODULES, 'modules.php', 'list'); 27 | $adminObject->displayButton('left'); 28 | 29 | require XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; 30 | 31 | $formImportModule = new \XoopsThemeForm('modules_import', 'Class', 'modules.php?op=modules_import', 'post', true); 32 | $select_module = new \XoopsFormSelect(_AM_MODULEBUILDER_MODULE_ID, 'moduleName', ''); 33 | $newModuleName = new \XoopsFormText(_AM_MODULEBUILDER_MODULE_NEW_NAME, 'moduleNewName', 50, 50, ''); 34 | /** @var \XoopsModuleHandler $moduleHandler */ 35 | $moduleHandler = xoops_getHandler('module'); 36 | $installed_mods = $moduleHandler->getObjects(); 37 | $listed_mods = []; 38 | $count = 0; 39 | foreach ($installed_mods as $module) { 40 | $select_module->addOption($module->getVar('dirname', 'E'), $module->getVar('dirname', 'E')); 41 | } 42 | $select_table = new \XoopsFormSelect(_AM_MODULEBUILDER_TABLE_ID, 'table_id', ''); 43 | 44 | $sql = 'SHOW TABLES'; 45 | $result = $GLOBALS['xoopsDB']->queryF($sql); 46 | 47 | if (!$result instanceof \mysqli_result) { 48 | // echo '_AM_MODULEBUILDER_ERROR_DATABASE'; 49 | // echo '_AM_MODULEBUILDER_ERROR_SQL' . $GLOBALS['xoopsDB']->error(); 50 | \trigger_error($GLOBALS['xoopsDB']->error()); 51 | } 52 | 53 | while (false !== ($row = $GLOBALS['xoopsDB']->fetchRow($result))) { 54 | $select_table->addOption($row[0], $row[0]); 55 | } 56 | //TODO: add an option to set a name of the new module created by importing the old one 57 | $formImportModule->addElement($select_module); 58 | $formImportModule->addElement($newModuleName); 59 | $op_hidden = new \XoopsFormHidden('op', 'modules_import'); 60 | $formImportModule->addElement($op_hidden); 61 | $dbname_hidden = new \XoopsFormHidden('dbname', ''); 62 | $formImportModule->addElement($dbname_hidden); 63 | 64 | //Submit buttons 65 | $buttonTray = new \XoopsFormElementTray('', ''); 66 | $submit_button = new \XoopsFormButton('', '', _AM_MODULEBUILDER_GENERATE, 'submit'); 67 | $buttonTray->addElement($submit_button); 68 | 69 | $cancel_button = new \XoopsFormButton('', '', _CANCEL, 'button'); 70 | $cancel_button->setExtra('onclick="history.go(-1)"'); 71 | $buttonTray->addElement($cancel_button); 72 | 73 | $formImportModule->addElement($buttonTray); 74 | 75 | $GLOBALS['xoopsTpl']->assign('form', $formImportModule->render()); 76 | 77 | require __DIR__ . '/footer.php'; 78 | -------------------------------------------------------------------------------- /files/ratingfiles/class/Ratings.php: -------------------------------------------------------------------------------- 1 | initVar('rate_id', \XOBJ_DTYPE_INT); 39 | $this->initVar('rate_source', \XOBJ_DTYPE_INT); 40 | $this->initVar('rate_itemid', \XOBJ_DTYPE_INT); 41 | $this->initVar('rate_value', \XOBJ_DTYPE_INT); 42 | $this->initVar('rate_uid', \XOBJ_DTYPE_INT); 43 | $this->initVar('rate_ip', \XOBJ_DTYPE_TXTBOX); 44 | $this->initVar('rate_date', \XOBJ_DTYPE_INT); 45 | } 46 | 47 | /** 48 | * @static function &getInstance 49 | * 50 | * @param null 51 | */ 52 | public static function getInstance(): void 53 | { 54 | static $instance = false; 55 | if (!$instance) { 56 | $instance = new self(); 57 | } 58 | } 59 | 60 | /** 61 | * The new inserted $Id 62 | * @return int inserted id 63 | */ 64 | public function getNewInsertedIdRatings() 65 | { 66 | $newInsertedId = $GLOBALS['xoopsDB']->getInsertId(); 67 | 68 | return $newInsertedId; 69 | } 70 | 71 | /** 72 | * Get Values 73 | * @param null $keys 74 | * @param null $format 75 | * @param null $maxDepth 76 | * @return array 77 | */ 78 | public function getValuesRatings($keys = null, $format = null, $maxDepth = null) 79 | { 80 | $ret = $this->getValues($keys, $format, $maxDepth); 81 | $ret['id'] = $this->getVar('rate_id'); 82 | $ret['source'] = $this->getVar('rate_source'); 83 | $ret['itemid'] = $this->getVar('rate_itemid'); 84 | $ret['value'] = $this->getVar('rate_value'); 85 | $ret['uid'] = \XoopsUser::getUnameFromId($this->getVar('rate_uid')); 86 | $ret['ip'] = $this->getVar('rate_ip'); 87 | $ret['date'] = \formatTimestamp($this->getVar('rate_date'), 's'); 88 | 89 | return $ret; 90 | } 91 | 92 | /** 93 | * Returns an array representation of the object 94 | * 95 | * @return array 96 | */ 97 | public function toArrayRatings() 98 | { 99 | $ret = []; 100 | $vars = $this->getVars(); 101 | foreach (\array_keys($vars) as $var) { 102 | $ret[$var] = $this->getVar('"{$var}"'); 103 | } 104 | 105 | return $ret; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /class/Files/Language/LanguageDefines.php: -------------------------------------------------------------------------------- 1 | getPhpCodeDefine("{$language}{$defined}", "\"{$description}\""); 92 | } else { 93 | $ret = $pc->getPhpCodeDefine("{$language}{$defined}", "'" . $description . "'"); 94 | } 95 | 96 | return $ret; 97 | } 98 | 99 | /** 100 | * @public function getBelowDefines 101 | * @param string $string 102 | * 103 | * @return string 104 | */ 105 | public function getBelowDefines($string) 106 | { 107 | return "// ---------------- {$string} ----------------"; 108 | } 109 | 110 | /** 111 | * @public function getBlankLine 112 | * 113 | * @return string 114 | */ 115 | public function getBlankLine() 116 | { 117 | return "\n"; 118 | } 119 | } 120 | --------------------------------------------------------------------------------