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
Complete language system refactoring across the entire SLAED CMS: Language File Standardization:
Renamed all language files from lang-{language}.php to {iso}.php
- lang-english.php → en.php
- lang-german.php → de.php
- lang-french.php → fr.php
- lang-polish.php → pl.php
- lang-russian.php → ru.php
- lang-ukrainian.php → uk.php
- Applied to admin/language/ and language/ directories
- Converted all language files to single quotes (performance optimization)
- Proper escaping of apostrophes in translations
Configuration Updates:
- Migrated from config_lang.php to config/lang.php
- Updated all language loading references across core files
- Modified language selection blocks and user preferences
Core System Changes:
- Updated core/core.php language loading mechanism
- Modified admin/admin.php for new language structure
- Updated all admin modules to use new language constants
- Refactored block-languages.php for ISO code support
- Updated user preference handling in core/user.php
Module Updates:
- account, contact, forum, voting, whois modules adapted
- All modules now use standardized language system
- Improved language switching functionality
Benefits:
- ISO 639-1 compliant naming convention
- Better internationalization standard compliance
- Cleaner, more maintainable codebase
- Performance improvements through single quotes
Major changes:
- PDO-only architecture (removed mysqli support)
- All SQL queries converted to prepared statements with named placeholders
- Single quotes throughout for performance optimization
- Language files standardized (lang-english.php → en.php)
- PHP 8.1 version check enforced
- sprintf format specifiers fixed (%1$s not %1\$s)
Dead code elimination:
- Removed buildSelect() function (unused)
- Removed 6 unused dropdown variable assignments
Code cleanup:
- Extracted checkWritableConfig() helper to reduce duplication
- Improved maintainability and DRY compliance
Security improvements:
- PDO parameter binding prevents SQL injection
- Automatic type handling and escaping
Applied modern file validation pattern to language files, replacing legacy end_chmod() permission checks with checkConfigFile() helper. Changes in admin/modules/lang.php:
- Replace end_chmod() with checkConfigFile() for language file validation
- Remove redundant opendir() error handling (relying on checkConfigFile)
- Consistent with config file modernization approach
Updated .
- Renamed section 2.10 to "System File Validation and Config Modernization"
- Added language file example demonstrating checkConfigFile() usage
- Clarified that pattern applies to all editable system files, not just configs
This change extends the modern permission validation pattern established for config files to language files and any other writable system files, improving code consistency and maintainability.