Passed
Push — master ( 834a16...1c3825 )
by Goffy
09:06 queued 04:27
created
commonfiles/class/Common/Resizer.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@
 block discarded – undo
65 65
 
66 66
         if ($width > $this->maxWidth || $height > $this->maxHeight) {
67 67
             // recalc image size based on this->maxWidth/this->maxHeight
68
-			$new_width  = 0;
69
-			$new_height = 0;
68
+            $new_width  = 0;
69
+            $new_height = 0;
70 70
             if ($width > $height) {
71 71
                 if ($width < $this->maxWidth) {
72 72
                     $new_width = $width;
Please login to merge, or discard this patch.
commonfiles/class/Common/Breadcrumb.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         require $GLOBALS['xoops']->path('class/template.php');
72 72
         $breadcrumbTpl = new \XoopsTpl();
73 73
         $breadcrumbTpl->assign('breadcrumb', $this->bread);
74
-        $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl');
74
+        $html = $breadcrumbTpl->fetch('db:'.$this->dirname.'_common_breadcrumb.tpl');
75 75
         unset($breadcrumbTpl);
76 76
 
77 77
         return $html;
Please login to merge, or discard this patch.
commonfiles/class/Common/Migrate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
                 $this->synchronizeTable($tableName);
92 92
                 $updateTable = $GLOBALS['xoopsDB']->prefix($tableName);
93 93
                 $joinTable   = $GLOBALS['xoopsDB']->prefix($srcTableName);
94
-                $sql         = "UPDATE `$updateTable` t1 INNER JOIN `$joinTable` t2 ON t1.post_id = t2.post_id \n" . "SET t1.dohtml = t2.dohtml,  t1.dosmiley = t2.dosmiley, t1.doxcode = t2.doxcode\n" . '  , t1.doimage = t2.doimage, t1.dobr = t2.dobr';
94
+                $sql         = "UPDATE `$updateTable` t1 INNER JOIN `$joinTable` t2 ON t1.post_id = t2.post_id \n"."SET t1.dohtml = t2.dohtml,  t1.dosmiley = t2.dosmiley, t1.doxcode = t2.doxcode\n".'  , t1.doimage = t2.doimage, t1.dobr = t2.dobr';
95 95
                 $this->tableHandler->addToQueue($sql);
96 96
             }
97 97
         }
Please login to merge, or discard this patch.
commonfiles/language/english/feedback.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@
 block discarded – undo
23 23
 $moduleDirName      = basename(dirname(dirname(__DIR__)));
24 24
 $moduleDirNameUpper = mb_strtoupper($moduleDirName);
25 25
 
26
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE', 'Send a feedback');
27
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT', 'Recipient');
28
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME', 'Name');
29
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER', 'Please enter your name');
30
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE', 'Website');
31
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER', 'Please enter your website');
32
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL', 'Email');
33
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER', 'Please enter your email');
34
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE', 'Type of feedback');
35
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION', 'Suggestions');
36
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS', 'Bugs');
37
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL', 'Testimonials');
38
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES', 'Features');
39
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS', 'Misc');
40
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT', 'Feedback content');
41
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR', 'Feedback for module ');
42
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_SUCCESS', 'Feedback successfully sent');
43
-define('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_ERROR', 'An errror occured when feedback was sent!');
26
+define('CO_'.$moduleDirNameUpper.'_'.'FB_FORM_TITLE', 'Send a feedback');
27
+define('CO_'.$moduleDirNameUpper.'_'.'FB_RECIPIENT', 'Recipient');
28
+define('CO_'.$moduleDirNameUpper.'_'.'FB_NAME', 'Name');
29
+define('CO_'.$moduleDirNameUpper.'_'.'FB_NAME_PLACEHOLER', 'Please enter your name');
30
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SITE', 'Website');
31
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SITE_PLACEHOLER', 'Please enter your website');
32
+define('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL', 'Email');
33
+define('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL_PLACEHOLER', 'Please enter your email');
34
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE', 'Type of feedback');
35
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_SUGGESTION', 'Suggestions');
36
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_BUGS', 'Bugs');
37
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_TESTIMONIAL', 'Testimonials');
38
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_FEATURES', 'Features');
39
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_OTHERS', 'Misc');
40
+define('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_CONTENT', 'Feedback content');
41
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_FOR', 'Feedback for module ');
42
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_SUCCESS', 'Feedback successfully sent');
43
+define('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_ERROR', 'An errror occured when feedback was sent!');
Please login to merge, or discard this patch.
commonfiles/language/english/common.php 1 patch
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -21,129 +21,129 @@  discard block
 block discarded – undo
21 21
 $moduleDirName      = basename(dirname(dirname(__DIR__)));
22 22
 $moduleDirNameUpper = mb_strtoupper($moduleDirName);
23 23
 
24
-define('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS', 'GD library support: ');
25
-define('CO_' . $moduleDirNameUpper . '_GDLIBVERSION', 'GD Library version: ');
26
-define('CO_' . $moduleDirNameUpper . '_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)");
27
-define('CO_' . $moduleDirNameUpper . '_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)");
28
-define('CO_' . $moduleDirNameUpper . '_IMAGEINFO', 'Server status');
29
-define('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): ');
30
-define('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): ');
31
-define('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): ');
32
-define('CO_' . $moduleDirNameUpper . '_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> ");
33
-define('CO_' . $moduleDirNameUpper . '_OFF', "<span style='font-weight: bold;'>OFF</span>");
34
-define('CO_' . $moduleDirNameUpper . '_ON', "<span style='font-weight: bold;'>ON</span>");
35
-define('CO_' . $moduleDirNameUpper . '_SERVERPATH', 'Server path to XOOPS root: ');
36
-define('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS', 'Server uploads status: ');
37
-define('CO_' . $moduleDirNameUpper . '_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>");
38
-define('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.');
39
-
40
-define('CO_' . $moduleDirNameUpper . '_PRINT', "<span style='font-weight: bold;'>Print</span>");
41
-define('CO_' . $moduleDirNameUpper . '_PDF', "<span style='font-weight: bold;'>Create PDF</span>");
42
-
43
-define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'");
44
-define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED1', "Update failed - couldn't add new fields");
45
-define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'");
46
-define('CO_' . $moduleDirNameUpper . '_ERROR_COLUMN', 'Could not create column in database : %s');
47
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)');
48
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)');
49
-define('CO_' . $moduleDirNameUpper . '_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module');
50
-
51
-define('CO_' . $moduleDirNameUpper . '_FOLDERS_DELETED_OK', 'Upload Folders have been deleted');
24
+define('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS', 'GD library support: ');
25
+define('CO_'.$moduleDirNameUpper.'_GDLIBVERSION', 'GD Library version: ');
26
+define('CO_'.$moduleDirNameUpper.'_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)");
27
+define('CO_'.$moduleDirNameUpper.'_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)");
28
+define('CO_'.$moduleDirNameUpper.'_IMAGEINFO', 'Server status');
29
+define('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): ');
30
+define('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): ');
31
+define('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): ');
32
+define('CO_'.$moduleDirNameUpper.'_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> ");
33
+define('CO_'.$moduleDirNameUpper.'_OFF', "<span style='font-weight: bold;'>OFF</span>");
34
+define('CO_'.$moduleDirNameUpper.'_ON', "<span style='font-weight: bold;'>ON</span>");
35
+define('CO_'.$moduleDirNameUpper.'_SERVERPATH', 'Server path to XOOPS root: ');
36
+define('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS', 'Server uploads status: ');
37
+define('CO_'.$moduleDirNameUpper.'_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>");
38
+define('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.');
39
+
40
+define('CO_'.$moduleDirNameUpper.'_PRINT', "<span style='font-weight: bold;'>Print</span>");
41
+define('CO_'.$moduleDirNameUpper.'_PDF', "<span style='font-weight: bold;'>Create PDF</span>");
42
+
43
+define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'");
44
+define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED1', "Update failed - couldn't add new fields");
45
+define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'");
46
+define('CO_'.$moduleDirNameUpper.'_ERROR_COLUMN', 'Could not create column in database : %s');
47
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)');
48
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)');
49
+define('CO_'.$moduleDirNameUpper.'_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module');
50
+
51
+define('CO_'.$moduleDirNameUpper.'_FOLDERS_DELETED_OK', 'Upload Folders have been deleted');
52 52
 
53 53
 // Error Msgs
54
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH', 'Could not delete %s directory');
55
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_REMOVE', 'Could not delete %s');
56
-define('CO_' . $moduleDirNameUpper . '_ERROR_NO_PLUGIN', 'Could not load plugin');
54
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH', 'Could not delete %s directory');
55
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_REMOVE', 'Could not delete %s');
56
+define('CO_'.$moduleDirNameUpper.'_ERROR_NO_PLUGIN', 'Could not load plugin');
57 57
 
58 58
 //Help
59
-define('CO_' . $moduleDirNameUpper . '_DIRNAME', basename(dirname(dirname(__DIR__))));
60
-define('CO_' . $moduleDirNameUpper . '_HELP_HEADER', __DIR__ . '/help/helpheader.tpl');
61
-define('CO_' . $moduleDirNameUpper . '_BACK_2_ADMIN', 'Back to Administration of ');
62
-define('CO_' . $moduleDirNameUpper . '_OVERVIEW', 'Overview');
59
+define('CO_'.$moduleDirNameUpper.'_DIRNAME', basename(dirname(dirname(__DIR__))));
60
+define('CO_'.$moduleDirNameUpper.'_HELP_HEADER', __DIR__.'/help/helpheader.tpl');
61
+define('CO_'.$moduleDirNameUpper.'_BACK_2_ADMIN', 'Back to Administration of ');
62
+define('CO_'.$moduleDirNameUpper.'_OVERVIEW', 'Overview');
63 63
 
64 64
 //define('CO_' . $moduleDirNameUpper . '_HELP_DIR', __DIR__);
65 65
 
66 66
 //help multi-page
67
-define('CO_' . $moduleDirNameUpper . '_DISCLAIMER', 'Disclaimer');
68
-define('CO_' . $moduleDirNameUpper . '_LICENSE', 'License');
69
-define('CO_' . $moduleDirNameUpper . '_SUPPORT', 'Support');
67
+define('CO_'.$moduleDirNameUpper.'_DISCLAIMER', 'Disclaimer');
68
+define('CO_'.$moduleDirNameUpper.'_LICENSE', 'License');
69
+define('CO_'.$moduleDirNameUpper.'_SUPPORT', 'Support');
70 70
 
71 71
 //Sample Data
72
-define('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA', 'Import Sample Data (will delete ALL current data)');
73
-define('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully');
74
-define('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA', 'Export Tables to YAML');
75
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
76
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
77
-define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA', 'Export DB Schema to YAML');
78
-define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS', 'Export DB Schema to YAML was a success');
79
-define('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR', 'ERROR: Export of DB Schema to YAML failed');
80
-define('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK', 'Are you sure to Import Sample Data? (It will delete ALL current data)');
81
-define('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS', 'Hide the Import buttons');
82
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS', 'Show the Import buttons');
83
-define('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM', 'Confirm');
72
+define('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA', 'Import Sample Data (will delete ALL current data)');
73
+define('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully');
74
+define('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA', 'Export Tables to YAML');
75
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
76
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
77
+define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA', 'Export DB Schema to YAML');
78
+define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_SUCCESS', 'Export DB Schema to YAML was a success');
79
+define('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR', 'ERROR: Export of DB Schema to YAML failed');
80
+define('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA_OK', 'Are you sure to Import Sample Data? (It will delete ALL current data)');
81
+define('CO_'.$moduleDirNameUpper.'_'.'HIDE_SAMPLEDATA_BUTTONS', 'Hide the Import buttons');
82
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLEDATA_BUTTONS', 'Show the Import buttons');
83
+define('CO_'.$moduleDirNameUpper.'_'.'CONFIRM', 'Confirm');
84 84
 
85 85
 //letter choice
86
-define('CO_' . $moduleDirNameUpper . '_' . 'BROWSETOTOPIC', "<span style='font-weight: bold;'>Browse items alphabetically</span>");
87
-define('CO_' . $moduleDirNameUpper . '_' . 'OTHER', 'Other');
88
-define('CO_' . $moduleDirNameUpper . '_' . 'ALL', 'All');
86
+define('CO_'.$moduleDirNameUpper.'_'.'BROWSETOTOPIC', "<span style='font-weight: bold;'>Browse items alphabetically</span>");
87
+define('CO_'.$moduleDirNameUpper.'_'.'OTHER', 'Other');
88
+define('CO_'.$moduleDirNameUpper.'_'.'ALL', 'All');
89 89
 
90 90
 // block defines
91
-define('CO_' . $moduleDirNameUpper . '_' . 'ACCESSRIGHTS', 'Access Rights');
92
-define('CO_' . $moduleDirNameUpper . '_' . 'ACTION', 'Action');
93
-define('CO_' . $moduleDirNameUpper . '_' . 'ACTIVERIGHTS', 'Active Rights');
94
-define('CO_' . $moduleDirNameUpper . '_' . 'BADMIN', 'Block Administration');
95
-define('CO_' . $moduleDirNameUpper . '_' . 'BLKDESC', 'Description');
96
-define('CO_' . $moduleDirNameUpper . '_' . 'CBCENTER', 'Center Middle');
97
-define('CO_' . $moduleDirNameUpper . '_' . 'CBLEFT', 'Center Left');
98
-define('CO_' . $moduleDirNameUpper . '_' . 'CBRIGHT', 'Center Right');
99
-define('CO_' . $moduleDirNameUpper . '_' . 'SBLEFT', 'Left');
100
-define('CO_' . $moduleDirNameUpper . '_' . 'SBRIGHT', 'Right');
101
-define('CO_' . $moduleDirNameUpper . '_' . 'SIDE', 'Alignment');
102
-define('CO_' . $moduleDirNameUpper . '_' . 'TITLE', 'Title');
103
-define('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE', 'Visible');
104
-define('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN', 'Visible In');
105
-define('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT', 'Weight');
106
-
107
-define('CO_' . $moduleDirNameUpper . '_' . 'PERMISSIONS', 'Permissions');
108
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS', 'Blocks Admin');
109
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_DESC', 'Blocks/Group Admin');
110
-
111
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_MANAGMENT', 'Manage');
112
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_ADDBLOCK', 'Add a new block');
113
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_EDITBLOCK', 'Edit a block');
114
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK', 'Clone a block');
91
+define('CO_'.$moduleDirNameUpper.'_'.'ACCESSRIGHTS', 'Access Rights');
92
+define('CO_'.$moduleDirNameUpper.'_'.'ACTION', 'Action');
93
+define('CO_'.$moduleDirNameUpper.'_'.'ACTIVERIGHTS', 'Active Rights');
94
+define('CO_'.$moduleDirNameUpper.'_'.'BADMIN', 'Block Administration');
95
+define('CO_'.$moduleDirNameUpper.'_'.'BLKDESC', 'Description');
96
+define('CO_'.$moduleDirNameUpper.'_'.'CBCENTER', 'Center Middle');
97
+define('CO_'.$moduleDirNameUpper.'_'.'CBLEFT', 'Center Left');
98
+define('CO_'.$moduleDirNameUpper.'_'.'CBRIGHT', 'Center Right');
99
+define('CO_'.$moduleDirNameUpper.'_'.'SBLEFT', 'Left');
100
+define('CO_'.$moduleDirNameUpper.'_'.'SBRIGHT', 'Right');
101
+define('CO_'.$moduleDirNameUpper.'_'.'SIDE', 'Alignment');
102
+define('CO_'.$moduleDirNameUpper.'_'.'TITLE', 'Title');
103
+define('CO_'.$moduleDirNameUpper.'_'.'VISIBLE', 'Visible');
104
+define('CO_'.$moduleDirNameUpper.'_'.'VISIBLEIN', 'Visible In');
105
+define('CO_'.$moduleDirNameUpper.'_'.'WEIGHT', 'Weight');
106
+
107
+define('CO_'.$moduleDirNameUpper.'_'.'PERMISSIONS', 'Permissions');
108
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS', 'Blocks Admin');
109
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_DESC', 'Blocks/Group Admin');
110
+
111
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_MANAGMENT', 'Manage');
112
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_ADDBLOCK', 'Add a new block');
113
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_EDITBLOCK', 'Edit a block');
114
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_CLONEBLOCK', 'Clone a block');
115 115
 
116 116
 //myblocksadmin
117
-define('CO_' . $moduleDirNameUpper . '_' . 'AGDS', 'Admin Groups');
118
-define('CO_' . $moduleDirNameUpper . '_' . 'BCACHETIME', 'Cache Time');
119
-define('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_ADMIN', 'Blocks Admin');
117
+define('CO_'.$moduleDirNameUpper.'_'.'AGDS', 'Admin Groups');
118
+define('CO_'.$moduleDirNameUpper.'_'.'BCACHETIME', 'Cache Time');
119
+define('CO_'.$moduleDirNameUpper.'_'.'BLOCKS_ADMIN', 'Blocks Admin');
120 120
 
121 121
 //Template Admin
122
-define('CO_' . $moduleDirNameUpper . '_' . 'TPLSETS', 'Template Management');
123
-define('CO_' . $moduleDirNameUpper . '_' . 'GENERATE', 'Generate');
124
-define('CO_' . $moduleDirNameUpper . '_' . 'FILENAME', 'File Name');
122
+define('CO_'.$moduleDirNameUpper.'_'.'TPLSETS', 'Template Management');
123
+define('CO_'.$moduleDirNameUpper.'_'.'GENERATE', 'Generate');
124
+define('CO_'.$moduleDirNameUpper.'_'.'FILENAME', 'File Name');
125 125
 
126 126
 //Menu
127
-define('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_MIGRATE', 'Migrate');
128
-define('CO_' . $moduleDirNameUpper . '_' . 'FOLDER_YES', 'Folder "%s" exist');
129
-define('CO_' . $moduleDirNameUpper . '_' . 'FOLDER_NO', 'Folder "%s" does not exist. Create the specified folder with CHMOD 777.');
130
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS', 'Show Development Tools Button?');
131
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_DEV_TOOLS_DESC', 'If yes, the "Migrate" Tab and other Development tools will be visible to the Admin.');
132
-define('CO_' . $moduleDirNameUpper . '_' . 'ADMENU_FEEDBACK', 'Feedback');
127
+define('CO_'.$moduleDirNameUpper.'_'.'ADMENU_MIGRATE', 'Migrate');
128
+define('CO_'.$moduleDirNameUpper.'_'.'FOLDER_YES', 'Folder "%s" exist');
129
+define('CO_'.$moduleDirNameUpper.'_'.'FOLDER_NO', 'Folder "%s" does not exist. Create the specified folder with CHMOD 777.');
130
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_DEV_TOOLS', 'Show Development Tools Button?');
131
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_DEV_TOOLS_DESC', 'If yes, the "Migrate" Tab and other Development tools will be visible to the Admin.');
132
+define('CO_'.$moduleDirNameUpper.'_'.'ADMENU_FEEDBACK', 'Feedback');
133 133
 
134 134
 //Latest Version Check
135
-define('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION', 'New Version: ');
135
+define('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION', 'New Version: ');
136 136
 
137 137
 //DirectoryChecker
138
-define('CO_' . $moduleDirNameUpper . '_' . 'AVAILABLE', "<span style='color: green;'>Available</span>");
139
-define('CO_' . $moduleDirNameUpper . '_' . 'NOTAVAILABLE', "<span style='color: red;'>Not available</span>");
140
-define('CO_' . $moduleDirNameUpper . '_' . 'NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>");
141
-define('CO_' . $moduleDirNameUpper . '_' . 'CREATETHEDIR', 'Create it');
142
-define('CO_' . $moduleDirNameUpper . '_' . 'SETMPERM', 'Set the permission');
143
-define('CO_' . $moduleDirNameUpper . '_' . 'DIRCREATED', 'The directory has been created');
144
-define('CO_' . $moduleDirNameUpper . '_' . 'DIRNOTCREATED', 'The directory cannot be created');
145
-define('CO_' . $moduleDirNameUpper . '_' . 'PERMSET', 'The permission has been set');
146
-define('CO_' . $moduleDirNameUpper . '_' . 'PERMNOTSET', 'The permission cannot be set');
138
+define('CO_'.$moduleDirNameUpper.'_'.'AVAILABLE', "<span style='color: green;'>Available</span>");
139
+define('CO_'.$moduleDirNameUpper.'_'.'NOTAVAILABLE', "<span style='color: red;'>Not available</span>");
140
+define('CO_'.$moduleDirNameUpper.'_'.'NOTWRITABLE', "<span style='color: red;'>Should have permission ( %d ), but it has ( %d )</span>");
141
+define('CO_'.$moduleDirNameUpper.'_'.'CREATETHEDIR', 'Create it');
142
+define('CO_'.$moduleDirNameUpper.'_'.'SETMPERM', 'Set the permission');
143
+define('CO_'.$moduleDirNameUpper.'_'.'DIRCREATED', 'The directory has been created');
144
+define('CO_'.$moduleDirNameUpper.'_'.'DIRNOTCREATED', 'The directory cannot be created');
145
+define('CO_'.$moduleDirNameUpper.'_'.'PERMSET', 'The permission has been set');
146
+define('CO_'.$moduleDirNameUpper.'_'.'PERMNOTSET', 'The permission cannot be set');
147 147
 
148 148
 //FileChecker
149 149
 //define('CO_' . $moduleDirNameUpper . '_' . 'AVAILABLE', "<span style='color: green;'>Available</span>");
@@ -153,31 +153,31 @@  discard block
 block discarded – undo
153 153
 //define('CO_' . $moduleDirNameUpper . '_' . 'CREATETHEFILE', 'Create it');
154 154
 //define('CO_' . $moduleDirNameUpper . '_' . 'SETMPERM', 'Set the permission');
155 155
 
156
-define('CO_' . $moduleDirNameUpper . '_' . 'FILECOPIED', 'The file has been copied');
157
-define('CO_' . $moduleDirNameUpper . '_' . 'FILENOTCOPIED', 'The file cannot be copied');
156
+define('CO_'.$moduleDirNameUpper.'_'.'FILECOPIED', 'The file has been copied');
157
+define('CO_'.$moduleDirNameUpper.'_'.'FILENOTCOPIED', 'The file cannot be copied');
158 158
 
159 159
 //define('CO_' . $moduleDirNameUpper . '_' . 'PERMSET', 'The permission has been set');
160 160
 //define('CO_' . $moduleDirNameUpper . '_' . 'PERMNOTSET', 'The permission cannot be set');
161 161
 
162 162
 //image config
163
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', 'Image Display Width');
164
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', 'Display width for image');
165
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', 'Image Display Height');
166
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', 'Display height for image');
167
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', '<span style="color: #FF0000; font-size: Small;  font-weight: bold;">--- EXTERNAL Image configuration ---</span> ');
168
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', '');
169
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', 'Image Upload path');
170
-define('CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', 'Path for uploading images');
163
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH', 'Image Display Width');
164
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH_DSC', 'Display width for image');
165
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT', 'Image Display Height');
166
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT_DSC', 'Display height for image');
167
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG', '<span style="color: #FF0000; font-size: Small;  font-weight: bold;">--- EXTERNAL Image configuration ---</span> ');
168
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG_DSC', '');
169
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH', 'Image Upload path');
170
+define('CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH_DSC', 'Path for uploading images');
171 171
 
172 172
 //Preferences
173
-define('CO_' . $moduleDirNameUpper . '_' . 'TRUNCATE_LENGTH', 'Number of Characters to truncate to the long text field');
174
-define('CO_' . $moduleDirNameUpper . '_' . 'TRUNCATE_LENGTH_DESC', 'Set the maximum number of characters to truncate the long text fields');
173
+define('CO_'.$moduleDirNameUpper.'_'.'TRUNCATE_LENGTH', 'Number of Characters to truncate to the long text field');
174
+define('CO_'.$moduleDirNameUpper.'_'.'TRUNCATE_LENGTH_DESC', 'Set the maximum number of characters to truncate the long text fields');
175 175
 
176 176
 //Module Stats
177
-define('CO_' . $moduleDirNameUpper . '_' . 'STATS_SUMMARY', 'Module Statistics');
178
-define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_CATEGORIES', 'Categories:');
179
-define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_ITEMS', 'Items');
180
-define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_OFFLINE', 'Offline');
181
-define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_PUBLISHED', 'Published');
182
-define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_REJECTED', 'Rejected');
183
-define('CO_' . $moduleDirNameUpper . '_' . 'TOTAL_SUBMITTED', 'Submitted');
177
+define('CO_'.$moduleDirNameUpper.'_'.'STATS_SUMMARY', 'Module Statistics');
178
+define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_CATEGORIES', 'Categories:');
179
+define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_ITEMS', 'Items');
180
+define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_OFFLINE', 'Offline');
181
+define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_PUBLISHED', 'Published');
182
+define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_REJECTED', 'Rejected');
183
+define('CO_'.$moduleDirNameUpper.'_'.'TOTAL_SUBMITTED', 'Submitted');
Please login to merge, or discard this patch.
include/update.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
         update_tdmcreate_v191($module);
39 39
     }
40 40
 
41
-	tdmcreate_check_db($module);
41
+    tdmcreate_check_db($module);
42 42
 	
43
-	//check upload directory
44
-	include_once __DIR__ . '/install.php';
43
+    //check upload directory
44
+    include_once __DIR__ . '/install.php';
45 45
     xoops_module_install_tdmcreate($module);
46 46
 	
47 47
     $errors = $module->getErrors();
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 function tdmcreate_check_db($module)
122 122
 {
123 123
     $ret = true;
124
-	//insert here code for database check
124
+    //insert here code for database check
125 125
     global $xoopsDB;
126 126
 
127 127
     // new form field SelectStatus
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	tdmcreate_check_db($module);
42 42
 	
43 43
 	//check upload directory
44
-	include_once __DIR__ . '/install.php';
44
+	include_once __DIR__.'/install.php';
45 45
     xoops_module_install_tdmcreate($module);
46 46
 	
47 47
     $errors = $module->getErrors();
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 {
64 64
     global $xoopsDB;
65 65
     $result = $xoopsDB->query(
66
-        'SELECT t1.tpl_id FROM ' . $xoopsDB->prefix('tplfile') . ' t1, ' . $xoopsDB->prefix('tplfile') . ' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id'
66
+        'SELECT t1.tpl_id FROM '.$xoopsDB->prefix('tplfile').' t1, '.$xoopsDB->prefix('tplfile').' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id'
67 67
     );
68 68
     $tplids = [];
69 69
     while (list($tplid) = $xoopsDB->fetchRow($result)) {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     if (count($tplids) > 0) {
73 73
         $tplfileHandler  = xoops_getHandler('tplfile');
74 74
         $duplicate_files = $tplfileHandler->getObjects(
75
-            new \Criteria('tpl_id', '(' . implode(',', $tplids) . ')', 'IN')
75
+            new \Criteria('tpl_id', '('.implode(',', $tplids).')', 'IN')
76 76
         );
77 77
 
78 78
         if (count($duplicate_files) > 0) {
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
             }
82 82
         }
83 83
     }
84
-    $sql = 'SHOW INDEX FROM ' . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
84
+    $sql = 'SHOW INDEX FROM '.$xoopsDB->prefix('tplfile')." WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
85 85
     if (!$result = $xoopsDB->queryF($sql)) {
86
-        xoops_error($xoopsDB->error() . '<br />' . $sql);
86
+        xoops_error($xoopsDB->error().'<br />'.$sql);
87 87
 
88 88
         return false;
89 89
     }
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
         return true;
100 100
     }
101
-    $sql = 'ALTER TABLE ' . $xoopsDB->prefix('tplfile') . ' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
101
+    $sql = 'ALTER TABLE '.$xoopsDB->prefix('tplfile').' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
102 102
     if (!$result = $xoopsDB->queryF($sql)) {
103
-        xoops_error($xoopsDB->error() . '<br />' . $sql);
103
+        xoops_error($xoopsDB->error().'<br />'.$sql);
104 104
         $module->setErrors(
105 105
             "'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index."
106 106
         );
@@ -129,29 +129,29 @@  discard block
 block discarded – undo
129 129
     $fid    = 16;
130 130
     $fvalue = 'XoopsFormSelectStatus';
131 131
     $result = $xoopsDB->query(
132
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
132
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
133 133
     );
134 134
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
135 135
     if ($num_rows == 0) {
136 136
         $result = $xoopsDB->query(
137
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
137
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
138 138
         );
139 139
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
140 140
         if ($num_rows > 0) {
141 141
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
142 142
             //add existing element at end of table
143
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
143
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
144 144
             $result = $xoopsDB->query($sql);
145 145
             // update table fields to new id of previous 16
146 146
             $newId = $xoopsDB->getInsertId();
147
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
147
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
148 148
             $result = $xoopsDB->query($sql);
149 149
             // update 16 to new element
150
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
150
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
151 151
             $result = $xoopsDB->query($sql);
152 152
         } else {
153 153
             //add missing element
154
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
154
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
155 155
             $result = $xoopsDB->query($sql);
156 156
         }
157 157
     }
@@ -161,29 +161,29 @@  discard block
 block discarded – undo
161 161
     $fid    = 17;
162 162
     $fvalue = 'XoopsFormPassword';
163 163
     $result = $xoopsDB->query(
164
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
164
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
165 165
     );
166 166
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
167 167
     if ($num_rows == 0) {
168 168
         $result = $xoopsDB->query(
169
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
169
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
170 170
         );
171 171
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
172 172
         if ($num_rows > 0) {
173 173
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
174 174
             //add existing element at end of table
175
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
175
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
176 176
             $result = $xoopsDB->query($sql);
177 177
             // update table fields to new id of previous 16
178 178
             $newId = $xoopsDB->getInsertId();
179
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
179
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
180 180
             $result = $xoopsDB->query($sql);
181 181
             // update 16 to new element
182
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
182
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
183 183
             $result = $xoopsDB->query($sql);
184 184
         } else {
185 185
             //add missing element
186
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
186
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
187 187
             $result = $xoopsDB->query($sql);
188 188
         }
189 189
     }
@@ -193,29 +193,29 @@  discard block
 block discarded – undo
193 193
     $fid    = 18;
194 194
     $fvalue = 'XoopsFormSelectCountry';
195 195
     $result = $xoopsDB->query(
196
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
196
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
197 197
     );
198 198
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
199 199
     if ($num_rows == 0) {
200 200
         $result = $xoopsDB->query(
201
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
201
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
202 202
         );
203 203
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
204 204
         if ($num_rows > 0) {
205 205
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
206 206
             //add existing element at end of table
207
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
207
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
208 208
             $result = $xoopsDB->query($sql);
209 209
             // update table fields to new id of previous 16
210 210
             $newId = $xoopsDB->getInsertId();
211
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
211
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
212 212
             $result = $xoopsDB->query($sql);
213 213
             // update 16 to new element
214
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
214
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
215 215
             $result = $xoopsDB->query($sql);
216 216
         } else {
217 217
             //add missing element
218
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
218
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
219 219
             $result = $xoopsDB->query($sql);
220 220
         }
221 221
     }
@@ -225,29 +225,29 @@  discard block
 block discarded – undo
225 225
     $fid    = 19;
226 226
     $fvalue = 'XoopsFormSelectLang';
227 227
     $result = $xoopsDB->query(
228
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
228
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
229 229
     );
230 230
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
231 231
     if ($num_rows == 0) {
232 232
         $result = $xoopsDB->query(
233
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
233
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
234 234
         );
235 235
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
236 236
         if ($num_rows > 0) {
237 237
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
238 238
             //add existing element at end of table
239
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
239
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
240 240
             $result = $xoopsDB->query($sql);
241 241
             // update table fields to new id of previous 16
242 242
             $newId = $xoopsDB->getInsertId();
243
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
243
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
244 244
             $result = $xoopsDB->query($sql);
245 245
             // update 16 to new element
246
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
246
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
247 247
             $result = $xoopsDB->query($sql);
248 248
         } else {
249 249
             //add missing element
250
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
250
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
251 251
             $result = $xoopsDB->query($sql);
252 252
         }
253 253
     }
@@ -257,29 +257,29 @@  discard block
 block discarded – undo
257 257
     $fid    = 20;
258 258
     $fvalue = 'XoopsFormRadio';
259 259
     $result = $xoopsDB->query(
260
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
260
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
261 261
     );
262 262
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
263 263
     if ($num_rows == 0) {
264 264
         $result = $xoopsDB->query(
265
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
265
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
266 266
         );
267 267
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
268 268
         if ($num_rows > 0) {
269 269
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
270 270
             //add existing element at end of table
271
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
271
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
272 272
             $result = $xoopsDB->query($sql);
273 273
             // update table fields to new id of previous 16
274 274
             $newId = $xoopsDB->getInsertId();
275
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
275
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
276 276
             $result = $xoopsDB->query($sql);
277 277
             // update 16 to new element
278
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
278
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
279 279
             $result = $xoopsDB->query($sql);
280 280
         } else {
281 281
             //add missing element
282
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
282
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
283 283
             $result = $xoopsDB->query($sql);
284 284
         }
285 285
     }
@@ -289,29 +289,29 @@  discard block
 block discarded – undo
289 289
     $fid    = 21;
290 290
     $fvalue = 'XoopsFormDateTime';
291 291
     $result = $xoopsDB->query(
292
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
292
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
293 293
     );
294 294
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
295 295
     if ($num_rows == 0) {
296 296
         $result = $xoopsDB->query(
297
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
297
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
298 298
         );
299 299
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
300 300
         if ($num_rows > 0) {
301 301
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
302 302
             //add existing element at end of table
303
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
303
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
304 304
             $result = $xoopsDB->query($sql);
305 305
             // update table fields to new id of previous 16
306 306
             $newId = $xoopsDB->getInsertId();
307
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
307
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
308 308
             $result = $xoopsDB->query($sql);
309 309
             // update 16 to new element
310
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
310
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
311 311
             $result = $xoopsDB->query($sql);
312 312
         } else {
313 313
             //add missing element
314
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
314
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
315 315
             $result = $xoopsDB->query($sql);
316 316
         }
317 317
     }
@@ -321,29 +321,29 @@  discard block
 block discarded – undo
321 321
     $fid    = 22;
322 322
     $fvalue = 'XoopsFormSelectCombo';
323 323
     $result = $xoopsDB->query(
324
-        'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_name = '{$fname}'"
324
+        'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_name = '{$fname}'"
325 325
     );
326 326
     $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
327 327
     if ($num_rows == 0) {
328 328
         $result = $xoopsDB->query(
329
-            'SELECT * FROM ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " as fe WHERE fe.fieldelement_id ={$fid}"
329
+            'SELECT * FROM '.$xoopsDB->prefix('tdmcreate_fieldelements')." as fe WHERE fe.fieldelement_id ={$fid}"
330 330
         );
331 331
         $num_rows = $GLOBALS['xoopsDB']->getRowsNum($result);
332 332
         if ($num_rows > 0) {
333 333
             list($fe_id, $fe_mid, $fe_tid, $fe_name, $fe_value) = $xoopsDB->fetchRow($result);
334 334
             //add existing element at end of table
335
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
335
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '{$fe_mid}', '{$fe_tid}', '{$fe_name}', '{$fe_value}')";
336 336
             $result = $xoopsDB->query($sql);
337 337
             // update table fields to new id of previous 16
338 338
             $newId = $xoopsDB->getInsertId();
339
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fields') . "` SET `field_element` = '{$newId}' WHERE `" . $xoopsDB->prefix('tdmcreate_fields') . "`.`field_element` = '{$fid}';";
339
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fields')."` SET `field_element` = '{$newId}' WHERE `".$xoopsDB->prefix('tdmcreate_fields')."`.`field_element` = '{$fid}';";
340 340
             $result = $xoopsDB->query($sql);
341 341
             // update 16 to new element
342
-            $sql = 'UPDATE `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
342
+            $sql = 'UPDATE `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` SET `fieldelement_mid` = '0', `fieldelement_tid` = '0', `fieldelement_name` = '{$fname}', `fieldelement_value` = '{$fvalue}' WHERE `fieldelement_id` = {$fid};";
343 343
             $result = $xoopsDB->query($sql);
344 344
         } else {
345 345
             //add missing element
346
-            $sql = 'INSERT INTO `' . $xoopsDB->prefix('tdmcreate_fieldelements') . "` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
346
+            $sql = 'INSERT INTO `'.$xoopsDB->prefix('tdmcreate_fieldelements')."` (`fieldelement_id`, `fieldelement_mid`, `fieldelement_tid`, `fieldelement_name`, `fieldelement_value`) VALUES (NULL, '0', '0', '{$fname}', '{$fvalue}')";
347 347
             $result = $xoopsDB->query($sql);
348 348
         }
349 349
     }
@@ -351,12 +351,12 @@  discard block
 block discarded – undo
351 351
     // update table 'tdmcreate_fieldelements'
352 352
     $table   = $GLOBALS['xoopsDB']->prefix('tdmcreate_fieldelements');
353 353
     $field   = 'fieldelement_sort';
354
-    $check   = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
354
+    $check   = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
355 355
     $numRows = $GLOBALS['xoopsDB']->getRowsNum($check);
356 356
     if (!$numRows) {
357 357
         $sql = "ALTER TABLE `$table` ADD `$field` INT(8) NOT NULL DEFAULT '0' AFTER `fieldelement_value`;";
358 358
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
359
-            xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql);
359
+            xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql);
360 360
             $module->setErrors("Error when adding '$field' to table '$table'.");
361 361
             $ret = false;
362 362
         }
@@ -365,12 +365,12 @@  discard block
 block discarded – undo
365 365
     // update table 'tdmcreate_fieldelements'
366 366
     $table   = $GLOBALS['xoopsDB']->prefix('tdmcreate_fieldelements');
367 367
     $field   = 'fieldelement_deftype';
368
-    $check   = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
368
+    $check   = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
369 369
     $numRows = $GLOBALS['xoopsDB']->getRowsNum($check);
370 370
     if (!$numRows) {
371 371
         $sql = "ALTER TABLE `$table` ADD `$field` INT(10) NOT NULL DEFAULT '0' AFTER `fieldelement_sort`;";
372 372
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
373
-            xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql);
373
+            xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql);
374 374
             $module->setErrors("Error when adding '$field' to table '$table'.");
375 375
             $ret = false;
376 376
         }
@@ -379,26 +379,26 @@  discard block
 block discarded – undo
379 379
     // update table 'tdmcreate_fieldelements'
380 380
     $table   = $GLOBALS['xoopsDB']->prefix('tdmcreate_fieldelements');
381 381
     $field   = 'fieldelement_defvalue';
382
-    $check   = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
382
+    $check   = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
383 383
     $numRows = $GLOBALS['xoopsDB']->getRowsNum($check);
384 384
     if (!$numRows) {
385 385
         $sql = "ALTER TABLE `$table` ADD `$field` int(10) NULL DEFAULT '0' AFTER `fieldelement_deftype`;";
386 386
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
387
-            xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql);
387
+            xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql);
388 388
             $module->setErrors("Error when adding '$field' to table '$table'.");
389 389
             $ret = false;
390 390
         }
