Passed
Pull Request — master (#144)
by Michael
03:10
created

CreateArchitecture   C

Complexity

Total Complexity 54

Size/Duplication

Total Lines 554
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 362
dl 0
loc 554
rs 6.4799
c 0
b 0
f 0
wmc 54

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getInstance() 0 8 2
F setFilesToBuilding() 0 419 34
F setBaseFoldersFiles() 0 89 17

How to fix   Complexity   

Complex Class

Complex classes like CreateArchitecture often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use CreateArchitecture, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace XoopsModules\Tdmcreate\Files;
4
5
use XoopsModules\Tdmcreate;
6
7
/*
8
 You may not change or alter any portion of this comment or credits
9
 of supporting developers from this source code or any supporting source code
10
 which is considered copyrighted (c) material of the original comment or credit authors.
11
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
 */
16
/**
17
 * tdmcreate module.
18
 *
19
 * @copyright       XOOPS Project (https://xoops.org)
20
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
21
 *
22
 * @since           2.5.0
23
 *
24
 * @author          Txmod Xoops http://www.txmodxoops.org
25
 *
26
 * @version         $Id: Architecture.php 12258 2014-01-02 09:33:29Z timgno $
27
 */
28
29
//include dirname(__DIR__) . '/autoload.php';
30
31
/**
32
 * Class Architecture.
33
 */
34
class CreateArchitecture extends CreateStructure
35
{
36
    /**
37
     *  @public function constructor class
38
     *
39
     *  @param null
40
     */
41
    public function __construct()
42
    {
43
        parent::__construct();
44
        $this->setUploadPath(TDMC_UPLOAD_REPOSITORY_PATH);
45
    }
46
47
    /**
48
     *  @static function getInstance
49
     *
50
     *  @param null
51
     *
52
     * @return Tdmcreate\Files\CreateArchitecture
53
     */
54
    public static function getInstance()
55
    {
56
        static $instance = false;
57
        if (!$instance) {
58
            $instance = new self();
59
        }
60
61
        return $instance;
62
    }
63
64
    /**
65
     * @public function setBaseFoldersFiles
66
     *
67
     * @param $module
68
     */
69
    public function setBaseFoldersFiles($module)
70
    {
71
        $helper = Tdmcreate\Helper::getInstance();
72
        $tf = Tdmcreate\Files\CreateFile::getInstance();
73
        // Module
74
        $modId = $module->getVar('mod_id');
75
        // Id of tables
76
        $tables = $tf->getTableTables($modId);
77
78
        $table = null;
79
        foreach (array_keys($tables) as $t) {
80
            $tableId = $tables[$t]->getVar('table_id');
81
            $tableName = $tables[$t]->getVar('table_name');
82
            $table = $helper->getHandler('Tables')->get($tableId);
83
        }
84
85
        $indexFile = XOOPS_UPLOAD_PATH . '/index.html';
86
        $stlModuleAuthor = str_replace(' ', '', mb_strtolower($module->getVar('mod_author')));
87
        $this->setModuleName($module->getVar('mod_dirname'));
88
        $uploadPath = $this->getUploadPath();
89
        // Creation of "module" folder in the Directory repository
90
        $this->makeDir($uploadPath . '/' . $this->getModuleName());
91
        if (1 != $module->getVar('mod_user')) {
92
            // Copied of index.html file in "root module" folder
93
            $this->copyFile('', $indexFile, 'index.html');
94
        }
95
        if (1 == $module->getVar('mod_admin')) {
96
            // Creation of "admin" folder and index.html file
97
            $this->makeDirAndCopyFile('admin', $indexFile, 'index.html');
98
        }
99
        if (1 == $module->getVar('mod_blocks')) {
100
            // Creation of "blocks" folder and index.html file
101
            $this->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
102
        }
103
        $language = ('english' !== $GLOBALS['xoopsConfig']['language']) ? $GLOBALS['xoopsConfig']['language'] : 'english';
104
        $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];
105
        foreach ($copyFiles as $k => $v) {
106
            // Creation of folders and index.html file
107
            $this->makeDirAndCopyFile($k, $v, 'index.html');
108
        }
109
        //Copy the logo of the module
110
        $modImage = str_replace(' ', '', mb_strtolower($module->getVar('mod_image')));
111
        $this->copyFile('assets/images', TDMC_UPLOAD_IMGMOD_PATH . '/' . $modImage, $modImage);
112
        // Copy of 'module_author_logo.png' file in uploads dir
113
        $logoPng = $stlModuleAuthor . '_logo.png';
114
        $logoGifFrom = TDMC_UPLOAD_IMGMOD_PATH . '/' . $logoPng;
115
        // If file exists
116
        if (!file_exists($logoGifFrom)) {
117
            // Rename file
118
            $copyFile = TDMC_IMAGES_LOGOS_URL . '/xoopsdevelopmentteam_logo.gif';
119
            $copyNewFile = $logoGifFrom;
120
            copy($copyFile, $copyNewFile);
121
        } else {
122
            // Copy file
123
            $copyFile = TDMC_IMAGES_LOGOS_URL . '/' . $logoPng;
124
            $copyNewFile = $logoGifFrom;
125
            copy($copyFile, $copyNewFile);
126
        }
127
        // Creation of 'module_author_logo.gif' file
128
        $this->copyFile('assets/images', $copyNewFile, $logoPng);
129
        $docs = [
130
            '/credits.txt' => 'credits.txt',
131
'/install.txt' => 'install.txt',
132
            '/lang.diff' => 'lang.diff',
133
'/license.txt' => 'license.txt',
134
'/readme.txt' => 'readme.txt',
135
        ];
136
        foreach ($docs as $k => $v) {
137
            // Creation of folder docs and .txt files
138
            $this->makeDirAndCopyFile('docs', TDMC_DOCS_PATH . $k, $v);
139
        }
140
        if (!empty($tableName)) {
141
            if (1 == $module->getVar('mod_admin') || 1 == $module->getVar('mod_user')) {
142
                // Creation of "templates" folder and index.html file
143
                $this->makeDirAndCopyFile('templates', $indexFile, 'index.html');
144
            }
145
            if (1 == $module->getVar('mod_admin')) {
146
                // Creation of "templates/admin" folder and index.html file
147
                $this->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
148
            }
149
            if ((1 == $module->getVar('mod_blocks')) && (1 == $table->getVar('table_blocks'))) {
150
                // Creation of "templates/blocks" folder and index.html file
151
                $this->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
152
            }
153
            // Creation of "sql" folder and index.html file
154
            $this->makeDirAndCopyFile('sql', $indexFile, 'index.html');
155
            if ((1 == $module->getVar('mod_notifications')) && (1 == $table->getVar('table_notifications'))) {
156
                // Creation of "language/local_language/mail_template" folder and index.html file
157
                $this->makeDirAndCopyFile('language/' . $language . '/mail_template', $indexFile, 'index.html');
158
            }
159
        }
160
    }
161
162
    /**
163
     *  @public function setFilesToBuilding
164
     *
165
     *  @param string $module
166
     *
167
     * @return array
168
     */
169
    public function setFilesToBuilding($module)
170
    {
171
        $helper = Tdmcreate\Helper::getInstance();
172
        $tf = Tdmcreate\Files\CreateFile::getInstance();
173
        // Module
174
        $modId = $module->getVar('mod_id');
175
        $moduleDirname = $module->getVar('mod_dirname');
176
        $icon32 = 'assets/icons/32';
177
        $tables = $tf->getTableTables($modId);
178
        $files = $tf->getTableMoreFiles($modId);
179
        $ret = [];
180
181
        $table = [];
182
        $tableCategory = [];
183
        $tableName = [];
0 ignored issues
show
Unused Code introduced by
The assignment to $tableName is dead and can be removed.
Loading history...
184
        $tableAdmin = [];
185
        $tableUser = [];
186
        $tableBlocks = [];
187
        $tableSearch = [];
188
        $tableComments = [];
189
        $tableNotifications = [];
190
        $tablePermissions = [];
191
        $tableBroken = [];
192
        $tablePdf = [];
193
        $tablePrint = [];
194
        $tableRate = [];
195
        $tableRss = [];
196
        $tableSingle = [];
197
        $tableSubmit = [];
198
        $tableVisit = [];
199
        $tableTag = [];
200
        foreach (array_keys($tables) as $t) {
201
            $tableId = $tables[$t]->getVar('table_id');
202
            $tableName = $tables[$t]->getVar('table_name');
203
            $tableCategory[] = $tables[$t]->getVar('table_category');
204
            $tableImage = $tables[$t]->getVar('table_image');
205
            $tableAdmin[] = $tables[$t]->getVar('table_admin');
206
            $tableUser[] = $tables[$t]->getVar('table_user');
207
            $tableBlocks[] = $tables[$t]->getVar('table_blocks');
208
            $tableSearch[] = $tables[$t]->getVar('table_search');
209
            $tableComments[] = $tables[$t]->getVar('table_comments');
210
            $tableNotifications[] = $tables[$t]->getVar('table_notifications');
211
            $tablePermissions[] = $tables[$t]->getVar('table_permissions');
212
            $tableBroken[] = $tables[$t]->getVar('table_broken');
213
            $tablePdf[] = $tables[$t]->getVar('table_pdf');
214
            $tablePrint[] = $tables[$t]->getVar('table_print');
215
            $tableRate[] = $tables[$t]->getVar('table_rate');
216
            $tableRss[] = $tables[$t]->getVar('table_rss');
217
            $tableSingle[] = $tables[$t]->getVar('table_single');
218
            $tableSubmit[] = $tables[$t]->getVar('table_submit');
219
            $tableVisit[] = $tables[$t]->getVar('table_visit');
220
            $tableTag[] = $tables[$t]->getVar('table_tag');
221
            // Get Table Object
222
            $table = $helper->getHandler('Tables')->get($tableId);
223
            // Copy of tables images file
224
            if (file_exists($uploadTableImage = TDMC_UPLOAD_IMGTAB_PATH . '/' . $tableImage)) {
225
                $this->copyFile($icon32, $uploadTableImage, $tableImage);
226
            } elseif (file_exists($uploadTableImage = XOOPS_ICONS32_PATH . '/' . $tableImage)) {
227
                $this->copyFile($icon32, $uploadTableImage, $tableImage);
228
            }
229
            // Creation of admin files
230
            if (in_array(1, $tableAdmin)) {
231
                // Admin Pages File
232
                $adminPages = Tdmcreate\Files\Admin\AdminPages::getInstance();
233
                $adminPages->write($module, $table, $tableName . '.php');
234
                $ret[] = $adminPages->render();
235
                // Admin Templates File
236
                $adminTemplatesPages = Tdmcreate\Files\Templates\Admin\TemplatesAdminPages::getInstance();
237
                $adminTemplatesPages->write($module, $table, $moduleDirname . '_admin_' . $tableName . '.tpl');
238
                $ret[] = $adminTemplatesPages->render();
239
            }
240
            // Creation of blocks
241
            if (in_array(1, $tableBlocks)) {
242
                // Blocks Files
243
                $blocksFiles = Tdmcreate\Files\Blocks\BlocksFiles::getInstance();
244
                $blocksFiles->write($module, $table, $tableName . '.php');
245
                $ret[] = $blocksFiles->render();
246
                // Templates Blocks Files
247
                $templatesBlocks = Tdmcreate\Files\Templates\Blocks\TemplatesBlocks::getInstance();
248
                $templatesBlocks->write($module, $table, $moduleDirname . '_block_' . $tableName . '.tpl');
249
                $ret[] = $templatesBlocks->render();
250
            }
251
            // Creation of classes
252
            if (in_array(1, $tableAdmin, true) || in_array(1, $tableUser)) {
253
                // Class Files
254
                $classFiles = Tdmcreate\Files\Classes\ClassFiles::getInstance();
255
                $classFiles->write($module, $table, $tables, $tableName . '.php');
0 ignored issues
show
Bug introduced by
$table of type XoopsObject is incompatible with the type string expected by parameter $table of XoopsModules\Tdmcreate\F...ses\ClassFiles::write(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

255
                $classFiles->write($module, /** @scrutinizer ignore-type */ $table, $tables, $tableName . '.php');
Loading history...
256
                $ret[] = $classFiles->render();
257
            }
258
            // Creation of user files
259
            if (in_array(1, $tableUser)) {
260
                // User Pages File
261
                $userPages = Tdmcreate\Files\User\UserPages::getInstance();
262
                $userPages->write($module, $table, $tableName . '.php');
263
                $ret[] = $userPages->render();
264
                if (in_array(0, $tableCategory)) {
265
                    // User Templates File
266
                    $userTemplatesPages = Tdmcreate\Files\Templates\User\Pages::getInstance();
267
                    $userTemplatesPages->write($module, $table, $moduleDirname . '_' . $tableName . '.tpl');
268
                    $ret[] = $userTemplatesPages->render();
269
                    // User List Templates File
270
                    $userTemplatesPagesList = Tdmcreate\Files\Templates\User\PagesList::getInstance();
271
                    $userTemplatesPagesList->write($module, $table, $tables, $moduleDirname . '_' . $tableName . '_list' . '.tpl');
272
                    $ret[] = $userTemplatesPagesList->render();
273
                }
274
                if (in_array(1, $tableCategory)) {
275
                    // User List Templates File
276
                    $userTemplatesCategories = Templates\User\Categories::getInstance();
277
                    $userTemplatesCategories->write($module, $table, $moduleDirname . '_' . $tableName . '.tpl');
278
                    $ret[] = $userTemplatesCategories->render();
279
                    // User List Templates File
280
                    $userTemplatesCategoriesList = Templates\User\CategoriesList::getInstance();
281
                    $userTemplatesCategoriesList->write($module, $table, $moduleDirname . '_' . $tableName . '_list' . '.tpl');
282
                    $ret[] = $userTemplatesCategoriesList->render();
283
                }
284
            }
285
        }
286
        foreach (array_keys($files) as $t) {
287
            $fileName = $files[$t]->getVar('file_name');
288
            $fileExtension = $files[$t]->getVar('file_extension');
289
            $fileInfolder = $files[$t]->getVar('file_infolder');
290
            // More File
291
            $moreFiles = Tdmcreate\MoreFiles::getInstance();
292
            $moreFiles->write($module, $fileName, $fileInfolder, $fileExtension);
0 ignored issues
show
Bug introduced by
The method write() does not exist on XoopsModules\Tdmcreate\MoreFiles. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

292
            $moreFiles->/** @scrutinizer ignore-call */ 
293
                        write($module, $fileName, $fileInfolder, $fileExtension);
Loading history...
293
            $ret[] = $moreFiles->render();
0 ignored issues
show
Bug introduced by
The method render() does not exist on XoopsModules\Tdmcreate\MoreFiles. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

293
            /** @scrutinizer ignore-call */ 
294
            $ret[] = $moreFiles->render();
Loading history...
294
        }
295
        // Language Modinfo File
296
        $languageModinfo = Tdmcreate\Files\Language\LanguageModinfo::getInstance();
297
        $languageModinfo->write($module, $table, 'modinfo.php');
298
        $ret[] = $languageModinfo->render();
299
        if (1 == $module->getVar('mod_admin')) {
300
            // Admin Header File
301
            $adminHeader = Tdmcreate\Files\Admin\AdminHeader::getInstance();
302
            $adminHeader->write($module, $table, $tables, 'header.php');
303
            $ret[] = $adminHeader->render();
304
            // Admin Index File
305
            $adminIndex = Tdmcreate\Files\Admin\AdminIndex::getInstance();
306
            $adminIndex->write($module, $tables, 'index.php');
307
            $ret[] = $adminIndex->render();
308
            // Admin Menu File
309
            $adminObject = Tdmcreate\Files\Admin\AdminMenu::getInstance();
310
            $adminObject->write($module, 'menu.php');
311
            $ret[] = $adminObject->render();
312
            // Admin About File
313
            $adminAbout = Tdmcreate\Files\Admin\AdminAbout::getInstance();
314
            $adminAbout->write($module, 'about.php');
315
            $ret[] = $adminAbout->render();
316
            // Admin Footer File
317
            $adminFooter = Tdmcreate\Files\Admin\AdminFooter::getInstance();
318
            $adminFooter->write($module, 'footer.php');
319
            $ret[] = $adminFooter->render();
320
            // Templates Admin About File
321
            $adminTemplatesAbout = Tdmcreate\Files\Templates\Admin\TemplatesAdminAbout::getInstance();
322
            $adminTemplatesAbout->write($module, $moduleDirname . '_admin_about.tpl');
323
            $ret[] = $adminTemplatesAbout->render();
324
            // Templates Admin Index File
325
            $adminTemplatesIndex = Tdmcreate\Files\Templates\Admin\TemplatesAdminIndex::getInstance();
326
            $adminTemplatesIndex->write($module, $moduleDirname . '_admin_index.tpl');
327
            $ret[] = $adminTemplatesIndex->render();
328
            // Templates Admin Footer File
329
            $adminTemplatesFooter = Tdmcreate\Files\Templates\Admin\TemplatesAdminFooter::getInstance();
330
            $adminTemplatesFooter->write($module, $moduleDirname . '_admin_footer.tpl');
331
            $ret[] = $adminTemplatesFooter->render();
332
            // Templates Admin Header File
333
            $adminTemplatesHeader = Tdmcreate\Files\Templates\Admin\TemplatesAdminHeader::getInstance();
334
            $adminTemplatesHeader->write($module, $moduleDirname . '_admin_header.tpl');
335
            $ret[] = $adminTemplatesHeader->render();
336
            // Language Admin File
337
            $languageAdmin = Tdmcreate\Files\Language\LanguageAdmin::getInstance();
338
            $languageAdmin->write($module, $table, $tables, 'admin.php');
339
            $ret[] = $languageAdmin->render();
340
        }
341
        // Class Helper File
342
        $classHelper = Tdmcreate\Files\Classes\ClassHelper::getInstance();
343
        $classHelper->write($module, 'helper.php');
344
        $ret[] = $classHelper->render();
345
        // Include Functions File
346
        $includeFunctions = Tdmcreate\Files\Includes\IncludeFunctions::getInstance();
347
        $includeFunctions->write($module, 'functions.php');
348
        $ret[] = $includeFunctions->render();
349
        // Creation of blocks language file
350
        if (null != $table->getVar('table_name')) {
351
            // Include Install File
352
            $includeInstall = Tdmcreate\Files\Includes\IncludeInstall::getInstance();
353
            $includeInstall->write($module, $table, $tables, 'install.php');
354
            $ret[] = $includeInstall->render();
355
            if (in_array(1, $tableBlocks)) {
356
                // Language Blocks File
357
                $languageBlocks = Tdmcreate\Files\Language\LanguageBlocks::getInstance();
358
                $languageBlocks->write($module, $tables, 'blocks.php');
359
                $ret[] = $languageBlocks->render();
360
            }
361
            // Creation of admin permission files
362
            if (in_array(1, $tablePermissions)) {
363
                // Admin Permissions File
364
                $adminPermissions = Tdmcreate\Files\Admin\AdminPermissions::getInstance();
365
                $adminPermissions->write($module, $tables, 'permissions.php');
366
                $ret[] = $adminPermissions->render();
367
                // Templates Admin Permissions File
368
                $adminTemplatesPermissions = Tdmcreate\Files\Templates\Admin\TemplatesAdminPermissions::getInstance();
369
                $adminTemplatesPermissions->write($module, $moduleDirname . '_admin_permissions.tpl');
370
                $ret[] = $adminTemplatesPermissions->render();
371
            }
372
            // Creation of notifications files
373
            if (in_array(1, $tableNotifications)) {
374
                // Include Notifications File
375
                $includeNotifications = Tdmcreate\Files\Includes\IncludeNotifications::getInstance();
376
                $includeNotifications->write($module, $table, 'notifications.inc.php');
377
                $ret[] = $includeNotifications->render();
378
                // Language Mail Template Category File
379
                $languageMailTpl = Tdmcreate\Files\Language\LanguageMailTpl::getInstance();
380
                $languageMailTpl->write($module, 'category_new_notify.tpl');
381
                $ret[] = $languageMailTpl->render();
382
            }
383
            // Creation of sql file
384
            if (null != $table->getVar('table_name')) {
385
                // Sql File
386
                $sqlFile = Tdmcreate\Files\Sql\SqlFile::getInstance();
387
                $sqlFile->write($module, 'mysql.sql');
388
                $ret[] = $sqlFile->render();
389
                // Include Update File
390
                $includeUpdate = Tdmcreate\Files\Includes\IncludeUpdate::getInstance();
391
                $includeUpdate->write($module, 'update.php');
392
                $ret[] = $includeUpdate->render();
393
            }
394
            // Creation of search file
395
            if (in_array(1, $tableSearch)) {
396
                // Include Search File
397
                $includeSearch = Tdmcreate\Files\Includes\IncludeSearch::getInstance();
398
                $includeSearch->write($module, $table, 'search.inc.php');
399
                $ret[] = $includeSearch->render();
400
            }
401
            // Creation of comments files
402
            if (in_array(1, $tableComments)) {
403
                // Include Comments File
404
                $includeComments = Tdmcreate\Files\Includes\IncludeComments::getInstance();
405
                $includeComments->write($module, $table);
406
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
407
                // Include Comments File
408
                $includeComments = Tdmcreate\Files\Includes\IncludeComments::getInstance();
409
                $includeComments->write($module, $table);
410
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
411
                // Include Comments File
412
                $includeComments = Tdmcreate\Files\Includes\IncludeComments::getInstance();
413
                $includeComments->write($module, $table);
414
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
415
                // Include Comments File
416
                $includeComments = Tdmcreate\Files\Includes\IncludeComments::getInstance();
417
                $includeComments->write($module, $table);
418
                $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
419
                // Include Comments File
420
                $includeComments = Tdmcreate\Files\Includes\IncludeComments::getInstance();
421
                $includeComments->write($module, $table);
422
                $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
423
                // Include Comment Functions File
424
                $includeCommentFunctions = Tdmcreate\Files\Includes\IncludeCommentFunctions::getInstance();
425
                $includeCommentFunctions->write($module, $table, 'comment_functions.php');
426
                $ret[] = $includeCommentFunctions->render();
427
            }
428
        }
429
        // Creation of admin files
430
        if (1 == $module->getVar('mod_admin')) {
431
            // Templates Index File
432
            $userTemplatesIndex = Tdmcreate\Files\Templates\User\Index::getInstance();
433
            $userTemplatesIndex->write($module, $table, $tables, $moduleDirname . '_index.tpl');
434
            $ret[] = $userTemplatesIndex->render();
435
            // Templates Footer File
436
            $userTemplatesFooter = Tdmcreate\Files\Templates\User\Footer::getInstance();
437
            $userTemplatesFooter->write($module, $table, $moduleDirname . '_footer.tpl');
438
            $ret[] = $userTemplatesFooter->render();
439
            // Templates Header File
440
            $userTemplatesHeader = Tdmcreate\Files\Templates\User\Header::getInstance();
441
            $userTemplatesHeader->write($module, $moduleDirname . '_header.tpl');
442
            $ret[] = $userTemplatesHeader->render();
443
        }
444
        // Creation of user files
445
        if ((1 == $module->getVar('mod_user')) && in_array(1, $tableUser)) {
446
            // User Footer File
447
            $userFooter = Tdmcreate\Files\User\UserFooter::getInstance();
448
            $userFooter->write($module, 'footer.php');
449
            $ret[] = $userFooter->render();
450
            // User Header File
451
            $userHeader = Tdmcreate\Files\User\UserHeader::getInstance();
452
            $userHeader->write($module, $table, $tables, 'header.php');
453
            $ret[] = $userHeader->render();
454
            // User Notification Update File
455
            if ((1 == $module->getVar('mod_notifications')) && in_array(1, $tableNotifications)) {
456
                $userNotificationUpdate = Tdmcreate\Files\User\UserNotificationUpdate::getInstance();
457
                $userNotificationUpdate->write($module, 'notification_update.php');
458
                $ret[] = $userNotificationUpdate->render();
459
            }
460
            // User Broken File
461
            if (in_array(1, $tableBroken)) {
462
                $userBroken = Tdmcreate\Files\User\UserBroken::getInstance();
463
                $userBroken->write($module, $table, 'broken.php');
464
                $ret[] = $userBroken->render();
465
                // User Templates Broken File
466
                $userTemplatesBroken = Templates\User\Broken::getInstance();
467
                $userTemplatesBroken->write($module, $table, $moduleDirname . '_broken.tpl');
468
                $ret[] = $userTemplatesBroken->render();
469
            }
470
            // User Pdf File
471
            if (in_array(1, $tablePdf)) {
472
                $userPdf = Tdmcreate\Files\User\UserPdf::getInstance();
473
                $userPdf->write($module, $table, 'pdf.php');
474
                $ret[] = $userPdf->render();
475
                // User Templates Pdf File
476
                $userTemplatesPdf = Tdmcreate\Files\Templates\User\Pdf::getInstance();
477
                $userTemplatesPdf->write($module, $moduleDirname . '_pdf.tpl');
478
                $ret[] = $userTemplatesPdf->render();
479
            }
480
            // User Print File
481
            if (in_array(1, $tablePrint)) {
482
                $userPrint = Tdmcreate\Files\User\UserPrint::getInstance();
483
                $userPrint->write($module, $table, 'print.php');
484
                $ret[] = $userPrint->render();
485
                // User Templates Print File
486
                $userTemplatesPrint = Tdmcreate\Files\Templates\User\UserPrint::getInstance();
487
                $userTemplatesPrint->write($module, $table, $moduleDirname . '_print.tpl');
488
                $ret[] = $userTemplatesPrint->render();
489
            }
490
            // User Rate File
491
            if (in_array(1, $tableRate)) {
492
                $userRate = Tdmcreate\Files\User\UserRate::getInstance();
493
                $userRate->write($module, $table, 'rate.php');
494
                $ret[] = $userRate->render();
495
                // User Templates Rate File
496
                $userTemplatesRate = Tdmcreate\Files\Templates\User\Rate::getInstance();
497
                $userTemplatesRate->write($module, $table, $moduleDirname . '_rate.tpl');
498
                $ret[] = $userTemplatesRate->render();
499
            }
500
            // User Rss File
501
            if (in_array(1, $tableRss)) {
502
                $userRss = Tdmcreate\Files\User\UserRss::getInstance();
503
                $userRss->write($module, $table, 'rss.php');
504
                $ret[] = $userRss->render();
505
                // User Templates Rss File
506
                $userTemplatesRss = Tdmcreate\Files\Templates\User\Rss::getInstance();
507
                $userTemplatesRss->write($module, $moduleDirname . '_rss.tpl');
508
                $ret[] = $userTemplatesRss->render();
509
            }
510
            // User Single File
511
            if (in_array(1, $tableSingle)) {
512
                $userSingle = Tdmcreate\Files\User\UserSingle::getInstance();
513
                $userSingle->write($module, $table, 'single.php');
514
                $ret[] = $userSingle->render();
515
                // User Templates Single File
516
                $userTemplatesSingle = Tdmcreate\Files\Templates\User\Single::getInstance();
517
                $userTemplatesSingle->write($module, $table, $moduleDirname . '_single.tpl');
518
                $ret[] = $userTemplatesSingle->render();
519
            }
520
            // User Submit File
521
            if (in_array(1, $tableSubmit)) {
522
                $userSubmit = Tdmcreate\Files\User\UserSubmit::getInstance();
523
                $userSubmit->write($module, $table, 'submit.php');
524
                $ret[] = $userSubmit->render();
525
                // User Templates Submit File
526
                $userTemplatesSubmit = Tdmcreate\Files\Templates\User\Submit::getInstance();
527
                $userTemplatesSubmit->write($module, $table, $moduleDirname . '_submit.tpl');
528
                $ret[] = $userTemplatesSubmit->render();
529
            }// User Visit File
530
            if (in_array(1, $tableVisit)) {
531
                $userVisit = Tdmcreate\Files\User\UserVisit::getInstance();
532
                $userVisit->write($module, $table, 'visit.php');
533
                $ret[] = $userVisit->render();
534
            }
535
            // User Tag Files
536
            if (in_array(1, $tableTag)) {
537
                $userListTag = Tdmcreate\Files\User\UserListTag::getInstance();
538
                $userListTag->write($module, 'list.tag.php');
539
                $ret[] = $userListTag->render();
540
                $userViewTag = Tdmcreate\Files\User\UserViewTag::getInstance();
541
                $userViewTag->write($module, 'view.tag.php');
542
                $ret[] = $userViewTag->render();
543
            }
544
            // User Index File
545
            $userIndex = Tdmcreate\Files\User\UserIndex::getInstance();
546
            $userIndex->write($module, $table, 'index.php');
547
            $ret[] = $userIndex->render();
548
            // Language Main File
549
            $languageMain = Tdmcreate\Files\Language\LanguageMain::getInstance();
550
            $languageMain->write($module, $tables, 'main.php');
551
            $ret[] = $languageMain->render();
552
            // User Templates Submit File
553
            $userTemplatesUserBreadcrumbs = Templates\User\Breadcrumbs::getInstance();
554
            $userTemplatesUserBreadcrumbs->write($module, $moduleDirname . '_breadcrumbs.tpl');
555
            $ret[] = $userTemplatesUserBreadcrumbs->render();
556
        }
557
        // Css Admin Styles File
558
        $cssStyles = Tdmcreate\Files\Assets\Css\Admin\CssAdminStyles::getInstance();
559
        $cssStyles->write($module, 'style.css');
560
        $ret[] = $cssStyles->render();
561
        // Css Styles File
562
        $cssStyles = Tdmcreate\Files\Assets\Css\CssStyles::getInstance();
563
        $cssStyles->write($module, 'style.css');
564
        $ret[] = $cssStyles->render();
565
        // Include Jquery File
566
        $JavascriptJQuery = Tdmcreate\Files\Assets\Js\JavascriptJQuery::getInstance();
567
        $JavascriptJQuery->write($module, 'functions.js');
568
        $ret[] = $JavascriptJQuery->render();
569
        // Include Common File
570
        $includeCommon = Tdmcreate\Files\Includes\IncludeCommon::getInstance();
571
        $includeCommon->write($module, $table, 'common.php');
572
        $ret[] = $includeCommon->render();
573
        // Docs Changelog File
574
        $docsChangelog = Tdmcreate\Files\Docs\DocsChangelog::getInstance();
575
        $docsChangelog->write($module, 'changelog.txt');
576
        $ret[] = $docsChangelog->render();
577
        // Language Help File
578
        $languageHelp = Tdmcreate\Files\Language\LanguageHelp::getInstance();
579
        $languageHelp->write($module, 'help.html');
580
        $ret[] = $languageHelp->render();
581
        // User Xoops Version File
582
        $userXoopsVersion = Tdmcreate\Files\User\UserXoopsVersion::getInstance();
583
        $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
584
        $ret[] = $userXoopsVersion->render();
585
586
        // Return Array
587
        return $ret;
588
    }
589
}
590