commit f4b39bea26d1227249e05c6c91a15b73e0e77641 Author: Anton Afanasyeu Date: Tue Jun 23 12:29:28 2026 +0200 initial diff --git a/README.md b/README.md new file mode 100644 index 0000000..08dfec9 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# ac-platform-php + +Shared Database, bootstrap, session, footer. + +Remote: `git://f0xx.org/ac/ac-platform-php` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5799545 --- /dev/null +++ b/composer.json @@ -0,0 +1,21 @@ +{ + "name": "androidcast/platform-php", + "description": "AndroidCast shared PHP: Database, bootstrap, session", + "type": "library", + "require": { + "php": ">=8.1", + "androidcast/platform-db": "dev-next" + }, + "repositories": [ + { + "type": "vcs", + "url": "git://f0xx.org/ac/ac-platform-db" + } + ], + "autoload": { + "classmap": [ + "src/", + "platform/" + ] + } +} diff --git a/platform/README.md b/platform/README.md new file mode 100644 index 0000000..8ee897d --- /dev/null +++ b/platform/README.md @@ -0,0 +1,57 @@ +# Shared platform pieces + +## Footer (`footer.php`) + +Flexible site-wide footer for hub, crashes, tickets, graphs, and builder consoles. + +**Configure:** edit `footer.config.php` (copy from `footer.config.example.php`). + +### Layout + +``` +┌─────────────────────────────────────────────┐ +│ top (optional, full width) │ +├──────────────────────────┬──────────────────┤ +│ left (optional / auto) │ right (optional) │ +├──────────────────────────┴──────────────────┤ +│ bottom (optional, full width) │ +└─────────────────────────────────────────────┘ +``` + +When `left` is null, the left column is built from `copyright_symbol`, `holder`, and year settings. + +| Key | Purpose | +|-----|---------| +| `top` | Full-width line above main row (`null` = hidden) | +| `left` | Main left text; `null` = auto copyright line | +| `right` | Main right text (e.g. build id, links) | +| `bottom` | Full-width line below main row | +| `holder` | Copyright name (default left) | +| `copyright_symbol` | `©` (U+00A9) or empty | +| `show_year` | Append year / range on default left | +| `year` | Fixed end year, or `null` for current | +| `year_start` | Start year (integer). With `year_through_current` → `2026 - current`; else range `2026–{end}` | +| `year_through_current` | If true with `year_start`, year label is `{start} - current` (not a rolling end year) | +| `use_i18n` | `data-i18n` on auto-built left column | +| `footer_class` | Extra CSS class (always adds `platform-footer`) | + +**Per-page override** when rendering: + +```php +platform_render_footer([ + 'right' => 'OTA: staging', + 'bottom' => 'Internal only', +]); +``` + +**In PHP views:** `` (loaded via each app `bootstrap.php`). + +**Hub:** `examples/app_hub/index.php` (landing nginx runs it through PHP-FPM). + +**Static HTML export:** + +```bash +php examples/platform/scripts/render-footer-html.php +``` + +**Gitea** (`/git/`) uses the upstream Gitea UI; this footer does not apply there unless you customize Gitea templates separately. diff --git a/platform/footer.config.example.php b/platform/footer.config.example.php new file mode 100644 index 0000000..0d3209f --- /dev/null +++ b/platform/footer.config.example.php @@ -0,0 +1,41 @@ + null, + 'left' => null, + 'right' => null, + 'bottom' => null, + + // --- Default left column when `left` is null --- + // Use holder_name + holder_url for a safe link (holder HTML is escaped if used alone). + 'holder_name' => 'Anton Afanaasyeu', + 'holder_url' => 'https://f0xx.org', + 'holder' => null, + 'copyright_symbol' => "\u{00A9}", + 'show_year' => false, + // null = current calendar year at render time (end of range). + 'year' => null, + // Integer start year. With year_through_current: "2026 - current" (literal suffix). + // Without it: "2026–2027" range (en dash) or lone "2026" when start equals end year. + 'year_start' => 2026, + 'year_through_current' => true, + + // CSS class on