Improve AngularJS module reference check in websiteFunctions.js

- Enhanced module check to first try window.app before falling back to angular.module
- Ensures createWordpress controller can register properly
- Fixes [$controller:ctrlreg] error for createWordpress controller
- Applied to all websiteFunctions.js file locations
This commit is contained in:
master3395
2026-01-22 19:28:05 +01:00
parent fa8980cbe6
commit 29e4ddd422
3 changed files with 12631 additions and 1165 deletions

View File

@@ -5,7 +5,14 @@
// Ensure app is available (get existing module or create reference)
// This ensures compatibility with the global app variable from system-status.js
if (typeof app === 'undefined') {
app = angular.module('CyberCP');
// First try to get window.app (set by system-status.js)
if (typeof window !== 'undefined' && typeof window.app !== 'undefined') {
app = window.app;
} else {
// If window.app doesn't exist, get the existing CyberCP module
// This works because system-status.js should have already created it
app = angular.module('CyberCP');
}
}
// Global function for deleting staging sites