@@ -146,7 +146,7 @@ |
||
| 146 | 146 | } |
| 147 | 147 | $folder = array(1, 2, 3); |
| 148 | 148 | $system->cleanCache($folder); |
| 149 | - //Set active modules in cache folder |
|
| 149 | + //Set active modules in cache folder |
|
| 150 | 150 | $xoops->setActiveModules(); |
| 151 | 151 | // Call Footer |
| 152 | 152 | $xoops->footer(); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $xoops->theme()->addScript('modules/system/js/module.js'); |
| 59 | 59 | // Define Breadcrumb and tips |
| 60 | 60 | $admin_page = new \Xoops\Module\Admin(); |
| 61 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 61 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 62 | 62 | $admin_page->addBreadcrumbLink( |
| 63 | 63 | SystemLocale::EXTENSIONS_ADMINISTRATION, |
| 64 | 64 | $system->adminVersion('extensions', 'adminpath') |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 87 | 87 | // Define Breadcrumb and tips |
| 88 | 88 | $admin_page = new \Xoops\Module\Admin(); |
| 89 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 89 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 90 | 90 | $admin_page->addBreadcrumbLink( |
| 91 | 91 | SystemLocale::EXTENSIONS_ADMINISTRATION, |
| 92 | 92 | $system->adminVersion('extensions', 'adminpath') |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 127 | 127 | // Define Breadcrumb and tips |
| 128 | 128 | $admin_page = new \Xoops\Module\Admin(); |
| 129 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 129 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 130 | 130 | $admin_page->addBreadcrumbLink( |
| 131 | 131 | SystemLocale::EXTENSIONS_ADMINISTRATION, |
| 132 | 132 | $system->adminVersion('extensions', 'adminpath') |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 164 | 164 | // Define Breadcrumb and tips |
| 165 | 165 | $admin_page = new \Xoops\Module\Admin(); |
| 166 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 166 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 167 | 167 | $admin_page->addBreadcrumbLink( |
| 168 | 168 | SystemLocale::EXTENSIONS_ADMINISTRATION, |
| 169 | 169 | $system->adminVersion('extensions', 'adminpath') |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | case 'users_edit': |
| 65 | 65 | // Assign Breadcrumb menu |
| 66 | 66 | $admin_page = new \Xoops\Module\Admin(); |
| 67 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 67 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 68 | 68 | $admin_page->addBreadcrumbLink(SystemLocale::USERS_MANAGEMENT, $system->adminVersion('users', 'adminpath')); |
| 69 | 69 | $admin_page->addBreadcrumbLink(SystemLocale::EDIT_USER); |
| 70 | 70 | $admin_page->renderBreadcrumb(); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | case 'users_add': |
| 80 | 80 | // Assign Breadcrumb menu |
| 81 | 81 | $admin_page = new \Xoops\Module\Admin(); |
| 82 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 82 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 83 | 83 | $admin_page->addBreadcrumbLink(SystemLocale::USERS_MANAGEMENT, $system->adminVersion('users', 'adminpath')); |
| 84 | 84 | $admin_page->addBreadcrumbLink(SystemLocale::ADD_USER); |
| 85 | 85 | $admin_page->renderBreadcrumb(); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | case 'users_delete': |
| 94 | 94 | // Assign Breadcrumb menu |
| 95 | 95 | $admin_page = new \Xoops\Module\Admin(); |
| 96 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 96 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 97 | 97 | $admin_page->addBreadcrumbLink(SystemLocale::USERS_MANAGEMENT, $system->adminVersion('users', 'adminpath')); |
| 98 | 98 | $admin_page->addBreadcrumbLink(SystemLocale::DELETE_USER); |
| 99 | 99 | $admin_page->renderBreadcrumb(); |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | } else { |
| 120 | 120 | //Assign Breadcrumb menu |
| 121 | - $system_breadcrumb->addHelp(system_adminVersion('users', 'help') . '#delete'); |
|
| 121 | + $system_breadcrumb->addHelp(system_adminVersion('users', 'help').'#delete'); |
|
| 122 | 122 | $system_breadcrumb->addLink(SystemLocale::DELETE_USER); |
| 123 | 123 | $system_breadcrumb->render(); |
| 124 | 124 | echo $xoops->confirm(array( |
| 125 | 125 | 'ok' => 1, 'uid' => $uid, 'op' => 'users_delete' |
| 126 | - ), "admin.php?fct=users", sprintf(SystemLocale::F_DELETE_USER, $user->getVar('uname')) . '<br />'); |
|
| 126 | + ), "admin.php?fct=users", sprintf(SystemLocale::F_DELETE_USER, $user->getVar('uname')).'<br />'); |
|
| 127 | 127 | } |
| 128 | 128 | break; |
| 129 | 129 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | if ($_REQUEST['password'] != $_REQUEST['pass2']) { |
| 215 | 215 | $xoops->header(); |
| 216 | 216 | echo " |
| 217 | - <strong>" . SystemLocale::E_NEW_PASSWORDS_NOT_MATCH_TRY_AGAIN . "</strong>"; |
|
| 217 | + <strong>" . SystemLocale::E_NEW_PASSWORDS_NOT_MATCH_TRY_AGAIN."</strong>"; |
|
| 218 | 218 | $xoops->footer(); |
| 219 | 219 | exit(); |
| 220 | 220 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $member_handler = $xoops->getHandlerMember(); |
| 256 | 256 | // make sure the username doesnt exist yet |
| 257 | 257 | if ($member_handler->getUserCount(new Criteria('uname', $_REQUEST['username'])) > 0) { |
| 258 | - $adduser_errormsg = 'User name ' . $myts->htmlSpecialChars($_REQUEST['username']) . ' already exists'; |
|
| 258 | + $adduser_errormsg = 'User name '.$myts->htmlSpecialChars($_REQUEST['username']).' already exists'; |
|
| 259 | 259 | } else { |
| 260 | 260 | $newuser = $member_handler->createUser(); |
| 261 | 261 | if (isset($user_viewemail)) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | if ($_REQUEST['pass2'] != "") { |
| 280 | 280 | if ($_REQUEST['password'] != $_REQUEST['pass2']) { |
| 281 | 281 | $xoops->header(); |
| 282 | - echo "<strong>" . SystemLocale::E_NEW_PASSWORDS_NOT_MATCH_TRY_AGAIN . "</strong>"; |
|
| 282 | + echo "<strong>".SystemLocale::E_NEW_PASSWORDS_NOT_MATCH_TRY_AGAIN."</strong>"; |
|
| 283 | 283 | $xoops->footer(); |
| 284 | 284 | exit(); |
| 285 | 285 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | if (!empty($groups_failed)) { |
| 311 | - $group_names = $member_handler->getGroupList(new Criteria('groupid', "(" . implode(", ", $groups_failed) . ")", 'IN')); |
|
| 311 | + $group_names = $member_handler->getGroupList(new Criteria('groupid', "(".implode(", ", $groups_failed).")", 'IN')); |
|
| 312 | 312 | $adduser_errormsg = sprintf(SystemLocale::EF_COULD_NOT_ADD_USER_TO_GROUPS, implode(", ", $group_names)); |
| 313 | 313 | } else { |
| 314 | 314 | XoopsUserUtility::sendWelcome($newuser); |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | if (isset($_REQUEST['complet_search'])) { |
| 357 | 357 | // Assign Breadcrumb menu |
| 358 | 358 | $admin_page = new \Xoops\Module\Admin(); |
| 359 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 359 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 360 | 360 | $admin_page->addBreadcrumbLink(SystemLocale::USERS_MANAGEMENT, $system->adminVersion('users', 'adminpath')); |
| 361 | 361 | $admin_page->addBreadcrumbLink(XoopsLocale::ADVANCED_SEARCH); |
| 362 | 362 | $admin_page->renderBreadcrumb(); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | /* @var $group XoopsGroup */ |
| 371 | 371 | foreach ($group_arr as $group) { |
| 372 | 372 | if ($group->getVar("groupid") != FixedGroups::ANONYMOUS) { |
| 373 | - $group_select->addOption("" . $group->getVar("groupid") . "", "" . $group->getVar("name") . ""); |
|
| 373 | + $group_select->addOption("".$group->getVar("groupid")."", "".$group->getVar("name").""); |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | unset($group); |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | //Display data |
| 478 | 478 | // Assign Breadcrumb menu |
| 479 | 479 | $admin_page = new \Xoops\Module\Admin(); |
| 480 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 480 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 481 | 481 | $admin_page->addBreadcrumbLink(SystemLocale::USERS_MANAGEMENT, $system->adminVersion('users', 'adminpath')); |
| 482 | 482 | $admin_page->addBreadcrumbLink(XoopsLocale::LIST_); |
| 483 | 483 | $admin_page->renderBreadcrumb(); |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | $admin_page->addItemButton(SystemLocale::ADD_USER, 'admin.php?fct=users&op=users_add', 'add'); |
| 488 | 488 | $admin_page->renderButton(); |
| 489 | 489 | |
| 490 | - $requete_search = '<br /><br /><strong>' . SystemLocale::C_SEE_SEARCH_REQUEST . '</strong><br /><br />'; |
|
| 490 | + $requete_search = '<br /><br /><strong>'.SystemLocale::C_SEE_SEARCH_REQUEST.'</strong><br /><br />'; |
|
| 491 | 491 | $requete_pagenav = ''; |
| 492 | 492 | |
| 493 | 493 | $criteria = new CriteriaCompo(); |
@@ -496,84 +496,84 @@ discard block |
||
| 496 | 496 | if (!empty($value)) { |
| 497 | 497 | $match = Request::getInt('user_uname_match', XOOPS_MATCH_START); |
| 498 | 498 | addCriteria($criteria, 'uname', $value, $match); |
| 499 | - $requete_pagenav .= '&user_uname=' . $myts->htmlSpecialChars($value) . '&user_uname_match=' . $match; |
|
| 500 | - $requete_search .= 'uname : ' . $value . ' and user_uname_match=' . $match . '<br />'; |
|
| 499 | + $requete_pagenav .= '&user_uname='.$myts->htmlSpecialChars($value).'&user_uname_match='.$match; |
|
| 500 | + $requete_search .= 'uname : '.$value.' and user_uname_match='.$match.'<br />'; |
|
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | $value = Request::getString('user_name', ''); |
| 504 | 504 | if (!empty($value)) { |
| 505 | 505 | $match = Request::getInt('user_name_match', XOOPS_MATCH_START); |
| 506 | 506 | addCriteria($criteria, 'name', $value, $match); |
| 507 | - $requete_pagenav .= '&user_name=' . $myts->htmlSpecialChars($value) . '&user_name_match=' . $match; |
|
| 508 | - $requete_search .= 'name : ' . $value . ' and user_name_match=' . $match . '<br />'; |
|
| 507 | + $requete_pagenav .= '&user_name='.$myts->htmlSpecialChars($value).'&user_name_match='.$match; |
|
| 508 | + $requete_search .= 'name : '.$value.' and user_name_match='.$match.'<br />'; |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | $value = Request::getString('user_email', ''); |
| 512 | 512 | if (!empty($value)) { |
| 513 | 513 | $match = Request::getInt('user_email_match', XOOPS_MATCH_START); |
| 514 | 514 | addCriteria($criteria, 'email', $value, $match); |
| 515 | - $requete_pagenav .= '&user_email=' . $myts->htmlSpecialChars($value) . '&user_email_match=' . $match; |
|
| 516 | - $requete_search .= 'email : ' . $value . ' and user_email_match=' . $match . '<br />'; |
|
| 515 | + $requete_pagenav .= '&user_email='.$myts->htmlSpecialChars($value).'&user_email_match='.$match; |
|
| 516 | + $requete_search .= 'email : '.$value.' and user_email_match='.$match.'<br />'; |
|
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | $value = Request::getString('user_url', ''); |
| 520 | 520 | if (!empty($value)) { |
| 521 | 521 | //$url = $xoops->formatURL(trim($_REQUEST['user_url'])); |
| 522 | - $criteria->add(new Criteria('url', '%' . $value . '%', 'LIKE')); |
|
| 523 | - $requete_search .= 'url : ' . $value . '<br />'; |
|
| 522 | + $criteria->add(new Criteria('url', '%'.$value.'%', 'LIKE')); |
|
| 523 | + $requete_search .= 'url : '.$value.'<br />'; |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | $value = Request::getInt('user_icq', 0); |
| 527 | 527 | if (!empty($value)) { |
| 528 | 528 | $match = Request::getInt('user_icq_match', XOOPS_MATCH_START); |
| 529 | - addCriteria($criteria, 'user_icq', (string) $value, $match); |
|
| 530 | - $requete_pagenav .= '&user_icq=' . $value . '&user_icq_match=' . $match; |
|
| 531 | - $requete_search .= 'icq : ' . $value . ' and user_icq_match=' . $match . '<br />'; |
|
| 529 | + addCriteria($criteria, 'user_icq', (string)$value, $match); |
|
| 530 | + $requete_pagenav .= '&user_icq='.$value.'&user_icq_match='.$match; |
|
| 531 | + $requete_search .= 'icq : '.$value.' and user_icq_match='.$match.'<br />'; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $value = Request::getString('user_aim', ''); |
| 535 | 535 | if (!empty($value)) { |
| 536 | 536 | $match = Request::getInt('user_aim_match', XOOPS_MATCH_START); |
| 537 | 537 | addCriteria($criteria, 'user_aim', $value, $match); |
| 538 | - $requete_pagenav .= '&user_aim=' . $myts->htmlSpecialChars($value) . '&user_aim_match=' . $match; |
|
| 539 | - $requete_search .= 'aim : ' . $value . ' and user_aim_match=' . $match . '<br />'; |
|
| 538 | + $requete_pagenav .= '&user_aim='.$myts->htmlSpecialChars($value).'&user_aim_match='.$match; |
|
| 539 | + $requete_search .= 'aim : '.$value.' and user_aim_match='.$match.'<br />'; |
|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | $value = Request::getString('user_yim', ''); |
| 543 | 543 | if (!empty($value)) { |
| 544 | 544 | $match = Request::getInt('user_yim_match', XOOPS_MATCH_START); |
| 545 | 545 | addCriteria($criteria, 'user_yim', $value, $match); |
| 546 | - $requete_pagenav .= '&user_yim=' . $myts->htmlSpecialChars($value) . '&user_yim_match=' . $match; |
|
| 547 | - $requete_search .= 'yim : ' . $value . ' and user_yim_match=' . $match . '<br />'; |
|
| 546 | + $requete_pagenav .= '&user_yim='.$myts->htmlSpecialChars($value).'&user_yim_match='.$match; |
|
| 547 | + $requete_search .= 'yim : '.$value.' and user_yim_match='.$match.'<br />'; |
|
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | $value = Request::getString('user_msnm', ''); |
| 551 | 551 | if (!empty($value)) { |
| 552 | 552 | $match = Request::getInt('user_msnm_match', XOOPS_MATCH_START); |
| 553 | 553 | addCriteria($criteria, 'user_msnm', $value, $match); |
| 554 | - $requete_pagenav .= '&user_msnm=' . $myts->htmlSpecialChars($value) . '&user_msnm_match=' . $match; |
|
| 555 | - $requete_search .= 'msnm : ' . $value . ' and user_msnm_match=' . $match . '<br />'; |
|
| 554 | + $requete_pagenav .= '&user_msnm='.$myts->htmlSpecialChars($value).'&user_msnm_match='.$match; |
|
| 555 | + $requete_search .= 'msnm : '.$value.' and user_msnm_match='.$match.'<br />'; |
|
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | $value = Request::getString('user_from', ''); |
| 559 | 559 | if (!empty($value)) { |
| 560 | - $criteria->add(new Criteria('user_from', '%' . $value . '%', 'LIKE')); |
|
| 561 | - $requete_pagenav .= '&user_from=' . $myts->htmlSpecialChars($value); |
|
| 562 | - $requete_search .= 'from : ' . $value . '<br />'; |
|
| 560 | + $criteria->add(new Criteria('user_from', '%'.$value.'%', 'LIKE')); |
|
| 561 | + $requete_pagenav .= '&user_from='.$myts->htmlSpecialChars($value); |
|
| 562 | + $requete_search .= 'from : '.$value.'<br />'; |
|
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | $value = Request::getString('user_intrest', ''); |
| 566 | 566 | if (!empty($value)) { |
| 567 | - $criteria->add(new Criteria('user_intrest', '%' . $value . '%', 'LIKE')); |
|
| 568 | - $requete_pagenav .= '&user_intrest=' . $myts->htmlSpecialChars($value); |
|
| 569 | - $requete_search .= 'interet : ' . $value . '<br />'; |
|
| 567 | + $criteria->add(new Criteria('user_intrest', '%'.$value.'%', 'LIKE')); |
|
| 568 | + $requete_pagenav .= '&user_intrest='.$myts->htmlSpecialChars($value); |
|
| 569 | + $requete_search .= 'interet : '.$value.'<br />'; |
|
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | $value = Request::getString('user_occ', ''); |
| 573 | 573 | if (!empty($value)) { |
| 574 | - $criteria->add(new Criteria('user_occ', '%' . $value . '%', 'LIKE')); |
|
| 575 | - $requete_pagenav .= '&user_occ=' . $myts->htmlSpecialChars($value); |
|
| 576 | - $requete_search .= 'location : ' . $value . '<br />'; |
|
| 574 | + $criteria->add(new Criteria('user_occ', '%'.$value.'%', 'LIKE')); |
|
| 575 | + $requete_pagenav .= '&user_occ='.$myts->htmlSpecialChars($value); |
|
| 576 | + $requete_search .= 'location : '.$value.'<br />'; |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | $value = Request::getInt('user_lastlog_more', 0); |
@@ -581,8 +581,8 @@ discard block |
||
| 581 | 581 | $time = time() - (60 * 60 * 24 * $value); |
| 582 | 582 | if ($time > 0) { |
| 583 | 583 | $criteria->add(new Criteria('last_login', $time, '<')); |
| 584 | - $requete_pagenav .= '&user_lastlog_more=' . $value; |
|
| 585 | - $requete_search .= 'derniere connexion apres : ' . $value . '<br />'; |
|
| 584 | + $requete_pagenav .= '&user_lastlog_more='.$value; |
|
| 585 | + $requete_search .= 'derniere connexion apres : '.$value.'<br />'; |
|
| 586 | 586 | } |
| 587 | 587 | } |
| 588 | 588 | |
@@ -591,8 +591,8 @@ discard block |
||
| 591 | 591 | $time = time() - (60 * 60 * 24 * $value); |
| 592 | 592 | if ($time > 0) { |
| 593 | 593 | $criteria->add(new Criteria('last_login', $time, '>')); |
| 594 | - $requete_pagenav .= '&user_lastlog_less=' . $value; |
|
| 595 | - $requete_search .= 'derniere connexion avant : ' . $value . '<br />'; |
|
| 594 | + $requete_pagenav .= '&user_lastlog_less='.$value; |
|
| 595 | + $requete_search .= 'derniere connexion avant : '.$value.'<br />'; |
|
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | |
@@ -601,8 +601,8 @@ discard block |
||
| 601 | 601 | $time = time() - (60 * 60 * 24 * $value); |
| 602 | 602 | if ($time > 0) { |
| 603 | 603 | $criteria->add(new Criteria('user_regdate', $time, '<')); |
| 604 | - $requete_pagenav .= '&user_reg_more=' . $value; |
|
| 605 | - $requete_search .= 'enregistre apres : ' . $value . '<br />'; |
|
| 604 | + $requete_pagenav .= '&user_reg_more='.$value; |
|
| 605 | + $requete_search .= 'enregistre apres : '.$value.'<br />'; |
|
| 606 | 606 | } |
| 607 | 607 | } |
| 608 | 608 | |
@@ -611,31 +611,31 @@ discard block |
||
| 611 | 611 | $time = time() - (60 * 60 * 24 * $value); |
| 612 | 612 | if ($time > 0) { |
| 613 | 613 | $criteria->add(new Criteria('user_regdate', $time, '>')); |
| 614 | - $requete_pagenav .= '&user_reg_less=' . $value; |
|
| 615 | - $requete_search .= 'enregistre avant : ' . $value . '<br />'; |
|
| 614 | + $requete_pagenav .= '&user_reg_less='.$value; |
|
| 615 | + $requete_search .= 'enregistre avant : '.$value.'<br />'; |
|
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | $value = Request::getInt('user_posts_more', 0); |
| 620 | 620 | if (!empty($value)) { |
| 621 | 621 | $criteria->add(new Criteria('posts', $value, '>')); |
| 622 | - $requete_pagenav .= '&user_posts_more=' . $value; |
|
| 623 | - $requete_search .= 'posts plus de : ' . $value . '<br />'; |
|
| 622 | + $requete_pagenav .= '&user_posts_more='.$value; |
|
| 623 | + $requete_search .= 'posts plus de : '.$value.'<br />'; |
|
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | $value = Request::getInt('user_posts_less', 0); |
| 627 | 627 | if (!empty($value)) { |
| 628 | 628 | $criteria->add(new Criteria('posts', $value, '<')); |
| 629 | - $requete_pagenav .= '&user_posts_less=' . $value; |
|
| 630 | - $requete_search .= 'post moins de : ' . $value . '<br />'; |
|
| 629 | + $requete_pagenav .= '&user_posts_less='.$value; |
|
| 630 | + $requete_search .= 'post moins de : '.$value.'<br />'; |
|
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | $value = Request::getWord('user_mailok', ''); |
| 634 | 634 | if (!empty($value) && ($value !== 'both')) { |
| 635 | 635 | $ok = ($value === 'mailok') ? 1 : 0; |
| 636 | 636 | $criteria->add(new Criteria('user_mailok', $ok)); |
| 637 | - $requete_pagenav .= '&user_mailok=' . $value; |
|
| 638 | - $requete_search .= 'accept email : ' . $value . '<br />'; |
|
| 637 | + $requete_pagenav .= '&user_mailok='.$value; |
|
| 638 | + $requete_search .= 'accept email : '.$value.'<br />'; |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | $user_type = Request::getWord('user_type', ''); |
@@ -645,31 +645,31 @@ discard block |
||
| 645 | 645 | } elseif ($user_type === "actv") { |
| 646 | 646 | $criteria->add(new Criteria('level', 0, '>')); |
| 647 | 647 | } |
| 648 | - $requete_search .= 'actif ou inactif : ' . $user_type . '<br />'; |
|
| 649 | - $requete_pagenav .= '&user_type=' . $user_type; |
|
| 648 | + $requete_search .= 'actif ou inactif : '.$user_type.'<br />'; |
|
| 649 | + $requete_pagenav .= '&user_type='.$user_type; |
|
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | //$groups = empty($_REQUEST['selgroups']) ? array() : array_map("intval", $_REQUEST['selgroups']); |
| 653 | 653 | $validsort = array("uname", "email", "last_login", "user_regdate", "posts"); |
| 654 | 654 | $sort = Request::getWord('user_sort', 'user_regdate'); |
| 655 | 655 | $sort = (!in_array($sort, $validsort)) ? "user_regdate" : $sort; |
| 656 | - $requete_pagenav .= '&user_sort=' . $sort; |
|
| 657 | - $requete_search .= 'order by : ' . $sort . '<br />'; |
|
| 656 | + $requete_pagenav .= '&user_sort='.$sort; |
|
| 657 | + $requete_search .= 'order by : '.$sort.'<br />'; |
|
| 658 | 658 | $criteria->setSort($sort); |
| 659 | 659 | |
| 660 | 660 | $order = Request::getWord('user_order', 'DESC'); |
| 661 | - $requete_pagenav .= '&user_order=' . $order; |
|
| 662 | - $requete_search .= 'tris : ' . $order . '<br />'; |
|
| 661 | + $requete_pagenav .= '&user_order='.$order; |
|
| 662 | + $requete_search .= 'tris : '.$order.'<br />'; |
|
| 663 | 663 | $criteria->setOrder($order); |
| 664 | 664 | |
| 665 | 665 | $user_limit = $xoops->getModuleConfig('users_pager', 'system'); |
| 666 | 666 | if (isset($_REQUEST['user_limit'])) { |
| 667 | 667 | $user_limit = $_REQUEST['user_limit']; |
| 668 | - $requete_pagenav .= '&user_limit=' . $myts->htmlSpecialChars($_REQUEST['user_limit']); |
|
| 669 | - $requete_search .= 'limit : ' . $user_limit . '<br />'; |
|
| 668 | + $requete_pagenav .= '&user_limit='.$myts->htmlSpecialChars($_REQUEST['user_limit']); |
|
| 669 | + $requete_search .= 'limit : '.$user_limit.'<br />'; |
|
| 670 | 670 | } else { |
| 671 | - $requete_pagenav .= '&user_limit=' . $xoops->getModuleConfig('users_pager', 'system'); |
|
| 672 | - $requete_search .= 'limit : ' . $user_limit . '<br />'; |
|
| 671 | + $requete_pagenav .= '&user_limit='.$xoops->getModuleConfig('users_pager', 'system'); |
|
| 672 | + $requete_search .= 'limit : '.$user_limit.'<br />'; |
|
| 673 | 673 | } |
| 674 | 674 | |
| 675 | 675 | $start = (!empty($_REQUEST['start'])) ? (int)($_REQUEST['start']) : 0; |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | } else { |
| 685 | 685 | $groups = array(); |
| 686 | 686 | } |
| 687 | - $requete_pagenav .= '&selgroups=' . $myts->htmlSpecialChars($_REQUEST['selgroups']); |
|
| 687 | + $requete_pagenav .= '&selgroups='.$myts->htmlSpecialChars($_REQUEST['selgroups']); |
|
| 688 | 688 | } else { |
| 689 | 689 | $groups = array(); |
| 690 | 690 | } |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | $users_count = $member_handler->getUserCountByGroupLink($groups, $criteria); |
| 694 | 694 | $users_arr = array(); |
| 695 | 695 | if ($start < $users_count) { |
| 696 | - echo sprintf(XoopsLocale::F_USERS_FOUND, $users_count) . "<br />"; |
|
| 696 | + echo sprintf(XoopsLocale::F_USERS_FOUND, $users_count)."<br />"; |
|
| 697 | 697 | $criteria->setSort($sort); |
| 698 | 698 | $criteria->setOrder($order); |
| 699 | 699 | $criteria->setLimit($user_limit); |
@@ -716,32 +716,32 @@ discard block |
||
| 716 | 716 | $user_uname = (!isset($_REQUEST['user_uname'])) ? '' : $_REQUEST['user_uname']; |
| 717 | 717 | //Form tris |
| 718 | 718 | $form = '<form action="admin.php?fct=users" method="post"> |
| 719 | - ' . SystemLocale::C_SEARCH_USER . '<input type="text" name="user_uname" value="' . $myts->htmlSpecialChars($user_uname) . '" size="15"> |
|
| 719 | + ' . SystemLocale::C_SEARCH_USER.'<input type="text" name="user_uname" value="'.$myts->htmlSpecialChars($user_uname).'" size="15"> |
|
| 720 | 720 | <select name="selgroups"> |
| 721 | - <option value="" selected="selected">' . XoopsLocale::ALL_GROUPS . '</option>'; |
|
| 721 | + <option value="" selected="selected">' . XoopsLocale::ALL_GROUPS.'</option>'; |
|
| 722 | 722 | $group_handler = $xoops->getHandlerGroup(); |
| 723 | 723 | $group_arr = $group_handler->getObjects(); |
| 724 | 724 | /* @var $group XoopsGroup */ |
| 725 | 725 | foreach ($group_arr as $group) { |
| 726 | 726 | if ($group->getVar("groupid") != FixedGroups::ANONYMOUS) { |
| 727 | - $form .= '<option value="' . $group->getVar("groupid") . '" ' . ($selgroups == $group->getVar("groupid") ? ' selected="selected"' : '') . '>' . $group->getVar("name") . '</option>'; |
|
| 727 | + $form .= '<option value="'.$group->getVar("groupid").'" '.($selgroups == $group->getVar("groupid") ? ' selected="selected"' : '').'>'.$group->getVar("name").'</option>'; |
|
| 728 | 728 | } |
| 729 | 729 | } |
| 730 | 730 | unset($group); |
| 731 | 731 | $form .= '</select> |
| 732 | 732 | <select name="user_type"> |
| 733 | - <option value="" ' . ($user_type == '' ? ' selected="selected"' : '') . '>' . XoopsLocale::ALL_USERS . '</option> |
|
| 734 | - <option value="actv" ' . ($user_type === 'actv' ? ' selected="selected"' : '') . '>' . SystemLocale::ONLY_ACTIVE_USERS . '</option> |
|
| 735 | - <option value="inactv" ' . ($user_type === 'inactv' ? ' selected="selected"' : '') . '>' . SystemLocale::ONLY_INACTIVE_USERS . '</option> |
|
| 733 | + <option value="" ' . ($user_type == '' ? ' selected="selected"' : '').'>'.XoopsLocale::ALL_USERS.'</option> |
|
| 734 | + <option value="actv" ' . ($user_type === 'actv' ? ' selected="selected"' : '').'>'.SystemLocale::ONLY_ACTIVE_USERS.'</option> |
|
| 735 | + <option value="inactv" ' . ($user_type === 'inactv' ? ' selected="selected"' : '').'>'.SystemLocale::ONLY_INACTIVE_USERS.'</option> |
|
| 736 | 736 | </select> |
| 737 | 737 | <select name="user_limit"> |
| 738 | - <option value="20" ' . ($user_limit == 20 ? ' selected="selected"' : '') . '>20</option> |
|
| 739 | - <option value="50" ' . ($user_limit == 50 ? ' selected="selected"' : '') . '>50</option> |
|
| 740 | - <option value="100" ' . ($user_limit == 100 ? ' selected="selected"' : '') . '>100</option> |
|
| 738 | + <option value="20" ' . ($user_limit == 20 ? ' selected="selected"' : '').'>20</option> |
|
| 739 | + <option value="50" ' . ($user_limit == 50 ? ' selected="selected"' : '').'>50</option> |
|
| 740 | + <option value="100" ' . ($user_limit == 100 ? ' selected="selected"' : '').'>100</option> |
|
| 741 | 741 | </select> |
| 742 | 742 | <input type="hidden" name="user_uname_match" value="XOOPS_MATCH_START" /> |
| 743 | - <input class="btn" type="submit" value="' . XoopsLocale::A_SEARCH . '" name="speed_search"> |
|
| 744 | - <input class="btn success" type="submit" value="' . XoopsLocale::ADVANCED_SEARCH . '" name="complet_search"></form> |
|
| 743 | + <input class="btn" type="submit" value="' . XoopsLocale::A_SEARCH.'" name="speed_search"> |
|
| 744 | + <input class="btn success" type="submit" value="' . XoopsLocale::ADVANCED_SEARCH.'" name="complet_search"></form> |
|
| 745 | 745 | '; |
| 746 | 746 | |
| 747 | 747 | //select groupe |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | /* @var $group XoopsGroup */ |
| 753 | 753 | foreach ($group_arr as $group) { |
| 754 | 754 | if ($group->getVar("groupid") != FixedGroups::ANONYMOUS) { |
| 755 | - $form_select_groups .= '<option value="' . $group->getVar("groupid") . '" ' . ($selgroups == $group->getVar("groupid") ? ' selected="selected"' : '') . '>' . $group->getVar("name") . '</option>'; |
|
| 755 | + $form_select_groups .= '<option value="'.$group->getVar("groupid").'" '.($selgroups == $group->getVar("groupid") ? ' selected="selected"' : '').'>'.$group->getVar("name").'</option>'; |
|
| 756 | 756 | } |
| 757 | 757 | } |
| 758 | 758 | unset($group); |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | if ($users_count > $user_limit) { |
| 810 | - $nav = new XoopsPageNav($users_count, $user_limit, $start, 'start', 'fct=users&op=default' . $requete_pagenav); |
|
| 810 | + $nav = new XoopsPageNav($users_count, $user_limit, $start, 'start', 'fct=users&op=default'.$requete_pagenav); |
|
| 811 | 811 | $xoops->tpl()->assign('nav', $nav->renderNav()); |
| 812 | 812 | } |
| 813 | 813 | } |
@@ -832,17 +832,17 @@ discard block |
||
| 832 | 832 | switch ($match) { |
| 833 | 833 | default: |
| 834 | 834 | case XOOPS_MATCH_START: |
| 835 | - $value = $value . '%'; |
|
| 835 | + $value = $value.'%'; |
|
| 836 | 836 | break; |
| 837 | 837 | case XOOPS_MATCH_END: |
| 838 | - $value = '%' . $value; |
|
| 838 | + $value = '%'.$value; |
|
| 839 | 839 | break; |
| 840 | 840 | case XOOPS_MATCH_EQUAL: |
| 841 | 841 | //$value = $value; |
| 842 | 842 | $relation = '='; |
| 843 | 843 | break; |
| 844 | 844 | case XOOPS_MATCH_CONTAIN: |
| 845 | - $value = '%' . $value . '%'; |
|
| 845 | + $value = '%'.$value.'%'; |
|
| 846 | 846 | break; |
| 847 | 847 | } |
| 848 | 848 | $criteria->add(new Criteria($column, $value, $relation)); |
@@ -40,28 +40,28 @@ |
||
| 40 | 40 | switch ($op) { |
| 41 | 41 | |
| 42 | 42 | // Display post |
| 43 | - case 'display_post': |
|
| 44 | - include_once $xoops->path('modules/system/include/functions.php'); |
|
| 43 | + case 'display_post': |
|
| 44 | + include_once $xoops->path('modules/system/include/functions.php'); |
|
| 45 | 45 | |
| 46 | - $uid = $system->cleanVars($_REQUEST, 'uid', 'int'); |
|
| 47 | - $total_posts = 0; |
|
| 46 | + $uid = $system->cleanVars($_REQUEST, 'uid', 'int'); |
|
| 47 | + $total_posts = 0; |
|
| 48 | 48 | |
| 49 | - /* @var $plugin SystemPluginInterface */ |
|
| 50 | - $plugins = \Xoops\Module\Plugin::getPlugins(); |
|
| 51 | - foreach ($plugins as $plugin) { |
|
| 52 | - if ($res = $plugin->userPosts($uid)) { |
|
| 53 | - $total_posts += $res; |
|
| 49 | + /* @var $plugin SystemPluginInterface */ |
|
| 50 | + $plugins = \Xoops\Module\Plugin::getPlugins(); |
|
| 51 | + foreach ($plugins as $plugin) { |
|
| 52 | + if ($res = $plugin->userPosts($uid)) { |
|
| 53 | + $total_posts += $res; |
|
| 54 | + } |
|
| 54 | 55 | } |
| 55 | - } |
|
| 56 | 56 | |
| 57 | - $qb = $xoops->db()->createXoopsQueryBuilder(); |
|
| 58 | - $eb = $qb->expr(); |
|
| 59 | - $sql = $qb->updatePrefix('system_user') |
|
| 60 | - ->set('posts', ':posts') |
|
| 61 | - ->where('uid = :uid') |
|
| 62 | - ->setParameter(':posts', $total_posts) |
|
| 63 | - ->setParameter(':uid', $uid); |
|
| 64 | - $row_count = $sql->execute(); |
|
| 65 | - echo $row_count; |
|
| 66 | - break; |
|
| 57 | + $qb = $xoops->db()->createXoopsQueryBuilder(); |
|
| 58 | + $eb = $qb->expr(); |
|
| 59 | + $sql = $qb->updatePrefix('system_user') |
|
| 60 | + ->set('posts', ':posts') |
|
| 61 | + ->where('uid = :uid') |
|
| 62 | + ->setParameter(':posts', $total_posts) |
|
| 63 | + ->setParameter(':uid', $uid); |
|
| 64 | + $row_count = $sql->execute(); |
|
| 65 | + echo $row_count; |
|
| 66 | + break; |
|
| 67 | 67 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * @version $Id$ |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -include dirname(dirname(__DIR__)) . '/header.php'; |
|
| 22 | +include dirname(dirname(__DIR__)).'/header.php'; |
|
| 23 | 23 | |
| 24 | 24 | $xoops = Xoops::getInstance(); |
| 25 | 25 | $system = System::getInstance(); |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | |
| 80 | 80 | // Define Breadcrumb and tips |
| 81 | 81 | $admin_page = new \Xoops\Module\Admin(); |
| 82 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 82 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 83 | 83 | $admin_page->addBreadcrumbLink(XoopsLocale::PREFERENCES, $system->adminVersion('extensions', 'adminpath')); |
| 84 | 84 | $admin_page->addBreadcrumbLink($module->getVar('name')); |
| 85 | 85 | $admin_page->renderBreadcrumb(); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | default: |
| 56 | 56 | // Define Breadcrumb and tips |
| 57 | 57 | $admin_page = new \Xoops\Module\Admin(); |
| 58 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 58 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 59 | 59 | $admin_page->addBreadcrumbLink(SystemLocale::TEMPLATES_MANAGER, $system->adminVersion('tplsets', 'adminpath')); |
| 60 | 60 | $admin_page->renderBreadcrumb(); |
| 61 | 61 | $admin_page->addTips(SystemLocale::TEMPLATES_TIPS); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $xoops->redirect('admin.php?fct=tplsets', 3, implode('<br />', $xoops->security()->getErrors())); |
| 105 | 105 | } |
| 106 | 106 | // Assign Breadcrumb menu |
| 107 | - $system_breadcrumb->addHelp(system_adminVersion('tplsets', 'help') . '#override'); |
|
| 107 | + $system_breadcrumb->addHelp(system_adminVersion('tplsets', 'help').'#override'); |
|
| 108 | 108 | $system_breadcrumb->addLink(SystemLocale::FILES_GENERATED); |
| 109 | 109 | $system_breadcrumb->render(); |
| 110 | 110 | |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | if (isset($_REQUEST['select_theme']) && isset($_REQUEST['force_generated'])) { |
| 114 | 114 | //on verifie si le dossier module existe |
| 115 | 115 | $template_overload = \XoopsBaseConfig::get('themes-path') |
| 116 | - . '/' . $_REQUEST['select_theme'] . '/modules'; |
|
| 117 | - $indexFile = \XoopsBaseConfig::get('root-path') . "/modules/system/include/index.html"; |
|
| 116 | + . '/'.$_REQUEST['select_theme'].'/modules'; |
|
| 117 | + $indexFile = \XoopsBaseConfig::get('root-path')."/modules/system/include/index.html"; |
|
| 118 | 118 | $verif_write = false; |
| 119 | 119 | $text = ''; |
| 120 | 120 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | mkdir($template_overload, 0777); |
| 126 | 126 | } |
| 127 | 127 | chmod($template_overload, 0777); |
| 128 | - copy($indexFile, $template_overload . "/index.html"); |
|
| 128 | + copy($indexFile, $template_overload."/index.html"); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $tplset = $system->cleanVars($POST, 'tplset', 'default', 'string'); |
@@ -153,42 +153,42 @@ discard block |
||
| 153 | 153 | $module = $xoops->getModuleByDirname($moddir); |
| 154 | 154 | if (is_object($module)) { |
| 155 | 155 | // create module folder |
| 156 | - if (!is_dir($template_overload . '/' . $module->getVar('dirname'))) { |
|
| 157 | - mkdir($template_overload . '/' . $module->getVar('dirname'), 0777); |
|
| 158 | - chmod($template_overload . '/' . $module->getVar('dirname'), 0777); |
|
| 159 | - copy($indexFile, $template_overload . '/' . $module->getVar('dirname') . '/index.html'); |
|
| 156 | + if (!is_dir($template_overload.'/'.$module->getVar('dirname'))) { |
|
| 157 | + mkdir($template_overload.'/'.$module->getVar('dirname'), 0777); |
|
| 158 | + chmod($template_overload.'/'.$module->getVar('dirname'), 0777); |
|
| 159 | + copy($indexFile, $template_overload.'/'.$module->getVar('dirname').'/index.html'); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | // create block folder |
| 163 | - if (!is_dir($template_overload . '/' . $module->getVar('dirname') . '/blocks')) { |
|
| 164 | - if (!is_dir($template_overload . '/' . $module->getVar('dirname') . '/blocks')) { |
|
| 165 | - mkdir($template_overload . '/' . $module->getVar('dirname') . '/blocks', 0777); |
|
| 163 | + if (!is_dir($template_overload.'/'.$module->getVar('dirname').'/blocks')) { |
|
| 164 | + if (!is_dir($template_overload.'/'.$module->getVar('dirname').'/blocks')) { |
|
| 165 | + mkdir($template_overload.'/'.$module->getVar('dirname').'/blocks', 0777); |
|
| 166 | 166 | } |
| 167 | - chmod($template_overload . '/' . $module->getVar('dirname') . '/blocks', 0777); |
|
| 168 | - copy($indexFile, $template_overload . '/' . $module->getVar('dirname') . '/blocks' . '/index.html'); |
|
| 167 | + chmod($template_overload.'/'.$module->getVar('dirname').'/blocks', 0777); |
|
| 168 | + copy($indexFile, $template_overload.'/'.$module->getVar('dirname').'/blocks'.'/index.html'); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $class = "odd"; |
| 172 | - $text .= '<table cellspacing="1" class="outer"><tr><th colspan="3" align="center">' . XoopsLocale::C_MODULES . ucfirst($module->getVar('dirname')) . '</th></tr><tr><th align="center">' . XoopsLocale::TYPES . '</th><th align="center">' . XoopsLocale::FILES . '</th><th>' . XoopsLocale::STATUS . '</th></tr>'; |
|
| 172 | + $text .= '<table cellspacing="1" class="outer"><tr><th colspan="3" align="center">'.XoopsLocale::C_MODULES.ucfirst($module->getVar('dirname')).'</th></tr><tr><th align="center">'.XoopsLocale::TYPES.'</th><th align="center">'.XoopsLocale::FILES.'</th><th>'.XoopsLocale::STATUS.'</th></tr>'; |
|
| 173 | 173 | |
| 174 | 174 | // create template |
| 175 | 175 | $templates = $tpltpl_handler->find($tplsetname, 'module', null, $moddir); |
| 176 | 176 | for ($j = 0; $j < count($templates); ++$j) { |
| 177 | 177 | $filename = $templates[$j]->getVar('tpl_file'); |
| 178 | 178 | if ($tplsetname == $tplset) { |
| 179 | - $physical_file = \XoopsBaseConfig::get('themes-path') . '/' . $_REQUEST['select_theme'] . '/modules/' . $moddir . '/' . $filename; |
|
| 179 | + $physical_file = \XoopsBaseConfig::get('themes-path').'/'.$_REQUEST['select_theme'].'/modules/'.$moddir.'/'.$filename; |
|
| 180 | 180 | |
| 181 | 181 | $tplfile = $tpltpl_handler->get($templates[$j]->getVar('tpl_id'), true); |
| 182 | 182 | |
| 183 | 183 | if (is_object($tplfile)) { |
| 184 | 184 | if (!XoopsLoad::fileExists($physical_file) || $_REQUEST['force_generated'] == 1) { |
| 185 | 185 | $open = fopen($physical_file, 'w+'); |
| 186 | - if (fwrite($open, "" . html_entity_decode($tplfile->getVar('tpl_source', 'E'), ENT_QUOTES))) { |
|
| 187 | - $text .= '<tr class="' . $class . '"><td align="center">' . XoopsLocale::TEMPLATES . '</td><td>' . $physical_file . '</td><td align="center">'; |
|
| 186 | + if (fwrite($open, "".html_entity_decode($tplfile->getVar('tpl_source', 'E'), ENT_QUOTES))) { |
|
| 187 | + $text .= '<tr class="'.$class.'"><td align="center">'.XoopsLocale::TEMPLATES.'</td><td>'.$physical_file.'</td><td align="center">'; |
|
| 188 | 188 | if (XoopsLoad::fileExists($physical_file)) { |
| 189 | - $text .= '<img width="16" src="' . system_AdminIcons('success.png') . '" /></td></tr>'; |
|
| 189 | + $text .= '<img width="16" src="'.system_AdminIcons('success.png').'" /></td></tr>'; |
|
| 190 | 190 | } else { |
| 191 | - $text .= '<img width="16" src="' . system_AdminIcons('cancel.png') . '" /></td></tr>'; |
|
| 191 | + $text .= '<img width="16" src="'.system_AdminIcons('cancel.png').'" /></td></tr>'; |
|
| 192 | 192 | } |
| 193 | 193 | $verif_write = true; |
| 194 | 194 | } |
@@ -204,18 +204,18 @@ discard block |
||
| 204 | 204 | for ($k = 0; $k < count($btemplates); ++$k) { |
| 205 | 205 | $filename = $btemplates[$k]->getVar('tpl_file'); |
| 206 | 206 | if ($tplsetname == $tplset) { |
| 207 | - $physical_file = \XoopsBaseConfig::get('themes-path') . '/' . $_REQUEST['select_theme'] . '/modules/' . $moddir . '/blocks/' . $filename; |
|
| 207 | + $physical_file = \XoopsBaseConfig::get('themes-path').'/'.$_REQUEST['select_theme'].'/modules/'.$moddir.'/blocks/'.$filename; |
|
| 208 | 208 | $btplfile = $tpltpl_handler->get($btemplates[$k]->getVar('tpl_id'), true); |
| 209 | 209 | |
| 210 | 210 | if (is_object($btplfile)) { |
| 211 | 211 | if (!XoopsLoad::fileExists($physical_file) || $_REQUEST['force_generated'] == 1) { |
| 212 | 212 | $open = fopen($physical_file, 'w+'); |
| 213 | - if (fwrite($open, "" . utf8_encode(html_entity_decode($btplfile->getVar('tpl_source', 'E'))) . "")) { |
|
| 214 | - $text .= '<tr class="' . $class . '"><td align="center">' . XoopsLocale::BLOCKS . '</td><td>' . $physical_file . '</td><td align="center">'; |
|
| 213 | + if (fwrite($open, "".utf8_encode(html_entity_decode($btplfile->getVar('tpl_source', 'E')))."")) { |
|
| 214 | + $text .= '<tr class="'.$class.'"><td align="center">'.XoopsLocale::BLOCKS.'</td><td>'.$physical_file.'</td><td align="center">'; |
|
| 215 | 215 | if (XoopsLoad::fileExists($physical_file)) { |
| 216 | - $text .= '<img width="16" src="' . system_AdminIcons('success.png') . '" /></td></tr>'; |
|
| 216 | + $text .= '<img width="16" src="'.system_AdminIcons('success.png').'" /></td></tr>'; |
|
| 217 | 217 | } else { |
| 218 | - $text .= '<img width="16" src="' . system_AdminIcons('cancel.png') . '" /></td></tr>'; |
|
| 218 | + $text .= '<img width="16" src="'.system_AdminIcons('cancel.png').'" /></td></tr>'; |
|
| 219 | 219 | } |
| 220 | 220 | $verif_write = true; |
| 221 | 221 | } |
@@ -241,23 +241,23 @@ discard block |
||
| 241 | 241 | $module = $xoops->getModuleByDirname($moddir); |
| 242 | 242 | if (is_object($module)) { |
| 243 | 243 | // create module folder |
| 244 | - if (!is_dir($template_overload . '/' . $module->getVar('dirname'))) { |
|
| 245 | - mkdir($template_overload . '/' . $module->getVar('dirname'), 0777); |
|
| 246 | - chmod($template_overload . '/' . $module->getVar('dirname'), 0777); |
|
| 247 | - copy($indexFile, $template_overload . '/' . $module->getVar('dirname') . '/index.html'); |
|
| 244 | + if (!is_dir($template_overload.'/'.$module->getVar('dirname'))) { |
|
| 245 | + mkdir($template_overload.'/'.$module->getVar('dirname'), 0777); |
|
| 246 | + chmod($template_overload.'/'.$module->getVar('dirname'), 0777); |
|
| 247 | + copy($indexFile, $template_overload.'/'.$module->getVar('dirname').'/index.html'); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | // create block folder |
| 251 | - if (!is_dir($template_overload . '/' . $module->getVar('dirname') . '/blocks')) { |
|
| 252 | - if (!is_dir($template_overload . '/' . $module->getVar('dirname') . '/blocks')) { |
|
| 253 | - mkdir($template_overload . '/' . $module->getVar('dirname') . '/blocks', 0777); |
|
| 251 | + if (!is_dir($template_overload.'/'.$module->getVar('dirname').'/blocks')) { |
|
| 252 | + if (!is_dir($template_overload.'/'.$module->getVar('dirname').'/blocks')) { |
|
| 253 | + mkdir($template_overload.'/'.$module->getVar('dirname').'/blocks', 0777); |
|
| 254 | 254 | } |
| 255 | - chmod($template_overload . '/' . $module->getVar('dirname') . '/blocks', 0777); |
|
| 256 | - copy($indexFile, $template_overload . '/' . $module->getVar('dirname') . '/blocks' . '/index.html'); |
|
| 255 | + chmod($template_overload.'/'.$module->getVar('dirname').'/blocks', 0777); |
|
| 256 | + copy($indexFile, $template_overload.'/'.$module->getVar('dirname').'/blocks'.'/index.html'); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | $class = "odd"; |
| 260 | - $text .= '<table cellspacing="1" class="outer"><tr><th colspan="3" align="center">' . XoopsLocale::C_MODULES . ucfirst($module->getVar('dirname')) . '</th></tr><tr><th align="center">' . XoopsLocale::TYPES . '</th><th align="center">' . XoopsLocale::FILES . '</th><th>' . XoopsLocale::STATUS . '</th></tr>'; |
|
| 260 | + $text .= '<table cellspacing="1" class="outer"><tr><th colspan="3" align="center">'.XoopsLocale::C_MODULES.ucfirst($module->getVar('dirname')).'</th></tr><tr><th align="center">'.XoopsLocale::TYPES.'</th><th align="center">'.XoopsLocale::FILES.'</th><th>'.XoopsLocale::STATUS.'</th></tr>'; |
|
| 261 | 261 | $select_templates_modules = $_REQUEST['select_templates_modules']; |
| 262 | 262 | for ($l = 0; $l < count($_REQUEST['select_templates_modules']); ++$l) { |
| 263 | 263 | // create template |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | for ($j = 0; $j < count($templates); ++$j) { |
| 266 | 266 | $filename = $templates[$j]->getVar('tpl_file'); |
| 267 | 267 | if ($tplsetname == $tplset) { |
| 268 | - $physical_file = \XoopsBaseConfig::get('themes-path') . '/' . $_REQUEST['select_theme'] . '/modules/' . $moddir . '/' . $filename; |
|
| 268 | + $physical_file = \XoopsBaseConfig::get('themes-path').'/'.$_REQUEST['select_theme'].'/modules/'.$moddir.'/'.$filename; |
|
| 269 | 269 | |
| 270 | 270 | $tplfile = $tpltpl_handler->get($templates[$j]->getVar('tpl_id'), true); |
| 271 | 271 | |
@@ -274,11 +274,11 @@ discard block |
||
| 274 | 274 | if ($select_templates_modules[$l] == $filename) { |
| 275 | 275 | $open = fopen($physical_file, 'w+'); |
| 276 | 276 | if (fwrite($open, html_entity_decode($tplfile->getVar('tpl_source', 'E'), ENT_QUOTES))) { |
| 277 | - $text .= '<tr class="' . $class . '"><td align="center">' . XoopsLocale::TEMPLATES . '</td><td>' . $physical_file . '</td><td align="center">'; |
|
| 277 | + $text .= '<tr class="'.$class.'"><td align="center">'.XoopsLocale::TEMPLATES.'</td><td>'.$physical_file.'</td><td align="center">'; |
|
| 278 | 278 | if (XoopsLoad::fileExists($physical_file)) { |
| 279 | - $text .= '<img width="16" src="' . system_AdminIcons('success.png') . '" /></td></tr>'; |
|
| 279 | + $text .= '<img width="16" src="'.system_AdminIcons('success.png').'" /></td></tr>'; |
|
| 280 | 280 | } else { |
| 281 | - $text .= '<img width="16" src="' . system_AdminIcons('cancel.png') . '" /></td></tr>'; |
|
| 281 | + $text .= '<img width="16" src="'.system_AdminIcons('cancel.png').'" /></td></tr>'; |
|
| 282 | 282 | } |
| 283 | 283 | $verif_write = true; |
| 284 | 284 | } |
@@ -295,19 +295,19 @@ discard block |
||
| 295 | 295 | for ($k = 0; $k < count($btemplates); ++$k) { |
| 296 | 296 | $filename = $btemplates[$k]->getVar('tpl_file'); |
| 297 | 297 | if ($tplsetname == $tplset) { |
| 298 | - $physical_file = \XoopsBaseConfig::get('themes-path') . '/' . $_REQUEST['select_theme'] . '/modules/' . $moddir . '/blocks/' . $filename; |
|
| 298 | + $physical_file = \XoopsBaseConfig::get('themes-path').'/'.$_REQUEST['select_theme'].'/modules/'.$moddir.'/blocks/'.$filename; |
|
| 299 | 299 | $btplfile = $tpltpl_handler->get($btemplates[$k]->getVar('tpl_id'), true); |
| 300 | 300 | |
| 301 | 301 | if (is_object($btplfile)) { |
| 302 | 302 | if (!XoopsLoad::fileExists($physical_file) || $_REQUEST['force_generated'] == 1) { |
| 303 | 303 | if ($select_templates_modules[$l] == $filename) { |
| 304 | 304 | $open = fopen($physical_file, 'w+'); |
| 305 | - if (fwrite($open, utf8_encode(html_entity_decode($btplfile->getVar('tpl_source', 'E'))) . "")) { |
|
| 306 | - $text .= '<tr class="' . $class . '"><td align="center">' . XoopsLocale::BLOCKS . '</td><td>' . $physical_file . '</td><td align="center">'; |
|
| 305 | + if (fwrite($open, utf8_encode(html_entity_decode($btplfile->getVar('tpl_source', 'E')))."")) { |
|
| 306 | + $text .= '<tr class="'.$class.'"><td align="center">'.XoopsLocale::BLOCKS.'</td><td>'.$physical_file.'</td><td align="center">'; |
|
| 307 | 307 | if (XoopsLoad::fileExists($physical_file)) { |
| 308 | - $text .= '<img width="16" src="' . system_AdminIcons('success.png') . '" /></td></tr>'; |
|
| 308 | + $text .= '<img width="16" src="'.system_AdminIcons('success.png').'" /></td></tr>'; |
|
| 309 | 309 | } else { |
| 310 | - $text .= '<img width="16" src="' . system_AdminIcons('cancel.png') . '" /></td></tr>'; |
|
| 310 | + $text .= '<img width="16" src="'.system_AdminIcons('cancel.png').'" /></td></tr>'; |
|
| 311 | 311 | } |
| 312 | 312 | $verif_write = true; |
| 313 | 313 | } |
@@ -365,14 +365,14 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | $clean_path_file = Request::getString('path_file', ''); |
| 367 | 367 | if (!empty($clean_path_file)) { |
| 368 | - $path_file = realpath(\XoopsBaseConfig::get('themes-path') . '/' . trim($clean_path_file)); |
|
| 368 | + $path_file = realpath(\XoopsBaseConfig::get('themes-path').'/'.trim($clean_path_file)); |
|
| 369 | 369 | $path_file = str_replace('\\', '/', $path_file); |
| 370 | 370 | $pathInfo = pathinfo($path_file); |
| 371 | 371 | if (!in_array($pathInfo['extension'], array('css', 'html', 'tpl'))) { |
| 372 | 372 | $xoops->redirect("admin.php?fct=tplsets", 2, XoopsLocale::E_NOT_DONE); |
| 373 | 373 | } |
| 374 | 374 | // copy file |
| 375 | - $copy_file = $path_file . '.back'; |
|
| 375 | + $copy_file = $path_file.'.back'; |
|
| 376 | 376 | copy($path_file, $copy_file); |
| 377 | 377 | // Save modif |
| 378 | 378 | if (isset($_REQUEST['templates'])) { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @package system |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | -include dirname(dirname(__DIR__)) . '/header.php'; |
|
| 23 | +include dirname(dirname(__DIR__)).'/header.php'; |
|
| 24 | 24 | |
| 25 | 25 | $xoops = Xoops::getInstance(); |
| 26 | 26 | $xoops->logger()->quiet(); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | exit(XoopsLocale::E_NO_ACCESS_PERMISSION); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -if (isset($_REQUEST['dir']) && strpos($_REQUEST['dir'],'..') !== false || isset($_REQUEST['path_file']) && strpos($_REQUEST['path_file'],'..') !== false) { |
|
| 32 | +if (isset($_REQUEST['dir']) && strpos($_REQUEST['dir'], '..') !== false || isset($_REQUEST['path_file']) && strpos($_REQUEST['path_file'], '..') !== false) { |
|
| 33 | 33 | exit(XoopsLocale::E_NO_ACCESS_PERMISSION); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -42,33 +42,33 @@ discard block |
||
| 42 | 42 | case "tpls_display_folder": |
| 43 | 43 | $_REQUEST['dir'] = urldecode($_REQUEST['dir']); |
| 44 | 44 | $root = \XoopsBaseConfig::get('themes-path'); |
| 45 | - if (XoopsLoad::fileExists($root . $_REQUEST['dir'])) { |
|
| 46 | - $files = scandir($root . $_REQUEST['dir']); |
|
| 45 | + if (XoopsLoad::fileExists($root.$_REQUEST['dir'])) { |
|
| 46 | + $files = scandir($root.$_REQUEST['dir']); |
|
| 47 | 47 | natcasesort($files); |
| 48 | 48 | if (count($files) > 2) { /* The 2 accounts for . and .. */ |
| 49 | 49 | echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">"; |
| 50 | 50 | // All dirs |
| 51 | 51 | foreach ($files as $file) { |
| 52 | 52 | |
| 53 | - if (XoopsLoad::fileExists($root . $_REQUEST['dir'] . $file) && $file !== '.' && $file !== '..' && is_dir($root . $_REQUEST['dir'] . $file)) { |
|
| 53 | + if (XoopsLoad::fileExists($root.$_REQUEST['dir'].$file) && $file !== '.' && $file !== '..' && is_dir($root.$_REQUEST['dir'].$file)) { |
|
| 54 | 54 | //retirer .svn |
| 55 | 55 | $file_no_valid = array('.svn', 'icons', 'img', 'images', 'language', 'locale'); |
| 56 | 56 | |
| 57 | 57 | if (!in_array($file, $file_no_valid)) { |
| 58 | - echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_REQUEST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>"; |
|
| 58 | + echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"".htmlentities($_REQUEST['dir'].$file)."/\">".htmlentities($file)."</a></li>"; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | // All files |
| 63 | 63 | foreach ($files as $file) { |
| 64 | - if (XoopsLoad::fileExists($root . $_REQUEST['dir'] . $file) && $file !== '.' && $file !== '..' && !is_dir($root . $_REQUEST['dir'] . $file) && $file !== 'index.html') { |
|
| 64 | + if (XoopsLoad::fileExists($root.$_REQUEST['dir'].$file) && $file !== '.' && $file !== '..' && !is_dir($root.$_REQUEST['dir'].$file) && $file !== 'index.html') { |
|
| 65 | 65 | $ext = preg_replace('/^.*\./', '', $file); |
| 66 | 66 | |
| 67 | 67 | $extensions = array('.tpl', '.html', '.htm', '.css'); |
| 68 | 68 | $extension_verif = strrchr($file, '.'); |
| 69 | 69 | |
| 70 | 70 | if (in_array($extension_verif, $extensions)) { |
| 71 | - echo "<li class=\"file ext_$ext\"><a href=\"#\" onclick=\"tpls_edit_file('" . htmlentities($_REQUEST['dir'] . $file) . "', '" . htmlentities($_REQUEST['dir']) . "', '" . htmlentities($file) . "', '" . $ext . "');\" rel=\"tpls_edit_file('" . htmlentities($_REQUEST['dir'] . $file) . "', '" . htmlentities($_REQUEST['dir']) . "', '" . htmlentities($file) . "', '" . $ext . "');\">" . htmlentities($file) . "</a></li>"; |
|
| 71 | + echo "<li class=\"file ext_$ext\"><a href=\"#\" onclick=\"tpls_edit_file('".htmlentities($_REQUEST['dir'].$file)."', '".htmlentities($_REQUEST['dir'])."', '".htmlentities($file)."', '".$ext."');\" rel=\"tpls_edit_file('".htmlentities($_REQUEST['dir'].$file)."', '".htmlentities($_REQUEST['dir'])."', '".htmlentities($file)."', '".$ext."');\">".htmlentities($file)."</a></li>"; |
|
| 72 | 72 | } else { |
| 73 | 73 | //echo "<li class=\"file ext_$ext\">" . htmlentities($file) . "</li>"; |
| 74 | 74 | } |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | $clean_file = Request::getString('file', ''); |
| 84 | 84 | $clean_path_file = Request::getString('path_file', ''); |
| 85 | 85 | $path_file = realpath(XOOPS_ROOT_PATH.'/themes'.trim($clean_path_file)); |
| 86 | - $path_file = str_replace('\\','/',$path_file); |
|
| 86 | + $path_file = str_replace('\\', '/', $path_file); |
|
| 87 | 87 | |
| 88 | 88 | //Button restore |
| 89 | - if (XoopsLoad::fileExists($path_file . '.back')) { |
|
| 90 | - $restore = '<button class="ui-corner-all tooltip" type="button" onclick="tpls_restore(\'' . $path_file . '\')" value="' . XoopsLocale::A_RESTORE . '" title="' . XoopsLocale::A_RESTORE . '"> |
|
| 91 | - <img src="' . system_AdminIcons('revert.png') . '" alt="' . XoopsLocale::A_RESTORE . '" /> |
|
| 89 | + if (XoopsLoad::fileExists($path_file.'.back')) { |
|
| 90 | + $restore = '<button class="ui-corner-all tooltip" type="button" onclick="tpls_restore(\''.$path_file.'\')" value="'.XoopsLocale::A_RESTORE.'" title="'.XoopsLocale::A_RESTORE.'"> |
|
| 91 | + <img src="' . system_AdminIcons('revert.png').'" alt="'.XoopsLocale::A_RESTORE.'" /> |
|
| 92 | 92 | </button>'; |
| 93 | 93 | } else { |
| 94 | 94 | $restore = ''; |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | <td> |
| 108 | 108 | <div class="xo-btn-actions"> |
| 109 | 109 | <div class="xo-buttons"> |
| 110 | - <button class="ui-corner-all tooltip" type="submit" value="' . XoopsLocale::A_SAVE . '" title="' . XoopsLocale::A_SAVE . '"> |
|
| 111 | - <img src="' . system_AdminIcons('save.png') . '" alt="' . XoopsLocale::A_SAVE . '" /> |
|
| 110 | + <button class="ui-corner-all tooltip" type="submit" value="' . XoopsLocale::A_SAVE.'" title="'.XoopsLocale::A_SAVE.'"> |
|
| 111 | + <img src="' . system_AdminIcons('save.png').'" alt="'.XoopsLocale::A_SAVE.'" /> |
|
| 112 | 112 | </button> |
| 113 | - ' . $restore . ' |
|
| 114 | - <button class="ui-corner-all tooltip" type="button" onclick="$(\'#display_contenu\').hide();$(\'#display_form\').fadeIn(\'fast\');" title="' . XoopsLocale::A_CANCEL . '"> |
|
| 115 | - <img src="' . system_AdminIcons('cancel.png') . '" alt="' . XoopsLocale::A_CANCEL . '" /> |
|
| 113 | + ' . $restore.' |
|
| 114 | + <button class="ui-corner-all tooltip" type="button" onclick="$(\'#display_contenu\').hide();$(\'#display_form\').fadeIn(\'fast\');" title="' . XoopsLocale::A_CANCEL.'"> |
|
| 115 | + <img src="' . system_AdminIcons('cancel.png').'" alt="'.XoopsLocale::A_CANCEL.'" /> |
|
| 116 | 116 | </button> |
| 117 | 117 | <div class="clear"></div> |
| 118 | 118 | </div> |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | </td> |
| 121 | 121 | </tr> |
| 122 | 122 | <tr> |
| 123 | - <td><textarea id="code_mirror" name="templates" rows=24 cols=110>' . $content . '</textarea></td> |
|
| 123 | + <td><textarea id="code_mirror" name="templates" rows=24 cols=110>' . $content.'</textarea></td> |
|
| 124 | 124 | </tr> |
| 125 | 125 | </table>'; |
| 126 | 126 | $xoopsToken = new \Xoops\Form\Token(); |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | $extensions = array('.tpl', '.html', '.htm', '.css'); |
| 134 | 134 | |
| 135 | 135 | //check if the file is inside themes directory |
| 136 | - $valid_dir = stristr(realpath($_REQUEST['path_file']), realpath(\XoopsBaseConfig::get('root-path') . '/themes')); |
|
| 136 | + $valid_dir = stristr(realpath($_REQUEST['path_file']), realpath(\XoopsBaseConfig::get('root-path').'/themes')); |
|
| 137 | 137 | |
| 138 | - $old_file = $_REQUEST['path_file'] . '.back'; |
|
| 138 | + $old_file = $_REQUEST['path_file'].'.back'; |
|
| 139 | 139 | $new_file = $_REQUEST['path_file']; |
| 140 | 140 | |
| 141 | 141 | $extension_verif = strrchr($new_file, '.'); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | 21 | // Include XOOPS control panel header |
| 22 | -include_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
|
| 22 | +include_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php'; |
|
| 23 | 23 | |
| 24 | 24 | $xoops = Xoops::getInstance(); |
| 25 | 25 | $xoops->loadLocale('system'); |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | continue; |
| 47 | 47 | } |
| 48 | 48 | if (false == $gperm_handler->deleteByModule($modid, $perm_name)) { |
| 49 | - $msg[] = sprintf(SystemLocale::EF_COULD_NOT_RESET_GROUP_PERMISSION_FOR_MODULE, $module->getVar('name') . '(' . $perm_name . ')'); |
|
| 49 | + $msg[] = sprintf(SystemLocale::EF_COULD_NOT_RESET_GROUP_PERMISSION_FOR_MODULE, $module->getVar('name').'('.$perm_name.')'); |
|
| 50 | 50 | } |
| 51 | - if (!array_key_exists('groups', $perm_data)){ |
|
| 51 | + if (!array_key_exists('groups', $perm_data)) { |
|
| 52 | 52 | $msg[] = sprintf(SystemLocale::SF_ADDED_PERMISSION_FOR_GROUP, $module->getVar('name'), $perm_name, ' /'); |
| 53 | - }else{ |
|
| 53 | + } else { |
|
| 54 | 54 | foreach ($perm_data['groups'] as $group_id => $item_ids) { |
| 55 | 55 | foreach ($item_ids as $item_id => $selected) { |
| 56 | 56 | if ($selected == 1) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | foreach ($parent_ids as $pid) { |
| 61 | 61 | if ($pid != 0 && !in_array($pid, array_keys($item_ids))) { |
| 62 | 62 | // one of the parent items were not selected, so skip this item |
| 63 | - $msg[] = sprintf(SystemLocale::EF_COULD_NOT_ADD_PERMISSION_FOR_GROUP, '<strong>' . $perm_name . '</strong>', '<strong>' . $perm_data['itemname'][$item_id] . '</strong>', '<strong>' . $group_list[$group_id] . '</strong>') . ' (' . XoopsLocale::E_ALL_PARENT_ITEMS_MUST_BE_SELECTED . ')'; |
|
| 63 | + $msg[] = sprintf(SystemLocale::EF_COULD_NOT_ADD_PERMISSION_FOR_GROUP, '<strong>'.$perm_name.'</strong>', '<strong>'.$perm_data['itemname'][$item_id].'</strong>', '<strong>'.$group_list[$group_id].'</strong>').' ('.XoopsLocale::E_ALL_PARENT_ITEMS_MUST_BE_SELECTED.')'; |
|
| 64 | 64 | continue 2; |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | $gperm->setVar('gperm_modid', $modid); |
| 72 | 72 | $gperm->setVar('gperm_itemid', $item_id); |
| 73 | 73 | if (!$gperm_handler->insert($gperm)) { |
| 74 | - $msg[] = sprintf(SystemLocale::EF_COULD_NOT_ADD_PERMISSION_FOR_GROUP, '<strong>' . $perm_name . '</strong>', '<strong>' . $perm_data['itemname'][$item_id] . '</strong>', '<strong>' . $group_list[$group_id] . '</strong>'); |
|
| 74 | + $msg[] = sprintf(SystemLocale::EF_COULD_NOT_ADD_PERMISSION_FOR_GROUP, '<strong>'.$perm_name.'</strong>', '<strong>'.$perm_data['itemname'][$item_id].'</strong>', '<strong>'.$group_list[$group_id].'</strong>'); |
|
| 75 | 75 | } else { |
| 76 | - $msg[] = sprintf(SystemLocale::SF_ADDED_PERMISSION_FOR_GROUP, '<strong>' . $perm_name . '</strong>', '<strong>' . $perm_data['itemname'][$item_id] . '</strong>', '<strong>' . $group_list[$group_id] . '</strong>'); |
|
| 76 | + $msg[] = sprintf(SystemLocale::SF_ADDED_PERMISSION_FOR_GROUP, '<strong>'.$perm_name.'</strong>', '<strong>'.$perm_data['itemname'][$item_id].'</strong>', '<strong>'.$group_list[$group_id].'</strong>'); |
|
| 77 | 77 | } |
| 78 | 78 | unset($gperm); |
| 79 | 79 | } |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | if ($module->getVar('hasadmin')) { |
| 87 | 87 | $adminindex = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : $module->getInfo('adminindex'); |
| 88 | 88 | if ($adminindex) { |
| 89 | - $backlink = $xoops->url('modules/' . $module->getVar('dirname') . '/' . $adminindex); |
|
| 89 | + $backlink = $xoops->url('modules/'.$module->getVar('dirname').'/'.$adminindex); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | -$backlink = ($backlink) ? $backlink : \XoopsBaseConfig::get('url') . '/admin.php'; |
|
| 92 | +$backlink = ($backlink) ? $backlink : \XoopsBaseConfig::get('url').'/admin.php'; |
|
| 93 | 93 | |
| 94 | 94 | $xoops->redirect($backlink, 2, implode("<br />", $msg)); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | } |
| 51 | 51 | if (!array_key_exists('groups', $perm_data)){ |
| 52 | 52 | $msg[] = sprintf(SystemLocale::SF_ADDED_PERMISSION_FOR_GROUP, $module->getVar('name'), $perm_name, ' /'); |
| 53 | - }else{ |
|
| 53 | + } else{ |
|
| 54 | 54 | foreach ($perm_data['groups'] as $group_id => $item_ids) { |
| 55 | 55 | foreach ($item_ids as $item_id => $selected) { |
| 56 | 56 | if ($selected == 1) { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $xoops->theme()->addScript('modules/system/js/admin.js'); |
| 56 | 56 | // Define Breadcrumb and tips |
| 57 | 57 | $admin_page = new \Xoops\Module\Admin(); |
| 58 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 58 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 59 | 59 | $admin_page->addBreadcrumbLink(SystemLocale::GROUPS_MANAGER, $system->adminVersion('groups', 'adminpath')); |
| 60 | 60 | $admin_page->addBreadcrumbLink(XoopsLocale::MAIN); |
| 61 | 61 | $admin_page->addItemButton(SystemLocale::ADD_NEW_GROUP, 'admin.php?fct=groups&op=groups_add', 'add'); |
@@ -90,15 +90,15 @@ discard block |
||
| 90 | 90 | } else { |
| 91 | 91 | $groups['nb_users_by_groups'] = ''; |
| 92 | 92 | } |
| 93 | - $edit_delete = '<a href="admin.php?fct=groups&op=groups_edit&groups_id=' . $groups_id . '">' |
|
| 94 | - . '<img src="./images/icons/edit.png" border="0" alt="' . SystemLocale::EDIT_GROUP |
|
| 95 | - . '" title="' . SystemLocale::EDIT_GROUP . '"></a>'; |
|
| 93 | + $edit_delete = '<a href="admin.php?fct=groups&op=groups_edit&groups_id='.$groups_id.'">' |
|
| 94 | + . '<img src="./images/icons/edit.png" border="0" alt="'.SystemLocale::EDIT_GROUP |
|
| 95 | + . '" title="'.SystemLocale::EDIT_GROUP.'"></a>'; |
|
| 96 | 96 | if (!in_array($group->getVar("groupid"), array(FixedGroups::ADMIN, FixedGroups::USERS, FixedGroups::ANONYMOUS, FixedGroups::REMOVED)) |
| 97 | 97 | ) { |
| 98 | 98 | $groups['delete'] = 1; |
| 99 | - $edit_delete .= '<a href="admin.php?fct=groups&op=groups_delete&groups_id=' . $groups_id . '">' |
|
| 100 | - . '<img src="./images/icons/delete.png" border="0" alt="' . SystemLocale::DELETE_GROUP |
|
| 101 | - . '" title="' . SystemLocale::DELETE_GROUP . '"></a>'; |
|
| 99 | + $edit_delete .= '<a href="admin.php?fct=groups&op=groups_delete&groups_id='.$groups_id.'">' |
|
| 100 | + . '<img src="./images/icons/delete.png" border="0" alt="'.SystemLocale::DELETE_GROUP |
|
| 101 | + . '" title="'.SystemLocale::DELETE_GROUP.'"></a>'; |
|
| 102 | 102 | } |
| 103 | 103 | $groups['edit_delete'] = $edit_delete; |
| 104 | 104 | $xoops->tpl()->appendByRef('groups', $groups); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 118 | 118 | // Define Breadcrumb and tips |
| 119 | 119 | $admin_page = new \Xoops\Module\Admin(); |
| 120 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 120 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 121 | 121 | $admin_page->addBreadcrumbLink(SystemLocale::GROUPS_MANAGER, $system->adminVersion('groups', 'adminpath')); |
| 122 | 122 | $admin_page->addBreadcrumbLink(SystemLocale::ADD_NEW_GROUP); |
| 123 | 123 | $admin_page->addTips(SystemLocale::GROUPS_TIPS_2); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 137 | 137 | // Define Breadcrumb and tips |
| 138 | 138 | $admin_page = new \Xoops\Module\Admin(); |
| 139 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 139 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 140 | 140 | $admin_page->addBreadcrumbLink(SystemLocale::GROUPS_MANAGER, $system->adminVersion('groups', 'adminpath')); |
| 141 | 141 | $admin_page->addBreadcrumbLink(SystemLocale::EDIT_GROUP); |
| 142 | 142 | $admin_page->addTips(SystemLocale::GROUPS_TIPS_2); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | case 'groups_delete': |
| 310 | 310 | // Define Breadcrumb and tips |
| 311 | 311 | $admin_page = new \Xoops\Module\Admin(); |
| 312 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 312 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 313 | 313 | $admin_page->addBreadcrumbLink(SystemLocale::GROUPS_MANAGER, $system->adminVersion('groups', 'adminpath')); |
| 314 | 314 | $admin_page->addBreadcrumbLink(SystemLocale::DELETE_GROUP); |
| 315 | 315 | $admin_page->renderBreadcrumb(); |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 341 | 341 | // Define Breadcrumb and tips |
| 342 | 342 | $system_breadcrumb->addLink(SystemLocale::DELETE_GROUP); |
| 343 | - $system_breadcrumb->addHelp(system_adminVersion('groups', 'help') . '#edit'); |
|
| 343 | + $system_breadcrumb->addHelp(system_adminVersion('groups', 'help').'#edit'); |
|
| 344 | 344 | $system_breadcrumb->render(); |
| 345 | 345 | // Display message |
| 346 | 346 | echo $xoops->confirm( |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | "op" => "groups_delete" |
| 351 | 351 | ), |
| 352 | 352 | 'admin.php?fct=groups', |
| 353 | - SystemLocale::Q_ARE_YOU_SURE_DELETE_THIS_GROUP . '<br />' . $obj->getVar("name") . '<br />' |
|
| 353 | + SystemLocale::Q_ARE_YOU_SURE_DELETE_THIS_GROUP.'<br />'.$obj->getVar("name").'<br />' |
|
| 354 | 354 | ); |
| 355 | 355 | } |
| 356 | 356 | } else { |
@@ -71,260 +71,260 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | switch ($op) { |
| 73 | 73 | |
| 74 | - case 'list': |
|
| 75 | - // Call Header |
|
| 76 | - $xoops->header('admin:system/system_blocks.tpl'); |
|
| 77 | - // Define Stylesheet |
|
| 78 | - $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 79 | - // Define scripts |
|
| 80 | - $xoops->theme()->addScript('modules/system/js/admin.js'); |
|
| 81 | - $xoops->theme()->addScript('modules/system/js/blocks.js'); |
|
| 82 | - // Define Breadcrumb and tips |
|
| 83 | - $admin_page = new \Xoops\Module\Admin(); |
|
| 84 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 85 | - $admin_page->addBreadcrumbLink( |
|
| 86 | - SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 87 | - $system->adminVersion('blocksadmin', 'adminpath') |
|
| 88 | - ); |
|
| 89 | - $admin_page->addBreadcrumbLink(SystemLocale::MANAGE_BLOCKS); |
|
| 90 | - $admin_page->renderBreadcrumb(); |
|
| 91 | - $admin_page->addItemButton(SystemLocale::ADD_BLOCK, 'admin.php?fct=blocksadmin&op=add', 'add'); |
|
| 92 | - $admin_page->renderButton(); |
|
| 93 | - $admin_page->addTips(sprintf( |
|
| 94 | - SystemLocale::BLOCKS_TIPS, |
|
| 95 | - system_AdminIcons('block.png'), |
|
| 96 | - system_AdminIcons('success.png'), |
|
| 97 | - system_AdminIcons('cancel.png'), |
|
| 98 | - SystemLocale::DRAG_OR_SORT_BLOCK, |
|
| 99 | - SystemLocale::DISPLAY_BLOCK, |
|
| 100 | - SystemLocale::HIDE_BLOCK |
|
| 101 | - )); |
|
| 102 | - $admin_page->renderTips(); |
|
| 103 | - // Initialize module handler |
|
| 104 | - $module_handler = $xoops->getHandlerModule(); |
|
| 105 | - $modules = $module_handler->getObjects(null, true); |
|
| 106 | - $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); |
|
| 107 | - |
|
| 108 | - $criteria->add(new Criteria('isactive', 1)); |
|
| 109 | - // Modules for blocks to be visible in |
|
| 110 | - $display_list = $module_handler->getNameList($criteria); |
|
| 111 | - unset($criteria); |
|
| 112 | - // Initialize blocks handler |
|
| 113 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 114 | - $modules = $xoops->getHandlerModule()->getObjects(null, true); |
|
| 115 | - |
|
| 116 | - $filterform = new Xoops\Form\ThemeForm('', 'filterform', 'admin.php', 'get'); |
|
| 117 | - $filterform->addElement(new Xoops\Form\Hidden('fct', 'blocksadmin')); |
|
| 118 | - $filterform->addElement(new Xoops\Form\Hidden('op', 'list')); |
|
| 119 | - $filterform->addElement(new Xoops\Form\Hidden('filter', 1)); |
|
| 120 | - $sel_gen = new Xoops\Form\Select(XoopsLocale::MODULES, 'selgen', $selgen); |
|
| 121 | - $sel_gen->setExtra("onchange='submit()'"); |
|
| 122 | - $sel_gen->addOption(-1, XoopsLocale::ALL_TYPES); |
|
| 123 | - $sel_gen->addOption(0, SystemLocale::CUSTOM_BLOCK); |
|
| 124 | - /* @var $list XoopsModule */ |
|
| 125 | - foreach ($modules as $list) { |
|
| 126 | - $sel_gen->addOption($list->getVar('mid'), $list->getVar('name')); |
|
| 127 | - } |
|
| 128 | - $filterform->addElement($sel_gen); |
|
| 129 | - |
|
| 130 | - $sel_mod = new Xoops\Form\Select(XoopsLocale::PAGE, 'selmod', $selmod); |
|
| 131 | - $sel_mod->setExtra("onchange='submit()'"); |
|
| 132 | - ksort($display_list); |
|
| 133 | - $display_list_spec[0] = XoopsLocale::ALL_PAGES; |
|
| 134 | - $display_list_spec[-1] = XoopsLocale::TOP_PAGE; |
|
| 135 | - $display_list_spec[-2] = XoopsLocale::ALL_TYPES; |
|
| 136 | - $display_list = $display_list_spec + $display_list; |
|
| 137 | - foreach ($display_list as $k => $v) { |
|
| 138 | - $sel_mod->addOption($k, $v); |
|
| 139 | - } |
|
| 140 | - $filterform->addElement($sel_mod); |
|
| 141 | - |
|
| 142 | - // For selection of group access |
|
| 143 | - $sel_grp = new Xoops\Form\Select(XoopsLocale::GROUPS, 'selgrp', $selgrp); |
|
| 144 | - $sel_grp->setExtra("onchange='submit()'"); |
|
| 145 | - $member_handler = $xoops->getHandlerMember(); |
|
| 146 | - $group_list = $member_handler->getGroupList(); |
|
| 147 | - $sel_grp->addOption(-1, XoopsLocale::ALL_TYPES); |
|
| 148 | - $sel_grp->addOption(0, XoopsLocale::UNASSIGNED); |
|
| 149 | - foreach ($group_list as $k => $v) { |
|
| 150 | - $sel_grp->addOption($k, $v); |
|
| 151 | - } |
|
| 152 | - $filterform->addElement($sel_grp); |
|
| 153 | - |
|
| 154 | - $sel_vis = new Xoops\Form\Select(XoopsLocale::VISIBLE, 'selvis', $selvis); |
|
| 155 | - $sel_vis->setExtra("onchange='submit()'"); |
|
| 156 | - $sel_vis->addOption(-1, XoopsLocale::ALL_TYPES); |
|
| 157 | - $sel_vis->addOption(0, XoopsLocale::NO); |
|
| 158 | - $sel_vis->addOption(1, XoopsLocale::YES); |
|
| 159 | - |
|
| 160 | - $filterform->addElement($sel_vis); |
|
| 161 | - |
|
| 162 | - $filterform->assign($xoops->tpl()); |
|
| 163 | - |
|
| 164 | - /* Get blocks */ |
|
| 165 | - $selvis = ($selvis == -1) ? null : $selvis; |
|
| 166 | - $selmod = ($selmod == -2) ? null : $selmod; |
|
| 167 | - $order_block = (isset($selvis) ? "" : "b.visible DESC, ") . "b.side,b.weight,b.bid"; |
|
| 168 | - |
|
| 169 | - if ($selgrp == 0) { |
|
| 170 | - // get blocks that are not assigned to any groups |
|
| 171 | - $blocks_arr = $block_handler->getNonGroupedBlocks($selmod, $toponlyblock = false, $selvis, $order_block); |
|
| 172 | - } else { |
|
| 173 | - $selgrp = ($selgrp == -1) ? null : $selgrp; |
|
| 174 | - $blocks_arr = $block_handler-> |
|
| 175 | - getAllByGroupModule($selgrp, $selmod, $toponlyblock = false, $selvis, $order_block); |
|
| 176 | - } |
|
| 74 | + case 'list': |
|
| 75 | + // Call Header |
|
| 76 | + $xoops->header('admin:system/system_blocks.tpl'); |
|
| 77 | + // Define Stylesheet |
|
| 78 | + $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 79 | + // Define scripts |
|
| 80 | + $xoops->theme()->addScript('modules/system/js/admin.js'); |
|
| 81 | + $xoops->theme()->addScript('modules/system/js/blocks.js'); |
|
| 82 | + // Define Breadcrumb and tips |
|
| 83 | + $admin_page = new \Xoops\Module\Admin(); |
|
| 84 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 85 | + $admin_page->addBreadcrumbLink( |
|
| 86 | + SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 87 | + $system->adminVersion('blocksadmin', 'adminpath') |
|
| 88 | + ); |
|
| 89 | + $admin_page->addBreadcrumbLink(SystemLocale::MANAGE_BLOCKS); |
|
| 90 | + $admin_page->renderBreadcrumb(); |
|
| 91 | + $admin_page->addItemButton(SystemLocale::ADD_BLOCK, 'admin.php?fct=blocksadmin&op=add', 'add'); |
|
| 92 | + $admin_page->renderButton(); |
|
| 93 | + $admin_page->addTips(sprintf( |
|
| 94 | + SystemLocale::BLOCKS_TIPS, |
|
| 95 | + system_AdminIcons('block.png'), |
|
| 96 | + system_AdminIcons('success.png'), |
|
| 97 | + system_AdminIcons('cancel.png'), |
|
| 98 | + SystemLocale::DRAG_OR_SORT_BLOCK, |
|
| 99 | + SystemLocale::DISPLAY_BLOCK, |
|
| 100 | + SystemLocale::HIDE_BLOCK |
|
| 101 | + )); |
|
| 102 | + $admin_page->renderTips(); |
|
| 103 | + // Initialize module handler |
|
| 104 | + $module_handler = $xoops->getHandlerModule(); |
|
| 105 | + $modules = $module_handler->getObjects(null, true); |
|
| 106 | + $criteria = new CriteriaCompo(new Criteria('hasmain', 1)); |
|
| 107 | + |
|
| 108 | + $criteria->add(new Criteria('isactive', 1)); |
|
| 109 | + // Modules for blocks to be visible in |
|
| 110 | + $display_list = $module_handler->getNameList($criteria); |
|
| 111 | + unset($criteria); |
|
| 112 | + // Initialize blocks handler |
|
| 113 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 114 | + $modules = $xoops->getHandlerModule()->getObjects(null, true); |
|
| 115 | + |
|
| 116 | + $filterform = new Xoops\Form\ThemeForm('', 'filterform', 'admin.php', 'get'); |
|
| 117 | + $filterform->addElement(new Xoops\Form\Hidden('fct', 'blocksadmin')); |
|
| 118 | + $filterform->addElement(new Xoops\Form\Hidden('op', 'list')); |
|
| 119 | + $filterform->addElement(new Xoops\Form\Hidden('filter', 1)); |
|
| 120 | + $sel_gen = new Xoops\Form\Select(XoopsLocale::MODULES, 'selgen', $selgen); |
|
| 121 | + $sel_gen->setExtra("onchange='submit()'"); |
|
| 122 | + $sel_gen->addOption(-1, XoopsLocale::ALL_TYPES); |
|
| 123 | + $sel_gen->addOption(0, SystemLocale::CUSTOM_BLOCK); |
|
| 124 | + /* @var $list XoopsModule */ |
|
| 125 | + foreach ($modules as $list) { |
|
| 126 | + $sel_gen->addOption($list->getVar('mid'), $list->getVar('name')); |
|
| 127 | + } |
|
| 128 | + $filterform->addElement($sel_gen); |
|
| 129 | + |
|
| 130 | + $sel_mod = new Xoops\Form\Select(XoopsLocale::PAGE, 'selmod', $selmod); |
|
| 131 | + $sel_mod->setExtra("onchange='submit()'"); |
|
| 132 | + ksort($display_list); |
|
| 133 | + $display_list_spec[0] = XoopsLocale::ALL_PAGES; |
|
| 134 | + $display_list_spec[-1] = XoopsLocale::TOP_PAGE; |
|
| 135 | + $display_list_spec[-2] = XoopsLocale::ALL_TYPES; |
|
| 136 | + $display_list = $display_list_spec + $display_list; |
|
| 137 | + foreach ($display_list as $k => $v) { |
|
| 138 | + $sel_mod->addOption($k, $v); |
|
| 139 | + } |
|
| 140 | + $filterform->addElement($sel_mod); |
|
| 141 | + |
|
| 142 | + // For selection of group access |
|
| 143 | + $sel_grp = new Xoops\Form\Select(XoopsLocale::GROUPS, 'selgrp', $selgrp); |
|
| 144 | + $sel_grp->setExtra("onchange='submit()'"); |
|
| 145 | + $member_handler = $xoops->getHandlerMember(); |
|
| 146 | + $group_list = $member_handler->getGroupList(); |
|
| 147 | + $sel_grp->addOption(-1, XoopsLocale::ALL_TYPES); |
|
| 148 | + $sel_grp->addOption(0, XoopsLocale::UNASSIGNED); |
|
| 149 | + foreach ($group_list as $k => $v) { |
|
| 150 | + $sel_grp->addOption($k, $v); |
|
| 151 | + } |
|
| 152 | + $filterform->addElement($sel_grp); |
|
| 153 | + |
|
| 154 | + $sel_vis = new Xoops\Form\Select(XoopsLocale::VISIBLE, 'selvis', $selvis); |
|
| 155 | + $sel_vis->setExtra("onchange='submit()'"); |
|
| 156 | + $sel_vis->addOption(-1, XoopsLocale::ALL_TYPES); |
|
| 157 | + $sel_vis->addOption(0, XoopsLocale::NO); |
|
| 158 | + $sel_vis->addOption(1, XoopsLocale::YES); |
|
| 159 | + |
|
| 160 | + $filterform->addElement($sel_vis); |
|
| 161 | + |
|
| 162 | + $filterform->assign($xoops->tpl()); |
|
| 163 | + |
|
| 164 | + /* Get blocks */ |
|
| 165 | + $selvis = ($selvis == -1) ? null : $selvis; |
|
| 166 | + $selmod = ($selmod == -2) ? null : $selmod; |
|
| 167 | + $order_block = (isset($selvis) ? "" : "b.visible DESC, ") . "b.side,b.weight,b.bid"; |
|
| 168 | + |
|
| 169 | + if ($selgrp == 0) { |
|
| 170 | + // get blocks that are not assigned to any groups |
|
| 171 | + $blocks_arr = $block_handler->getNonGroupedBlocks($selmod, $toponlyblock = false, $selvis, $order_block); |
|
| 172 | + } else { |
|
| 173 | + $selgrp = ($selgrp == -1) ? null : $selgrp; |
|
| 174 | + $blocks_arr = $block_handler-> |
|
| 175 | + getAllByGroupModule($selgrp, $selmod, $toponlyblock = false, $selvis, $order_block); |
|
| 176 | + } |
|
| 177 | 177 | |
| 178 | - if ($selgen >= 0) { |
|
| 179 | - foreach (array_keys($blocks_arr) as $bid) { |
|
| 180 | - if ($blocks_arr[$bid]->getVar("mid") != $selgen) { |
|
| 181 | - unset($blocks_arr[$bid]); |
|
| 178 | + if ($selgen >= 0) { |
|
| 179 | + foreach (array_keys($blocks_arr) as $bid) { |
|
| 180 | + if ($blocks_arr[$bid]->getVar("mid") != $selgen) { |
|
| 181 | + unset($blocks_arr[$bid]); |
|
| 182 | + } |
|
| 182 | 183 | } |
| 183 | 184 | } |
| 184 | - } |
|
| 185 | - |
|
| 186 | - $arr = array(); |
|
| 187 | - foreach (array_keys($blocks_arr) as $i) { |
|
| 188 | - $arr[$i] = $blocks_arr[$i]->getValues(); |
|
| 189 | - $xoops->tpl()->appendByRef('blocks', $arr[$i]); |
|
| 190 | - } |
|
| 191 | - // Call Footer |
|
| 192 | - $xoops->footer(); |
|
| 193 | - break; |
|
| 194 | - |
|
| 195 | - case 'add': |
|
| 196 | - // Call Header |
|
| 197 | - $xoops->header('admin:system/system_blocks.tpl'); |
|
| 198 | - // Define Stylesheet |
|
| 199 | - $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 200 | - // Define scripts |
|
| 201 | - $xoops->theme()->addScript('media/jquery/plugins/jquery.form.js'); |
|
| 202 | - $xoops->theme()->addScript('modules/system/js/admin.js'); |
|
| 203 | - $xoops->theme()->addScript('modules/system/js/blocks.js'); |
|
| 204 | - // Define Breadcrumb and tips |
|
| 205 | - $admin_page = new \Xoops\Module\Admin(); |
|
| 206 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 207 | - $admin_page->addBreadcrumbLink( |
|
| 208 | - SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 209 | - $system->adminVersion('blocksadmin', 'adminpath') |
|
| 210 | - ); |
|
| 211 | - $admin_page->addBreadcrumbLink(SystemLocale::ADD_BLOCK); |
|
| 212 | - $admin_page->renderBreadcrumb(); |
|
| 213 | - // Initialize blocks handler |
|
| 214 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 215 | - $block = $block_handler->create(); |
|
| 216 | - $form = $xoops->getModuleForm($block, 'block'); |
|
| 217 | - $form->getForm(); |
|
| 218 | - $form->display(); |
|
| 219 | - // Call Footer |
|
| 220 | - $xoops->footer(); |
|
| 221 | - break; |
|
| 222 | 185 | |
| 223 | - case 'display': |
|
| 224 | - // Initialize blocks handler |
|
| 225 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 226 | - // Get variable |
|
| 227 | - $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 228 | - $visible = $system->cleanVars($_POST, 'visible', 0, 'int'); |
|
| 229 | - if ($block_id > 0) { |
|
| 230 | - $block = $block_handler->get($block_id); |
|
| 231 | - $block->setVar('visible', $visible); |
|
| 232 | - if (!$block_handler->insertBlock($block)) { |
|
| 233 | - $error = true; |
|
| 186 | + $arr = array(); |
|
| 187 | + foreach (array_keys($blocks_arr) as $i) { |
|
| 188 | + $arr[$i] = $blocks_arr[$i]->getValues(); |
|
| 189 | + $xoops->tpl()->appendByRef('blocks', $arr[$i]); |
|
| 234 | 190 | } |
| 235 | - } |
|
| 236 | - break; |
|
| 191 | + // Call Footer |
|
| 192 | + $xoops->footer(); |
|
| 193 | + break; |
|
| 237 | 194 | |
| 238 | - case 'drag': |
|
| 239 | - // Initialize blocks handler |
|
| 240 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 241 | - // Get variable |
|
| 242 | - $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 243 | - $side = $system->cleanVars($_POST, 'side', 0, 'int'); |
|
| 244 | - if ($block_id > 0) { |
|
| 245 | - $block = $block_handler->get($block_id); |
|
| 246 | - $block->setVar('side', $side); |
|
| 247 | - if (!$block_handler->insertBlock($block)) { |
|
| 248 | - $error = true; |
|
| 195 | + case 'add': |
|
| 196 | + // Call Header |
|
| 197 | + $xoops->header('admin:system/system_blocks.tpl'); |
|
| 198 | + // Define Stylesheet |
|
| 199 | + $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 200 | + // Define scripts |
|
| 201 | + $xoops->theme()->addScript('media/jquery/plugins/jquery.form.js'); |
|
| 202 | + $xoops->theme()->addScript('modules/system/js/admin.js'); |
|
| 203 | + $xoops->theme()->addScript('modules/system/js/blocks.js'); |
|
| 204 | + // Define Breadcrumb and tips |
|
| 205 | + $admin_page = new \Xoops\Module\Admin(); |
|
| 206 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 207 | + $admin_page->addBreadcrumbLink( |
|
| 208 | + SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 209 | + $system->adminVersion('blocksadmin', 'adminpath') |
|
| 210 | + ); |
|
| 211 | + $admin_page->addBreadcrumbLink(SystemLocale::ADD_BLOCK); |
|
| 212 | + $admin_page->renderBreadcrumb(); |
|
| 213 | + // Initialize blocks handler |
|
| 214 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 215 | + $block = $block_handler->create(); |
|
| 216 | + $form = $xoops->getModuleForm($block, 'block'); |
|
| 217 | + $form->getForm(); |
|
| 218 | + $form->display(); |
|
| 219 | + // Call Footer |
|
| 220 | + $xoops->footer(); |
|
| 221 | + break; |
|
| 222 | + |
|
| 223 | + case 'display': |
|
| 224 | + // Initialize blocks handler |
|
| 225 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 226 | + // Get variable |
|
| 227 | + $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 228 | + $visible = $system->cleanVars($_POST, 'visible', 0, 'int'); |
|
| 229 | + if ($block_id > 0) { |
|
| 230 | + $block = $block_handler->get($block_id); |
|
| 231 | + $block->setVar('visible', $visible); |
|
| 232 | + if (!$block_handler->insertBlock($block)) { |
|
| 233 | + $error = true; |
|
| 234 | + } |
|
| 249 | 235 | } |
| 250 | - } |
|
| 251 | - break; |
|
| 252 | - |
|
| 253 | - case 'order': |
|
| 254 | - // Initialize blocks handler |
|
| 255 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 256 | - if (isset($_POST['blk'])) { |
|
| 257 | - $i = 0; |
|
| 258 | - foreach ($_POST['blk'] as $order) { |
|
| 259 | - if ($order > 0) { |
|
| 260 | - $block = $block_handler->get($order); |
|
| 261 | - $block->setVar('weight', $i); |
|
| 262 | - if (!$block_handler->insertBlock($block)) { |
|
| 263 | - $error = true; |
|
| 236 | + break; |
|
| 237 | + |
|
| 238 | + case 'drag': |
|
| 239 | + // Initialize blocks handler |
|
| 240 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 241 | + // Get variable |
|
| 242 | + $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 243 | + $side = $system->cleanVars($_POST, 'side', 0, 'int'); |
|
| 244 | + if ($block_id > 0) { |
|
| 245 | + $block = $block_handler->get($block_id); |
|
| 246 | + $block->setVar('side', $side); |
|
| 247 | + if (!$block_handler->insertBlock($block)) { |
|
| 248 | + $error = true; |
|
| 249 | + } |
|
| 250 | + } |
|
| 251 | + break; |
|
| 252 | + |
|
| 253 | + case 'order': |
|
| 254 | + // Initialize blocks handler |
|
| 255 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 256 | + if (isset($_POST['blk'])) { |
|
| 257 | + $i = 0; |
|
| 258 | + foreach ($_POST['blk'] as $order) { |
|
| 259 | + if ($order > 0) { |
|
| 260 | + $block = $block_handler->get($order); |
|
| 261 | + $block->setVar('weight', $i); |
|
| 262 | + if (!$block_handler->insertBlock($block)) { |
|
| 263 | + $error = true; |
|
| 264 | + } |
|
| 265 | + ++$i; |
|
| 264 | 266 | } |
| 265 | - ++$i; |
|
| 266 | 267 | } |
| 267 | 268 | } |
| 268 | - } |
|
| 269 | - exit; |
|
| 270 | - break; |
|
| 269 | + exit; |
|
| 270 | + break; |
|
| 271 | 271 | |
| 272 | - case 'preview': |
|
| 273 | - if (!$xoops->security()->check()) { |
|
| 274 | - $xoops->redirect('admin.php?fct=blocksadmin', 3, implode('<br />', $xoops->security()->getErrors())); |
|
| 275 | - exit(); |
|
| 276 | - } |
|
| 277 | - // Initialize blocks handler |
|
| 278 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 279 | - /* @var $block XoopsBlock */ |
|
| 280 | - $block = $block_handler->create(); |
|
| 281 | - $block->setVars($_POST); |
|
| 282 | - $content = isset($_POST['content_block']) ? $_POST['content_block'] : ''; |
|
| 283 | - $block->setVar('content', $content); |
|
| 284 | - $myts = \Xoops\Core\Text\Sanitizer::getInstance(); |
|
| 285 | - echo '<div id="xo-preview-dialog" title="' . $block->getVar('title', 's') |
|
| 286 | - . '">' . $block->getContent('s', $block->getVar('c_type')) . '</div>'; |
|
| 287 | - break; |
|
| 288 | - |
|
| 289 | - case 'save': |
|
| 290 | - if (!$xoops->security()->check()) { |
|
| 291 | - $xoops->redirect('admin.php?fct=blocksadmin', 3, implode('<br />', $xoops->security()->getErrors())); |
|
| 292 | - exit(); |
|
| 293 | - } |
|
| 294 | - // Initialize blocks handler |
|
| 295 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 296 | - // Get avatar id |
|
| 297 | - $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 298 | - if ($block_id > 0) { |
|
| 299 | - $block = $block_handler->get($block_id); |
|
| 300 | - } else { |
|
| 272 | + case 'preview': |
|
| 273 | + if (!$xoops->security()->check()) { |
|
| 274 | + $xoops->redirect('admin.php?fct=blocksadmin', 3, implode('<br />', $xoops->security()->getErrors())); |
|
| 275 | + exit(); |
|
| 276 | + } |
|
| 277 | + // Initialize blocks handler |
|
| 278 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 279 | + /* @var $block XoopsBlock */ |
|
| 301 | 280 | $block = $block_handler->create(); |
| 302 | - } |
|
| 303 | - $block_type = $system->cleanVars($_POST, 'block_type', '', 'string'); |
|
| 304 | - $block->setVar('block_type', $block_type); |
|
| 305 | - |
|
| 306 | - if (!$block->isCustom()) { |
|
| 307 | 281 | $block->setVars($_POST); |
| 308 | - $type = $block->getVar('block_type'); |
|
| 309 | - $name = $block->getVar('name'); |
|
| 310 | - // Save block options |
|
| 311 | - $options = $_POST['options']; |
|
| 312 | - if (isset($options)) { |
|
| 313 | - $options_count = count($options); |
|
| 314 | - if ($options_count > 0) { |
|
| 315 | - //Convert array values to comma-separated |
|
| 316 | - for ($i = 0; $i < $options_count; ++$i) { |
|
| 317 | - if (is_array($options[$i])) { |
|
| 318 | - $options[$i] = implode(',', $options[$i]); |
|
| 282 | + $content = isset($_POST['content_block']) ? $_POST['content_block'] : ''; |
|
| 283 | + $block->setVar('content', $content); |
|
| 284 | + $myts = \Xoops\Core\Text\Sanitizer::getInstance(); |
|
| 285 | + echo '<div id="xo-preview-dialog" title="' . $block->getVar('title', 's') |
|
| 286 | + . '">' . $block->getContent('s', $block->getVar('c_type')) . '</div>'; |
|
| 287 | + break; |
|
| 288 | + |
|
| 289 | + case 'save': |
|
| 290 | + if (!$xoops->security()->check()) { |
|
| 291 | + $xoops->redirect('admin.php?fct=blocksadmin', 3, implode('<br />', $xoops->security()->getErrors())); |
|
| 292 | + exit(); |
|
| 293 | + } |
|
| 294 | + // Initialize blocks handler |
|
| 295 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 296 | + // Get avatar id |
|
| 297 | + $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 298 | + if ($block_id > 0) { |
|
| 299 | + $block = $block_handler->get($block_id); |
|
| 300 | + } else { |
|
| 301 | + $block = $block_handler->create(); |
|
| 302 | + } |
|
| 303 | + $block_type = $system->cleanVars($_POST, 'block_type', '', 'string'); |
|
| 304 | + $block->setVar('block_type', $block_type); |
|
| 305 | + |
|
| 306 | + if (!$block->isCustom()) { |
|
| 307 | + $block->setVars($_POST); |
|
| 308 | + $type = $block->getVar('block_type'); |
|
| 309 | + $name = $block->getVar('name'); |
|
| 310 | + // Save block options |
|
| 311 | + $options = $_POST['options']; |
|
| 312 | + if (isset($options)) { |
|
| 313 | + $options_count = count($options); |
|
| 314 | + if ($options_count > 0) { |
|
| 315 | + //Convert array values to comma-separated |
|
| 316 | + for ($i = 0; $i < $options_count; ++$i) { |
|
| 317 | + if (is_array($options[$i])) { |
|
| 318 | + $options[$i] = implode(',', $options[$i]); |
|
| 319 | + } |
|
| 319 | 320 | } |
| 321 | + $options = implode('|', $options); |
|
| 322 | + $block->setVar('options', $options); |
|
| 320 | 323 | } |
| 321 | - $options = implode('|', $options); |
|
| 322 | - $block->setVar('options', $options); |
|
| 323 | 324 | } |
| 324 | - } |
|
| 325 | - } else { |
|
| 326 | - $block->setVars($_POST); |
|
| 327 | - switch ($block->getVar('c_type')) { |
|
| 325 | + } else { |
|
| 326 | + $block->setVars($_POST); |
|
| 327 | + switch ($block->getVar('c_type')) { |
|
| 328 | 328 | case 'H': |
| 329 | 329 | $name = SystemLocale::CUSTOM_BLOCK_HTML; |
| 330 | 330 | break; |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | default: |
| 338 | 338 | $name = SystemLocale::CUSTOM_BLOCK_AUTO_FORMAT; |
| 339 | 339 | break; |
| 340 | - } |
|
| 340 | + } |
|
| 341 | 341 | } |
| 342 | 342 | $block->setVar('name', $name); |
| 343 | 343 | $block->setVar('isactive', 1); |
@@ -395,18 +395,44 @@ discard block |
||
| 395 | 395 | $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::S_DATABASE_UPDATED); |
| 396 | 396 | break; |
| 397 | 397 | |
| 398 | - case 'edit': |
|
| 399 | - // Initialize blocks handler |
|
| 400 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 401 | - // Get avatar id |
|
| 402 | - $block_id = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); |
|
| 403 | - if ($block_id > 0) { |
|
| 398 | + case 'edit': |
|
| 399 | + // Initialize blocks handler |
|
| 400 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 401 | + // Get avatar id |
|
| 402 | + $block_id = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); |
|
| 403 | + if ($block_id > 0) { |
|
| 404 | + // Call Header |
|
| 405 | + $xoops->header('admin:system/system_blocks.tpl'); |
|
| 406 | + // Define Stylesheet |
|
| 407 | + $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 408 | + $xoops->theme()->addScript('media/jquery/plugins/jquery.form.js'); |
|
| 409 | + $xoops->theme()->addScript('modules/system/js/admin.js'); |
|
| 410 | + // Define Breadcrumb and tips |
|
| 411 | + $admin_page = new \Xoops\Module\Admin(); |
|
| 412 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 413 | + $admin_page->addBreadcrumbLink( |
|
| 414 | + SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 415 | + $system->adminVersion('blocksadmin', 'adminpath') |
|
| 416 | + ); |
|
| 417 | + $admin_page->addBreadcrumbLink(SystemLocale::EDIT_BLOCK); |
|
| 418 | + $admin_page->renderBreadcrumb(); |
|
| 419 | + $block = $block_handler->get($block_id); |
|
| 420 | + /* @var $form SystemBlockForm */ |
|
| 421 | + $form = $xoops->getModuleForm($block, 'block'); |
|
| 422 | + $form->getForm(); |
|
| 423 | + $form->display(); |
|
| 424 | + // Call Footer |
|
| 425 | + $xoops->footer(); |
|
| 426 | + } else { |
|
| 427 | + $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); |
|
| 428 | + } |
|
| 429 | + break; |
|
| 430 | + |
|
| 431 | + case 'delete': |
|
| 404 | 432 | // Call Header |
| 405 | 433 | $xoops->header('admin:system/system_blocks.tpl'); |
| 406 | 434 | // Define Stylesheet |
| 407 | 435 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 408 | - $xoops->theme()->addScript('media/jquery/plugins/jquery.form.js'); |
|
| 409 | - $xoops->theme()->addScript('modules/system/js/admin.js'); |
|
| 410 | 436 | // Define Breadcrumb and tips |
| 411 | 437 | $admin_page = new \Xoops\Module\Admin(); |
| 412 | 438 | $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
@@ -414,141 +440,115 @@ discard block |
||
| 414 | 440 | SystemLocale::BLOCKS_ADMINISTRATION, |
| 415 | 441 | $system->adminVersion('blocksadmin', 'adminpath') |
| 416 | 442 | ); |
| 417 | - $admin_page->addBreadcrumbLink(SystemLocale::EDIT_BLOCK); |
|
| 443 | + $admin_page->addBreadcrumbLink(SystemLocale::DELETE_BLOCK); |
|
| 418 | 444 | $admin_page->renderBreadcrumb(); |
| 419 | - $block = $block_handler->get($block_id); |
|
| 420 | - /* @var $form SystemBlockForm */ |
|
| 421 | - $form = $xoops->getModuleForm($block, 'block'); |
|
| 422 | - $form->getForm(); |
|
| 423 | - $form->display(); |
|
| 424 | - // Call Footer |
|
| 425 | - $xoops->footer(); |
|
| 426 | - } else { |
|
| 427 | - $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); |
|
| 428 | - } |
|
| 429 | - break; |
|
| 430 | - |
|
| 431 | - case 'delete': |
|
| 432 | - // Call Header |
|
| 433 | - $xoops->header('admin:system/system_blocks.tpl'); |
|
| 434 | - // Define Stylesheet |
|
| 435 | - $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 436 | - // Define Breadcrumb and tips |
|
| 437 | - $admin_page = new \Xoops\Module\Admin(); |
|
| 438 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 439 | - $admin_page->addBreadcrumbLink( |
|
| 440 | - SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 441 | - $system->adminVersion('blocksadmin', 'adminpath') |
|
| 442 | - ); |
|
| 443 | - $admin_page->addBreadcrumbLink(SystemLocale::DELETE_BLOCK); |
|
| 444 | - $admin_page->renderBreadcrumb(); |
|
| 445 | - // Initialize blocks handler |
|
| 446 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 447 | - // Get avatar id |
|
| 448 | - $block_id = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); |
|
| 449 | - if ($block_id > 0) { |
|
| 450 | - $block = $block_handler->get($block_id); |
|
| 451 | - if ($block->getVar('block_type') === XoopsBlock::BLOCK_TYPE_SYSTEM) { |
|
| 452 | - $xoops->redirect('admin.php?fct=blocksadmin', 4, SystemLocale::E_SYSTEM_BLOCKS_CANNOT_BE_DELETED); |
|
| 453 | - exit(); |
|
| 454 | - } elseif ($block->getVar('block_type') === XoopsBlock::BLOCK_TYPE_MODULE) { |
|
| 455 | - // Fix for duplicated blocks created in 2.0.9 module update |
|
| 456 | - // A module block can be deleted if there is more than 1 that |
|
| 457 | - // has the same func_num/show_func which is mostly likely |
|
| 458 | - // be the one that was duplicated in 2.0.9 |
|
| 459 | - if (1 >= $count = $block_handler->countSimilarBlocks( |
|
| 460 | - $block->getVar('mid'), |
|
| 461 | - $block->getVar('func_num'), |
|
| 462 | - $block->getVar('show_func') |
|
| 463 | - )) { |
|
| 464 | - $xoops->redirect('admin.php?fct=blocksadmin', 4, SystemLocale::E_THIS_BLOCK_CANNOT_BE_DELETED); |
|
| 445 | + // Initialize blocks handler |
|
| 446 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 447 | + // Get avatar id |
|
| 448 | + $block_id = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); |
|
| 449 | + if ($block_id > 0) { |
|
| 450 | + $block = $block_handler->get($block_id); |
|
| 451 | + if ($block->getVar('block_type') === XoopsBlock::BLOCK_TYPE_SYSTEM) { |
|
| 452 | + $xoops->redirect('admin.php?fct=blocksadmin', 4, SystemLocale::E_SYSTEM_BLOCKS_CANNOT_BE_DELETED); |
|
| 465 | 453 | exit(); |
| 454 | + } elseif ($block->getVar('block_type') === XoopsBlock::BLOCK_TYPE_MODULE) { |
|
| 455 | + // Fix for duplicated blocks created in 2.0.9 module update |
|
| 456 | + // A module block can be deleted if there is more than 1 that |
|
| 457 | + // has the same func_num/show_func which is mostly likely |
|
| 458 | + // be the one that was duplicated in 2.0.9 |
|
| 459 | + if (1 >= $count = $block_handler->countSimilarBlocks( |
|
| 460 | + $block->getVar('mid'), |
|
| 461 | + $block->getVar('func_num'), |
|
| 462 | + $block->getVar('show_func') |
|
| 463 | + )) { |
|
| 464 | + $xoops->redirect('admin.php?fct=blocksadmin', 4, SystemLocale::E_THIS_BLOCK_CANNOT_BE_DELETED); |
|
| 465 | + exit(); |
|
| 466 | + } |
|
| 466 | 467 | } |
| 468 | + // Call Header |
|
| 469 | + $xoops->header('admin:system/system_header.tpl'); |
|
| 470 | + // Display Question |
|
| 471 | + echo $xoops->confirm(array( |
|
| 472 | + 'op' => 'delete_ok', |
|
| 473 | + 'fct' => 'blocksadmin', |
|
| 474 | + 'bid' => $block->getVar('bid') |
|
| 475 | + ), 'admin.php', sprintf(SystemLocale::QF_ARE_YOU_SURE_TO_DELETE_THIS_BLOCK, $block->getVar('title'))); |
|
| 476 | + // Call Footer |
|
| 477 | + $xoops->footer(); |
|
| 467 | 478 | } |
| 468 | - // Call Header |
|
| 469 | - $xoops->header('admin:system/system_header.tpl'); |
|
| 470 | - // Display Question |
|
| 471 | - echo $xoops->confirm(array( |
|
| 472 | - 'op' => 'delete_ok', |
|
| 473 | - 'fct' => 'blocksadmin', |
|
| 474 | - 'bid' => $block->getVar('bid') |
|
| 475 | - ), 'admin.php', sprintf(SystemLocale::QF_ARE_YOU_SURE_TO_DELETE_THIS_BLOCK, $block->getVar('title'))); |
|
| 476 | - // Call Footer |
|
| 477 | - $xoops->footer(); |
|
| 478 | - } |
|
| 479 | - break; |
|
| 479 | + break; |
|
| 480 | 480 | |
| 481 | - case 'delete_ok': |
|
| 482 | - if (!$xoops->security()->check()) { |
|
| 483 | - $xoops->redirect('admin.php?fct=blocksadmin', 3, implode('<br />', $xoops->security()->getErrors())); |
|
| 484 | - exit(); |
|
| 485 | - } |
|
| 486 | - // Initialize blocks handler |
|
| 487 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 488 | - // Get avatar id |
|
| 489 | - $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 490 | - if ($block_id > 0) { |
|
| 491 | - $block = $block_handler->get($block_id); |
|
| 492 | - if ($block_handler->deleteBlock($block)) { |
|
| 493 | - // Delete Group link |
|
| 494 | - $blockmodulelink_handler = $xoops->getHandlerBlockModuleLink(); |
|
| 495 | - $blockmodulelink = |
|
| 496 | - $blockmodulelink_handler->getObjects(new CriteriaCompo(new Criteria('block_id', $block_id))); |
|
| 497 | - foreach ($blockmodulelink as $link) { |
|
| 498 | - $blockmodulelink_handler->delete($link, true); |
|
| 499 | - } |
|
| 500 | - // Delete Group permission |
|
| 501 | - $groupperm_handler = $xoops->getHandlerGroupPermission(); |
|
| 502 | - $criteria = new CriteriaCompo(new Criteria('gperm_name', 'block_read')); |
|
| 503 | - $criteria->add(new Criteria('gperm_itemid', $block_id)); |
|
| 504 | - $groupperm = $groupperm_handler->getObjects($criteria); |
|
| 505 | - /* @var $perm XoopsGroupPerm */ |
|
| 506 | - foreach ($groupperm as $perm) { |
|
| 507 | - $groupperm_handler->delete($perm, true); |
|
| 508 | - } |
|
| 509 | - // Delete template |
|
| 510 | - if ($block->getVar('template') != '') { |
|
| 511 | - $tplfile_handler = $xoops->getHandlerTplFile(); |
|
| 512 | - $btemplate = $tplfile_handler->find($xoops->getConfig('template_set'), 'block', $block_id); |
|
| 513 | - if (count($btemplate) > 0) { |
|
| 514 | - $tplfile_handler->deleteTpl($btemplate[0]); |
|
| 481 | + case 'delete_ok': |
|
| 482 | + if (!$xoops->security()->check()) { |
|
| 483 | + $xoops->redirect('admin.php?fct=blocksadmin', 3, implode('<br />', $xoops->security()->getErrors())); |
|
| 484 | + exit(); |
|
| 485 | + } |
|
| 486 | + // Initialize blocks handler |
|
| 487 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 488 | + // Get avatar id |
|
| 489 | + $block_id = $system->cleanVars($_POST, 'bid', 0, 'int'); |
|
| 490 | + if ($block_id > 0) { |
|
| 491 | + $block = $block_handler->get($block_id); |
|
| 492 | + if ($block_handler->deleteBlock($block)) { |
|
| 493 | + // Delete Group link |
|
| 494 | + $blockmodulelink_handler = $xoops->getHandlerBlockModuleLink(); |
|
| 495 | + $blockmodulelink = |
|
| 496 | + $blockmodulelink_handler->getObjects(new CriteriaCompo(new Criteria('block_id', $block_id))); |
|
| 497 | + foreach ($blockmodulelink as $link) { |
|
| 498 | + $blockmodulelink_handler->delete($link, true); |
|
| 499 | + } |
|
| 500 | + // Delete Group permission |
|
| 501 | + $groupperm_handler = $xoops->getHandlerGroupPermission(); |
|
| 502 | + $criteria = new CriteriaCompo(new Criteria('gperm_name', 'block_read')); |
|
| 503 | + $criteria->add(new Criteria('gperm_itemid', $block_id)); |
|
| 504 | + $groupperm = $groupperm_handler->getObjects($criteria); |
|
| 505 | + /* @var $perm XoopsGroupPerm */ |
|
| 506 | + foreach ($groupperm as $perm) { |
|
| 507 | + $groupperm_handler->delete($perm, true); |
|
| 508 | + } |
|
| 509 | + // Delete template |
|
| 510 | + if ($block->getVar('template') != '') { |
|
| 511 | + $tplfile_handler = $xoops->getHandlerTplFile(); |
|
| 512 | + $btemplate = $tplfile_handler->find($xoops->getConfig('template_set'), 'block', $block_id); |
|
| 513 | + if (count($btemplate) > 0) { |
|
| 514 | + $tplfile_handler->deleteTpl($btemplate[0]); |
|
| 515 | + } |
|
| 515 | 516 | } |
| 517 | + $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::S_DATABASE_UPDATED); |
|
| 516 | 518 | } |
| 517 | - $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::S_DATABASE_UPDATED); |
|
| 519 | + } else { |
|
| 520 | + $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); |
|
| 518 | 521 | } |
| 519 | - } else { |
|
| 520 | - $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); |
|
| 521 | - } |
|
| 522 | - break; |
|
| 523 | - |
|
| 524 | - case 'clone': |
|
| 525 | - // Initialize blocks handler |
|
| 526 | - $block_handler = $xoops->getHandlerBlock(); |
|
| 527 | - // Get avatar id |
|
| 528 | - $block_id = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); |
|
| 529 | - if ($block_id > 0) { |
|
| 530 | - // Call Header |
|
| 531 | - $xoops->header('admin:system/system_blocks.tpl'); |
|
| 532 | - // Define Stylesheet |
|
| 533 | - $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 534 | - // Define Breadcrumb and tips |
|
| 535 | - $system_breadcrumb = new \Xoops\Module\Admin(); |
|
| 536 | - $system_breadcrumb->addBreadcrumbLink( |
|
| 537 | - SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 538 | - system_adminVersion('blocksadmin', 'adminpath') |
|
| 539 | - ); |
|
| 540 | - $system_breadcrumb->addBreadcrumbLink(SystemLocale::CLONE_BLOCK); |
|
| 541 | - $system_breadcrumb->renderBreadcrumb(); |
|
| 542 | - |
|
| 543 | - $block = $block_handler->get($block_id); |
|
| 544 | - /* @var $form SystemBlockForm */ |
|
| 545 | - $form = $xoops->getModuleForm($block, 'block'); |
|
| 546 | - $form->getForm('clone'); |
|
| 547 | - $form->display(); |
|
| 548 | - // Call Footer |
|
| 549 | - $xoops->footer(); |
|
| 550 | - } else { |
|
| 551 | - $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); |
|
| 552 | - } |
|
| 553 | - break; |
|
| 522 | + break; |
|
| 523 | + |
|
| 524 | + case 'clone': |
|
| 525 | + // Initialize blocks handler |
|
| 526 | + $block_handler = $xoops->getHandlerBlock(); |
|
| 527 | + // Get avatar id |
|
| 528 | + $block_id = $system->cleanVars($_REQUEST, 'bid', 0, 'int'); |
|
| 529 | + if ($block_id > 0) { |
|
| 530 | + // Call Header |
|
| 531 | + $xoops->header('admin:system/system_blocks.tpl'); |
|
| 532 | + // Define Stylesheet |
|
| 533 | + $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
|
| 534 | + // Define Breadcrumb and tips |
|
| 535 | + $system_breadcrumb = new \Xoops\Module\Admin(); |
|
| 536 | + $system_breadcrumb->addBreadcrumbLink( |
|
| 537 | + SystemLocale::BLOCKS_ADMINISTRATION, |
|
| 538 | + system_adminVersion('blocksadmin', 'adminpath') |
|
| 539 | + ); |
|
| 540 | + $system_breadcrumb->addBreadcrumbLink(SystemLocale::CLONE_BLOCK); |
|
| 541 | + $system_breadcrumb->renderBreadcrumb(); |
|
| 542 | + |
|
| 543 | + $block = $block_handler->get($block_id); |
|
| 544 | + /* @var $form SystemBlockForm */ |
|
| 545 | + $form = $xoops->getModuleForm($block, 'block'); |
|
| 546 | + $form->getForm('clone'); |
|
| 547 | + $form->display(); |
|
| 548 | + // Call Footer |
|
| 549 | + $xoops->footer(); |
|
| 550 | + } else { |
|
| 551 | + $xoops->redirect('admin.php?fct=blocksadmin', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); |
|
| 552 | + } |
|
| 553 | + break; |
|
| 554 | 554 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $xoops->theme()->addScript('modules/system/js/blocks.js'); |
| 82 | 82 | // Define Breadcrumb and tips |
| 83 | 83 | $admin_page = new \Xoops\Module\Admin(); |
| 84 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 84 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 85 | 85 | $admin_page->addBreadcrumbLink( |
| 86 | 86 | SystemLocale::BLOCKS_ADMINISTRATION, |
| 87 | 87 | $system->adminVersion('blocksadmin', 'adminpath') |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | /* Get blocks */ |
| 165 | 165 | $selvis = ($selvis == -1) ? null : $selvis; |
| 166 | 166 | $selmod = ($selmod == -2) ? null : $selmod; |
| 167 | - $order_block = (isset($selvis) ? "" : "b.visible DESC, ") . "b.side,b.weight,b.bid"; |
|
| 167 | + $order_block = (isset($selvis) ? "" : "b.visible DESC, ")."b.side,b.weight,b.bid"; |
|
| 168 | 168 | |
| 169 | 169 | if ($selgrp == 0) { |
| 170 | 170 | // get blocks that are not assigned to any groups |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $xoops->theme()->addScript('modules/system/js/blocks.js'); |
| 204 | 204 | // Define Breadcrumb and tips |
| 205 | 205 | $admin_page = new \Xoops\Module\Admin(); |
| 206 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 206 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 207 | 207 | $admin_page->addBreadcrumbLink( |
| 208 | 208 | SystemLocale::BLOCKS_ADMINISTRATION, |
| 209 | 209 | $system->adminVersion('blocksadmin', 'adminpath') |
@@ -282,8 +282,8 @@ discard block |
||
| 282 | 282 | $content = isset($_POST['content_block']) ? $_POST['content_block'] : ''; |
| 283 | 283 | $block->setVar('content', $content); |
| 284 | 284 | $myts = \Xoops\Core\Text\Sanitizer::getInstance(); |
| 285 | - echo '<div id="xo-preview-dialog" title="' . $block->getVar('title', 's') |
|
| 286 | - . '">' . $block->getContent('s', $block->getVar('c_type')) . '</div>'; |
|
| 285 | + echo '<div id="xo-preview-dialog" title="'.$block->getVar('title', 's') |
|
| 286 | + . '">'.$block->getContent('s', $block->getVar('c_type')).'</div>'; |
|
| 287 | 287 | break; |
| 288 | 288 | |
| 289 | 289 | case 'save': |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $xoops->theme()->addScript('modules/system/js/admin.js'); |
| 410 | 410 | // Define Breadcrumb and tips |
| 411 | 411 | $admin_page = new \Xoops\Module\Admin(); |
| 412 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 412 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 413 | 413 | $admin_page->addBreadcrumbLink( |
| 414 | 414 | SystemLocale::BLOCKS_ADMINISTRATION, |
| 415 | 415 | $system->adminVersion('blocksadmin', 'adminpath') |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $xoops->theme()->addStylesheet('modules/system/css/admin.css'); |
| 436 | 436 | // Define Breadcrumb and tips |
| 437 | 437 | $admin_page = new \Xoops\Module\Admin(); |
| 438 | - $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true); |
|
| 438 | + $admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url').'/admin.php', true); |
|
| 439 | 439 | $admin_page->addBreadcrumbLink( |
| 440 | 440 | SystemLocale::BLOCKS_ADMINISTRATION, |
| 441 | 441 | $system->adminVersion('blocksadmin', 'adminpath') |