Passed
Push — master ( 0c230a...202965 )
by Michael
02:53
created

TDMCreateArchitecture::setFilesToBuilding()   F

Complexity

Conditions 34
Paths > 20000

Size

Total Lines 419
Code Lines 300

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 34
eloc 300
nc 64493000
nop 1
dl 0
loc 419
rs 0
c 1
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
/**
13
 * tdmcreate module.
14
 *
15
 * @copyright       XOOPS Project (https://xoops.org)
16
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 *
18
 * @since           2.5.0
19
 *
20
 * @author          Txmod Xoops http://www.txmodxoops.org
21
 *
22
 * @version         $Id: TDMCreateArchitecture.php 12258 2014-01-02 09:33:29Z timgno $
23
 */
24
include dirname(__DIR__) . '/autoload.php';
25
/**
26
 * Class TDMCreateArchitecture.
27
 */
28
class TDMCreateArchitecture extends TDMCreateStructure
29
{
30
    /**
31
     *  @public function constructor class
32
     *
33
     *  @param null
34
     */
35
    public function __construct()
36
    {
37
        parent::__construct();
38
        $this->setUploadPath(TDMC_UPLOAD_REPOSITORY_PATH);
39
    }
40
41
    /**
42
     *  @static function getInstance
43
     *
44
     *  @param null
45
     *
46
     * @return TDMCreateArchitecture
47
     */
48
    public static function getInstance()
49
    {
50
        static $instance = false;
51
        if (!$instance) {
52
            $instance = new self();
53
        }
54
55
        return $instance;
56
    }
57
58
    /**
59
     * @public function setBaseFoldersFiles
60
     *
61
     * @param $module
62
     */
63
    public function setBaseFoldersFiles($module)
64
    {
65
        $tdmcreate = TDMCreateHelper::getInstance();
66
        $tf = TDMCreateFile::getInstance();
67
        // Module
68
        $modId = $module->getVar('mod_id');
69
        // Id of tables
70
        $tables = $tf->getTableTables($modId);
71
72
        $table = null;
73
        foreach (array_keys($tables) as $t) {
74
            $tableId = $tables[$t]->getVar('table_id');
75
            $tableName = $tables[$t]->getVar('table_name');
76
            $table = $tdmcreate->getHandler('tables')->get($tableId);
0 ignored issues
show
Bug introduced by
The method get cannot be called on $tdmcreate->getHandler('tables') (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
77
        }
78
79
        $indexFile = XOOPS_UPLOAD_PATH . '/index.html';
80
        $stlModuleAuthor = str_replace(' ', '', mb_strtolower($module->getVar('mod_author')));
81
        $this->setModuleName($module->getVar('mod_dirname'));
82
        $uploadPath = $this->getUploadPath();
83
        // Creation of "module" folder in the Directory repository
84
        $this->makeDir($uploadPath . '/' . $this->getModuleName());
85
        if (1 != $module->getVar('mod_user')) {
86
            // Copied of index.html file in "root module" folder
87
            $this->copyFile('', $indexFile, 'index.html');
88
        }
89
        if (1 == $module->getVar('mod_admin')) {
90
            // Creation of "admin" folder and index.html file
91
            $this->makeDirAndCopyFile('admin', $indexFile, 'index.html');
92
        }
93
        if (1 == $module->getVar('mod_blocks')) {
94
            // Creation of "blocks" folder and index.html file
95
            $this->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
96
        }
97
        $language = ('english' !== $GLOBALS['xoopsConfig']['language']) ? $GLOBALS['xoopsConfig']['language'] : 'english';
98
        $copyFiles = ['class' => $indexFile, 'include' => $indexFile, 'language' => $indexFile, 'assets' => $indexFile, 'assets/css' => $indexFile, 'assets/css/admin' => $indexFile, 'assets/icons' => $indexFile, 'assets/icons/16' => $indexFile, 'assets/icons/32' => $indexFile, 'docs' => $indexFile, 'assets/images' => $indexFile, 'assets/js' => $indexFile, 'language/' . $language => $indexFile, 'language/' . $language . '/help' => $indexFile, 'preloads' => $indexFile];
99
        foreach ($copyFiles as $k => $v) {
100
            // Creation of folders and index.html file
101
            $this->makeDirAndCopyFile($k, $v, 'index.html');
102
        }
103
        //Copy the logo of the module
104
        $modImage = str_replace(' ', '', mb_strtolower($module->getVar('mod_image')));
105
        $this->copyFile('assets/images', TDMC_UPLOAD_IMGMOD_PATH . '/' . $modImage, $modImage);
106
        // Copy of 'module_author_logo.png' file in uploads dir
107
        $logoPng = $stlModuleAuthor . '_logo.png';
108
        $logoGifFrom = TDMC_UPLOAD_IMGMOD_PATH . '/' . $logoPng;
109
        // If file exists
110
        if (!file_exists($logoGifFrom)) {
111
            // Rename file
112
            $copyFile = TDMC_IMAGES_LOGOS_URL . '/xoopsdevelopmentteam_logo.gif';
113
            $copyNewFile = $logoGifFrom;
114
            copy($copyFile, $copyNewFile);
115
        } else {
116
            // Copy file
117
            $copyFile = TDMC_IMAGES_LOGOS_URL . '/' . $logoPng;
118
            $copyNewFile = $logoGifFrom;
119
            copy($copyFile, $copyNewFile);
120
        }
121
        // Creation of 'module_author_logo.gif' file
122
        $this->copyFile('assets/images', $copyNewFile, $logoPng);
123
        $docs = [
124
            '/credits.txt' => 'credits.txt', '/install.txt' => 'install.txt',
125
            '/lang.diff' => 'lang.diff', '/license.txt' => 'license.txt', '/readme.txt' => 'readme.txt',
126
        ];
127
        foreach ($docs as $k => $v) {
128
            // Creation of folder docs and .txt files
129
            $this->makeDirAndCopyFile('docs', TDMC_DOCS_PATH . $k, $v);
130
        }
131
        if (!empty($tableName)) {
132
            if (1 == $module->getVar('mod_admin') || 1 == $module->getVar('mod_user')) {
133
                // Creation of "templates" folder and index.html file
134
                $this->makeDirAndCopyFile('templates', $indexFile, 'index.html');
135
            }
136
            if (1 == $module->getVar('mod_admin')) {
137
                // Creation of "templates/admin" folder and index.html file
138
                $this->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
139
            }
140
            if ((1 == $module->getVar('mod_blocks')) && (1 == $table->getVar('table_blocks'))) {
141
                // Creation of "templates/blocks" folder and index.html file
142
                $this->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
143
            }
144
            // Creation of "sql" folder and index.html file
145
            $this->makeDirAndCopyFile('sql', $indexFile, 'index.html');
146
            if ((1 == $module->getVar('mod_notifications')) && (1 == $table->getVar('table_notifications'))) {
147
                // Creation of "language/local_language/mail_template" folder and index.html file
148
                $this->makeDirAndCopyFile('language/' . $language . '/mail_template', $indexFile, 'index.html');
149
            }
150
        }
151
    }
152
153
    /**
154
     *  @public function setFilesToBuilding
155
     *
156
     *  @param string $module
157
     *
158
     * @return array
159
     */
160
    public function setFilesToBuilding($module)
161
    {
162
        $tdmcreate = TDMCreateHelper::getInstance();
163
        $tf = TDMCreateFile::getInstance();
164
        // Module
165
        $modId = $module->getVar('mod_id');
0 ignored issues
show
Bug introduced by
The method getVar cannot be called on $module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
166
        $moduleDirname = $module->getVar('mod_dirname');
0 ignored issues
show
Bug introduced by
The method getVar cannot be called on $module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
167
        $icon32 = 'assets/icons/32';
168
        $tables = $tf->getTableTables($modId);
169
        $files = $tf->getTableMoreFiles($modId);
170
        $ret = [];
171
172
        $table = [];
173
        $tableCategory = [];
174
        $tableName = [];
0 ignored issues
show
Unused Code introduced by
$tableName is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
175
        $tableAdmin = [];
176
        $tableUser = [];
177
        $tableBlocks = [];
178
        $tableSearch = [];
179
        $tableComments = [];
180
        $tableNotifications = [];
181
        $tablePermissions = [];
182
        $tableBroken = [];
183
        $tablePdf = [];
184
        $tablePrint = [];
185
        $tableRate = [];
186
        $tableRss = [];
187
        $tableSingle = [];
188
        $tableSubmit = [];
189
        $tableVisit = [];
190
        $tableTag = [];
191
        foreach (array_keys($tables) as $t) {
192
            $tableId = $tables[$t]->getVar('table_id');
193
            $tableName = $tables[$t]->getVar('table_name');
194
            $tableCategory[] = $tables[$t]->getVar('table_category');
195
            $tableImage = $tables[$t]->getVar('table_image');
196
            $tableAdmin[] = $tables[$t]->getVar('table_admin');
197
            $tableUser[] = $tables[$t]->getVar('table_user');
198
            $tableBlocks[] = $tables[$t]->getVar('table_blocks');
199
            $tableSearch[] = $tables[$t]->getVar('table_search');
200
            $tableComments[] = $tables[$t]->getVar('table_comments');
201
            $tableNotifications[] = $tables[$t]->getVar('table_notifications');
202
            $tablePermissions[] = $tables[$t]->getVar('table_permissions');
203
            $tableBroken[] = $tables[$t]->getVar('table_broken');
204
            $tablePdf[] = $tables[$t]->getVar('table_pdf');
205
            $tablePrint[] = $tables[$t]->getVar('table_print');
206
            $tableRate[] = $tables[$t]->getVar('table_rate');
207
            $tableRss[] = $tables[$t]->getVar('table_rss');
208
            $tableSingle[] = $tables[$t]->getVar('table_single');
209
            $tableSubmit[] = $tables[$t]->getVar('table_submit');
210
            $tableVisit[] = $tables[$t]->getVar('table_visit');
211
            $tableTag[] = $tables[$t]->getVar('table_tag');
212
            // Get Table Object
213
            $table = $tdmcreate->getHandler('tables')->get($tableId);
0 ignored issues
show
Bug introduced by
The method get cannot be called on $tdmcreate->getHandler('tables') (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
214
            // Copy of tables images file
215
            if (file_exists($uploadTableImage = TDMC_UPLOAD_IMGTAB_PATH . '/' . $tableImage)) {
216
                $this->copyFile($icon32, $uploadTableImage, $tableImage);
217
            } elseif (file_exists($uploadTableImage = XOOPS_ICONS32_PATH . '/' . $tableImage)) {
218
                $this->copyFile($icon32, $uploadTableImage, $tableImage);
219
            }
220
            // Creation of admin files
221
            if (in_array(1, $tableAdmin, true)) {
222
                // Admin Pages File
223
                $adminPages = AdminPages::getInstance();
224
                $adminPages->write($module, $table, $tableName . '.php');
225
                $ret[] = $adminPages->render();
226
                // Admin Templates File
227
                $adminTemplatesPages = TemplatesAdminPages::getInstance();
228
                $adminTemplatesPages->write($module, $table, $moduleDirname . '_admin_' . $tableName . '.tpl');
229
                $ret[] = $adminTemplatesPages->render();
230
            }
231
            // Creation of blocks
232
            if (in_array(1, $tableBlocks, true)) {
233
                // Blocks Files
234
                $blocksFiles = BlocksFiles::getInstance();
235
                $blocksFiles->write($module, $table, $tableName . '.php');
236
                $ret[] = $blocksFiles->render();
237
                // Templates Blocks Files
238
                $templatesBlocks = TemplatesBlocks::getInstance();
239
                $templatesBlocks->write($module, $table, $moduleDirname . '_block_' . $tableName . '.tpl');
240
                $ret[] = $templatesBlocks->render();
241
            }
242
            // Creation of classes
243
            if (in_array(1, $tableAdmin, true) || in_array(1, $tableUser, true)) {
244
                // Class Files
245
                $classFiles = ClassFiles::getInstance();
246
                $classFiles->write($module, $table, $tables, $tableName . '.php');
247
                $ret[] = $classFiles->render();
248
            }
249
            // Creation of user files
250
            if (in_array(1, $tableUser, true)) {
251
                // User Pages File
252
                $userPages = UserPages::getInstance();
253
                $userPages->write($module, $table, $tableName . '.php');
254
                $ret[] = $userPages->render();
255
                if (in_array(0, $tableCategory, true)) {
256
                    // User Templates File
257
                    $userTemplatesPages = TemplatesUserPages::getInstance();
258
                    $userTemplatesPages->write($module, $table, $moduleDirname . '_' . $tableName . '.tpl');
259
                    $ret[] = $userTemplatesPages->render();
260
                    // User List Templates File
261
                    $userTemplatesPagesList = TemplatesUserPagesList::getInstance();
262
                    $userTemplatesPagesList->write($module, $table, $tables, $moduleDirname . '_' . $tableName . '_list' . '.tpl');
263
                    $ret[] = $userTemplatesPagesList->render();
264
                }
265
                if (in_array(1, $tableCategory, true)) {
266
                    // User List Templates File
267
                    $userTemplatesCategories = TemplatesUserCategories::getInstance();
268
                    $userTemplatesCategories->write($module, $table, $moduleDirname . '_' . $tableName . '.tpl');
269
                    $ret[] = $userTemplatesCategories->render();
270
                    // User List Templates File
271
                    $userTemplatesCategoriesList = TemplatesUserCategoriesList::getInstance();
272
                    $userTemplatesCategoriesList->write($module, $table, $moduleDirname . '_' . $tableName . '_list' . '.tpl');
273
                    $ret[] = $userTemplatesCategoriesList->render();
274
                }
275
            }
276
        }
277
        foreach (array_keys($files) as $t) {
278
            $fileName = $files[$t]->getVar('file_name');
279
            $fileExtension = $files[$t]->getVar('file_extension');
280
            $fileInfolder = $files[$t]->getVar('file_infolder');
281
            // More File
282
            $moreFiles = TDMCreateMoreFiles::getInstance();
283
            $moreFiles->write($module, $fileName, $fileInfolder, $fileExtension);
284
            $ret[] = $moreFiles->render();
285
        }
286
        // Language Modinfo File
287
        $languageModinfo = LanguageModinfo::getInstance();
288
        $languageModinfo->write($module, $table, 'modinfo.php');
289
        $ret[] = $languageModinfo->render();
290
        if (1 == $module->getVar('mod_admin')) {
0 ignored issues
show
Bug introduced by
The method getVar cannot be called on $module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
291
            // Admin Header File
292
            $adminHeader = AdminHeader::getInstance();
293
            $adminHeader->write($module, $table, $tables, 'header.php');
294
            $ret[] = $adminHeader->render();
295
            // Admin Index File
296
            $adminIndex = AdminIndex::getInstance();
297
            $adminIndex->write($module, $tables, 'index.php');
298
            $ret[] = $adminIndex->render();
299
            // Admin Menu File
300
            $adminObject = AdminMenu::getInstance();
301
            $adminObject->write($module, 'menu.php');
302
            $ret[] = $adminObject->render();
303
            // Admin About File
304
            $adminAbout = AdminAbout::getInstance();
305
            $adminAbout->write($module, 'about.php');
306
            $ret[] = $adminAbout->render();
307
            // Admin Footer File
308
            $adminFooter = AdminFooter::getInstance();
309
            $adminFooter->write($module, 'footer.php');
310
            $ret[] = $adminFooter->render();
311
            // Templates Admin About File
312
            $adminTemplatesAbout = TemplatesAdminAbout::getInstance();
313
            $adminTemplatesAbout->write($module, $moduleDirname . '_admin_about.tpl');
314
            $ret[] = $adminTemplatesAbout->render();
315
            // Templates Admin Index File
316
            $adminTemplatesIndex = TemplatesAdminIndex::getInstance();
317
            $adminTemplatesIndex->write($module, $moduleDirname . '_admin_index.tpl');
318
            $ret[] = $adminTemplatesIndex->render();
319
            // Templates Admin Footer File
320
            $adminTemplatesFooter = TemplatesAdminFooter::getInstance();
321
            $adminTemplatesFooter->write($module, $moduleDirname . '_admin_footer.tpl');
322
            $ret[] = $adminTemplatesFooter->render();
323
            // Templates Admin Header File
324
            $adminTemplatesHeader = TemplatesAdminHeader::getInstance();
325
            $adminTemplatesHeader->write($module, $moduleDirname . '_admin_header.tpl');
326
            $ret[] = $adminTemplatesHeader->render();
327
            // Language Admin File
328
            $languageAdmin = LanguageAdmin::getInstance();
329
            $languageAdmin->write($module, $table, $tables, 'admin.php');
330
            $ret[] = $languageAdmin->render();
331
        }
332
        // Class Helper File
333
        $classHelper = ClassHelper::getInstance();
334
        $classHelper->write($module, 'helper.php');
335
        $ret[] = $classHelper->render();
336
        // Include Functions File
337
        $includeFunctions = IncludeFunctions::getInstance();
338
        $includeFunctions->write($module, 'functions.php');
339
        $ret[] = $includeFunctions->render();
340
        // Creation of blocks language file
341
        if (null != $table->getVar('table_name')) {
342
            // Include Install File
343
            $includeInstall = IncludeInstall::getInstance();
344
            $includeInstall->write($module, $table, $tables, 'install.php');
345
            $ret[] = $includeInstall->render();
346
            if (in_array(1, $tableBlocks, true)) {
347
                // Language Blocks File
348
                $languageBlocks = LanguageBlocks::getInstance();
349
                $languageBlocks->write($module, $tables, 'blocks.php');
350
                $ret[] = $languageBlocks->render();
351
            }
352
            // Creation of admin permission files
353
            if (in_array(1, $tablePermissions, true)) {
354
                // Admin Permissions File
355
                $adminPermissions = AdminPermissions::getInstance();
356
                $adminPermissions->write($module, $tables, 'permissions.php');
357
                $ret[] = $adminPermissions->render();
358
                // Templates Admin Permissions File
359
                $adminTemplatesPermissions = TemplatesAdminPermissions::getInstance();
360
                $adminTemplatesPermissions->write($module, $moduleDirname . '_admin_permissions.tpl');
361
                $ret[] = $adminTemplatesPermissions->render();
362
            }
363
            // Creation of notifications files
364
            if (in_array(1, $tableNotifications, true)) {
365
                // Include Notifications File
366
                $includeNotifications = IncludeNotifications::getInstance();
367
                $includeNotifications->write($module, $table, 'notifications.inc.php');
368
                $ret[] = $includeNotifications->render();
369
                // Language Mail Template Category File
370
                $languageMailTpl = LanguageMailTpl::getInstance();
371
                $languageMailTpl->write($module, 'category_new_notify.tpl');
372
                $ret[] = $languageMailTpl->render();
373
            }
374
            // Creation of sql file
375
            if (null != $table->getVar('table_name')) {
376
                // Sql File
377
                $sqlFile = SqlFile::getInstance();
378
                $sqlFile->write($module, 'mysql.sql');
379
                $ret[] = $sqlFile->render();
380
                // Include Update File
381
                $includeUpdate = IncludeUpdate::getInstance();
382
                $includeUpdate->write($module, 'update.php');
383
                $ret[] = $includeUpdate->render();
384
            }
385
            // Creation of search file
386
            if (in_array(1, $tableSearch, true)) {
387
                // Include Search File
388
                $includeSearch = IncludeSearch::getInstance();
389
                $includeSearch->write($module, $table, 'search.inc.php');
390
                $ret[] = $includeSearch->render();
391
            }
392
            // Creation of comments files
393
            if (in_array(1, $tableComments, true)) {
394
                // Include Comments File
395
                $includeComments = IncludeComments::getInstance();
396
                $includeComments->write($module, $table);
397
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
398
                // Include Comments File
399
                $includeComments = IncludeComments::getInstance();
400
                $includeComments->write($module, $table);
401
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
402
                // Include Comments File
403
                $includeComments = IncludeComments::getInstance();
404
                $includeComments->write($module, $table);
405
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
406
                // Include Comments File
407
                $includeComments = IncludeComments::getInstance();
408
                $includeComments->write($module, $table);
409
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
410
                // Include Comments File
411
                $includeComments = IncludeComments::getInstance();
412
                $includeComments->write($module, $table);
413
                $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
414
                // Include Comment Functions File
415
                $includeCommentFunctions = IncludeCommentFunctions::getInstance();
416
                $includeCommentFunctions->write($module, $table, 'comment_functions.php');
417
                $ret[] = $includeCommentFunctions->render();
418
            }
419
        }
420
        // Creation of admin files
421
        if (1 == $module->getVar('mod_admin')) {
0 ignored issues
show
Bug introduced by
The method getVar cannot be called on $module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
422
            // Templates Index File
423
            $userTemplatesIndex = TemplatesUserIndex::getInstance();
424
            $userTemplatesIndex->write($module, $table, $tables, $moduleDirname . '_index.tpl');
425
            $ret[] = $userTemplatesIndex->render();
426
            // Templates Footer File
427
            $userTemplatesFooter = TemplatesUserFooter::getInstance();
428
            $userTemplatesFooter->write($module, $table, $moduleDirname . '_footer.tpl');
429
            $ret[] = $userTemplatesFooter->render();
430
            // Templates Header File
431
            $userTemplatesHeader = TemplatesUserHeader::getInstance();
432
            $userTemplatesHeader->write($module, $moduleDirname . '_header.tpl');
433
            $ret[] = $userTemplatesHeader->render();
434
        }
435
        // Creation of user files
436
        if ((1 == $module->getVar('mod_user')) && in_array(1, $tableUser, true)) {
0 ignored issues
show
Bug introduced by
The method getVar cannot be called on $module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
437
            // User Footer File
438
            $userFooter = UserFooter::getInstance();
439
            $userFooter->write($module, 'footer.php');
440
            $ret[] = $userFooter->render();
441
            // User Header File
442
            $userHeader = UserHeader::getInstance();
443
            $userHeader->write($module, $table, $tables, 'header.php');
444
            $ret[] = $userHeader->render();
445
            // User Notification Update File
446
            if ((1 == $module->getVar('mod_notifications')) && in_array(1, $tableNotifications, true)) {
0 ignored issues
show
Bug introduced by
The method getVar cannot be called on $module (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
447
                $userNotificationUpdate = UserNotificationUpdate::getInstance();
448
                $userNotificationUpdate->write($module, 'notification_update.php');
449
                $ret[] = $userNotificationUpdate->render();
450
            }
451
            // User Broken File
452
            if (in_array(1, $tableBroken, true)) {
453
                $userBroken = UserBroken::getInstance();
454
                $userBroken->write($module, $table, 'broken.php');
455
                $ret[] = $userBroken->render();
456
                // User Templates Broken File
457
                $userTemplatesBroken = TemplatesUserBroken::getInstance();
458
                $userTemplatesBroken->write($module, $table, $moduleDirname . '_broken.tpl');
459
                $ret[] = $userTemplatesBroken->render();
460
            }
461
            // User Pdf File
462
            if (in_array(1, $tablePdf, true)) {
463
                $userPdf = UserPdf::getInstance();
464
                $userPdf->write($module, $table, 'pdf.php');
465
                $ret[] = $userPdf->render();
466
                // User Templates Pdf File
467
                $userTemplatesPdf = TemplatesUserPdf::getInstance();
468
                $userTemplatesPdf->write($module, $moduleDirname . '_pdf.tpl');
469
                $ret[] = $userTemplatesPdf->render();
470
            }
471
            // User Print File
472
            if (in_array(1, $tablePrint, true)) {
473
                $userPrint = UserPrint::getInstance();
474
                $userPrint->write($module, $table, 'print.php');
475
                $ret[] = $userPrint->render();
476
                // User Templates Print File
477
                $userTemplatesPrint = TemplatesUserPrint::getInstance();
478
                $userTemplatesPrint->write($module, $table, $moduleDirname . '_print.tpl');
479
                $ret[] = $userTemplatesPrint->render();
480
            }
481
            // User Rate File
482
            if (in_array(1, $tableRate, true)) {
483
                $userRate = UserRate::getInstance();
484
                $userRate->write($module, $table, 'rate.php');
485
                $ret[] = $userRate->render();
486
                // User Templates Rate File
487
                $userTemplatesRate = TemplatesUserRate::getInstance();
488
                $userTemplatesRate->write($module, $table, $moduleDirname . '_rate.tpl');
489
                $ret[] = $userTemplatesRate->render();
490
            }
491
            // User Rss File
492
            if (in_array(1, $tableRss, true)) {
493
                $userRss = UserRss::getInstance();
494
                $userRss->write($module, $table, 'rss.php');
495
                $ret[] = $userRss->render();
496
                // User Templates Rss File
497
                $userTemplatesRss = TemplatesUserRss::getInstance();
498
                $userTemplatesRss->write($module, $moduleDirname . '_rss.tpl');
499
                $ret[] = $userTemplatesRss->render();
500
            }
501
            // User Single File
502
            if (in_array(1, $tableSingle, true)) {
503
                $userSingle = UserSingle::getInstance();
504
                $userSingle->write($module, $table, 'single.php');
505
                $ret[] = $userSingle->render();
506
                // User Templates Single File
507
                $userTemplatesSingle = TemplatesUserSingle::getInstance();
508
                $userTemplatesSingle->write($module, $table, $moduleDirname . '_single.tpl');
509
                $ret[] = $userTemplatesSingle->render();
510
            }
511
            // User Submit File
512
            if (in_array(1, $tableSubmit, true)) {
513
                $userSubmit = UserSubmit::getInstance();
514
                $userSubmit->write($module, $table, 'submit.php');
515
                $ret[] = $userSubmit->render();
516
                // User Templates Submit File
517
                $userTemplatesSubmit = TemplatesUserSubmit::getInstance();
518
                $userTemplatesSubmit->write($module, $table, $moduleDirname . '_submit.tpl');
519
                $ret[] = $userTemplatesSubmit->render();
520
            }// User Visit File
521
            if (in_array(1, $tableVisit, true)) {
522
                $userVisit = UserVisit::getInstance();
523
                $userVisit->write($module, $table, 'visit.php');
524
                $ret[] = $userVisit->render();
525
            }
526
            // User Tag Files
527
            if (in_array(1, $tableTag, true)) {
528
                $userListTag = UserListTag::getInstance();
529
                $userListTag->write($module, 'list.tag.php');
530
                $ret[] = $userListTag->render();
531
                $userViewTag = UserViewTag::getInstance();
532
                $userViewTag->write($module, 'view.tag.php');
533
                $ret[] = $userViewTag->render();
534
            }
535
            // User Index File
536
            $userIndex = UserIndex::getInstance();
537
            $userIndex->write($module, $table, 'index.php');
538
            $ret[] = $userIndex->render();
539
            // Language Main File
540
            $languageMain = LanguageMain::getInstance();
541
            $languageMain->write($module, $tables, 'main.php');
542
            $ret[] = $languageMain->render();
543
            // User Templates Submit File
544
            $userTemplatesUserBreadcrumbs = TemplatesUserBreadcrumbs::getInstance();
545
            $userTemplatesUserBreadcrumbs->write($module, $moduleDirname . '_breadcrumbs.tpl');
546
            $ret[] = $userTemplatesUserBreadcrumbs->render();
547
        }
548
        // Css Admin Styles File
549
        $cssStyles = CssAdminStyles::getInstance();
550
        $cssStyles->write($module, 'style.css');
551
        $ret[] = $cssStyles->render();
552
        // Css Styles File
553
        $cssStyles = CssStyles::getInstance();
554
        $cssStyles->write($module, 'style.css');
555
        $ret[] = $cssStyles->render();
556
        // Include Jquery File
557
        $JavascriptJQuery = JavascriptJQuery::getInstance();
558
        $JavascriptJQuery->write($module, 'functions.js');
559
        $ret[] = $JavascriptJQuery->render();
560
        // Include Common File
561
        $includeCommon = IncludeCommon::getInstance();
562
        $includeCommon->write($module, $table, 'common.php');
563
        $ret[] = $includeCommon->render();
564
        // Docs Changelog File
565
        $docsChangelog = DocsChangelog::getInstance();
566
        $docsChangelog->write($module, 'changelog.txt');
567
        $ret[] = $docsChangelog->render();
568
        // Language Help File
569
        $languageHelp = LanguageHelp::getInstance();
570
        $languageHelp->write($module, 'help.html');
571
        $ret[] = $languageHelp->render();
572
        // User Xoops Version File
573
        $userXoopsVersion = UserXoopsVersion::getInstance();
574
        $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
575
        $ret[] = $userXoopsVersion->render();
576
577
        // Return Array
578
        return $ret;
579
    }
580
}
581