Журнал изменений
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
Converted all 13 remaining admin modules to RESTful URL structure: Core modules:
- changelog.php: name=changelog&op={show|conf|saveconf|info}
- comments.php: name=comments&op={show|edit|editsave|conf|save}
- config.php: name=config&op={show|save|info}
- database.php: name=database&op={show|dump|del|info}
- editor.php: name=editor&op={function|header|rewrite|htaccess|robots}
Content modules:
- messages.php: name=messages&op={show|add|save|status|delete}
- newsletter.php: name=newsletter&op={show|add|save|delete}
System modules:
- favorites.php: name=favorites&op={show|conf|confsave}
- fields.php: name=fields&op={show|saveconf}
- groups.php: name=groups&op={show|add|save|del|points}
- lang.php: name=lang&op={main|file|save|conf|confsave}
- modules.php: name=modules&op={show|status|edit|editsave|add}
- privat.php: name=privat&op={show|conf|confsave}
All modules now follow consistent pattern: ✓ URL: ?name={module}&op={action} ✓ Simplified switch cases (show vs moduleShow) ✓ Updated navigation, forms, and redirects ✓ Consistent with admins, blocks, categories
Converted 3 admin modules + menu to RESTful URL structure:
- admin/links/links.admin.php: Updated all menu links
- admin/modules/admins.php: name=admins&op={action}
- admin/modules/blocks.php: name=blocks&op={action}
- admin/modules/categories.php: name=categories&op={action}
New URL pattern: ?name={module}&op={action}
- Separates resource (module) from action (operation)
- Simplified switch cases: 'show', 'add', 'save' vs 'moduleShow', 'moduleAdd'
- Updated all forms, redirects, and navigation