Changeset 5270
- Timestamp:
- 11/19/07 08:22:13 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/page.modules.php
r4993 r5270 393 393 foreach ($moduleaction as $module => $action) { 394 394 $text = false; 395 $skipaction = false; 395 396 396 397 // make sure name is set. This is a problem for broken modules … … 403 404 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 404 405 if (is_array($errors = module_checkdepends($modules_online[$module]))) { 406 $skipaction = true; 405 407 $errorstext[] = sprintf(_("%s cannot be upgraded: %s Please correct this error first."), 406 408 $modules[$module]['name'], … … 408 410 } else { 409 411 $actionstext[] = sprintf(_("%s %s will be upgraded to online version %s"), $modules[$module]['name'], $modules[$module]['dbversion'], $modules_online[$module]['version']); 410 411 412 } 412 413 } … … 415 416 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 416 417 if (is_array($errors = module_checkdepends($modules_online[$module]))) { 418 $skipaction = true; 417 419 $errorstext[] = sprintf(_("%s cannot be installed: %s Please correct this error first."), 418 420 $modules[$module]['name'], … … 426 428 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 427 429 if (is_array($errors = module_checkdepends($modules[$module]))) { 430 $skipaction = true; 428 431 $errorstext[] = sprintf((($modules[$module]['status'] == MODULE_STATUS_NEEDUPGRADE) ? _("%s cannot be upgraded: %s Please correct this error first.") : _("%s cannot be installed: %s Please correct this error first.") ), 429 432 $modules[$module]['name'], … … 440 443 case 'enable': 441 444 if (is_array($errors = module_checkdepends($modules[$module]))) { 445 $skipaction = true; 442 446 $errorstext[] = sprintf(_("%s cannot be enabled: %s Please correct this error first."), 443 447 $modules[$module]['name'], … … 449 453 case 'disable': 450 454 if (is_array($errors = module_reversedepends($modules[$module]))) { 455 $skipaction = true; 451 456 $errorstext[] = sprintf(_("%s cannot be disabled because the following modules depend on it: %s Please correct this error first."), 452 457 $modules[$module]['name'], … … 459 464 if (!EXTERNAL_PACKAGE_MANAGEMENT) { 460 465 if (is_array($errors = module_reversedepends($modules[$module]))) { 466 $skipaction = true; 461 467 $errorstext[] = sprintf(_("%s cannot be uninstalled because the following modules depend on it: %s Please correct this error first."), 462 468 $modules[$module]['name'], … … 468 474 break; 469 475 } 470 //echo "\t<input type=\"hidden\" name=\"moduleaction[".$module."]\" value=\"".$action."\" />\n"; 471 echo "\t<script type=\"text/javascript\"> moduleActions['".$module."'] = '".$action."'; </script>\n"; 472 } 473 476 477 // If error above we skip this action so we can proceed with the others 478 // 479 if (!$skipaction) { //TODO 480 echo "\t<script type=\"text/javascript\"> moduleActions['".$module."'] = '".$action."'; </script>\n"; 481 } 482 } 483 484 // Write out the erros, if there are additional actions that can be accomplished list those next with the choice to 485 // process which will ignore the ones with errors but process the rest. 486 // 474 487 if (count($errorstext) > 0) { 475 488 echo "<h4>"._("Errors with selection:")."</h4>\n"; … … 479 492 } 480 493 echo "</ul>"; 481 482 } else if (count($actionstext) > 0) { 483 echo "<h4>"._("Please confirm the following actions:")."</h4>\n"; 494 } 495 if (count($actionstext) > 0) { 496 if (count($errorstext) > 0) { 497 echo "<h4>"._("You may confirm the remaining selection (errors will be skipped):")."</h4>\n"; 498 } else { 499 echo "<h4>"._("Please confirm the following actions:")."</h4>\n"; 500 } 484 501 echo "<ul>\n"; 485 502 foreach ($actionstext as $text) { … … 487 504 } 488 505 echo "</ul>"; 489 490 //echo "\t<input type=\"submit\" value=\"Confirm\" name=\"process\" />";491 506 echo "\t<input type=\"button\" value=\"Confirm\" name=\"process\" onclick=\"process_module_actions(moduleActions);\" />"; 492 507 } else { … … 495 510 } 496 511 echo "\t<input type=\"button\" value=\""._("Cancel")."\" onclick=\"location.href = 'config.php?display=modules&type=tool&online=".($_REQUEST['online']?1:0)."';\" />"; 497 498 512 echo "</form>"; 499 513
