Журнал изменений
Problem:
- Parse error: "new" ist ein reserviertes PHP-Keyword
- Funktion new() konnte nicht deklariert werden Lösung:
- Funktion new() → newBlock()
- Switch case angepasst: case 'new': newBlock();
- Navigation bleibt: name=blocks&op=new (nur interne Funktion renamed)
Änderung:
- Navigation: name=blocks&op=show → name=blocks (use default case) Alle Redirects waren bereits korrekt mit explizitem &op=show. Keine weiteren Änderungen nötig - Datei war bereits sauber strukturiert.
Änderungen:
- Funktion navi() → adminsNavi() (consistent with other modules)
- Navigation: name=admins&op=show → name=admins (use default case)
- Formular: Redundant Hidden-Field "name" removed (in Action-URL)
- Funktion getAdminInfo() → adm_info() (konsistent)
- Redirects: Explicit &op=show added for clarity All function calls updated:
- admins() Zeile 18
- add() Zeile 54
- info() Zeile 167
Probleme behoben:
- admins.php: Feldname 'name' collided with Modul-Parameter 'name=admins'
- POST-Feld von 'name' in 'adminname' renamed
- Hidden fields 'name=admins' und 'op=save' added
- Neue Admins could not be created (only editing worked)
- lang.php: Funktion file() collided with PHP Built-in Funktion
- Funktion file() in edit() renamed
- Switch-case entsprechend angepasst
Problem:
- Admin-Panel wurde doppelt angezeigt (in Sidebar und Hauptbereich)
- Jede Modul-Navi-Funktion rief panel() auf Lösung:
- Removed all panel() calls from navigation functions (26 modules)
- panel() wird jetzt nur noch vom Routing in admin.php aufgerufen
- Panel erscheint nur auf Admin-Startseite (admin.php without Parameter) Geänderte Module: admins, blocks, categories, changelog, comments, config, database, editor, favorites, fields, groups, lang, messages, modules, newsletter, privat, ratings, referers, replace, rss, security, sitemap, stat, template, uploads, users
- panel() was calling template functions before head() loaded them
- Added head() at start of panel()
- Added foot() at end of panel()
- Fixes: Call to undefined function setTemplateWarning()
- Updated panel() function to use auto-discovery
- Added panel() call in routing logic when no module selected
- Removed references to deleted admin/links directory
- Now admin.php correctly displays module grid
System Architecture Modernization
1. Auto-Discovery System (admin.php)
✓ Replaced manual links.admin.php with auto-discovery ✓ Scans admin/modules/ directory dynamically ✓ New routing: ?name={module}&op={action} ✓ Loads only requested module (vs loading ALL modules) ✓ Added getAdminModuleMeta() for module metadata
2. Function Name Simplification (All 16 Modules)
✓ Removed redundant module prefixes from all functions ✓ Pattern: adminsShow() → admins(), adminsAdd() → add() ✓ Main function named after module: admins(), blocks(), etc. ✓ Switch statements use default: case for main function ✓ Navi functions keep full name: adminsNavi(), blocksNavi()
3. File Changes
✓ configure.php → config.php (renamed) ✓ admin/links/links.admin.php (deleted - no longer needed!)
Modules Refactored (16 total):
- admins: admins(), add(), save(), info()
- blocks: blocks(), new(), add(), edit(), file(), fix()
- categories: categories(), add(), edit(), save(), fix()
- changelog: changelog(), conf(), confsave(), info()
- comments: comments(), edit(), editsave(), conf()
- config: config(), save(), info()
- database: database(), dump(), info()
- editor: editor(), header(), rewrite(), htaccess(), robots()
- favorites: favorites(), conf(), confsave()
- fields: fields(), saveconf(), info()
- groups: groups(), add(), save(), points()
- lang: lang(), file(), save(), conf(), confsave()
- messages: messages(), add(), save(), delete()
- modules: modules(), edit(), info()
- newsletter: newsletter(), add(), save()
- privat: privat(), conf(), confsave()
Benefits:
✅ Cleaner code - no redundant prefixes ✅ Faster - loads only needed module ✅ Auto-discovery - new modules appear automatically ✅ RESTful URLs - consistent name/op pattern ✅ Maintainable - single source of truth in getAdminModuleMeta() ✅ No manual menu file to maintain