| Conditions | 34 |
| Paths | > 20000 |
| Total Lines | 416 |
| Code Lines | 298 |
| Lines | 123 |
| Ratio | 29.57 % |
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:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 215 | public function setFilesToBuilding($module) |
||
| 216 | { |
||
| 217 | // Module |
||
| 218 | $modId = $module->getVar('mod_id'); |
||
| 219 | $moduleDirname = $module->getVar('mod_dirname'); |
||
| 220 | $icon32 = 'assets/icons/32'; |
||
| 221 | $tables = $this->tdmcfile->getTableTables($modId); |
||
| 222 | $files = $this->tdmcfile->getTableMoreFiles($modId); |
||
| 223 | $ret = array(); |
||
| 224 | // |
||
| 225 | $table = array(); |
||
| 226 | $tableCategory = array(); |
||
| 227 | $tableName = array(); |
||
| 228 | $tableImage = array(); |
||
| 229 | $tableAdmin = array(); |
||
| 230 | $tableUser = array(); |
||
| 231 | $tableBlocks = array(); |
||
| 232 | $tableSearch = array(); |
||
| 233 | $tableComments = array(); |
||
| 234 | $tableNotifications = array(); |
||
| 235 | $tablePermissions = array(); |
||
| 236 | $tableBroken = array(); |
||
| 237 | $tablePdf = array(); |
||
| 238 | $tablePrint = array(); |
||
| 239 | $tableRate = array(); |
||
| 240 | $tableRss = array(); |
||
| 241 | $tableSingle = array(); |
||
| 242 | $tableSubmit = array(); |
||
| 243 | $tableVisit = array(); |
||
| 244 | $tableTag = array(); |
||
| 245 | foreach (array_keys($tables) as $t) { |
||
| 246 | $tableMid = $tables[$t]->getVar('table_mid'); |
||
| 247 | $tableId = $tables[$t]->getVar('table_id'); |
||
| 248 | $tableName = $tables[$t]->getVar('table_name'); |
||
| 249 | $tableCategory[] = $tables[$t]->getVar('table_category'); |
||
| 250 | $tableImage = $tables[$t]->getVar('table_image'); |
||
| 251 | $tableAdmin[] = $tables[$t]->getVar('table_admin'); |
||
| 252 | $tableUser[] = $tables[$t]->getVar('table_user'); |
||
| 253 | $tableBlocks[] = $tables[$t]->getVar('table_blocks'); |
||
| 254 | $tableSearch[] = $tables[$t]->getVar('table_search'); |
||
| 255 | $tableComments[] = $tables[$t]->getVar('table_comments'); |
||
| 256 | $tableNotifications[] = $tables[$t]->getVar('table_notifications'); |
||
| 257 | $tablePermissions[] = $tables[$t]->getVar('table_permissions'); |
||
| 258 | $tableBroken[] = $tables[$t]->getVar('table_broken'); |
||
| 259 | $tablePdf[] = $tables[$t]->getVar('table_pdf'); |
||
| 260 | $tablePrint[] = $tables[$t]->getVar('table_print'); |
||
| 261 | $tableRate[] = $tables[$t]->getVar('table_rate'); |
||
| 262 | $tableRss[] = $tables[$t]->getVar('table_rss'); |
||
| 263 | $tableSingle[] = $tables[$t]->getVar('table_single'); |
||
| 264 | $tableSubmit[] = $tables[$t]->getVar('table_submit'); |
||
| 265 | $tableVisit[] = $tables[$t]->getVar('table_visit'); |
||
| 266 | $tableTag[] = $tables[$t]->getVar('table_tag'); |
||
| 267 | // Get Table Object |
||
| 268 | $table = $this->tdmcreate->getHandler('tables')->get($tableId); |
||
| 269 | // Copy of tables images file |
||
| 270 | if (file_exists($uploadTableImage = TDMC_UPLOAD_IMGTAB_PATH.'/'.$tableImage)) { |
||
| 271 | $this->copyFile($icon32, $uploadTableImage, $tableImage); |
||
| 272 | } elseif (file_exists($uploadTableImage = XOOPS_ICONS32_PATH.'/'.$tableImage)) { |
||
| 273 | $this->copyFile($icon32, $uploadTableImage, $tableImage); |
||
| 274 | } |
||
| 275 | // Creation of admin files |
||
| 276 | View Code Duplication | if (in_array(1, $tableAdmin)) { |
|
| 277 | // Admin Pages File |
||
| 278 | $adminPages = AdminPages::getInstance(); |
||
| 279 | $adminPages->write($module, $table); |
||
| 280 | $ret[] = $adminPages->renderFile($tableName.'.php'); |
||
| 281 | // Admin Templates File |
||
| 282 | $adminTemplatesPages = TemplatesAdminPages::getInstance(); |
||
| 283 | $adminTemplatesPages->write($module, $table); |
||
| 284 | $ret[] = $adminTemplatesPages->renderFile($moduleDirname.'_admin_'.$tableName.'.tpl'); |
||
| 285 | } |
||
| 286 | // Creation of blocks |
||
| 287 | View Code Duplication | if (in_array(1, $tableBlocks)) { |
|
| 288 | // Blocks Files |
||
| 289 | $blocksFiles = BlocksFiles::getInstance(); |
||
| 290 | $blocksFiles->write($module, $table); |
||
| 291 | $ret[] = $blocksFiles->renderFile($tableName.'.php'); |
||
| 292 | // Templates Blocks Files |
||
| 293 | $templatesBlocks = TemplatesBlocks::getInstance(); |
||
| 294 | $templatesBlocks->write($module, $table); |
||
| 295 | $ret[] = $templatesBlocks->renderFile($moduleDirname.'_block_'.$tableName.'.tpl'); |
||
| 296 | } |
||
| 297 | // Creation of classes |
||
| 298 | if (in_array(1, $tableAdmin) || in_array(1, $tableUser)) { |
||
| 299 | // Class Files |
||
| 300 | $classFiles = ClassFiles::getInstance(); |
||
| 301 | $classFiles->write($module, $table, $tables); |
||
| 302 | $ret[] = $classFiles->renderFile($tableName.'.php'); |
||
| 303 | } |
||
| 304 | // Creation of user files |
||
| 305 | if (in_array(1, $tableUser)) { |
||
| 306 | // User Pages File |
||
| 307 | $userPages = UserPages::getInstance(); |
||
| 308 | $userPages->write($module, $table, $tableName.'.php'); |
||
| 309 | $ret[] = $userPages->renderFile(); |
||
| 310 | View Code Duplication | if (in_array(0, $tableCategory)) { |
|
| 311 | // User Templates File |
||
| 312 | $userTemplatesPages = TemplatesUserPages::getInstance(); |
||
| 313 | $userTemplatesPages->write($module, $table); |
||
| 314 | $ret[] = $userTemplatesPages->renderFile($moduleDirname.'_'.$tableName.'.tpl'); |
||
| 315 | // User List Templates File |
||
| 316 | $userTemplatesPagesList = TemplatesUserPagesList::getInstance(); |
||
| 317 | $userTemplatesPagesList->write($module, $table, $tables, $moduleDirname.'_'.$tableName.'_list'.'.tpl'); |
||
| 318 | $ret[] = $userTemplatesPagesList->renderFile(); |
||
| 319 | } |
||
| 320 | View Code Duplication | if (in_array(1, $tableCategory)) { |
|
| 321 | // User List Templates File |
||
| 322 | $userTemplatesCategories = TemplatesUserCategories::getInstance(); |
||
| 323 | $userTemplatesCategories->write($module, $table); |
||
| 324 | $ret[] = $userTemplatesCategories->renderFile($moduleDirname.'_'.$tableName.'.tpl'); |
||
| 325 | // User List Templates File |
||
| 326 | $userTemplatesCategoriesList = TemplatesUserCategoriesList::getInstance(); |
||
| 327 | $userTemplatesCategoriesList->write($module, $table); |
||
| 328 | $ret[] = $userTemplatesCategoriesList->renderFile($moduleDirname.'_'.$tableName.'_list'.'.tpl'); |
||
| 329 | } |
||
| 330 | } |
||
| 331 | } |
||
| 332 | foreach (array_keys($files) as $t) { |
||
| 333 | $fileName = $files[$t]->getVar('file_name'); |
||
| 334 | $fileExtension = $files[$t]->getVar('file_extension'); |
||
| 335 | $fileInfolder = $files[$t]->getVar('file_infolder'); |
||
| 336 | // More File |
||
| 337 | $moreFiles = TDMCreateMoreFiles::getInstance(); |
||
| 338 | $moreFiles->write($module, $fileName, $fileInfolder, $fileExtension); |
||
| 339 | $ret[] = $moreFiles->render(); |
||
| 340 | } |
||
| 341 | // Language Modinfo File |
||
| 342 | $languageModinfo = LanguageModinfo::getInstance(); |
||
| 343 | $languageModinfo->write($module, $table, $tables, 'modinfo.php'); |
||
| 344 | $ret[] = $languageModinfo->render(); |
||
| 345 | if (1 == $module->getVar('mod_admin')) { |
||
| 346 | // Admin Header File |
||
| 347 | $adminHeader = AdminHeader::getInstance(); |
||
| 348 | $adminHeader->write($module, $table, $tables, 'header.php'); |
||
| 349 | $ret[] = $adminHeader->render(); |
||
| 350 | // Admin Index File |
||
| 351 | $adminIndex = AdminIndex::getInstance(); |
||
| 352 | $adminIndex->write($module, $tables, 'index.php'); |
||
| 353 | $ret[] = $adminIndex->render(); |
||
| 354 | // Admin Menu File |
||
| 355 | $adminMenu = AdminMenu::getInstance(); |
||
| 356 | $adminMenu->write($module, $tables, 'menu.php'); |
||
| 357 | $ret[] = $adminMenu->render(); |
||
| 358 | // Admin About File |
||
| 359 | $adminAbout = AdminAbout::getInstance(); |
||
| 360 | $adminAbout->write($module, 'about.php'); |
||
| 361 | $ret[] = $adminAbout->render(); |
||
| 362 | // Admin Footer File |
||
| 363 | $adminFooter = AdminFooter::getInstance(); |
||
| 364 | $adminFooter->write($module, 'footer.php'); |
||
| 365 | $ret[] = $adminFooter->render(); |
||
| 366 | // Templates Admin About File |
||
| 367 | $adminTemplatesAbout = TemplatesAdminAbout::getInstance(); |
||
| 368 | $adminTemplatesAbout->write($module, $moduleDirname.'_admin_about.tpl'); |
||
| 369 | $ret[] = $adminTemplatesAbout->render(); |
||
| 370 | // Templates Admin Index File |
||
| 371 | $adminTemplatesIndex = TemplatesAdminIndex::getInstance(); |
||
| 372 | $adminTemplatesIndex->write($module, $moduleDirname.'_admin_index.tpl'); |
||
| 373 | $ret[] = $adminTemplatesIndex->render(); |
||
| 374 | // Templates Admin Footer File |
||
| 375 | $adminTemplatesFooter = TemplatesAdminFooter::getInstance(); |
||
| 376 | $adminTemplatesFooter->write($module, $moduleDirname.'_admin_footer.tpl'); |
||
| 377 | $ret[] = $adminTemplatesFooter->render(); |
||
| 378 | // Templates Admin Header File |
||
| 379 | $adminTemplatesHeader = TemplatesAdminHeader::getInstance(); |
||
| 380 | $adminTemplatesHeader->write($module, $moduleDirname.'_admin_header.tpl'); |
||
| 381 | $ret[] = $adminTemplatesHeader->render(); |
||
| 382 | // Language Admin File |
||
| 383 | $languageAdmin = LanguageAdmin::getInstance(); |
||
| 384 | $languageAdmin->write($module, $table, $tables, 'admin.php'); |
||
| 385 | $ret[] = $languageAdmin->render(); |
||
| 386 | } |
||
| 387 | // Class Helper File |
||
| 388 | $classHelper = ClassHelper::getInstance(); |
||
| 389 | $classHelper->write($module, 'helper.php'); |
||
| 390 | $ret[] = $classHelper->render(); |
||
| 391 | // Include Functions File |
||
| 392 | $includeFunctions = IncludeFunctions::getInstance(); |
||
| 393 | $includeFunctions->write($module, $table, 'functions.php'); |
||
| 394 | $ret[] = $includeFunctions->render(); |
||
| 395 | // Creation of blocks language file |
||
| 396 | if ($table->getVar('table_name') != null) { |
||
| 397 | // Include Install File |
||
| 398 | $includeInstall = IncludeInstall::getInstance(); |
||
| 399 | $includeInstall->write($module, $table, $tables, 'install.php'); |
||
| 400 | $ret[] = $includeInstall->render(); |
||
| 401 | if (in_array(1, $tableBlocks)) { |
||
| 402 | // Language Blocks File |
||
| 403 | $languageBlocks = LanguageBlocks::getInstance(); |
||
| 404 | $languageBlocks->write($module, $tables, 'blocks.php'); |
||
| 405 | $ret[] = $languageBlocks->render(); |
||
| 406 | } |
||
| 407 | // Creation of admin permission files |
||
| 408 | if (in_array(1, $tablePermissions)) { |
||
| 409 | // Admin Permissions File |
||
| 410 | $adminPermissions = AdminPermissions::getInstance(); |
||
| 411 | $adminPermissions->write($module, $tables, 'permissions.php'); |
||
| 412 | $ret[] = $adminPermissions->render(); |
||
| 413 | // Templates Admin Permissions File |
||
| 414 | $adminTemplatesPermissions = TemplatesAdminPermissions::getInstance(); |
||
| 415 | $adminTemplatesPermissions->write($module, $moduleDirname.'_admin_permissions.tpl'); |
||
| 416 | $ret[] = $adminTemplatesPermissions->render(); |
||
| 417 | } |
||
| 418 | // Creation of notifications files |
||
| 419 | View Code Duplication | if (in_array(1, $tableNotifications)) { |
|
| 420 | // Include Notifications File |
||
| 421 | $includeNotifications = IncludeNotifications::getInstance(); |
||
| 422 | $includeNotifications->write($module, $table, 'notifications.inc.php'); |
||
| 423 | $ret[] = $includeNotifications->render(); |
||
| 424 | // Language Mail Template Category File |
||
| 425 | $languageMailTpl = LanguageMailTpl::getInstance(); |
||
| 426 | $languageMailTpl->write($module); |
||
| 427 | $ret[] = $languageMailTpl->renderFile('category_new_notify.tpl'); |
||
| 428 | } |
||
| 429 | // Creation of sql file |
||
| 430 | View Code Duplication | if ($table->getVar('table_name') != null) { |
|
| 431 | // Sql File |
||
| 432 | $sqlFile = SqlFile::getInstance(); |
||
| 433 | $sqlFile->write($module, $tables, 'mysql.sql'); |
||
| 434 | $ret[] = $sqlFile->render(); |
||
| 435 | // Include Update File |
||
| 436 | $includeUpdate = IncludeUpdate::getInstance(); |
||
| 437 | $includeUpdate->write($module, 'update.php'); |
||
| 438 | $ret[] = $includeUpdate->renderFile(); |
||
| 439 | } |
||
| 440 | // Creation of search file |
||
| 441 | if (in_array(1, $tableSearch)) { |
||
| 442 | // Include Search File |
||
| 443 | $includeSearch = IncludeSearch::getInstance(); |
||
| 444 | $includeSearch->write($module, $table, 'search.inc.php'); |
||
| 445 | $ret[] = $includeSearch->render(); |
||
| 446 | } |
||
| 447 | // Creation of comments files |
||
| 448 | if (in_array(1, $tableComments)) { |
||
| 449 | // Include Comments File |
||
| 450 | $includeComments = IncludeComments::getInstance(); |
||
| 451 | $includeComments->write($module, $table); |
||
| 452 | $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit'); |
||
| 453 | // Include Comments File |
||
| 454 | $includeComments = IncludeComments::getInstance(); |
||
| 455 | $includeComments->write($module, $table); |
||
| 456 | $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete'); |
||
| 457 | // Include Comments File |
||
| 458 | $includeComments = IncludeComments::getInstance(); |
||
| 459 | $includeComments->write($module, $table); |
||
| 460 | $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post'); |
||
| 461 | // Include Comments File |
||
| 462 | $includeComments = IncludeComments::getInstance(); |
||
| 463 | $includeComments->write($module, $table); |
||
| 464 | $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply'); |
||
| 465 | // Include Comments File |
||
| 466 | $includeComments = IncludeComments::getInstance(); |
||
| 467 | $includeComments->write($module, $table); |
||
| 468 | $ret[] = $includeComments->renderCommentsNew($module, 'comment_new'); |
||
| 469 | // Include Comment Functions File |
||
| 470 | $includeCommentFunctions = IncludeCommentFunctions::getInstance(); |
||
| 471 | $includeCommentFunctions->write($module, $table, 'comment_functions.php'); |
||
| 472 | $ret[] = $includeCommentFunctions->renderFile(); |
||
| 473 | } |
||
| 474 | } |
||
| 475 | // Creation of admin files |
||
| 476 | if (1 == $module->getVar('mod_admin')) { |
||
| 477 | // Templates Index File |
||
| 478 | $userTemplatesIndex = TemplatesUserIndex::getInstance(); |
||
| 479 | $userTemplatesIndex->write($module, $table, $tables, $moduleDirname.'_index.tpl'); |
||
| 480 | $ret[] = $userTemplatesIndex->render(); |
||
| 481 | // Templates Footer File |
||
| 482 | $userTemplatesFooter = TemplatesUserFooter::getInstance(); |
||
| 483 | $userTemplatesFooter->write($module, $table, $moduleDirname.'_footer.tpl'); |
||
| 484 | $ret[] = $userTemplatesFooter->render(); |
||
| 485 | // Templates Header File |
||
| 486 | $userTemplatesHeader = TemplatesUserHeader::getInstance(); |
||
| 487 | $userTemplatesHeader->write($module, $moduleDirname.'_header.tpl'); |
||
| 488 | $ret[] = $userTemplatesHeader->render(); |
||
| 489 | } |
||
| 490 | // Creation of user files |
||
| 491 | if ((1 == $module->getVar('mod_user')) && in_array(1, $tableUser)) { |
||
| 492 | // User Footer File |
||
| 493 | $userFooter = UserFooter::getInstance(); |
||
| 494 | $userFooter->write($module, 'footer.php'); |
||
| 495 | $ret[] = $userFooter->render(); |
||
| 496 | // User Header File |
||
| 497 | $userHeader = UserHeader::getInstance(); |
||
| 498 | $userHeader->write($module, $table, $tables, 'header.php'); |
||
| 499 | $ret[] = $userHeader->render(); |
||
| 500 | // User Notification Update File |
||
| 501 | if ((1 == $module->getVar('mod_notifications')) && in_array(1, $tableNotifications)) { |
||
| 502 | $userNotificationUpdate = UserNotificationUpdate::getInstance(); |
||
| 503 | $userNotificationUpdate->write($module, 'notification_update.php'); |
||
| 504 | $ret[] = $userNotificationUpdate->render(); |
||
| 505 | } |
||
| 506 | // User Broken File |
||
| 507 | View Code Duplication | if (in_array(1, $tableBroken)) { |
|
| 508 | $userBroken = UserBroken::getInstance(); |
||
| 509 | $userBroken->write($module, $table, 'broken.php'); |
||
| 510 | $ret[] = $userBroken->render(); |
||
| 511 | // User Templates Broken File |
||
| 512 | $userTemplatesBroken = TemplatesUserBroken::getInstance(); |
||
| 513 | $userTemplatesBroken->write($module, $table); |
||
| 514 | $ret[] = $userTemplatesBroken->renderFile($moduleDirname.'_broken.tpl'); |
||
| 515 | } |
||
| 516 | // User Pdf File |
||
| 517 | View Code Duplication | if (in_array(1, $tablePdf)) { |
|
| 518 | $userPdf = UserPdf::getInstance(); |
||
| 519 | $userPdf->write($module, $table, 'pdf.php'); |
||
| 520 | $ret[] = $userPdf->render(); |
||
| 521 | // User Templates Pdf File |
||
| 522 | $userTemplatesPdf = TemplatesUserPdf::getInstance(); |
||
| 523 | $userTemplatesPdf->write($module); |
||
| 524 | $ret[] = $userTemplatesPdf->renderFile($moduleDirname.'_pdf.tpl'); |
||
| 525 | } |
||
| 526 | // User Print File |
||
| 527 | View Code Duplication | if (in_array(1, $tablePrint)) { |
|
| 528 | $userPrint = UserPrint::getInstance(); |
||
| 529 | $userPrint->write($module, $table, 'print.php'); |
||
| 530 | $ret[] = $userPrint->render(); |
||
| 531 | // User Templates Print File |
||
| 532 | $userTemplatesPrint = TemplatesUserPrint::getInstance(); |
||
| 533 | $userTemplatesPrint->write($module, $table); |
||
| 534 | $ret[] = $userTemplatesPrint->renderFile($moduleDirname.'_print.tpl'); |
||
| 535 | } |
||
| 536 | // User Rate File |
||
| 537 | View Code Duplication | if (in_array(1, $tableRate)) { |
|
| 538 | $userRate = UserRate::getInstance(); |
||
| 539 | $userRate->write($module, $table, 'rate.php'); |
||
| 540 | $ret[] = $userRate->render(); |
||
| 541 | // User Templates Rate File |
||
| 542 | $userTemplatesRate = TemplatesUserRate::getInstance(); |
||
| 543 | $userTemplatesRate->write($module, $table); |
||
| 544 | $ret[] = $userTemplatesRate->renderFile($moduleDirname.'_rate.tpl'); |
||
| 545 | } |
||
| 546 | // User Rss File |
||
| 547 | View Code Duplication | if (in_array(1, $tableRss)) { |
|
| 548 | $userRss = UserRss::getInstance(); |
||
| 549 | $userRss->write($module, $table, 'rss.php'); |
||
| 550 | $ret[] = $userRss->render(); |
||
| 551 | // User Templates Rss File |
||
| 552 | $userTemplatesRss = TemplatesUserRss::getInstance(); |
||
| 553 | $userTemplatesRss->write($module); |
||
| 554 | $ret[] = $userTemplatesRss->renderFile($moduleDirname.'_rss.tpl'); |
||
| 555 | } |
||
| 556 | // User Single File |
||
| 557 | View Code Duplication | if (in_array(1, $tableSingle)) { |
|
| 558 | $userSingle = UserSingle::getInstance(); |
||
| 559 | $userSingle->write($module, $table, 'single.php'); |
||
| 560 | $ret[] = $userSingle->render(); |
||
| 561 | // User Templates Single File |
||
| 562 | $userTemplatesSingle = TemplatesUserSingle::getInstance(); |
||
| 563 | $userTemplatesSingle->write($module, $table); |
||
| 564 | $ret[] = $userTemplatesSingle->renderFile($moduleDirname.'_single.tpl'); |
||
| 565 | } |
||
| 566 | // User Submit File |
||
| 567 | View Code Duplication | if (in_array(1, $tableSubmit)) { |
|
| 568 | $userSubmit = UserSubmit::getInstance(); |
||
| 569 | $userSubmit->write($module, $table, 'submit.php'); |
||
| 570 | $ret[] = $userSubmit->render(); |
||
| 571 | // User Templates Submit File |
||
| 572 | $userTemplatesSubmit = TemplatesUserSubmit::getInstance(); |
||
| 573 | $userTemplatesSubmit->write($module, $table); |
||
| 574 | $ret[] = $userTemplatesSubmit->renderFile($moduleDirname.'_submit.tpl'); |
||
| 575 | }// User Visit File |
||
| 576 | if (in_array(1, $tableVisit)) { |
||
| 577 | $userVisit = UserVisit::getInstance(); |
||
| 578 | $userVisit->write($module, $table, 'visit.php'); |
||
| 579 | $ret[] = $userVisit->render(); |
||
| 580 | } |
||
| 581 | // User Tag Files |
||
| 582 | if (in_array(1, $tableTag)) { |
||
| 583 | $userListTag = UserListTag::getInstance(); |
||
| 584 | $userListTag->write($module, 'list.tag.php'); |
||
| 585 | $ret[] = $userListTag->render(); |
||
| 586 | $userViewTag = UserViewTag::getInstance(); |
||
| 587 | $userViewTag->write($module, 'view.tag.php'); |
||
| 588 | $ret[] = $userViewTag->render(); |
||
| 589 | } |
||
| 590 | // User Index File |
||
| 591 | $userIndex = UserIndex::getInstance(); |
||
| 592 | $userIndex->write($module, $table, 'index.php'); |
||
| 593 | $ret[] = $userIndex->render(); |
||
| 594 | // Language Main File |
||
| 595 | $languageMain = LanguageMain::getInstance(); |
||
| 596 | $languageMain->write($module, $tables, 'main.php'); |
||
| 597 | $ret[] = $languageMain->render(); |
||
| 598 | // User Templates Submit File |
||
| 599 | $userTemplatesUserBreadcrumbs = TemplatesUserBreadcrumbs::getInstance(); |
||
| 600 | $userTemplatesUserBreadcrumbs->write($module, $moduleDirname.'_breadcrumbs.tpl'); |
||
| 601 | $ret[] = $userTemplatesUserBreadcrumbs->render(); |
||
| 602 | } |
||
| 603 | // Css Styles File |
||
| 604 | $cssStyles = CssStyles::getInstance(); |
||
| 605 | $cssStyles->write($module, 'style.css'); |
||
| 606 | $ret[] = $cssStyles->render(); |
||
| 607 | // Include Jquery File |
||
| 608 | $JavascriptJQuery = JavascriptJQuery::getInstance(); |
||
| 609 | $JavascriptJQuery->write($module, 'functions.js'); |
||
| 610 | $ret[] = $JavascriptJQuery->render(); |
||
| 611 | // Include Common File |
||
| 612 | $includeCommon = IncludeCommon::getInstance(); |
||
| 613 | $includeCommon->write($module, $table, 'common.php'); |
||
| 614 | $ret[] = $includeCommon->render(); |
||
| 615 | // Docs Changelog File |
||
| 616 | $docsChangelog = DocsChangelog::getInstance(); |
||
| 617 | $docsChangelog->write($module, 'changelog.txt'); |
||
| 618 | $ret[] = $docsChangelog->render(); |
||
| 619 | // Language Help File |
||
| 620 | $languageHelp = LanguageHelp::getInstance(); |
||
| 621 | $languageHelp->write($module, 'help.html'); |
||
| 622 | $ret[] = $languageHelp->render(); |
||
| 623 | // User Xoops Version File |
||
| 624 | $userXoopsVersion = UserXoopsVersion::getInstance(); |
||
| 625 | $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php'); |
||
| 626 | $ret[] = $userXoopsVersion->render(); |
||
| 627 | |||
| 628 | // Return Array |
||
| 629 | return $ret; |
||
| 630 | } |
||
| 631 | } |
||
| 632 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.