391 391
     }
392 392
 
393 393
     // set default values for form elements
394
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '255' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(2, 10, 11, 12, 13, 14, 17)");
395
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 15, `fieldelement_defvalue` = '0' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in (3, 4)");
396
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 2, `fieldelement_defvalue` = '10' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(5, 7, 8, 15, 20, 21, 22)");
397
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 2, `fieldelement_defvalue` = '1' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(6, 16)");
398
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '7' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(9)");
399
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '3' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(18)");
400
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '100' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(19)");
401
-    $result = $xoopsDB->query('UPDATE ' . $xoopsDB->prefix('tdmcreate_fieldelements') . " SET `fieldelement_deftype` = 2, `fieldelement_defvalue` = '10' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_mid` > 0");
394
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '255' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(2, 10, 11, 12, 13, 14, 17)");
395
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 15, `fieldelement_defvalue` = '0' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in (3, 4)");
396
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 2, `fieldelement_defvalue` = '10' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(5, 7, 8, 15, 20, 21, 22)");
397
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 2, `fieldelement_defvalue` = '1' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(6, 16)");
398
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '7' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(9)");
399
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '3' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(18)");
400
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 14, `fieldelement_defvalue` = '100' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_id` in(19)");
401
+    $result = $xoopsDB->query('UPDATE '.$xoopsDB->prefix('tdmcreate_fieldelements')." SET `fieldelement_deftype` = 2, `fieldelement_defvalue` = '10' WHERE `xc_tdmcreate_fieldelements`.`fieldelement_mid` > 0");
402 402
 
403 403
     return $ret;
404 404
 }
Please login to merge, or discard this patch.
_archive/class/Files/CreateHtmlSmartyCodes.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $str = '';
93 93
         foreach ($attributes as $name => $value) {
94 94
             if ('_' !== $name) {
95
-                $str .= ' ' . $name . '="' . $value . '"';
95
+                $str .= ' '.$name.'="'.$value.'"';
96 96
             }
97 97
         }
98 98
 
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
         $rDivClass = ('' != $divClass) ? " class='{$divClass}'" : '';
178 178
 
179 179
         if ($split) {
180
-            $ret       = "{$t}<div{$rDivClass}>{$n}";
180
+            $ret = "{$t}<div{$rDivClass}>{$n}";
181 181
             $ret       .= "{$content}";
182 182
             $ret       .= "{$t}</div>{$n}";
183 183
         } else {
184
-            $ret       = "{$t}<div{$rDivClass}>{$content}</div>{$n}";
184
+            $ret = "{$t}<div{$rDivClass}>{$content}</div>{$n}";
185 185
         }
186 186
 
187 187
         return $ret;
@@ -307,15 +307,15 @@  discard block
 block discarded – undo
307 307
      * @param bool $split
308 308
      * @return string
309 309
      */
310
-    public function getHtmlLi($content = '', $liClass = '', $t = '', $n = "\n",  $split = false)
310
+    public function getHtmlLi($content = '', $liClass = '', $t = '', $n = "\n", $split = false)
311 311
     {
312 312
         $rLiClass = ('' != $liClass) ? " class='{$liClass}'" : '';
313 313
         if ($split) {
314
-            $ret       = "{$t}<li{$rLiClass}>{$n}";
314
+            $ret = "{$t}<li{$rLiClass}>{$n}";
315 315
             $ret       .= "{$content}";
316 316
             $ret       .= "{$t}</li>{$n}";
317 317
         } else {
318
-            $ret       = "{$t}<li{$rLiClass}>{$content}</li>{$n}";
318
+            $ret = "{$t}<li{$rLiClass}>{$content}</li>{$n}";
319 319
         }
320 320
 
321 321
         return $ret;
@@ -447,11 +447,11 @@  discard block
 block discarded – undo
447 447
     {
448 448
         $rTfootClass = ('' != $tfootClass) ? " class='{$tfootClass}'" : '';
449 449
         if ($split) {
450
-            $ret         = "{$t}<tfoot{$rTfootClass}>{$n}";
450
+            $ret = "{$t}<tfoot{$rTfootClass}>{$n}";
451 451
             $ret         .= "{$content}";
452 452
             $ret         .= "{$t}</tfoot>{$n}";
453 453
         } else {
454
-            $ret         = "{$t}<tfoot{$rTfootClass}>{$content}</tfoot>{$n}";
454
+            $ret = "{$t}<tfoot{$rTfootClass}>{$content}</tfoot>{$n}";
455 455
         }
456 456
 
457 457
         return $ret;
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
         $rThClass = ('' != $thClass) ? " class='{$thClass}'" : '';
493 493
         $colspan  = ('' != $colspan) ? " colspan='{$colspan}'" : '';
494 494
         if ($split) {
495
-            $ret      = "{$t}<th{$colspan}{$rThClass}>{$n}";
495
+            $ret = "{$t}<th{$colspan}{$rThClass}>{$n}";
496 496
             $ret      .= "{$content}";
497 497
             $ret      .= "{$t}</th>{$n}";
498 498
         } else {
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         $rTdClass = ('' != $tdClass) ? " class='{$tdClass}'" : '';
518 518
         $colspan  = ('' != $colspan) ? " colspan='{$colspan}'" : '';
519 519
         if ($split) {
520
-            $ret      = "{$t}<td{$colspan}{$rTdClass}>{$n}";
520
+            $ret = "{$t}<td{$colspan}{$rTdClass}>{$n}";
521 521
             $ret      .= "{$content}";
522 522
             $ret      .= "{$t}</td>{$n}";
523 523
         } else {
Please login to merge, or discard this patch.
testdata/mymodule2/submit.php 3 patches
Indentation   +198 added lines, -198 removed lines patch added patch discarded remove patch
@@ -36,208 +36,208 @@
 block discarded – undo
36 36
 $permSubmit = $permissionsHandler->getPermGlobalSubmit();
37 37
 // Redirection if not permissions
38 38
 if ($permSubmit === false) {
39
-	redirect_header('index.php', 2, _NOPERM);
40
-	exit();
39
+    redirect_header('index.php', 2, _NOPERM);
40
+    exit();
41 41
 }
42 42
 switch($op) {
43
-	case 'form':
44
-	default:
45
-		// Navigation
46
-		$navigation = _MA_MYMODULE2_SUBMIT_PROPOSER;
47
-		$GLOBALS['xoopsTpl']->assign('navigation', $navigation);
48
-		// Title of page
49
-		$title = _MA_MYMODULE2_SUBMIT_PROPOSER . '&nbsp;-&nbsp;';
50
-		$title .= $GLOBALS['xoopsModule']->name();
51
-		$GLOBALS['xoopsTpl']->assign('xoops_pagetitle', $title);
52
-		// Description
53
-		$GLOBALS['xoTheme']->addMeta( 'meta', 'description', strip_tags(_MA_MYMODULE2_SUBMIT_PROPOSER));
54
-		// Form Create
55
-		$testfieldsObj = $testfieldsHandler->create();
56
-		$form = $testfieldsObj->getFormTestfields();
57
-		$GLOBALS['xoopsTpl']->assign('form', $form->render());
43
+    case 'form':
44
+    default:
45
+        // Navigation
46
+        $navigation = _MA_MYMODULE2_SUBMIT_PROPOSER;
47
+        $GLOBALS['xoopsTpl']->assign('navigation', $navigation);
48
+        // Title of page
49
+        $title = _MA_MYMODULE2_SUBMIT_PROPOSER . '&nbsp;-&nbsp;';
50
+        $title .= $GLOBALS['xoopsModule']->name();
51
+        $GLOBALS['xoopsTpl']->assign('xoops_pagetitle', $title);
52
+        // Description
53
+        $GLOBALS['xoTheme']->addMeta( 'meta', 'description', strip_tags(_MA_MYMODULE2_SUBMIT_PROPOSER));
54
+        // Form Create
55
+        $testfieldsObj = $testfieldsHandler->create();
56
+        $form = $testfieldsObj->getFormTestfields();
57
+        $GLOBALS['xoopsTpl']->assign('form', $form->render());
58 58
 
59
-	break;
60
-	case 'save':
61
-		// Security Check
62
-		if (!$GLOBALS['xoopsSecurity']->check()) {
63
-			redirect_header('testfields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
64
-		}
65
-		$testfieldsObj = $testfieldsHandler->create();
66
-		$testfieldsObj->setVar('tf_text', Request::getString('tf_text', ''));
67
-		$testfieldsObj->setVar('tf_textarea', Request::getString('tf_textarea', ''));
68
-		$testfieldsObj->setVar('tf_dhtml', Request::getString('tf_dhtml', ''));
69
-		$testfieldsObj->setVar('tf_checkbox', Request::getInt('tf_checkbox', 0));
70
-		$testfieldsObj->setVar('tf_yesno', Request::getInt('tf_yesno', 0));
71
-		$testfieldsObj->setVar('tf_selectbox', Request::getString('tf_selectbox', ''));
72
-		$testfieldsObj->setVar('tf_user', Request::getInt('tf_user', 0));
73
-		$testfieldsObj->setVar('tf_color', Request::getString('tf_color', ''));
74
-		// Set Var tf_imagelist
75
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
76
-		$uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32', 
77
-													$helper->getConfig('mimetypes_image'), 
78
-													$helper->getConfig('maxsize_image'), null, null);
79
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
80
-			//$uploader->setPrefix(tf_imagelist_);
81
-			//$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
82
-			if (!$uploader->upload()) {
83
-				$errors = $uploader->getErrors();
84
-				redirect_header('javascript:history.go(-1).php', 3, $errors);
85
-			} else {
86
-				$testfieldsObj->setVar('tf_imagelist', $uploader->getSavedFileName());
87
-			}
88
-		} else {
89
-			$testfieldsObj->setVar('tf_imagelist', Request::getString('tf_imagelist'));
90
-		}
91
-		$testfieldsObj->setVar('tf_urlfile', formatUrl($_REQUEST['tf_urlfile']));
92
-		// Set Var tf_urlfile
93
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
94
-		$filename       = $_FILES['tf_urlfile']['name'];
95
-		$imgNameDef     = Request::getString('tf_text');
96
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
97
-													$helper->getConfig('mimetypes_file'), 
98
-													$helper->getConfig('maxsize_file'), null, null);
99
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][1])) {
100
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
101
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
102
-			$uploader->setPrefix($imgName);
103
-			$uploader->fetchMedia($_POST['xoops_upload_file'][1]);
104
-			if (!$uploader->upload()) {
105
-				$errors = $uploader->getErrors();
106
-			} else {
107
-				$testfieldsObj->setVar('tf_urlfile', $uploader->getSavedFileName());
108
-			}
109
-		} else {
110
-			if ($filename > '') {
111
-				$uploaderErrors = $uploader->getErrors();
112
-			}
113
-			$testfieldsObj->setVar('tf_urlfile', Request::getString('tf_urlfile'));
114
-		}
115
-		// Set Var tf_uplimage
116
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
117
-		$filename       = $_FILES['tf_uplimage']['name'];
118
-		$imgMimetype    = $_FILES['tf_uplimage']['type'];
119
-		$imgNameDef     = Request::getString('tf_text');
120
-		$uploaderErrors = '';
121
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/', 
122
-													$helper->getConfig('mimetypes_image'), 
123
-													$helper->getConfig('maxsize_image'), null, null);
124
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][2])) {
125
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
126
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
127
-			$uploader->setPrefix($imgName);
128
-			$uploader->fetchMedia($_POST['xoops_upload_file'][2]);
129
-			if (!$uploader->upload()) {
130
-				$uploaderErrors = $uploader->getErrors();
131
-			} else {
132
-				$savedFilename = $uploader->getSavedFileName();
133
-				$maxwidth  = (int)$helper->getConfig('maxwidth_image');
134
-				$maxheight = (int)$helper->getConfig('maxheight_image');
135
-				if ($maxwidth > 0 && $maxheight > 0) {
136
-					// Resize image
137
-					$imgHandler                = new Mymodule2\Common\Resizer();
138
-					$imgHandler->sourceFile    = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
139
-					$imgHandler->endFile       = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
140
-					$imgHandler->imageMimetype = $imgMimetype;
141
-					$imgHandler->maxWidth      = $maxwidth;
142
-					$imgHandler->maxHeight     = $maxheight;
143
-					$result                    = $imgHandler->resizeImage();
144
-				}
145
-				$testfieldsObj->setVar('tf_uplimage', $savedFilename);
146
-			}
147
-		} else {
148
-			if ($filename > '') {
149
-				$uploaderErrors = $uploader->getErrors();
150
-			}
151
-			$testfieldsObj->setVar('tf_uplimage', Request::getString('tf_uplimage'));
152
-		}
153
-		// Set Var tf_uplfile
154
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
155
-		$filename       = $_FILES['tf_uplfile']['name'];
156
-		$imgNameDef     = Request::getString('tf_text');
157
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
158
-													$helper->getConfig('mimetypes_file'), 
159
-													$helper->getConfig('maxsize_file'), null, null);
160
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][3])) {
161
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
162
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
163
-			$uploader->setPrefix($imgName);
164
-			$uploader->fetchMedia($_POST['xoops_upload_file'][3]);
165
-			if (!$uploader->upload()) {
166
-				$errors = $uploader->getErrors();
167
-			} else {
168
-				$testfieldsObj->setVar('tf_uplfile', $uploader->getSavedFileName());
169
-			}
170
-		} else {
171
-			if ($filename > '') {
172
-				$uploaderErrors = $uploader->getErrors();
173
-			}
174
-			$testfieldsObj->setVar('tf_uplfile', Request::getString('tf_uplfile'));
175
-		}
176
-		$testfieldTextdateselect = date_create_from_format(_SHORTDATESTRING, Request::getString('tf_textdateselect'));
177
-		$testfieldsObj->setVar('tf_textdateselect', $testfieldTextdateselect->getTimestamp());
178
-		// Set Var tf_selectfile
179
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
180
-		$filename       = $_FILES['tf_selectfile']['name'];
181
-		$imgNameDef     = Request::getString('tf_text');
182
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
183
-													$helper->getConfig('mimetypes_file'), 
184
-													$helper->getConfig('maxsize_file'), null, null);
185
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][4])) {
186
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
187
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
188
-			$uploader->setPrefix($imgName);
189
-			$uploader->fetchMedia($_POST['xoops_upload_file'][4]);
190
-			if (!$uploader->upload()) {
191
-				$errors = $uploader->getErrors();
192
-			} else {
193
-				$testfieldsObj->setVar('tf_selectfile', $uploader->getSavedFileName());
194
-			}
195
-		} else {
196
-			if ($filename > '') {
197
-				$uploaderErrors = $uploader->getErrors();
198
-			}
199
-			$testfieldsObj->setVar('tf_selectfile', Request::getString('tf_selectfile'));
200
-		}
201
-		$testfieldsObj->setVar('tf_status', Request::getInt('tf_status', 0));
202
-		// Insert Data
203
-		if ($testfieldsHandler->insert($testfieldsObj)) {
204
-			$newTfId = $testfieldsObj->getNewInsertedIdTestfields();
205
-			$permId = isset($_REQUEST['tf_id']) ? $tfId : $newTfId;
206
-			$grouppermHandler = xoops_getHandler('groupperm');
207
-			$mid = $GLOBALS['xoopsModule']->getVar('mid');
208
-			// Permission to view_testfields
209
-			$grouppermHandler->deleteByModule($mid, 'mymodule2_view_testfields', $permId);
210
-			if (isset($_POST['groups_view_testfields'])) {
211
-				foreach($_POST['groups_view_testfields'] as $onegroupId) {
212
-					$grouppermHandler->addRight('mymodule2_view_testfields', $permId, $onegroupId, $mid);
213
-				}
214
-			}
215
-			// Permission to submit_testfields
216
-			$grouppermHandler->deleteByModule($mid, 'mymodule2_submit_testfields', $permId);
217
-			if (isset($_POST['groups_submit_testfields'])) {
218
-				foreach($_POST['groups_submit_testfields'] as $onegroupId) {
219
-					$grouppermHandler->addRight('mymodule2_submit_testfields', $permId, $onegroupId, $mid);
220
-				}
221
-			}
222
-			// Permission to approve_testfields
223
-			$grouppermHandler->deleteByModule($mid, 'mymodule2_approve_testfields', $permId);
224
-			if (isset($_POST['groups_approve_testfields'])) {
225
-				foreach($_POST['groups_approve_testfields'] as $onegroupId) {
226
-					$grouppermHandler->addRight('mymodule2_approve_testfields', $permId, $onegroupId, $mid);
227
-				}
228
-			}
229
-			if ('' !== $uploaderErrors) {
230
-				redirect_header('testfields.php?op=edit&tf_id=' . $tfId, 5, $uploaderErrors);
231
-			} else {
232
-				redirect_header('testfields.php?op=list', 2, _MA_MYMODULE2_FORM_OK);
233
-			}
234
-		}
235
-		// Get Form Error
236
-		$GLOBALS['xoopsTpl']->assign('error', $testfieldsObj->getHtmlErrors());
237
-		$form = $testfieldsObj->getFormTestfields();
238
-		$GLOBALS['xoopsTpl']->assign('form', $form->display());
59
+    break;
60
+    case 'save':
61
+        // Security Check
62
+        if (!$GLOBALS['xoopsSecurity']->check()) {
63
+            redirect_header('testfields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
64
+        }
65
+        $testfieldsObj = $testfieldsHandler->create();
66
+        $testfieldsObj->setVar('tf_text', Request::getString('tf_text', ''));
67
+        $testfieldsObj->setVar('tf_textarea', Request::getString('tf_textarea', ''));
68
+        $testfieldsObj->setVar('tf_dhtml', Request::getString('tf_dhtml', ''));
69
+        $testfieldsObj->setVar('tf_checkbox', Request::getInt('tf_checkbox', 0));
70
+        $testfieldsObj->setVar('tf_yesno', Request::getInt('tf_yesno', 0));
71
+        $testfieldsObj->setVar('tf_selectbox', Request::getString('tf_selectbox', ''));
72
+        $testfieldsObj->setVar('tf_user', Request::getInt('tf_user', 0));
73
+        $testfieldsObj->setVar('tf_color', Request::getString('tf_color', ''));
74
+        // Set Var tf_imagelist
75
+        include_once XOOPS_ROOT_PATH . '/class/uploader.php';
76
+        $uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32', 
77
+                                                    $helper->getConfig('mimetypes_image'), 
78
+                                                    $helper->getConfig('maxsize_image'), null, null);
79
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
80
+            //$uploader->setPrefix(tf_imagelist_);
81
+            //$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
82
+            if (!$uploader->upload()) {
83
+                $errors = $uploader->getErrors();
84
+                redirect_header('javascript:history.go(-1).php', 3, $errors);
85
+            } else {
86
+                $testfieldsObj->setVar('tf_imagelist', $uploader->getSavedFileName());
87
+            }
88
+        } else {
89
+            $testfieldsObj->setVar('tf_imagelist', Request::getString('tf_imagelist'));
90
+        }
91
+        $testfieldsObj->setVar('tf_urlfile', formatUrl($_REQUEST['tf_urlfile']));
92
+        // Set Var tf_urlfile
93
+        include_once XOOPS_ROOT_PATH . '/class/uploader.php';
94
+        $filename       = $_FILES['tf_urlfile']['name'];
95
+        $imgNameDef     = Request::getString('tf_text');
96
+        $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
97
+                                                    $helper->getConfig('mimetypes_file'), 
98
+                                                    $helper->getConfig('maxsize_file'), null, null);
99
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][1])) {
100
+            $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
101
+            $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
102
+            $uploader->setPrefix($imgName);
103
+            $uploader->fetchMedia($_POST['xoops_upload_file'][1]);
104
+            if (!$uploader->upload()) {
105
+                $errors = $uploader->getErrors();
106
+            } else {
107
+                $testfieldsObj->setVar('tf_urlfile', $uploader->getSavedFileName());
108
+            }
109
+        } else {
110
+            if ($filename > '') {
111
+                $uploaderErrors = $uploader->getErrors();
112
+            }
113
+            $testfieldsObj->setVar('tf_urlfile', Request::getString('tf_urlfile'));
114
+        }
115
+        // Set Var tf_uplimage
116
+        include_once XOOPS_ROOT_PATH . '/class/uploader.php';
117
+        $filename       = $_FILES['tf_uplimage']['name'];
118
+        $imgMimetype    = $_FILES['tf_uplimage']['type'];
119
+        $imgNameDef     = Request::getString('tf_text');
120
+        $uploaderErrors = '';
121
+        $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/', 
122
+                                                    $helper->getConfig('mimetypes_image'), 
123
+                                                    $helper->getConfig('maxsize_image'), null, null);
124
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][2])) {
125
+            $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
126
+            $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
127
+            $uploader->setPrefix($imgName);
128
+            $uploader->fetchMedia($_POST['xoops_upload_file'][2]);
129
+            if (!$uploader->upload()) {
130
+                $uploaderErrors = $uploader->getErrors();
131
+            } else {
132
+                $savedFilename = $uploader->getSavedFileName();
133
+                $maxwidth  = (int)$helper->getConfig('maxwidth_image');
134
+                $maxheight = (int)$helper->getConfig('maxheight_image');
135
+                if ($maxwidth > 0 && $maxheight > 0) {
136
+                    // Resize image
137
+                    $imgHandler                = new Mymodule2\Common\Resizer();
138
+                    $imgHandler->sourceFile    = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
139
+                    $imgHandler->endFile       = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
140
+                    $imgHandler->imageMimetype = $imgMimetype;
141
+                    $imgHandler->maxWidth      = $maxwidth;
142
+                    $imgHandler->maxHeight     = $maxheight;
143
+                    $result                    = $imgHandler->resizeImage();
144
+                }
145
+                $testfieldsObj->setVar('tf_uplimage', $savedFilename);
146
+            }
147
+        } else {
148
+            if ($filename > '') {
149
+                $uploaderErrors = $uploader->getErrors();
150
+            }
151
+            $testfieldsObj->setVar('tf_uplimage', Request::getString('tf_uplimage'));
152
+        }
153
+        // Set Var tf_uplfile
154
+        include_once XOOPS_ROOT_PATH . '/class/uploader.php';
155
+        $filename       = $_FILES['tf_uplfile']['name'];
156
+        $imgNameDef     = Request::getString('tf_text');
157
+        $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
158
+                                                    $helper->getConfig('mimetypes_file'), 
159
+                                                    $helper->getConfig('maxsize_file'), null, null);
160
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][3])) {
161
+            $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
162
+            $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
163
+            $uploader->setPrefix($imgName);
164
+            $uploader->fetchMedia($_POST['xoops_upload_file'][3]);
165
+            if (!$uploader->upload()) {
166
+                $errors = $uploader->getErrors();
167
+            } else {
168
+                $testfieldsObj->setVar('tf_uplfile', $uploader->getSavedFileName());
169
+            }
170
+        } else {
171
+            if ($filename > '') {
172
+                $uploaderErrors = $uploader->getErrors();
173
+            }
174
+            $testfieldsObj->setVar('tf_uplfile', Request::getString('tf_uplfile'));
175
+        }
176
+        $testfieldTextdateselect = date_create_from_format(_SHORTDATESTRING, Request::getString('tf_textdateselect'));
177
+        $testfieldsObj->setVar('tf_textdateselect', $testfieldTextdateselect->getTimestamp());
178
+        // Set Var tf_selectfile
179
+        include_once XOOPS_ROOT_PATH . '/class/uploader.php';
180
+        $filename       = $_FILES['tf_selectfile']['name'];
181
+        $imgNameDef     = Request::getString('tf_text');
182
+        $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
183
+                                                    $helper->getConfig('mimetypes_file'), 
184
+                                                    $helper->getConfig('maxsize_file'), null, null);
185
+        if ($uploader->fetchMedia($_POST['xoops_upload_file'][4])) {
186
+            $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
187
+            $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
188
+            $uploader->setPrefix($imgName);
189
+            $uploader->fetchMedia($_POST['xoops_upload_file'][4]);
190
+            if (!$uploader->upload()) {
191
+                $errors = $uploader->getErrors();
192
+            } else {
193
+                $testfieldsObj->setVar('tf_selectfile', $uploader->getSavedFileName());
194
+            }
195
+        } else {
196
+            if ($filename > '') {
197
+                $uploaderErrors = $uploader->getErrors();
198
+            }
199
+            $testfieldsObj->setVar('tf_selectfile', Request::getString('tf_selectfile'));
200
+        }
201
+        $testfieldsObj->setVar('tf_status', Request::getInt('tf_status', 0));
202
+        // Insert Data
203
+        if ($testfieldsHandler->insert($testfieldsObj)) {
204
+            $newTfId = $testfieldsObj->getNewInsertedIdTestfields();
205
+            $permId = isset($_REQUEST['tf_id']) ? $tfId : $newTfId;
206
+            $grouppermHandler = xoops_getHandler('groupperm');
207
+            $mid = $GLOBALS['xoopsModule']->getVar('mid');
208
+            // Permission to view_testfields
209
+            $grouppermHandler->deleteByModule($mid, 'mymodule2_view_testfields', $permId);
210
+            if (isset($_POST['groups_view_testfields'])) {
211
+                foreach($_POST['groups_view_testfields'] as $onegroupId) {
212
+                    $grouppermHandler->addRight('mymodule2_view_testfields', $permId, $onegroupId, $mid);
213
+                }
214
+            }
215
+            // Permission to submit_testfields
216
+            $grouppermHandler->deleteByModule($mid, 'mymodule2_submit_testfields', $permId);
217
+            if (isset($_POST['groups_submit_testfields'])) {
218
+                foreach($_POST['groups_submit_testfields'] as $onegroupId) {
219
+                    $grouppermHandler->addRight('mymodule2_submit_testfields', $permId, $onegroupId, $mid);
220
+                }
221
+            }
222
+            // Permission to approve_testfields
223
+            $grouppermHandler->deleteByModule($mid, 'mymodule2_approve_testfields', $permId);
224
+            if (isset($_POST['groups_approve_testfields'])) {
225
+                foreach($_POST['groups_approve_testfields'] as $onegroupId) {
226
+                    $grouppermHandler->addRight('mymodule2_approve_testfields', $permId, $onegroupId, $mid);
227
+                }
228
+            }
229
+            if ('' !== $uploaderErrors) {
230
+                redirect_header('testfields.php?op=edit&tf_id=' . $tfId, 5, $uploaderErrors);
231
+            } else {
232
+                redirect_header('testfields.php?op=list', 2, _MA_MYMODULE2_FORM_OK);
233
+            }
234
+        }
235
+        // Get Form Error
236
+        $GLOBALS['xoopsTpl']->assign('error', $testfieldsObj->getHtmlErrors());
237
+        $form = $testfieldsObj->getFormTestfields();
238
+        $GLOBALS['xoopsTpl']->assign('form', $form->display());
239 239
 
240
-	break;
240
+    break;
241 241
 }
242 242
 // Breadcrumbs
243 243
 $xoBreadcrumbs[] = ['title' => _MA_MYMODULE2_SUBMIT];
Please login to merge, or discard this patch.
Switch Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -40,204 +40,204 @@
 block discarded – undo
40 40
 	exit();
41 41
 }
42 42
 switch($op) {
43
-	case 'form':
44
-	default:
45
-		// Navigation
46
-		$navigation = _MA_MYMODULE2_SUBMIT_PROPOSER;
47
-		$GLOBALS['xoopsTpl']->assign('navigation', $navigation);
48
-		// Title of page
49
-		$title = _MA_MYMODULE2_SUBMIT_PROPOSER . '&nbsp;-&nbsp;';
50
-		$title .= $GLOBALS['xoopsModule']->name();
51
-		$GLOBALS['xoopsTpl']->assign('xoops_pagetitle', $title);
52
-		// Description
53
-		$GLOBALS['xoTheme']->addMeta( 'meta', 'description', strip_tags(_MA_MYMODULE2_SUBMIT_PROPOSER));
54
-		// Form Create
55
-		$testfieldsObj = $testfieldsHandler->create();
56
-		$form = $testfieldsObj->getFormTestfields();
57
-		$GLOBALS['xoopsTpl']->assign('form', $form->render());
43
+	    case 'form':
44
+	    default:
45
+		    // Navigation
46
+		    $navigation = _MA_MYMODULE2_SUBMIT_PROPOSER;
47
+		    $GLOBALS['xoopsTpl']->assign('navigation', $navigation);
48
+		    // Title of page
49
+		    $title = _MA_MYMODULE2_SUBMIT_PROPOSER . '&nbsp;-&nbsp;';
50
+		    $title .= $GLOBALS['xoopsModule']->name();
51
+		    $GLOBALS['xoopsTpl']->assign('xoops_pagetitle', $title);
52
+		    // Description
53
+		    $GLOBALS['xoTheme']->addMeta( 'meta', 'description', strip_tags(_MA_MYMODULE2_SUBMIT_PROPOSER));
54
+		    // Form Create
55
+		    $testfieldsObj = $testfieldsHandler->create();
56
+		    $form = $testfieldsObj->getFormTestfields();
57
+		    $GLOBALS['xoopsTpl']->assign('form', $form->render());
58 58
 
59
-	break;
60
-	case 'save':
61
-		// Security Check
62
-		if (!$GLOBALS['xoopsSecurity']->check()) {
63
-			redirect_header('testfields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
64
-		}
65
-		$testfieldsObj = $testfieldsHandler->create();
66
-		$testfieldsObj->setVar('tf_text', Request::getString('tf_text', ''));
67
-		$testfieldsObj->setVar('tf_textarea', Request::getString('tf_textarea', ''));
68
-		$testfieldsObj->setVar('tf_dhtml', Request::getString('tf_dhtml', ''));
69
-		$testfieldsObj->setVar('tf_checkbox', Request::getInt('tf_checkbox', 0));
70
-		$testfieldsObj->setVar('tf_yesno', Request::getInt('tf_yesno', 0));
71
-		$testfieldsObj->setVar('tf_selectbox', Request::getString('tf_selectbox', ''));
72
-		$testfieldsObj->setVar('tf_user', Request::getInt('tf_user', 0));
73
-		$testfieldsObj->setVar('tf_color', Request::getString('tf_color', ''));
74
-		// Set Var tf_imagelist
75
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
76
-		$uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32', 
77
-													$helper->getConfig('mimetypes_image'), 
78
-													$helper->getConfig('maxsize_image'), null, null);
79
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
80
-			//$uploader->setPrefix(tf_imagelist_);
81
-			//$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
82
-			if (!$uploader->upload()) {
83
-				$errors = $uploader->getErrors();
84
-				redirect_header('javascript:history.go(-1).php', 3, $errors);
85
-			} else {
86
-				$testfieldsObj->setVar('tf_imagelist', $uploader->getSavedFileName());
87
-			}
88
-		} else {
89
-			$testfieldsObj->setVar('tf_imagelist', Request::getString('tf_imagelist'));
90
-		}
91
-		$testfieldsObj->setVar('tf_urlfile', formatUrl($_REQUEST['tf_urlfile']));
92
-		// Set Var tf_urlfile
93
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
94
-		$filename       = $_FILES['tf_urlfile']['name'];
95
-		$imgNameDef     = Request::getString('tf_text');
96
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
97
-													$helper->getConfig('mimetypes_file'), 
98
-													$helper->getConfig('maxsize_file'), null, null);
99
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][1])) {
100
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
101
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
102
-			$uploader->setPrefix($imgName);
103
-			$uploader->fetchMedia($_POST['xoops_upload_file'][1]);
104
-			if (!$uploader->upload()) {
105
-				$errors = $uploader->getErrors();
106
-			} else {
107
-				$testfieldsObj->setVar('tf_urlfile', $uploader->getSavedFileName());
108
-			}
109
-		} else {
110
-			if ($filename > '') {
111
-				$uploaderErrors = $uploader->getErrors();
112
-			}
113
-			$testfieldsObj->setVar('tf_urlfile', Request::getString('tf_urlfile'));
114
-		}
115
-		// Set Var tf_uplimage
116
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
117
-		$filename       = $_FILES['tf_uplimage']['name'];
118
-		$imgMimetype    = $_FILES['tf_uplimage']['type'];
119
-		$imgNameDef     = Request::getString('tf_text');
120
-		$uploaderErrors = '';
121
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/', 
122
-													$helper->getConfig('mimetypes_image'), 
123
-													$helper->getConfig('maxsize_image'), null, null);
124
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][2])) {
125
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
126
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
127
-			$uploader->setPrefix($imgName);
128
-			$uploader->fetchMedia($_POST['xoops_upload_file'][2]);
129
-			if (!$uploader->upload()) {
130
-				$uploaderErrors = $uploader->getErrors();
131
-			} else {
132
-				$savedFilename = $uploader->getSavedFileName();
133
-				$maxwidth  = (int)$helper->getConfig('maxwidth_image');
134
-				$maxheight = (int)$helper->getConfig('maxheight_image');
135
-				if ($maxwidth > 0 && $maxheight > 0) {
136
-					// Resize image
137
-					$imgHandler                = new Mymodule2\Common\Resizer();
138
-					$imgHandler->sourceFile    = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
139
-					$imgHandler->endFile       = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
140
-					$imgHandler->imageMimetype = $imgMimetype;
141
-					$imgHandler->maxWidth      = $maxwidth;
142
-					$imgHandler->maxHeight     = $maxheight;
143
-					$result                    = $imgHandler->resizeImage();
144
-				}
145
-				$testfieldsObj->setVar('tf_uplimage', $savedFilename);
146
-			}
147
-		} else {
148
-			if ($filename > '') {
149
-				$uploaderErrors = $uploader->getErrors();
150
-			}
151
-			$testfieldsObj->setVar('tf_uplimage', Request::getString('tf_uplimage'));
152
-		}
153
-		// Set Var tf_uplfile
154
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
155
-		$filename       = $_FILES['tf_uplfile']['name'];
156
-		$imgNameDef     = Request::getString('tf_text');
157
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
158
-													$helper->getConfig('mimetypes_file'), 
159
-													$helper->getConfig('maxsize_file'), null, null);
160
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][3])) {
161
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
162
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
163
-			$uploader->setPrefix($imgName);
164
-			$uploader->fetchMedia($_POST['xoops_upload_file'][3]);
165
-			if (!$uploader->upload()) {
166
-				$errors = $uploader->getErrors();
167
-			} else {
168
-				$testfieldsObj->setVar('tf_uplfile', $uploader->getSavedFileName());
169
-			}
170
-		} else {
171
-			if ($filename > '') {
172
-				$uploaderErrors = $uploader->getErrors();
173
-			}
174
-			$testfieldsObj->setVar('tf_uplfile', Request::getString('tf_uplfile'));
175
-		}
176
-		$testfieldTextdateselect = date_create_from_format(_SHORTDATESTRING, Request::getString('tf_textdateselect'));
177
-		$testfieldsObj->setVar('tf_textdateselect', $testfieldTextdateselect->getTimestamp());
178
-		// Set Var tf_selectfile
179
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
180
-		$filename       = $_FILES['tf_selectfile']['name'];
181
-		$imgNameDef     = Request::getString('tf_text');
182
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
183
-													$helper->getConfig('mimetypes_file'), 
184
-													$helper->getConfig('maxsize_file'), null, null);
185
-		if ($uploader->fetchMedia($_POST['xoops_upload_file'][4])) {
186
-			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
187
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
188
-			$uploader->setPrefix($imgName);
189
-			$uploader->fetchMedia($_POST['xoops_upload_file'][4]);
190
-			if (!$uploader->upload()) {
191
-				$errors = $uploader->getErrors();
192
-			} else {
193
-				$testfieldsObj->setVar('tf_selectfile', $uploader->getSavedFileName());
194
-			}
195
-		} else {
196
-			if ($filename > '') {
197
-				$uploaderErrors = $uploader->getErrors();
198
-			}
199
-			$testfieldsObj->setVar('tf_selectfile', Request::getString('tf_selectfile'));
200
-		}
201
-		$testfieldsObj->setVar('tf_status', Request::getInt('tf_status', 0));
202
-		// Insert Data
203
-		if ($testfieldsHandler->insert($testfieldsObj)) {
204
-			$newTfId = $testfieldsObj->getNewInsertedIdTestfields();
205
-			$permId = isset($_REQUEST['tf_id']) ? $tfId : $newTfId;
206
-			$grouppermHandler = xoops_getHandler('groupperm');
207
-			$mid = $GLOBALS['xoopsModule']->getVar('mid');
208
-			// Permission to view_testfields
209
-			$grouppermHandler->deleteByModule($mid, 'mymodule2_view_testfields', $permId);
210
-			if (isset($_POST['groups_view_testfields'])) {
211
-				foreach($_POST['groups_view_testfields'] as $onegroupId) {
212
-					$grouppermHandler->addRight('mymodule2_view_testfields', $permId, $onegroupId, $mid);
213
-				}
214
-			}
215
-			// Permission to submit_testfields
216
-			$grouppermHandler->deleteByModule($mid, 'mymodule2_submit_testfields', $permId);
217
-			if (isset($_POST['groups_submit_testfields'])) {
218
-				foreach($_POST['groups_submit_testfields'] as $onegroupId) {
219
-					$grouppermHandler->addRight('mymodule2_submit_testfields', $permId, $onegroupId, $mid);
220
-				}
221
-			}
222
-			// Permission to approve_testfields
223
-			$grouppermHandler->deleteByModule($mid, 'mymodule2_approve_testfields', $permId);
224
-			if (isset($_POST['groups_approve_testfields'])) {
225
-				foreach($_POST['groups_approve_testfields'] as $onegroupId) {
226
-					$grouppermHandler->addRight('mymodule2_approve_testfields', $permId, $onegroupId, $mid);
227
-				}
228
-			}
229
-			if ('' !== $uploaderErrors) {
230
-				redirect_header('testfields.php?op=edit&tf_id=' . $tfId, 5, $uploaderErrors);
231
-			} else {
232
-				redirect_header('testfields.php?op=list', 2, _MA_MYMODULE2_FORM_OK);
233
-			}
234
-		}
235
-		// Get Form Error
236
-		$GLOBALS['xoopsTpl']->assign('error', $testfieldsObj->getHtmlErrors());
237
-		$form = $testfieldsObj->getFormTestfields();
238
-		$GLOBALS['xoopsTpl']->assign('form', $form->display());
59
+	    break;
60
+	    case 'save':
61
+		    // Security Check
62
+		    if (!$GLOBALS['xoopsSecurity']->check()) {
63
+			    redirect_header('testfields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
64
+		    }
65
+		    $testfieldsObj = $testfieldsHandler->create();
66
+		    $testfieldsObj->setVar('tf_text', Request::getString('tf_text', ''));
67
+		    $testfieldsObj->setVar('tf_textarea', Request::getString('tf_textarea', ''));
68
+		    $testfieldsObj->setVar('tf_dhtml', Request::getString('tf_dhtml', ''));
69
+		    $testfieldsObj->setVar('tf_checkbox', Request::getInt('tf_checkbox', 0));
70
+		    $testfieldsObj->setVar('tf_yesno', Request::getInt('tf_yesno', 0));
71
+		    $testfieldsObj->setVar('tf_selectbox', Request::getString('tf_selectbox', ''));
72
+		    $testfieldsObj->setVar('tf_user', Request::getInt('tf_user', 0));
73
+		    $testfieldsObj->setVar('tf_color', Request::getString('tf_color', ''));
74
+		    // Set Var tf_imagelist
75
+		    include_once XOOPS_ROOT_PATH . '/class/uploader.php';
76
+		    $uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32', 
77
+													    $helper->getConfig('mimetypes_image'), 
78
+													    $helper->getConfig('maxsize_image'), null, null);
79
+		    if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
80
+			    //$uploader->setPrefix(tf_imagelist_);
81
+			    //$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
82
+			    if (!$uploader->upload()) {
83
+				    $errors = $uploader->getErrors();
84
+				    redirect_header('javascript:history.go(-1).php', 3, $errors);
85
+			    } else {
86
+				    $testfieldsObj->setVar('tf_imagelist', $uploader->getSavedFileName());
87
+			    }
88
+		    } else {
89
+			    $testfieldsObj->setVar('tf_imagelist', Request::getString('tf_imagelist'));
90
+		    }
91
+		    $testfieldsObj->setVar('tf_urlfile', formatUrl($_REQUEST['tf_urlfile']));
92
+		    // Set Var tf_urlfile
93
+		    include_once XOOPS_ROOT_PATH . '/class/uploader.php';
94
+		    $filename       = $_FILES['tf_urlfile']['name'];
95
+		    $imgNameDef     = Request::getString('tf_text');
96
+		    $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
97
+													    $helper->getConfig('mimetypes_file'), 
98
+													    $helper->getConfig('maxsize_file'), null, null);
99
+		    if ($uploader->fetchMedia($_POST['xoops_upload_file'][1])) {
100
+			    $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
101
+			    $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
102
+			    $uploader->setPrefix($imgName);
103
+			    $uploader->fetchMedia($_POST['xoops_upload_file'][1]);
104
+			    if (!$uploader->upload()) {
105
+				    $errors = $uploader->getErrors();
106
+			    } else {
107
+				    $testfieldsObj->setVar('tf_urlfile', $uploader->getSavedFileName());
108
+			    }
109
+		    } else {
110
+			    if ($filename > '') {
111
+				    $uploaderErrors = $uploader->getErrors();
112
+			    }
113
+			    $testfieldsObj->setVar('tf_urlfile', Request::getString('tf_urlfile'));
114
+		    }
115
+		    // Set Var tf_uplimage
116
+		    include_once XOOPS_ROOT_PATH . '/class/uploader.php';
117
+		    $filename       = $_FILES['tf_uplimage']['name'];
118
+		    $imgMimetype    = $_FILES['tf_uplimage']['type'];
119
+		    $imgNameDef     = Request::getString('tf_text');
120
+		    $uploaderErrors = '';
121
+		    $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/', 
122
+													    $helper->getConfig('mimetypes_image'), 
123
+													    $helper->getConfig('maxsize_image'), null, null);
124
+		    if ($uploader->fetchMedia($_POST['xoops_upload_file'][2])) {
125
+			    $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
126
+			    $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
127
+			    $uploader->setPrefix($imgName);
128
+			    $uploader->fetchMedia($_POST['xoops_upload_file'][2]);
129
+			    if (!$uploader->upload()) {
130
+				    $uploaderErrors = $uploader->getErrors();
131
+			    } else {
132
+				    $savedFilename = $uploader->getSavedFileName();
133
+				    $maxwidth  = (int)$helper->getConfig('maxwidth_image');
134
+				    $maxheight = (int)$helper->getConfig('maxheight_image');
135
+				    if ($maxwidth > 0 && $maxheight > 0) {
136
+					    // Resize image
137
+					    $imgHandler                = new Mymodule2\Common\Resizer();
138
+					    $imgHandler->sourceFile    = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
139
+					    $imgHandler->endFile       = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
140
+					    $imgHandler->imageMimetype = $imgMimetype;
141
+					    $imgHandler->maxWidth      = $maxwidth;
142
+					    $imgHandler->maxHeight     = $maxheight;
143
+					    $result                    = $imgHandler->resizeImage();
144
+				    }
145
+				    $testfieldsObj->setVar('tf_uplimage', $savedFilename);
146
+			    }
147
+		    } else {
148
+			    if ($filename > '') {
149
+				    $uploaderErrors = $uploader->getErrors();
150
+			    }
151
+			    $testfieldsObj->setVar('tf_uplimage', Request::getString('tf_uplimage'));
152
+		    }
153
+		    // Set Var tf_uplfile
154
+		    include_once XOOPS_ROOT_PATH . '/class/uploader.php';
155
+		    $filename       = $_FILES['tf_uplfile']['name'];
156
+		    $imgNameDef     = Request::getString('tf_text');
157
+		    $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
158
+													    $helper->getConfig('mimetypes_file'), 
159
+													    $helper->getConfig('maxsize_file'), null, null);
160
+		    if ($uploader->fetchMedia($_POST['xoops_upload_file'][3])) {
161
+			    $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
162
+			    $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
163
+			    $uploader->setPrefix($imgName);
164
+			    $uploader->fetchMedia($_POST['xoops_upload_file'][3]);
165
+			    if (!$uploader->upload()) {
166
+				    $errors = $uploader->getErrors();
167
+			    } else {
168
+				    $testfieldsObj->setVar('tf_uplfile', $uploader->getSavedFileName());
169
+			    }
170
+		    } else {
171
+			    if ($filename > '') {
172
+				    $uploaderErrors = $uploader->getErrors();
173
+			    }
174
+			    $testfieldsObj->setVar('tf_uplfile', Request::getString('tf_uplfile'));
175
+		    }
176
+		    $testfieldTextdateselect = date_create_from_format(_SHORTDATESTRING, Request::getString('tf_textdateselect'));
177
+		    $testfieldsObj->setVar('tf_textdateselect', $testfieldTextdateselect->getTimestamp());
178
+		    // Set Var tf_selectfile
179
+		    include_once XOOPS_ROOT_PATH . '/class/uploader.php';
180
+		    $filename       = $_FILES['tf_selectfile']['name'];
181
+		    $imgNameDef     = Request::getString('tf_text');
182
+		    $uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
183
+													    $helper->getConfig('mimetypes_file'), 
184
+													    $helper->getConfig('maxsize_file'), null, null);
185
+		    if ($uploader->fetchMedia($_POST['xoops_upload_file'][4])) {
186
+			    $extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
187
+			    $imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
188
+			    $uploader->setPrefix($imgName);
189
+			    $uploader->fetchMedia($_POST['xoops_upload_file'][4]);
190
+			    if (!$uploader->upload()) {
191
+				    $errors = $uploader->getErrors();
192
+			    } else {
193
+				    $testfieldsObj->setVar('tf_selectfile', $uploader->getSavedFileName());
194
+			    }
195
+		    } else {
196
+			    if ($filename > '') {
197
+				    $uploaderErrors = $uploader->getErrors();
198
+			    }
199
+			    $testfieldsObj->setVar('tf_selectfile', Request::getString('tf_selectfile'));
200
+		    }
201
+		    $testfieldsObj->setVar('tf_status', Request::getInt('tf_status', 0));
202
+		    // Insert Data
203
+		    if ($testfieldsHandler->insert($testfieldsObj)) {
204
+			    $newTfId = $testfieldsObj->getNewInsertedIdTestfields();
205
+			    $permId = isset($_REQUEST['tf_id']) ? $tfId : $newTfId;
206
+			    $grouppermHandler = xoops_getHandler('groupperm');
207
+			    $mid = $GLOBALS['xoopsModule']->getVar('mid');
208
+			    // Permission to view_testfields
209
+			    $grouppermHandler->deleteByModule($mid, 'mymodule2_view_testfields', $permId);
210
+			    if (isset($_POST['groups_view_testfields'])) {
211
+				    foreach($_POST['groups_view_testfields'] as $onegroupId) {
212
+					    $grouppermHandler->addRight('mymodule2_view_testfields', $permId, $onegroupId, $mid);
213
+				    }
214
+			    }
215
+			    // Permission to submit_testfields
216
+			    $grouppermHandler->deleteByModule($mid, 'mymodule2_submit_testfields', $permId);
217
+			    if (isset($_POST['groups_submit_testfields'])) {
218
+				    foreach($_POST['groups_submit_testfields'] as $onegroupId) {
219
+					    $grouppermHandler->addRight('mymodule2_submit_testfields', $permId, $onegroupId, $mid);
220
+				    }
221
+			    }
222
+			    // Permission to approve_testfields
223
+			    $grouppermHandler->deleteByModule($mid, 'mymodule2_approve_testfields', $permId);
224
+			    if (isset($_POST['groups_approve_testfields'])) {
225
+				    foreach($_POST['groups_approve_testfields'] as $onegroupId) {
226
+					    $grouppermHandler->addRight('mymodule2_approve_testfields', $permId, $onegroupId, $mid);
227
+				    }
228
+			    }
229
+			    if ('' !== $uploaderErrors) {
230
+				    redirect_header('testfields.php?op=edit&tf_id=' . $tfId, 5, $uploaderErrors);
231
+			    } else {
232
+				    redirect_header('testfields.php?op=list', 2, _MA_MYMODULE2_FORM_OK);
233
+			    }
234
+		    }
235
+		    // Get Form Error
236
+		    $GLOBALS['xoopsTpl']->assign('error', $testfieldsObj->getHtmlErrors());
237
+		    $form = $testfieldsObj->getFormTestfields();
238
+		    $GLOBALS['xoopsTpl']->assign('form', $form->display());
239 239
 
240
-	break;
240
+	    break;
241 241
 }
242 242
 // Breadcrumbs
243 243
 $xoBreadcrumbs[] = ['title' => _MA_MYMODULE2_SUBMIT];
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
 use XoopsModules\Mymodule2;
25 25
 use XoopsModules\Mymodule2\Constants;
26 26
 
27
-require __DIR__ . '/header.php';
27
+require __DIR__.'/header.php';
28 28
 xoops_loadLanguage('admin', 'mymodule2');
29 29
 // It recovered the value of argument op in URL$
30 30
 $op = Request::getString('op', 'form');
31 31
 // Template
32 32
 $GLOBALS['xoopsOption']['template_main'] = 'mymodule2_submit.tpl';
33
-include_once XOOPS_ROOT_PATH . '/header.php';
34
-$GLOBALS['xoTheme']->addStylesheet( $style, null );
33
+include_once XOOPS_ROOT_PATH.'/header.php';
34
+$GLOBALS['xoTheme']->addStylesheet($style, null);
35 35
 $permissionsHandler = $helper->getHandler('permissions');
36 36
 $permSubmit = $permissionsHandler->getPermGlobalSubmit();
37 37
 // Redirection if not permissions
@@ -39,18 +39,18 @@  discard block
 block discarded – undo
39 39
 	redirect_header('index.php', 2, _NOPERM);
40 40
 	exit();
41 41
 }
42
-switch($op) {
42
+switch ($op) {
43 43
 	case 'form':
44 44
 	default:
45 45
 		// Navigation
46 46
 		$navigation = _MA_MYMODULE2_SUBMIT_PROPOSER;
47 47
 		$GLOBALS['xoopsTpl']->assign('navigation', $navigation);
48 48
 		// Title of page
49
-		$title = _MA_MYMODULE2_SUBMIT_PROPOSER . '&nbsp;-&nbsp;';
49
+		$title = _MA_MYMODULE2_SUBMIT_PROPOSER.'&nbsp;-&nbsp;';
50 50
 		$title .= $GLOBALS['xoopsModule']->name();
51 51
 		$GLOBALS['xoopsTpl']->assign('xoops_pagetitle', $title);
52 52
 		// Description
53
-		$GLOBALS['xoTheme']->addMeta( 'meta', 'description', strip_tags(_MA_MYMODULE2_SUBMIT_PROPOSER));
53
+		$GLOBALS['xoTheme']->addMeta('meta', 'description', strip_tags(_MA_MYMODULE2_SUBMIT_PROPOSER));
54 54
 		// Form Create
55 55
 		$testfieldsObj = $testfieldsHandler->create();
56 56
 		$form = $testfieldsObj->getFormTestfields();
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 		$testfieldsObj->setVar('tf_user', Request::getInt('tf_user', 0));
73 73
 		$testfieldsObj->setVar('tf_color', Request::getString('tf_color', ''));
74 74
 		// Set Var tf_imagelist
75
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
76
-		$uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32', 
75
+		include_once XOOPS_ROOT_PATH.'/class/uploader.php';
76
+		$uploader = new \XoopsMediaUploader(XOOPS_ROOT_PATH.'/Frameworks/moduleclasses/icons/32', 
77 77
 													$helper->getConfig('mimetypes_image'), 
78 78
 													$helper->getConfig('maxsize_image'), null, null);
79 79
 		if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
@@ -90,15 +90,15 @@  discard block
 block discarded – undo
90 90
 		}
91 91
 		$testfieldsObj->setVar('tf_urlfile', formatUrl($_REQUEST['tf_urlfile']));
92 92
 		// Set Var tf_urlfile
93
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
93
+		include_once XOOPS_ROOT_PATH.'/class/uploader.php';
94 94
 		$filename       = $_FILES['tf_urlfile']['name'];
95 95
 		$imgNameDef     = Request::getString('tf_text');
96
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
96
+		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH.'/testfields/', 
97 97
 													$helper->getConfig('mimetypes_file'), 
98 98
 													$helper->getConfig('maxsize_file'), null, null);
99 99
 		if ($uploader->fetchMedia($_POST['xoops_upload_file'][1])) {
100 100
 			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
101
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
101
+			$imgName = str_replace(' ', '', $imgNameDef).'.'.$extension;
102 102
 			$uploader->setPrefix($imgName);
103 103
 			$uploader->fetchMedia($_POST['xoops_upload_file'][1]);
104 104
 			if (!$uploader->upload()) {
@@ -113,17 +113,17 @@  discard block
 block discarded – undo
113 113
 			$testfieldsObj->setVar('tf_urlfile', Request::getString('tf_urlfile'));
114 114
 		}
115 115
 		// Set Var tf_uplimage
116
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
116
+		include_once XOOPS_ROOT_PATH.'/class/uploader.php';
117 117
 		$filename       = $_FILES['tf_uplimage']['name'];
118 118
 		$imgMimetype    = $_FILES['tf_uplimage']['type'];
119 119
 		$imgNameDef     = Request::getString('tf_text');
120 120
 		$uploaderErrors = '';
121
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/', 
121
+		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_IMAGE_PATH.'/testfields/', 
122 122
 													$helper->getConfig('mimetypes_image'), 
123 123
 													$helper->getConfig('maxsize_image'), null, null);
124 124
 		if ($uploader->fetchMedia($_POST['xoops_upload_file'][2])) {
125 125
 			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
126
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
126
+			$imgName = str_replace(' ', '', $imgNameDef).'.'.$extension;
127 127
 			$uploader->setPrefix($imgName);
128 128
 			$uploader->fetchMedia($_POST['xoops_upload_file'][2]);
129 129
 			if (!$uploader->upload()) {
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 				if ($maxwidth > 0 && $maxheight > 0) {
136 136
 					// Resize image
137 137
 					$imgHandler                = new Mymodule2\Common\Resizer();
138
-					$imgHandler->sourceFile    = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
139
-					$imgHandler->endFile       = MYMODULE2_UPLOAD_IMAGE_PATH . '/testfields/' . $savedFilename;
138
+					$imgHandler->sourceFile    = MYMODULE2_UPLOAD_IMAGE_PATH.'/testfields/'.$savedFilename;
139
+					$imgHandler->endFile       = MYMODULE2_UPLOAD_IMAGE_PATH.'/testfields/'.$savedFilename;
140 140
 					$imgHandler->imageMimetype = $imgMimetype;
141 141
 					$imgHandler->maxWidth      = $maxwidth;
142 142
 					$imgHandler->maxHeight     = $maxheight;
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
 			$testfieldsObj->setVar('tf_uplimage', Request::getString('tf_uplimage'));
152 152
 		}
153 153
 		// Set Var tf_uplfile
154
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
154
+		include_once XOOPS_ROOT_PATH.'/class/uploader.php';
155 155
 		$filename       = $_FILES['tf_uplfile']['name'];
156 156
 		$imgNameDef     = Request::getString('tf_text');
157
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
157
+		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH.'/testfields/', 
158 158
 													$helper->getConfig('mimetypes_file'), 
159 159
 													$helper->getConfig('maxsize_file'), null, null);
160 160
 		if ($uploader->fetchMedia($_POST['xoops_upload_file'][3])) {
161 161
 			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
162
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
162
+			$imgName = str_replace(' ', '', $imgNameDef).'.'.$extension;
163 163
 			$uploader->setPrefix($imgName);
164 164
 			$uploader->fetchMedia($_POST['xoops_upload_file'][3]);
165 165
 			if (!$uploader->upload()) {
@@ -176,15 +176,15 @@  discard block
 block discarded – undo
176 176
 		$testfieldTextdateselect = date_create_from_format(_SHORTDATESTRING, Request::getString('tf_textdateselect'));
177 177
 		$testfieldsObj->setVar('tf_textdateselect', $testfieldTextdateselect->getTimestamp());
178 178
 		// Set Var tf_selectfile
179
-		include_once XOOPS_ROOT_PATH . '/class/uploader.php';
179
+		include_once XOOPS_ROOT_PATH.'/class/uploader.php';
180 180
 		$filename       = $_FILES['tf_selectfile']['name'];
181 181
 		$imgNameDef     = Request::getString('tf_text');
182
-		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH . '/testfields/', 
182
+		$uploader = new \XoopsMediaUploader(MYMODULE2_UPLOAD_FILES_PATH.'/testfields/', 
183 183
 													$helper->getConfig('mimetypes_file'), 
184 184
 													$helper->getConfig('maxsize_file'), null, null);
185 185
 		if ($uploader->fetchMedia($_POST['xoops_upload_file'][4])) {
186 186
 			$extension = preg_replace('/^.+\.([^.]+)$/sU', '', $filename);
187
-			$imgName = str_replace(' ', '', $imgNameDef) . '.' . $extension;
187
+			$imgName = str_replace(' ', '', $imgNameDef).'.'.$extension;
188 188
 			$uploader->setPrefix($imgName);
189 189
 			$uploader->fetchMedia($_POST['xoops_upload_file'][4]);
190 190
 			if (!$uploader->upload()) {
@@ -208,26 +208,26 @@  discard block
 block discarded – undo
208 208
 			// Permission to view_testfields
209 209
 			$grouppermHandler->deleteByModule($mid, 'mymodule2_view_testfields', $permId);
210 210
 			if (isset($_POST['groups_view_testfields'])) {
211
-				foreach($_POST['groups_view_testfields'] as $onegroupId) {
211
+				foreach ($_POST['groups_view_testfields'] as $onegroupId) {
212 212
 					$grouppermHandler->addRight('mymodule2_view_testfields', $permId, $onegroupId, $mid);
213 213
 				}
214 214
 			}
215 215
 			// Permission to submit_testfields
216 216
 			$grouppermHandler->deleteByModule($mid, 'mymodule2_submit_testfields', $permId);
217 217
 			if (isset($_POST['groups_submit_testfields'])) {
218
-				foreach($_POST['groups_submit_testfields'] as $onegroupId) {
218
+				foreach ($_POST['groups_submit_testfields'] as $onegroupId) {
219 219
 					$grouppermHandler->addRight('mymodule2_submit_testfields', $permId, $onegroupId, $mid);
220 220
 				}
221 221
 			}
222 222
 			// Permission to approve_testfields
223 223
 			$grouppermHandler->deleteByModule($mid, 'mymodule2_approve_testfields', $permId);
224 224
 			if (isset($_POST['groups_approve_testfields'])) {
225
-				foreach($_POST['groups_approve_testfields'] as $onegroupId) {
225
+				foreach ($_POST['groups_approve_testfields'] as $onegroupId) {
226 226
 					$grouppermHandler->addRight('mymodule2_approve_testfields', $permId, $onegroupId, $mid);
227 227
 				}
228 228
 			}
229 229
 			if ('' !== $uploaderErrors) {
230
-				redirect_header('testfields.php?op=edit&tf_id=' . $tfId, 5, $uploaderErrors);
230
+				redirect_header('testfields.php?op=edit&tf_id='.$tfId, 5, $uploaderErrors);
231 231
 			} else {
232 232
 				redirect_header('testfields.php?op=list', 2, _MA_MYMODULE2_FORM_OK);
233 233
 			}
@@ -241,4 +241,4 @@  discard block
 block discarded – undo
241 241
 }
242 242
 // Breadcrumbs
243 243
 $xoBreadcrumbs[] = ['title' => _MA_MYMODULE2_SUBMIT];
244
-require __DIR__ . '/footer.php';
244
+require __DIR__.'/footer.php';
Please login to merge, or discard this patch.
testdata/mymodule2/pdf.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 require __DIR__ . '/header.php';
28 28
 $tfId = Request::getInt('tf_id');
29 29
 if (file_exists($tcpdf = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php')) {
30
-	require_once $tcpdf;
30
+    require_once $tcpdf;
31 31
 } else {
32
-	redirect_header('testfields.php', 2, _MA_MYMODULE2_NO_PDF_LIBRARY);
32
+    redirect_header('testfields.php', 2, _MA_MYMODULE2_NO_PDF_LIBRARY);
33 33
 }
34 34
 // Get Instance of Handler
35 35
 $testfieldsHandler = $helper->getHandler('testfields');
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 $pdfData['fontsize'] = 12;
62 62
 // For schinese
63 63
 if (_LANGCODE == 'cn') {
64
-	$pdf->SetFont('gbsn00lp', '', $pdfData['fontsize']);
64
+    $pdf->SetFont('gbsn00lp', '', $pdfData['fontsize']);
65 65
 } else {
66
-	$pdf->SetFont($pdfData['fontname'], '', $pdfData['fontsize']);
66
+    $pdf->SetFont($pdfData['fontname'], '', $pdfData['fontsize']);
67 67
 }
68 68
 // Set document information
69 69
 $pdf->SetCreator($pdfData['creator']);
@@ -80,16 +80,16 @@  discard block
 block discarded – undo
80 80
 $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
81 81
 $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set image scale factor
82 82
 if (_LANGCODE == 'cn') {
83
-	$pdf->setHeaderFont(array('gbsn00lp', '', $pdfData['fontsize']));
84
-	$pdf->setFooterFont(array('gbsn00lp', '', $pdfData['fontsize']));
83
+    $pdf->setHeaderFont(array('gbsn00lp', '', $pdfData['fontsize']));
84
+    $pdf->setFooterFont(array('gbsn00lp', '', $pdfData['fontsize']));
85 85
 } else {
86
-	$pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
87
-	$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
86
+    $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
87
+    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
88 88
 }
89 89
 // Set some language-dependent strings (optional)
90 90
 if (@file_exists($lang = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/lang/eng.php')) {
91
-	require_once $lang . '/.php';
92
-	$pdf->setLanguageArray($l);
91
+    require_once $lang . '/.php';
92
+    $pdf->setLanguageArray($l);
93 93
 }
94 94
 // Initialize document
95 95
 $pdf->AliasNbPages();
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 use XoopsModules\Mymodule2;
25 25
 use XoopsModules\Mymodule2\Constants;
26 26
 
27
-require __DIR__ . '/header.php';
27
+require __DIR__.'/header.php';
28 28
 $tfId = Request::getInt('tf_id');
29 29
 if (file_exists($tcpdf = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php')) {
30 30
 	require_once $tcpdf;
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 }
89 89
 // Set some language-dependent strings (optional)
90 90
 if (@file_exists($lang = XOOPS_ROOT_PATH.'/Frameworks/tcpdf/lang/eng.php')) {
91
-	require_once $lang . '/.php';
91
+	require_once $lang.'/.php';
92 92
 	$pdf->setLanguageArray($l);
93 93
 }
94 94
 // Initialize document
95 95
 $pdf->AliasNbPages();
96 96
 // Add Page document
97 97
 $pdf->AddPage();
98
-$pdf->writeHTMLCell($w=0, $h=0, $x='', $y='', $content, $border=0, $ln=1, $fill=0, $reseth=true, $align='', $autopadding=true);
98
+$pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $content, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);
99 99
 // Pdf Filename
100 100
 // Output
101 101
 $GLOBALS['xoopsTpl']->assign('pdfoutput', $pdf->Output('testfields.pdf', 'I'));
Please login to merge, or discard this patch.