Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 137e13ef81 | |||
| fdff95f140 |
@@ -1,63 +0,0 @@
|
|||||||
# MokoOnyx
|
|
||||||
|
|
||||||
Joomla site template — successor to MokoCassiopeia. Base template for all WaaS client deployments.
|
|
||||||
|
|
||||||
## Quick Reference
|
|
||||||
|
|
||||||
| Field | Value |
|
|
||||||
|---|---|
|
|
||||||
| **Element** | `tpl_mokoonyx` |
|
|
||||||
| **Type** | Joomla site template |
|
|
||||||
| **Language** | PHP 8.1+ / CSS / JS |
|
|
||||||
| **Branch** | develop on `dev`, merge to `main` (protected) |
|
|
||||||
| **Wiki** | [MokoOnyx Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/wiki) |
|
|
||||||
|
|
||||||
## Commands
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make build # Build template ZIP
|
|
||||||
make lint # Run linters
|
|
||||||
make validate # Validate structure
|
|
||||||
make release # Full release pipeline
|
|
||||||
make minify # Minify CSS/JS assets
|
|
||||||
make clean # Clean build artifacts
|
|
||||||
composer install # Install PHP dependencies
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
Joomla **site template** — the base layer that client theme packages override:
|
|
||||||
|
|
||||||
- `src/templateDetails.xml` — template manifest
|
|
||||||
- `src/index.php` — main template entry point
|
|
||||||
- `src/error.php` — error page
|
|
||||||
- `src/offline.php` — maintenance page
|
|
||||||
- `src/component.php` — print/component-only layout
|
|
||||||
- `src/html/` — template overrides for core components
|
|
||||||
- `src/media/css/` — base stylesheets
|
|
||||||
- `src/media/js/` — base scripts
|
|
||||||
- `src/media/images/` — template images
|
|
||||||
- `src/language/` — translations
|
|
||||||
|
|
||||||
### Client Theme Packages
|
|
||||||
|
|
||||||
Client repos (`client-clarksvillefurs`, `client-optainfunding`, etc.) install `type="file"` packages that overlay client-specific CSS, images, and JS into the MokoOnyx media directory. MokoOnyx provides the structure; client themes customize the appearance.
|
|
||||||
|
|
||||||
### Minification
|
|
||||||
|
|
||||||
`MokoMinifyHelper` handles runtime CSS/JS minification in Joomla. Build-time minification via `make minify`. Never commit `*.min.css`/`*.min.js` — they're generated.
|
|
||||||
|
|
||||||
## Rules
|
|
||||||
|
|
||||||
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js`
|
|
||||||
- **Attribution**: `Authored-by: Moko Consulting`
|
|
||||||
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
|
||||||
- **Minification**: handled at build time (CI) and runtime (MokoMinifyHelper)
|
|
||||||
- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files
|
|
||||||
- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)
|
|
||||||
|
|
||||||
## Coding Standards
|
|
||||||
|
|
||||||
- PHP 8.1+ minimum
|
|
||||||
- SPDX license headers on all PHP files
|
|
||||||
- `defined('_JEXEC') or die;` on all PHP files
|
|
||||||
@@ -1,251 +0,0 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Gitea.Workflow
|
|
||||||
# INGROUP: moko-platform.Automation
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /.gitea/workflows/branch-protection.yml
|
|
||||||
# BRIEF: Apply standardised branch protection rules to all governed repositories
|
|
||||||
#
|
|
||||||
# +========================================================================+
|
|
||||||
# | BRANCH PROTECTION SETUP |
|
|
||||||
# +========================================================================+
|
|
||||||
# | |
|
|
||||||
# | Applies protection rules for: main, dev, rc, beta, alpha |
|
|
||||||
# | |
|
|
||||||
# | main — Require PR, block rejected reviews, no force push |
|
|
||||||
# | dev — Allow push, no force push, no delete |
|
|
||||||
# | rc — Allow push, no force push, no delete |
|
|
||||||
# | beta — Allow push, no force push, no delete |
|
|
||||||
# | alpha — Allow push, no force push, no delete |
|
|
||||||
# | |
|
|
||||||
# | jmiller has override authority on all branches. |
|
|
||||||
# | |
|
|
||||||
# +========================================================================+
|
|
||||||
|
|
||||||
name: Branch Protection Setup
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 2 * * 1' # Weekly Monday 02:00 UTC
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
dry_run:
|
|
||||||
description: 'Preview mode (no changes)'
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
repos:
|
|
||||||
description: 'Comma-separated repo names (empty = all governed repos)'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ''
|
|
||||||
|
|
||||||
env:
|
|
||||||
GITEA_URL: https://git.mokoconsulting.tech
|
|
||||||
GITEA_ORG: MokoConsulting
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
protect:
|
|
||||||
name: Apply Branch Protection Rules
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Determine target repos
|
|
||||||
id: repos
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
|
||||||
run: |
|
|
||||||
API="${GITEA_URL}/api/v1"
|
|
||||||
|
|
||||||
# Platform/standards/infra repos to exclude
|
|
||||||
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private MokoStandards moko-platform MokoTesting"
|
|
||||||
EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate"
|
|
||||||
|
|
||||||
if [ -n "${{ inputs.repos }}" ]; then
|
|
||||||
# User-specified repos
|
|
||||||
REPOS=$(echo "${{ inputs.repos }}" | tr ',' ' ')
|
|
||||||
else
|
|
||||||
# Fetch all org repos
|
|
||||||
PAGE=1
|
|
||||||
REPOS=""
|
|
||||||
while true; do
|
|
||||||
BATCH=$(curl -sS \
|
|
||||||
-H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
"${API}/orgs/${GITEA_ORG}/repos?page=${PAGE}&limit=50" \
|
|
||||||
| jq -r '.[].name // empty')
|
|
||||||
[ -z "$BATCH" ] && break
|
|
||||||
REPOS="$REPOS $BATCH"
|
|
||||||
PAGE=$((PAGE + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
# Filter out excluded repos
|
|
||||||
FILTERED=""
|
|
||||||
for REPO in $REPOS; do
|
|
||||||
SKIP=false
|
|
||||||
for EX in $EXCLUDE; do
|
|
||||||
if [ "$REPO" = "$EX" ]; then
|
|
||||||
SKIP=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ "$SKIP" = "false" ]; then
|
|
||||||
FILTERED="$FILTERED $REPO"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
REPOS="$FILTERED"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "repos=$REPOS" >> "$GITHUB_OUTPUT"
|
|
||||||
COUNT=$(echo "$REPOS" | wc -w)
|
|
||||||
echo "📋 Target repos (${COUNT}): $REPOS"
|
|
||||||
|
|
||||||
- name: Apply protection rules
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
|
||||||
DRY_RUN: ${{ inputs.dry_run || 'false' }}
|
|
||||||
run: |
|
|
||||||
API="${GITEA_URL}/api/v1"
|
|
||||||
REPOS="${{ steps.repos.outputs.repos }}"
|
|
||||||
|
|
||||||
SUCCESS=0
|
|
||||||
FAILED=0
|
|
||||||
SKIPPED=0
|
|
||||||
|
|
||||||
# ── Rule definitions ──────────────────────────────────────
|
|
||||||
# Only the CI bot (jmiller token) can push directly.
|
|
||||||
# All human contributors must use PRs.
|
|
||||||
# Force push disabled on all branches.
|
|
||||||
|
|
||||||
RULE_MAIN='{
|
|
||||||
"rule_name": "main",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"dismiss_stale_approvals": true,
|
|
||||||
"block_on_rejected_reviews": true,
|
|
||||||
"block_on_outdated_branch": false,
|
|
||||||
"priority": 1
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_DEV='{
|
|
||||||
"rule_name": "dev",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 2
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_RC='{
|
|
||||||
"rule_name": "rc",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 3
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_BETA='{
|
|
||||||
"rule_name": "beta",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 4
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULE_ALPHA='{
|
|
||||||
"rule_name": "alpha",
|
|
||||||
"enable_push": true,
|
|
||||||
"enable_push_whitelist": true,
|
|
||||||
"push_whitelist_usernames": ["jmiller"],
|
|
||||||
"enable_force_push": false,
|
|
||||||
"enable_force_push_allowlist": false,
|
|
||||||
"force_push_allowlist_usernames": [],
|
|
||||||
"enable_merge_whitelist": false,
|
|
||||||
"required_approvals": 0,
|
|
||||||
"block_on_rejected_reviews": false,
|
|
||||||
"priority": 5
|
|
||||||
}'
|
|
||||||
|
|
||||||
RULES=("$RULE_MAIN" "$RULE_DEV" "$RULE_RC" "$RULE_BETA" "$RULE_ALPHA")
|
|
||||||
RULE_NAMES=("main" "dev" "rc" "beta" "alpha")
|
|
||||||
|
|
||||||
# ── Apply rules to each repo ──────────────────────────────
|
|
||||||
for REPO in $REPOS; do
|
|
||||||
echo ""
|
|
||||||
echo "═══ ${REPO} ═══"
|
|
||||||
|
|
||||||
for i in "${!RULES[@]}"; do
|
|
||||||
RULE="${RULES[$i]}"
|
|
||||||
NAME="${RULE_NAMES[$i]}"
|
|
||||||
|
|
||||||
if [ "$DRY_RUN" = "true" ]; then
|
|
||||||
echo " [DRY RUN] Would apply rule: ${NAME}"
|
|
||||||
SKIPPED=$((SKIPPED + 1))
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Delete existing rule if present (idempotent recreate)
|
|
||||||
ENCODED_NAME=$(echo "$NAME" | sed 's|/|%2F|g')
|
|
||||||
curl -sS -o /dev/null -w "" \
|
|
||||||
-X DELETE \
|
|
||||||
-H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
"${API}/repos/${GITEA_ORG}/${REPO}/branch_protections/${ENCODED_NAME}" 2>/dev/null || true
|
|
||||||
|
|
||||||
# Create rule
|
|
||||||
RESPONSE=$(curl -sS -w "\n%{http_code}" \
|
|
||||||
-X POST \
|
|
||||||
-H "Authorization: token ${GA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "$RULE" \
|
|
||||||
"${API}/repos/${GITEA_ORG}/${REPO}/branch_protections")
|
|
||||||
|
|
||||||
HTTP=$(echo "$RESPONSE" | tail -1)
|
|
||||||
BODY=$(echo "$RESPONSE" | sed '$d')
|
|
||||||
|
|
||||||
if [ "$HTTP" = "201" ]; then
|
|
||||||
echo " ✅ ${NAME}"
|
|
||||||
SUCCESS=$((SUCCESS + 1))
|
|
||||||
else
|
|
||||||
echo " ❌ ${NAME} (HTTP ${HTTP}): $(echo "$BODY" | jq -r '.message // .' 2>/dev/null | head -1)"
|
|
||||||
FAILED=$((FAILED + 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
# ── Summary ───────────────────────────────────────────────
|
|
||||||
echo ""
|
|
||||||
echo "════════════════════════════════════════"
|
|
||||||
echo " ✅ Success: ${SUCCESS}"
|
|
||||||
echo " ❌ Failed: ${FAILED}"
|
|
||||||
echo " ⏭️ Skipped: ${SKIPPED}"
|
|
||||||
echo "════════════════════════════════════════"
|
|
||||||
|
|
||||||
if [ "$FAILED" -gt 0 ]; then
|
|
||||||
echo "::warning::${FAILED} rule(s) failed to apply"
|
|
||||||
fi
|
|
||||||
+210
-5
@@ -1,8 +1,213 @@
|
|||||||
# DISABLED - auto-release handles dev recreation
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
name: Cascade (DISABLED)
|
#
|
||||||
on: workflow_dispatch
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Gitea.Workflow
|
||||||
|
# INGROUP: MokoStandards.Maintenance
|
||||||
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards-API
|
||||||
|
# PATH: /templates/workflows/cascade-dev.yml.template
|
||||||
|
# VERSION: 02.00.00
|
||||||
|
# BRIEF: Forward-merge main all open branches after every push to main
|
||||||
|
#
|
||||||
|
# +========================================================================+
|
||||||
|
# | CASCADE MAIN ALL BRANCHES |
|
||||||
|
# +========================================================================+
|
||||||
|
# | |
|
||||||
|
# | Triggers on every push to main (PR merges, bot commits, etc.) |
|
||||||
|
# | |
|
||||||
|
# | 1. List all branches matching: dev, rc/*, beta/*, alpha/* |
|
||||||
|
# | 2. For each: create PR (main branch), auto-merge if clean |
|
||||||
|
# | 3. On conflict: leave PR open for manual resolution |
|
||||||
|
# | |
|
||||||
|
# +========================================================================+
|
||||||
|
|
||||||
|
name: Cascade Main Dev
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||||
|
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
noop:
|
cascade:
|
||||||
|
name: Cascade main branches
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: >-
|
||||||
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||||
|
!contains(github.event.head_commit.message, '[skip cascade]')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo disabled
|
- name: Discover target branches
|
||||||
|
id: branches
|
||||||
|
env:
|
||||||
|
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
|
||||||
|
# Fetch all branches (paginated)
|
||||||
|
PAGE=1
|
||||||
|
ALL_BRANCHES=""
|
||||||
|
while true; do
|
||||||
|
BATCH=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
"${API}/branches?page=${PAGE}&limit=50" \
|
||||||
|
| jq -r '.[].name // empty')
|
||||||
|
[ -z "$BATCH" ] && break
|
||||||
|
ALL_BRANCHES="$ALL_BRANCHES $BATCH"
|
||||||
|
PAGE=$((PAGE + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
# Filter to cascade targets: dev, dev/*, rc/*, beta/*, alpha/*
|
||||||
|
TARGETS=""
|
||||||
|
for BRANCH in $ALL_BRANCHES; do
|
||||||
|
case "$BRANCH" in
|
||||||
|
dev|dev/*|rc/*|beta/*|alpha/*)
|
||||||
|
TARGETS="$TARGETS $BRANCH"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
TARGETS=$(echo "$TARGETS" | xargs) # trim whitespace
|
||||||
|
|
||||||
|
if [ -z "$TARGETS" ]; then
|
||||||
|
echo "targets=" >> "$GITHUB_OUTPUT"
|
||||||
|
echo " No cascade target branches found"
|
||||||
|
else
|
||||||
|
echo "targets=$TARGETS" >> "$GITHUB_OUTPUT"
|
||||||
|
COUNT=$(echo "$TARGETS" | wc -w)
|
||||||
|
echo " Found ${COUNT} target branch(es): ${TARGETS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Cascade to all target branches
|
||||||
|
if: steps.branches.outputs.targets != ''
|
||||||
|
env:
|
||||||
|
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
SHORT_SHA="${GITHUB_SHA:0:7}"
|
||||||
|
TARGETS="${{ steps.branches.outputs.targets }}"
|
||||||
|
|
||||||
|
SUCCESS=0
|
||||||
|
CONFLICTS=0
|
||||||
|
SKIPPED=0
|
||||||
|
FAILED=0
|
||||||
|
|
||||||
|
for BRANCH in $TARGETS; do
|
||||||
|
echo ""
|
||||||
|
echo " main ${BRANCH} "
|
||||||
|
|
||||||
|
# Check if branch is already up to date
|
||||||
|
ENCODED_BRANCH=$(echo "$BRANCH" | sed 's|/|%2F|g')
|
||||||
|
RESPONSE=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
"${API}/compare/${ENCODED_BRANCH}...main")
|
||||||
|
|
||||||
|
AHEAD=$(echo "$RESPONSE" | jq '.total_commits // 0')
|
||||||
|
|
||||||
|
if [ "$AHEAD" -eq 0 ]; then
|
||||||
|
echo " Already up to date"
|
||||||
|
SKIPPED=$((SKIPPED + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " main is ${AHEAD} commit(s) ahead"
|
||||||
|
|
||||||
|
# Check for existing cascade PR
|
||||||
|
EXISTING=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
"${API}/pulls?state=open&head=${GITEA_ORG}:main&base=${ENCODED_BRANCH}&limit=1")
|
||||||
|
|
||||||
|
EXISTING_COUNT=$(echo "$EXISTING" | jq 'length')
|
||||||
|
PR_NUMBER=""
|
||||||
|
|
||||||
|
if [ "$EXISTING_COUNT" -gt 0 ]; then
|
||||||
|
PR_NUMBER=$(echo "$EXISTING" | jq -r '.[0].number')
|
||||||
|
echo " Reusing existing PR #${PR_NUMBER}"
|
||||||
|
else
|
||||||
|
# Create cascade PR
|
||||||
|
PR_RESPONSE=$(curl -sS -w "\n%{http_code}" \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"title\": \"chore: cascade main ${BRANCH} (${SHORT_SHA}) [skip ci]\",
|
||||||
|
\"body\": \"## Automatic cascade\\n\\nForward-merging \`main\` (${SHORT_SHA}) into \`${BRANCH}\`.\\n\\nIf conflicts exist, resolve manually and merge.\\n\\n> Auto-created by **Cascade Main Dev**.\",
|
||||||
|
\"head\": \"main\",
|
||||||
|
\"base\": \"${BRANCH}\"
|
||||||
|
}" \
|
||||||
|
"${API}/pulls")
|
||||||
|
|
||||||
|
HTTP_CODE=$(echo "$PR_RESPONSE" | tail -1)
|
||||||
|
BODY=$(echo "$PR_RESPONSE" | sed '$d')
|
||||||
|
PR_NUMBER=$(echo "$BODY" | jq -r '.number // empty')
|
||||||
|
|
||||||
|
if [ "$HTTP_CODE" != "201" ] || [ -z "$PR_NUMBER" ]; then
|
||||||
|
MSG=$(echo "$BODY" | jq -r '.message // .' 2>/dev/null | head -1)
|
||||||
|
echo " Failed to create PR (HTTP ${HTTP_CODE}): ${MSG}"
|
||||||
|
FAILED=$((FAILED + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " Created PR #${PR_NUMBER}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try auto-merge
|
||||||
|
PR_DATA=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
"${API}/pulls/${PR_NUMBER}")
|
||||||
|
|
||||||
|
MERGEABLE=$(echo "$PR_DATA" | jq -r '.mergeable // false')
|
||||||
|
|
||||||
|
if [ "$MERGEABLE" != "true" ]; then
|
||||||
|
echo " Conflicts PR #${PR_NUMBER} left open"
|
||||||
|
CONFLICTS=$((CONFLICTS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
MERGE_RESPONSE=$(curl -sS -w "\n%{http_code}" \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"Do\": \"merge\",
|
||||||
|
\"merge_message_field\": \"chore: cascade main ${BRANCH} [skip ci]\",
|
||||||
|
\"delete_branch_after_merge\": false
|
||||||
|
}" \
|
||||||
|
"${API}/pulls/${PR_NUMBER}/merge")
|
||||||
|
|
||||||
|
MERGE_HTTP=$(echo "$MERGE_RESPONSE" | tail -1)
|
||||||
|
|
||||||
|
if [ "$MERGE_HTTP" = "200" ] || [ "$MERGE_HTTP" = "204" ]; then
|
||||||
|
echo " Merged ${BRANCH} is in sync"
|
||||||
|
SUCCESS=$((SUCCESS + 1))
|
||||||
|
else
|
||||||
|
MERGE_BODY=$(echo "$MERGE_RESPONSE" | sed '$d')
|
||||||
|
echo " Merge failed (HTTP ${MERGE_HTTP}) PR #${PR_NUMBER} left open"
|
||||||
|
CONFLICTS=$((CONFLICTS + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo " Merged: ${SUCCESS}"
|
||||||
|
echo " Conflicts: ${CONFLICTS}"
|
||||||
|
echo " Up to date: ${SKIPPED}"
|
||||||
|
echo " Failed: ${FAILED}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ "$FAILED" -gt 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -6,10 +6,9 @@
|
|||||||
<moko-platform xmlns="https://standards.mokoconsulting.tech/moko-platform/1.0" schema-version="1.0">
|
<moko-platform xmlns="https://standards.mokoconsulting.tech/moko-platform/1.0" schema-version="1.0">
|
||||||
<identity>
|
<identity>
|
||||||
<name>MokoOnyx</name>
|
<name>MokoOnyx</name>
|
||||||
<display-name>Template - MokoOnyx</display-name>
|
|
||||||
<org>MokoConsulting</org>
|
<org>MokoConsulting</org>
|
||||||
<description>MokoOnyx - Joomla site template (successor to MokoCassiopeia)</description>
|
<description>MokoOnyx - Joomla site template (successor to MokoCassiopeia)</description>
|
||||||
<version>02.19.08</version>
|
<version>02.08.00-dev</version>
|
||||||
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
||||||
</identity>
|
</identity>
|
||||||
<governance>
|
<governance>
|
||||||
|
|||||||
@@ -1,66 +1,85 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: moko-platform.Release
|
# INGROUP: moko-platform.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||||
# VERSION: 09.02.00
|
# VERSION: 09.02.00
|
||||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||||
|
|
||||||
name: "Universal: Auto Version Bump"
|
name: "Universal: Auto Version Bump"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
- rc
|
|
||||||
- 'feature/**'
|
env:
|
||||||
- 'patch/**'
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
env:
|
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
permissions:
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
contents: write
|
||||||
|
|
||||||
permissions:
|
jobs:
|
||||||
contents: write
|
bump:
|
||||||
|
name: Version Bump
|
||||||
jobs:
|
runs-on: release
|
||||||
bump:
|
if: >-
|
||||||
name: Version Bump
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||||
runs-on: release
|
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||||
if: >-
|
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
|
||||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
steps:
|
||||||
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
- name: Checkout
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
steps:
|
with:
|
||||||
- name: Checkout
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
fetch-depth: 1
|
||||||
with:
|
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
- name: Setup moko-platform tools
|
||||||
fetch-depth: 1
|
run: |
|
||||||
|
if ! command -v composer &> /dev/null; then
|
||||||
- name: Setup moko-platform tools
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
run: |
|
fi
|
||||||
if ! command -v composer &> /dev/null; then
|
if [ -d "/opt/moko-platform/cli" ]; then
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV"
|
||||||
fi
|
else
|
||||||
if [ -d "/opt/moko-platform/cli" ]; then
|
git clone --depth 1 --branch main --quiet \
|
||||||
echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV"
|
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/moko-platform.git" \
|
||||||
else
|
/tmp/moko-platform-api
|
||||||
git clone --depth 1 --branch main --quiet \
|
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
||||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/moko-platform.git" \
|
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
||||||
/tmp/moko-platform-api
|
fi
|
||||||
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
|
||||||
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
- name: Bump version
|
||||||
fi
|
run: |
|
||||||
|
BUMP=$(php ${MOKO_CLI}/version_bump.php --path . 2>&1) || true
|
||||||
- name: Bump version
|
echo "$BUMP"
|
||||||
run: |
|
|
||||||
php ${MOKO_CLI}/version_auto_bump.php \
|
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null) || true
|
||||||
--path . --branch "${GITHUB_REF_NAME}" \
|
[ -z "$VERSION" ] && { echo "No version found — skipping"; exit 0; }
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
||||||
--repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
# Propagate to platform manifests with -dev suffix
|
||||||
|
php ${MOKO_CLI}/version_set_platform.php \
|
||||||
|
--path . --version "$VERSION" --branch dev --stability dev 2>/dev/null || true
|
||||||
|
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
VERSION="${VERSION}-dev"
|
||||||
|
|
||||||
|
# Commit if anything changed
|
||||||
|
if git diff --quiet && git diff --cached --quiet; then
|
||||||
|
echo "No version changes to commit"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
|
git add -A
|
||||||
|
git commit -m "chore(version): auto-bump patch ${VERSION} [skip ci]" \
|
||||||
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||||
|
git push origin dev
|
||||||
|
echo "Bumped to ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
@@ -1,324 +1,524 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: moko-platform.Release
|
# INGROUP: moko-platform.Release
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
# PATH: /templates/workflows/universal/auto-release.yml.template
|
||||||
# VERSION: 05.00.00
|
# VERSION: 05.00.00
|
||||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||||
#
|
#
|
||||||
# +========================================================================+
|
# +========================================================================+
|
||||||
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
||||||
# +========================================================================+
|
# +========================================================================+
|
||||||
# | |
|
# | |
|
||||||
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
||||||
# | |
|
# | |
|
||||||
# | Platform-specific: |
|
# | Platform-specific: |
|
||||||
# | joomla: XML manifest, type-prefixed packages |
|
# | joomla: XML manifest, updates.xml, type-prefixed packages |
|
||||||
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
||||||
# | generic: README-only, no update stream |
|
# | generic: README-only, no update stream |
|
||||||
# | |
|
# | |
|
||||||
# +========================================================================+
|
# +========================================================================+
|
||||||
|
|
||||||
name: "Universal: Build & Release"
|
name: "Universal: Build & Release"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, closed]
|
types: [opened, closed]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
action:
|
action:
|
||||||
description: 'Action to perform'
|
description: 'Action to perform'
|
||||||
required: false
|
required: false
|
||||||
type: choice
|
type: choice
|
||||||
default: release
|
default: release
|
||||||
options:
|
options:
|
||||||
- release
|
- release
|
||||||
- promote-rc
|
- promote-rc
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||||
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ── PR Opened → Rename branch to RC and build RC release ─────────────────────
|
# ── Draft PR → Promote highest pre-release to RC ─────────────────────────────
|
||||||
promote-rc:
|
promote-rc:
|
||||||
name: Promote to RC
|
name: Promote Pre-Release to RC
|
||||||
runs-on: release
|
runs-on: release
|
||||||
if: >-
|
if: >-
|
||||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
(github.event.action == 'opened' && github.event.pull_request.draft == true) ||
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
- name: Setup moko-platform tools
|
||||||
env:
|
env:
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
run: |
|
run: |
|
||||||
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
|
if ! command -v composer &> /dev/null; then
|
||||||
echo Using pre-installed /opt/moko-platform
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
|
fi
|
||||||
else
|
git clone --depth 1 --branch main --quiet \
|
||||||
echo Falling back to fresh clone
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
if ! command -v composer > /dev/null 2>&1; then
|
/tmp/moko-platform-api
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
cd /tmp/moko-platform-api
|
||||||
fi
|
composer install --no-dev --no-interaction --quiet
|
||||||
rm -rf /tmp/moko-platform-api
|
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
|
- name: Promote to release-candidate
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
|
run: |
|
||||||
cd /tmp/moko-platform-api
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
composer install --no-dev --no-interaction --quiet
|
php /tmp/moko-platform-api/cli/release_promote.php \
|
||||||
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
|
--from auto --to release-candidate \
|
||||||
fi
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
--api-base "${API_BASE}" \
|
||||||
- name: Rename branch to rc
|
--branch "${{ github.event.pull_request.head.ref || 'dev' }}"
|
||||||
run: |
|
|
||||||
php ${MOKO_CLI}/branch_rename.php \
|
- name: Cascade lesser channels
|
||||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
continue-on-error: true
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
run: |
|
||||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
--pr "${{ github.event.pull_request.number }}"
|
php /tmp/moko-platform-api/cli/release_cascade.php \
|
||||||
|
--stability release-candidate \
|
||||||
- name: Checkout rc and configure git
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
run: |
|
--api-base "${API_BASE}"
|
||||||
git fetch origin rc
|
|
||||||
git checkout rc
|
- name: Summary
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
if: always()
|
||||||
git config --local user.name "gitea-actions[bot]"
|
run: |
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Draft PR opened — promoted highest pre-release to RC" >> $GITHUB_STEP_SUMMARY
|
||||||
- name: Publish RC release
|
|
||||||
run: |
|
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
||||||
php ${MOKO_CLI}/release_publish.php \
|
release:
|
||||||
--path . --stability rc --bump minor --branch rc \
|
name: Build & Release Pipeline
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
runs-on: release
|
||||||
|
if: >-
|
||||||
- name: Summary
|
github.event.pull_request.merged == true ||
|
||||||
if: always()
|
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||||
run: |
|
|
||||||
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
steps:
|
||||||
echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
with:
|
||||||
release:
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
name: Build & Release Pipeline
|
fetch-depth: 0
|
||||||
runs-on: release
|
|
||||||
if: >-
|
- name: Configure git for bot pushes
|
||||||
github.event.pull_request.merged == true ||
|
run: |
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
steps:
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
- name: Setup moko-platform tools
|
||||||
with:
|
env:
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
fetch-depth: 0
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
|
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
||||||
- name: Configure git for bot pushes
|
run: |
|
||||||
run: |
|
# Ensure PHP + Composer are available
|
||||||
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
if ! command -v composer &> /dev/null; then
|
||||||
git config --local user.name "gitea-actions[bot]"
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
fi
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
- name: Check for merge conflict markers
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
run: |
|
/tmp/moko-platform-api
|
||||||
CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true)
|
cd /tmp/moko-platform-api
|
||||||
if [ -n "$CONFLICTS" ]; then
|
composer install --no-dev --no-interaction --quiet
|
||||||
echo "::error::Merge conflict markers found — aborting release"
|
|
||||||
echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
# -- PLATFORM DETECTION ---------------------------------------------------
|
||||||
echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY
|
- name: Detect platform
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
id: platform
|
||||||
exit 1
|
run: |
|
||||||
fi
|
php /tmp/moko-platform-api/cli/manifest_read.php --path . --github-output
|
||||||
echo "No conflict markers found"
|
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1 || true)
|
||||||
|
MOD_FILE=$(find . -maxdepth 4 -name "mod*.class.php" ! -path "./.git/*" -exec grep -l 'extends DolibarrModules' {} \; 2>/dev/null | head -1 || true)
|
||||||
- name: Setup moko-platform tools
|
echo "manifest=${MANIFEST}" >> "$GITHUB_OUTPUT"
|
||||||
env:
|
echo "mod_file=${MOD_FILE}" >> "$GITHUB_OUTPUT"
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
- name: "Step 1: Read version"
|
||||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
id: version
|
||||||
run: |
|
run: |
|
||||||
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
|
VERSION=$(php /tmp/moko-platform-api/cli/version_read.php --path .)
|
||||||
echo Using pre-installed /opt/moko-platform
|
if [ -z "$VERSION" ]; then
|
||||||
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
|
echo "::error::No VERSION in README.md"
|
||||||
else
|
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||||
echo Falling back to fresh clone
|
exit 0
|
||||||
if ! command -v composer > /dev/null 2>&1; then
|
fi
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
# Strip any pre-release suffix merged from dev (e.g. 01.02.20-dev → 01.02.20)
|
||||||
fi
|
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
||||||
rm -rf /tmp/moko-platform-api
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
|
echo "release_tag=stable" >> "$GITHUB_OUTPUT"
|
||||||
cd /tmp/moko-platform-api
|
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||||
composer install --no-dev --no-interaction --quiet
|
echo "branch=main" >> "$GITHUB_OUTPUT"
|
||||||
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
|
|
||||||
fi
|
# -- CHECK FOR RC PROMOTION ------------------------------------------------
|
||||||
|
- name: "Check for RC release"
|
||||||
- name: "Publish stable release"
|
id: rc
|
||||||
run: |
|
if: steps.version.outputs.skip != 'true'
|
||||||
php ${MOKO_CLI}/release_publish.php \
|
run: |
|
||||||
--path . --stability stable --bump minor --branch main \
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
RC_JSON=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
"${API_BASE}/releases/tags/release-candidate" 2>/dev/null || echo "{}")
|
||||||
- name: Update release notes from CHANGELOG.md
|
RC_ID=$(echo "$RC_JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('id',''))" 2>/dev/null || true)
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
if [ -n "$RC_ID" ] && [ "$RC_ID" != "None" ] && [ "$RC_ID" != "" ]; then
|
||||||
|
echo "promote=true" >> "$GITHUB_OUTPUT"
|
||||||
# Extract [Unreleased] section from changelog
|
echo "release_id=${RC_ID}" >> "$GITHUB_OUTPUT"
|
||||||
if [ -f "CHANGELOG.md" ]; then
|
echo "::notice::RC release found (id: ${RC_ID}) — will promote to stable"
|
||||||
NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md)
|
else
|
||||||
[ -z "$NOTES" ] && NOTES="Stable release"
|
echo "promote=false" >> "$GITHUB_OUTPUT"
|
||||||
else
|
echo "::notice::No RC release — full build pipeline"
|
||||||
NOTES="Stable release"
|
fi
|
||||||
fi
|
|
||||||
|
- name: "Step 1b: Minor bump version"
|
||||||
# Update release body via API
|
id: bump
|
||||||
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
if: >-
|
||||||
"${API_BASE}/releases/tags/stable" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote != 'true'
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
run: |
|
||||||
python3 -c "
|
MOKO_API="/tmp/moko-platform-api/cli"
|
||||||
import json, urllib.request
|
php ${MOKO_API}/version_bump.php --path . --minor 2>&1 || true
|
||||||
body = open('/dev/stdin').read()
|
VERSION=$(php ${MOKO_API}/version_read.php --path .)
|
||||||
payload = json.dumps({'body': body}).encode()
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
req = urllib.request.Request(
|
echo "Bumped to: ${VERSION}"
|
||||||
'${API_BASE}/releases/${RELEASE_ID}',
|
|
||||||
data=payload, method='PATCH',
|
- name: Check if already released
|
||||||
headers={
|
if: steps.version.outputs.skip != 'true'
|
||||||
'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}',
|
id: check
|
||||||
'Content-Type': 'application/json'
|
run: |
|
||||||
})
|
TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
urllib.request.urlopen(req)
|
BRANCH="${{ steps.version.outputs.branch }}"
|
||||||
" <<< "$NOTES"
|
|
||||||
echo "Release notes updated from CHANGELOG.md"
|
TAG_EXISTS=false
|
||||||
fi
|
BRANCH_EXISTS=false
|
||||||
|
|
||||||
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
git rev-parse "$TAG" >/dev/null 2>&1 && TAG_EXISTS=true
|
||||||
- name: "Step 9: Mirror release to GitHub"
|
git ls-remote --heads origin "$BRANCH" 2>/dev/null | grep -q "$BRANCH" && BRANCH_EXISTS=true
|
||||||
if: >-
|
|
||||||
steps.version.outputs.skip != 'true' &&
|
echo "tag_exists=$TAG_EXISTS" >> "$GITHUB_OUTPUT"
|
||||||
secrets.GH_MIRROR_TOKEN != ''
|
echo "branch_exists=$BRANCH_EXISTS" >> "$GITHUB_OUTPUT"
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
# Tag and branch may persist across patch releases — never skip
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
echo "already_released=false" >> "$GITHUB_OUTPUT"
|
||||||
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
|
||||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
# -- SANITY CHECKS -------------------------------------------------------
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
- name: "Sanity: Pre-release validation"
|
||||||
php ${MOKO_CLI}/release_mirror.php \
|
if: >-
|
||||||
--version "$VERSION" --tag "$RELEASE_TAG" \
|
steps.version.outputs.skip != 'true' &&
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
steps.check.outputs.already_released != 'true'
|
||||||
--gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \
|
run: |
|
||||||
--branch main 2>&1 || true
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY
|
php /tmp/moko-platform-api/cli/release_validate.php \
|
||||||
|
--path . --version "$VERSION" --output-summary --github-output || true
|
||||||
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
|
||||||
- name: "Step 10: Push main to GitHub mirror"
|
# -- STEP 2: Create or update version/XX.YY archive branch ---------------
|
||||||
if: >-
|
# Always runs — every version change on main archives to version/XX.YY
|
||||||
steps.version.outputs.skip != 'true' &&
|
- name: "Step 2: Version archive branch"
|
||||||
secrets.GH_MIRROR_TOKEN != ''
|
if: steps.check.outputs.already_released != 'true'
|
||||||
continue-on-error: true
|
run: |
|
||||||
run: |
|
BRANCH="${{ steps.version.outputs.branch }}"
|
||||||
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
IS_MINOR="${{ steps.version.outputs.is_minor }}"
|
||||||
GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1)
|
PATCH="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2)
|
PATCH_NUM=$(echo "$PATCH" | awk -F. '{print $3}')
|
||||||
git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \
|
|
||||||
git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git"
|
# Check if branch exists
|
||||||
git fetch origin main --depth=1
|
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
|
||||||
git push github origin/main:refs/heads/main --force 2>/dev/null \
|
git push origin HEAD:"$BRANCH" --force
|
||||||
&& echo "main branch pushed to GitHub mirror" \
|
echo "Updated archive branch: ${BRANCH} (patch ${PATCH_NUM})" >> $GITHUB_STEP_SUMMARY
|
||||||
|| echo "WARNING: GitHub mirror push failed"
|
else
|
||||||
|
git checkout -b "$BRANCH" 2>/dev/null || git checkout "$BRANCH"
|
||||||
- name: "Step 11: Delete rc branch and recreate dev from main"
|
git push origin "$BRANCH" --force
|
||||||
if: steps.version.outputs.skip != 'true'
|
echo "Created archive branch: ${BRANCH}" >> $GITHUB_STEP_SUMMARY
|
||||||
continue-on-error: true
|
fi
|
||||||
run: |
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
# -- STEP 3: Set platform version ----------------------------------------
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
- name: "Step 3: Set platform version"
|
||||||
|
if: >-
|
||||||
# Delete rc branch (ephemeral — created by promote-rc)
|
steps.version.outputs.skip != 'true' &&
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
steps.check.outputs.already_released != 'true'
|
||||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
run: |
|
||||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
php /tmp/moko-platform-api/cli/version_set_platform.php \
|
||||||
# Delete dev branch
|
--path . --version "$VERSION" --branch main
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
|
||||||
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
# -- STEP 4: Update version badges ----------------------------------------
|
||||||
|
- name: "Step 4: Update version badges"
|
||||||
# Recreate dev from main (now includes version bump + changelog promotion)
|
if: steps.version.outputs.skip != 'true'
|
||||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
run: |
|
||||||
-H "Content-Type: application/json" \
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
"${API_BASE}/branches" \
|
php /tmp/moko-platform-api/cli/badge_update.php --path . --version "${VERSION}" 2>/dev/null || true
|
||||||
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
php /tmp/moko-platform-api/cli/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
|
||||||
echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY
|
# Step 5 (updates.xml) moved after Step 8 to include SHA-256 checksum
|
||||||
|
|
||||||
- name: "Step 12: Create version branch from main"
|
- name: "Step 4b: Promote and prune CHANGELOG"
|
||||||
if: steps.version.outputs.skip != 'true'
|
if: >-
|
||||||
continue-on-error: true
|
steps.version.outputs.skip != 'true' &&
|
||||||
run: |
|
steps.check.outputs.already_released != 'true'
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
run: |
|
||||||
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
MOKO_API="/tmp/moko-platform-api/cli"
|
||||||
BRANCH_NAME="version/${VERSION}"
|
if [ -f "CHANGELOG.md" ]; then
|
||||||
MAIN_SHA=$(git rev-parse HEAD)
|
php ${MOKO_API}/changelog_promote.php --path . --version "$VERSION" 2>&1 || true
|
||||||
|
php ${MOKO_API}/changelog_prune.php --path . --keep 5 2>&1 || true
|
||||||
# Delete old version branch if it exists (same version re-release)
|
fi
|
||||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}"
|
|
||||||
|
- name: Commit release changes
|
||||||
# Create version/XX.YY.ZZ from main
|
if: >-
|
||||||
curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed"
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.check.outputs.already_released != 'true'
|
||||||
echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY
|
run: |
|
||||||
|
if git diff --quiet && git diff --cached --quiet; then
|
||||||
|
echo "No changes to commit"
|
||||||
|
exit 0
|
||||||
# -- Dolibarr post-release: Reset dev version -----------------------------
|
fi
|
||||||
- name: "Post-release: Reset dev version"
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
if: steps.version.outputs.skip != 'true'
|
git add -A
|
||||||
continue-on-error: true
|
git commit -m "chore(release): build ${VERSION} [skip ci]" \
|
||||||
run: |
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
git push -u origin HEAD
|
||||||
php ${MOKO_CLI}/version_reset_dev.php \
|
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
# -- STEP 6: Create tag ---------------------------------------------------
|
||||||
--branch dev --path . 2>&1 || true
|
- name: "Step 6: Create git tag"
|
||||||
|
if: >-
|
||||||
# -- Summary --------------------------------------------------------------
|
steps.version.outputs.skip != 'true'
|
||||||
- name: Pipeline Summary
|
run: |
|
||||||
if: always()
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
run: |
|
# Only create the major release tag if it doesn't exist yet
|
||||||
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
if ! git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
git tag "$RELEASE_TAG"
|
||||||
if [ "${{ steps.version.outputs.skip }}" = "true" ]; then
|
git push origin "$RELEASE_TAG"
|
||||||
echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY
|
echo "Tag created: ${RELEASE_TAG}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY
|
else
|
||||||
elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then
|
echo "Tag ${RELEASE_TAG} already exists" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
fi
|
||||||
else
|
echo "Tag: ${TAG}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY
|
# -- STEP 7a: Promote RC to stable (skip build) ----------------------------
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
- name: "Step 7a: Promote RC to stable"
|
||||||
echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY
|
if: >-
|
||||||
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
|
steps.version.outputs.skip != 'true' &&
|
||||||
echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY
|
steps.rc.outputs.promote == 'true'
|
||||||
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
run: |
|
||||||
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
php /tmp/moko-platform-api/cli/release_promote.php \
|
||||||
fi
|
--from release-candidate --to stable \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
--api-base "${API_BASE}" \
|
||||||
|
--path . --branch main
|
||||||
|
echo "Promoted RC → stable (${VERSION})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# -- STEP 7b: Create or update Gitea Release (full build path) -------------
|
||||||
|
- name: "Step 7b: Gitea Release"
|
||||||
|
if: >-
|
||||||
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote != 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_create.php \
|
||||||
|
--path . --version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --branch main
|
||||||
|
echo "Release created: ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# -- STEP 8: Build packages and upload to release ----------------------------
|
||||||
|
- name: "Step 8: Build package and upload"
|
||||||
|
id: package
|
||||||
|
if: >-
|
||||||
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
steps.rc.outputs.promote != 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_package.php \
|
||||||
|
--path . --version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --output /tmp || true
|
||||||
|
|
||||||
|
# -- STEP 5: Write update stream (after build so SHA-256 is available) -----
|
||||||
|
- name: "Step 5: Write update stream"
|
||||||
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
||||||
|
|
||||||
|
# Fetch latest updates.xml from main so preserve logic has all channels
|
||||||
|
GITEA_TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||||
|
curl -sf -H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${API}/contents/updates.xml?ref=main" 2>/dev/null | \
|
||||||
|
python3 -c "import sys,json,base64; print(base64.b64decode(json.load(sys.stdin)['content']).decode())" \
|
||||||
|
> updates.xml 2>/dev/null || true
|
||||||
|
|
||||||
|
SHA_FLAG=""
|
||||||
|
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
||||||
|
|
||||||
|
php /tmp/moko-platform-api/cli/updates_xml_build.php \
|
||||||
|
--path . --version "${VERSION}" --stability stable \
|
||||||
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
${SHA_FLAG} --github-output
|
||||||
|
|
||||||
|
# Commit updates.xml if changed
|
||||||
|
if ! git diff --quiet updates.xml 2>/dev/null; then
|
||||||
|
git add updates.xml
|
||||||
|
git commit -m "chore: update stable channel ${VERSION} [skip ci]" \
|
||||||
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||||
|
git push origin HEAD 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# -- STEP 8b: Update release description with changelog ----------------------
|
||||||
|
- name: "Step 8b: Update release body"
|
||||||
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_body_update.php \
|
||||||
|
--path . --version "${VERSION}" --tag "${RELEASE_TAG}" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
2>&1 || true
|
||||||
|
echo "Release body updated" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# -- STEP 9: Mirror to GitHub (stable only) --------------------------------
|
||||||
|
- name: "Step 9: Mirror release to GitHub"
|
||||||
|
if: >-
|
||||||
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
secrets.GH_MIRROR_TOKEN != ''
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
|
||||||
|
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_mirror.php \
|
||||||
|
--version "$VERSION" --tag "$RELEASE_TAG" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \
|
||||||
|
--branch main 2>&1 || true
|
||||||
|
echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
# -- STEP 10: Sync main branch to GitHub mirror ----------------------------
|
||||||
|
- name: "Step 10: Push main to GitHub mirror"
|
||||||
|
if: >-
|
||||||
|
steps.version.outputs.skip != 'true' &&
|
||||||
|
secrets.GH_MIRROR_TOKEN != ''
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}"
|
||||||
|
GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1)
|
||||||
|
GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2)
|
||||||
|
git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \
|
||||||
|
git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git"
|
||||||
|
git fetch origin main --depth=1
|
||||||
|
git push github origin/main:refs/heads/main --force 2>/dev/null \
|
||||||
|
&& echo "main branch pushed to GitHub mirror" \
|
||||||
|
|| echo "WARNING: GitHub mirror push failed"
|
||||||
|
|
||||||
|
# -- Clean up lesser pre-releases (cascade) ---------------------------------
|
||||||
|
# stable → deletes all | rc → beta,alpha,dev | beta → alpha,dev | alpha → dev
|
||||||
|
- name: "Delete lesser pre-release channels"
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/release_cascade.php \
|
||||||
|
--stability stable \
|
||||||
|
--version "${VERSION}" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
--api-base "${API_BASE}" 2>/dev/null || true
|
||||||
|
|
||||||
|
- name: "Step 11: Delete and recreate dev branch from main"
|
||||||
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
|
||||||
|
# Delete dev branch
|
||||||
|
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch"
|
||||||
|
|
||||||
|
# Recreate dev from main (now includes version bump + changelog promotion)
|
||||||
|
curl -sf -X POST -H "Authorization: token ${TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"${API_BASE}/branches" \
|
||||||
|
-d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main"
|
||||||
|
|
||||||
|
echo "Dev branch reset from main (keeps dev ahead after release)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
- name: "Step 12: Create version branch from main"
|
||||||
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
BRANCH_NAME="version/${VERSION}"
|
||||||
|
MAIN_SHA=$(git rev-parse HEAD)
|
||||||
|
|
||||||
|
# Delete old version branch if it exists (same version re-release)
|
||||||
|
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}"
|
||||||
|
|
||||||
|
# Create version/XX.YY.ZZ from main
|
||||||
|
curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed"
|
||||||
|
|
||||||
|
echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# -- Dolibarr post-release: Reset dev version -----------------------------
|
||||||
|
- name: "Post-release: Reset dev version"
|
||||||
|
if: steps.version.outputs.skip != 'true'
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
php /tmp/moko-platform-api/cli/version_reset_dev.php \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \
|
||||||
|
--branch dev --path . 2>&1 || true
|
||||||
|
|
||||||
|
# -- Summary --------------------------------------------------------------
|
||||||
|
- name: Pipeline Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}"
|
||||||
|
PLATFORM="${{ steps.platform.outputs.platform }}"
|
||||||
|
if [ "${{ steps.version.outputs.skip }}" = "true" ]; then
|
||||||
|
echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY
|
||||||
|
elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then
|
||||||
|
echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
else
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "|------|--------|" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
BRANCH="${{ github.event.pull_request.head.ref }}"
|
BRANCH="${{ github.event.pull_request.head.ref }}"
|
||||||
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
||||||
ENCODED=$(php -r "echo rawurlencode('${BRANCH}');")
|
ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${BRANCH}', safe=''))")
|
||||||
|
|
||||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
||||||
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
|||||||
@@ -1,10 +1,213 @@
|
|||||||
# DISABLED — auto-release Step 11 recreates dev from main after every release.
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
# Cascade-dev is redundant and causes version conflicts when both main and dev
|
#
|
||||||
# have different version numbers in templateDetails.xml / manifest.xml.
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
name: "Cascade Main → Dev (DISABLED)"
|
#
|
||||||
on: workflow_dispatch
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Gitea.Workflow
|
||||||
|
# INGROUP: moko-platform.Maintenance
|
||||||
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||||
|
# PATH: /templates/workflows/cascade-dev.yml.template
|
||||||
|
# VERSION: 02.00.00
|
||||||
|
# BRIEF: Forward-merge main → all open branches after every push to main
|
||||||
|
#
|
||||||
|
# +========================================================================+
|
||||||
|
# | CASCADE MAIN → ALL BRANCHES |
|
||||||
|
# +========================================================================+
|
||||||
|
# | |
|
||||||
|
# | Triggers on every push to main (PR merges, bot commits, etc.) |
|
||||||
|
# | |
|
||||||
|
# | 1. List all branches matching: dev, rc/*, beta/*, alpha/* |
|
||||||
|
# | 2. For each: create PR (main → branch), auto-merge if clean |
|
||||||
|
# | 3. On conflict: leave PR open for manual resolution |
|
||||||
|
# | |
|
||||||
|
# +========================================================================+
|
||||||
|
|
||||||
|
name: "Universal: Cascade Main → Dev"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||||
|
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
noop:
|
cascade:
|
||||||
|
name: Cascade main → branches
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: >-
|
||||||
|
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||||
|
!contains(github.event.head_commit.message, '[skip cascade]')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo "Cascade disabled — auto-release handles dev recreation"
|
- name: Discover target branches
|
||||||
|
id: branches
|
||||||
|
env:
|
||||||
|
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
|
||||||
|
# Fetch all branches (paginated)
|
||||||
|
PAGE=1
|
||||||
|
ALL_BRANCHES=""
|
||||||
|
while true; do
|
||||||
|
BATCH=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${API}/branches?page=${PAGE}&limit=50" \
|
||||||
|
| jq -r '.[].name // empty')
|
||||||
|
[ -z "$BATCH" ] && break
|
||||||
|
ALL_BRANCHES="$ALL_BRANCHES $BATCH"
|
||||||
|
PAGE=$((PAGE + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
# Filter to cascade targets: dev, dev/*, rc/*, beta/*, alpha/*
|
||||||
|
TARGETS=""
|
||||||
|
for BRANCH in $ALL_BRANCHES; do
|
||||||
|
case "$BRANCH" in
|
||||||
|
dev|dev/*|rc/*|beta/*|alpha/*)
|
||||||
|
TARGETS="$TARGETS $BRANCH"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
TARGETS=$(echo "$TARGETS" | xargs) # trim whitespace
|
||||||
|
|
||||||
|
if [ -z "$TARGETS" ]; then
|
||||||
|
echo "targets=" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "ℹ️ No cascade target branches found"
|
||||||
|
else
|
||||||
|
echo "targets=$TARGETS" >> "$GITHUB_OUTPUT"
|
||||||
|
COUNT=$(echo "$TARGETS" | wc -w)
|
||||||
|
echo "📋 Found ${COUNT} target branch(es): ${TARGETS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Cascade to all target branches
|
||||||
|
if: steps.branches.outputs.targets != ''
|
||||||
|
env:
|
||||||
|
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
API="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
SHORT_SHA="${GITHUB_SHA:0:7}"
|
||||||
|
TARGETS="${{ steps.branches.outputs.targets }}"
|
||||||
|
|
||||||
|
SUCCESS=0
|
||||||
|
CONFLICTS=0
|
||||||
|
SKIPPED=0
|
||||||
|
FAILED=0
|
||||||
|
|
||||||
|
for BRANCH in $TARGETS; do
|
||||||
|
echo ""
|
||||||
|
echo "═══ main → ${BRANCH} ═══"
|
||||||
|
|
||||||
|
# Check if branch is already up to date
|
||||||
|
ENCODED_BRANCH=$(echo "$BRANCH" | sed 's|/|%2F|g')
|
||||||
|
RESPONSE=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${API}/compare/${ENCODED_BRANCH}...main")
|
||||||
|
|
||||||
|
AHEAD=$(echo "$RESPONSE" | jq '.total_commits // 0')
|
||||||
|
|
||||||
|
if [ "$AHEAD" -eq 0 ]; then
|
||||||
|
echo " ✅ Already up to date"
|
||||||
|
SKIPPED=$((SKIPPED + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " ℹ️ main is ${AHEAD} commit(s) ahead"
|
||||||
|
|
||||||
|
# Check for existing cascade PR
|
||||||
|
EXISTING=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${API}/pulls?state=open&head=${GITEA_ORG}:main&base=${ENCODED_BRANCH}&limit=1")
|
||||||
|
|
||||||
|
EXISTING_COUNT=$(echo "$EXISTING" | jq 'length')
|
||||||
|
PR_NUMBER=""
|
||||||
|
|
||||||
|
if [ "$EXISTING_COUNT" -gt 0 ]; then
|
||||||
|
PR_NUMBER=$(echo "$EXISTING" | jq -r '.[0].number')
|
||||||
|
echo " ℹ️ Reusing existing PR #${PR_NUMBER}"
|
||||||
|
else
|
||||||
|
# Create cascade PR
|
||||||
|
PR_RESPONSE=$(curl -sS -w "\n%{http_code}" \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"title\": \"chore: cascade main → ${BRANCH} (${SHORT_SHA}) [skip ci]\",
|
||||||
|
\"body\": \"## Automatic cascade\\n\\nForward-merging \`main\` (${SHORT_SHA}) into \`${BRANCH}\`.\\n\\nIf conflicts exist, resolve manually and merge.\\n\\n> Auto-created by **Cascade Main → Dev**.\",
|
||||||
|
\"head\": \"main\",
|
||||||
|
\"base\": \"${BRANCH}\"
|
||||||
|
}" \
|
||||||
|
"${API}/pulls")
|
||||||
|
|
||||||
|
HTTP_CODE=$(echo "$PR_RESPONSE" | tail -1)
|
||||||
|
BODY=$(echo "$PR_RESPONSE" | sed '$d')
|
||||||
|
PR_NUMBER=$(echo "$BODY" | jq -r '.number // empty')
|
||||||
|
|
||||||
|
if [ "$HTTP_CODE" != "201" ] || [ -z "$PR_NUMBER" ]; then
|
||||||
|
MSG=$(echo "$BODY" | jq -r '.message // .' 2>/dev/null | head -1)
|
||||||
|
echo " ❌ Failed to create PR (HTTP ${HTTP_CODE}): ${MSG}"
|
||||||
|
FAILED=$((FAILED + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " ✅ Created PR #${PR_NUMBER}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Try auto-merge
|
||||||
|
PR_DATA=$(curl -sS \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${API}/pulls/${PR_NUMBER}")
|
||||||
|
|
||||||
|
MERGEABLE=$(echo "$PR_DATA" | jq -r '.mergeable // false')
|
||||||
|
|
||||||
|
if [ "$MERGEABLE" != "true" ]; then
|
||||||
|
echo " ⚠️ Conflicts — PR #${PR_NUMBER} left open"
|
||||||
|
CONFLICTS=$((CONFLICTS + 1))
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
MERGE_RESPONSE=$(curl -sS -w "\n%{http_code}" \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"Do\": \"merge\",
|
||||||
|
\"merge_message_field\": \"chore: cascade main → ${BRANCH} [skip ci]\",
|
||||||
|
\"delete_branch_after_merge\": false
|
||||||
|
}" \
|
||||||
|
"${API}/pulls/${PR_NUMBER}/merge")
|
||||||
|
|
||||||
|
MERGE_HTTP=$(echo "$MERGE_RESPONSE" | tail -1)
|
||||||
|
|
||||||
|
if [ "$MERGE_HTTP" = "200" ] || [ "$MERGE_HTTP" = "204" ]; then
|
||||||
|
echo " ✅ Merged — ${BRANCH} is in sync"
|
||||||
|
SUCCESS=$((SUCCESS + 1))
|
||||||
|
else
|
||||||
|
MERGE_BODY=$(echo "$MERGE_RESPONSE" | sed '$d')
|
||||||
|
echo " ⚠️ Merge failed (HTTP ${MERGE_HTTP}) — PR #${PR_NUMBER} left open"
|
||||||
|
CONFLICTS=$((CONFLICTS + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
echo ""
|
||||||
|
echo "════════════════════════════════════════"
|
||||||
|
echo " ✅ Merged: ${SUCCESS}"
|
||||||
|
echo " ⚠️ Conflicts: ${CONFLICTS}"
|
||||||
|
echo " ⏭️ Up to date: ${SKIPPED}"
|
||||||
|
echo " ❌ Failed: ${FAILED}"
|
||||||
|
echo "════════════════════════════════════════"
|
||||||
|
|
||||||
|
if [ "$FAILED" -gt 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Clone MokoStandards
|
- name: Clone MokoStandards
|
||||||
env:
|
env:
|
||||||
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }}
|
GA_TOKEN: ${{ secrets.GA_TOKEN || secrets.GA_TOKEN || github.token }}
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }}
|
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN || secrets.GA_TOKEN || github.token }}
|
||||||
MOKO_CLONE_HOST: ${{ secrets.MOKOGITEA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
MOKO_CLONE_HOST: ${{ secrets.GA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 --branch main --quiet \
|
git clone --depth 1 --branch main --quiet \
|
||||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GA_TOKEN || github.token }}"}}'
|
||||||
run: |
|
run: |
|
||||||
if [ -f "composer.json" ]; then
|
if [ -f "composer.json" ]; then
|
||||||
composer install \
|
composer install \
|
||||||
@@ -346,7 +346,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GA_TOKEN || github.token }}"}}'
|
||||||
run: |
|
run: |
|
||||||
if [ -f "composer.json" ]; then
|
if [ -f "composer.json" ]; then
|
||||||
composer install \
|
composer install \
|
||||||
@@ -391,7 +391,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GA_TOKEN || github.token }}"}}'
|
||||||
run: |
|
run: |
|
||||||
if [ -f "composer.json" ]; then
|
if [ -f "composer.json" ]; then
|
||||||
composer install --no-interaction --prefer-dist --optimize-autoloader
|
composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
@@ -458,10 +458,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Trigger pre-release build
|
- name: Trigger pre-release build
|
||||||
env:
|
env:
|
||||||
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
BRANCH: ${{ github.head_ref }}
|
BRANCH: ${{ github.head_ref }}
|
||||||
run: |
|
run: |
|
||||||
curl -s -X POST "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${GITEA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
curl -s -X POST "${GITEA_URL:-https://git.mokoconsulting.tech}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${GA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
||||||
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: moko-platform.Automation
|
# INGROUP: moko-platform.Automation
|
||||||
# VERSION: 02.19.08
|
# VERSION: 01.00.00
|
||||||
# BRIEF: Auto-create feature branch when an issue is opened
|
# BRIEF: Auto-create feature branch when an issue is opened
|
||||||
|
|
||||||
name: "Universal: Issue Branch"
|
name: "Universal: Issue Branch"
|
||||||
|
|||||||
+214
-508
@@ -1,508 +1,214 @@
|
|||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# FILE INFORMATION
|
# FILE INFORMATION
|
||||||
# DEFGROUP: Gitea.Workflow
|
# DEFGROUP: Gitea.Workflow
|
||||||
# INGROUP: moko-platform.CI
|
# INGROUP: moko-platform.CI
|
||||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||||
# PATH: /templates/workflows/universal/pr-check.yml.template
|
# PATH: /templates/workflows/universal/pr-check.yml.template
|
||||||
# VERSION: 09.23.00
|
# VERSION: 05.00.00
|
||||||
# BRIEF: PR gate — branch policy + code validation before merge
|
# BRIEF: PR gate — branch policy + code validation before merge
|
||||||
|
|
||||||
name: "Universal: PR Check"
|
name: "Universal: PR Check"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, edited]
|
types: [opened, synchronize, reopened, edited]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ── Branch Policy ──────────────────────────────────────────────────────
|
# ── Branch Policy ──────────────────────────────────────────────────────
|
||||||
branch-policy:
|
branch-policy:
|
||||||
name: Branch Policy
|
name: Branch Policy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check branch merge target
|
- name: Check branch merge target
|
||||||
run: |
|
run: |
|
||||||
HEAD="${{ github.head_ref }}"
|
HEAD="${{ github.head_ref }}"
|
||||||
BASE="${{ github.base_ref }}"
|
BASE="${{ github.base_ref }}"
|
||||||
|
|
||||||
echo "PR: ${HEAD} → ${BASE}"
|
echo "PR: ${HEAD} → ${BASE}"
|
||||||
|
|
||||||
ALLOWED=true
|
ALLOWED=true
|
||||||
REASON=""
|
REASON=""
|
||||||
|
|
||||||
case "$HEAD" in
|
case "$HEAD" in
|
||||||
feature/*|feat/*)
|
feature/*|feat/*)
|
||||||
if [ "$BASE" != "dev" ]; then
|
if [ "$BASE" != "dev" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Feature branches must target 'dev', not '${BASE}'"
|
REASON="Feature branches must target 'dev', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
fix/*|bugfix/*)
|
fix/*|bugfix/*)
|
||||||
if [ "$BASE" != "dev" ]; then
|
if [ "$BASE" != "dev" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Fix branches must target 'dev', not '${BASE}'"
|
REASON="Fix branches must target 'dev', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
patch/*)
|
hotfix/*)
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "rc" ]; then
|
if [ "$BASE" != "dev" ] && [ "$BASE" != "main" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Patch branches must target 'dev' or 'rc', not '${BASE}'"
|
REASON="Hotfix branches can only target 'dev' or 'main', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
hotfix/*)
|
alpha/*|beta/*)
|
||||||
if [ "$BASE" != "dev" ] && [ "$BASE" != "main" ]; then
|
if [ "$BASE" != "dev" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Hotfix branches can only target 'dev' or 'main', not '${BASE}'"
|
REASON="Pre-release branches must target 'dev', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
rc)
|
rc/*)
|
||||||
if [ "$BASE" != "main" ]; then
|
if [ "$BASE" != "main" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="RC branch can only merge into 'main', not '${BASE}'"
|
REASON="Release candidate branches must target 'main', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dev)
|
dev)
|
||||||
if [ "$BASE" != "main" ]; then
|
if [ "$BASE" != "main" ]; then
|
||||||
ALLOWED=false
|
ALLOWED=false
|
||||||
REASON="Dev branch can only merge into 'main', not '${BASE}'"
|
REASON="Dev branch can only merge into 'main', not '${BASE}'"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$ALLOWED" = false ]; then
|
if [ "$ALLOWED" = false ]; then
|
||||||
echo "::error::${REASON}"
|
echo "::error::${REASON}"
|
||||||
echo "## Branch Policy Violation" >> $GITHUB_STEP_SUMMARY
|
echo "## Branch Policy Violation" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "${REASON}" >> $GITHUB_STEP_SUMMARY
|
echo "${REASON}" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
echo "### Allowed merge paths:" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`feature/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`fix/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`fix/*\` → \`dev\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`hotfix/*\` → \`dev\` or \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`dev\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
echo "- \`rc/*\` → \`main\`" >> $GITHUB_STEP_SUMMARY
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
echo "Branch policy: OK (${HEAD} → ${BASE})"
|
||||||
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
echo "## Branch Policy: Passed" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
# ── Code Validation ────────────────────────────────────────────────────
|
# ── Code Validation ────────────────────────────────────────────────────
|
||||||
validate:
|
validate:
|
||||||
name: Validate PR
|
name: Validate PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check for merge conflict markers
|
- name: Detect platform
|
||||||
run: |
|
id: platform
|
||||||
CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true)
|
run: |
|
||||||
if [ -n "$CONFLICTS" ]; then
|
# Read platform from XML manifest (<platform> tag) or plain text fallback
|
||||||
echo "::error::Merge conflict markers found in source files"
|
PLATFORM=$(sed -n 's/.*<platform>\([^<]*\)<\/platform>.*/\1/p' .mokogitea/manifest.xml 2>/dev/null | head -1)
|
||||||
echo "## Conflict Markers Found" >> $GITHUB_STEP_SUMMARY
|
[ -z "$PLATFORM" ] && PLATFORM=$(cat .mokogitea/manifest.xml 2>/dev/null | tr -d '[:space:]')
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
||||||
echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY
|
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 1
|
- name: Setup PHP
|
||||||
fi
|
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
||||||
echo "No conflict markers found"
|
run: |
|
||||||
|
if ! command -v php &> /dev/null; then
|
||||||
- name: Detect platform
|
sudo apt-get update -qq
|
||||||
id: platform
|
sudo apt-get install -y -qq php-cli php-mbstring php-xml >/dev/null 2>&1
|
||||||
run: |
|
fi
|
||||||
# Read platform from XML manifest (<platform> tag) or plain text fallback
|
|
||||||
PLATFORM=$(sed -n 's/.*<platform>\([^<]*\)<\/platform>.*/\1/p' .mokogitea/manifest.xml 2>/dev/null | head -1)
|
- name: PHP syntax check
|
||||||
[ -z "$PLATFORM" ] && PLATFORM=$(cat .mokogitea/manifest.xml 2>/dev/null | tr -d '[:space:]')
|
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
||||||
[ -z "$PLATFORM" ] && PLATFORM="generic"
|
run: |
|
||||||
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
|
ERRORS=0
|
||||||
|
while IFS= read -r -d '' file; do
|
||||||
- name: Setup PHP
|
if ! php -l "$file" 2>&1 | grep -q "No syntax errors"; then
|
||||||
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
ERRORS=$((ERRORS + 1))
|
||||||
run: |
|
fi
|
||||||
if ! command -v php &> /dev/null; then
|
done < <(find . -name "*.php" -not -path "./.git/*" -not -path "./vendor/*" -print0)
|
||||||
sudo apt-get update -qq
|
echo "PHP lint: ${ERRORS} error(s)"
|
||||||
sudo apt-get install -y -qq php-cli php-mbstring php-xml >/dev/null 2>&1
|
[ "$ERRORS" -eq 0 ] || { echo "::error::PHP syntax errors found"; exit 1; }
|
||||||
fi
|
|
||||||
|
- name: Validate platform manifest
|
||||||
- name: PHP syntax check
|
run: |
|
||||||
if: steps.platform.outputs.platform == 'joomla' || steps.platform.outputs.platform == 'dolibarr'
|
PLATFORM="${{ steps.platform.outputs.platform }}"
|
||||||
run: |
|
case "$PLATFORM" in
|
||||||
ERRORS=0
|
joomla)
|
||||||
while IFS= read -r -d '' file; do
|
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
||||||
if ! php -l "$file" 2>&1 | grep -q "No syntax errors"; then
|
if [ -z "$MANIFEST" ]; then
|
||||||
ERRORS=$((ERRORS + 1))
|
echo "::warning::No Joomla manifest found (WaaS site)"
|
||||||
fi
|
exit 0
|
||||||
done < <(find . -name "*.php" -not -path "./.git/*" -not -path "./vendor/*" -print0)
|
fi
|
||||||
echo "PHP lint: ${ERRORS} error(s)"
|
echo "Manifest: ${MANIFEST}"
|
||||||
[ "$ERRORS" -eq 0 ] || { echo "::error::PHP syntax errors found"; exit 1; }
|
if command -v php &> /dev/null; then
|
||||||
|
php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('$MANIFEST'); if(!\$x){foreach(libxml_get_errors() as \$e) echo \$e->message; exit(1);}" || { echo "::error::Manifest XML is malformed"; exit 1; }
|
||||||
- name: Joomla JEXEC guard check
|
fi
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
for ELEMENT in name version description; do
|
||||||
run: |
|
grep -q "<${ELEMENT}>" "$MANIFEST" || { echo "::error::Missing <${ELEMENT}> in manifest"; exit 1; }
|
||||||
ERRORS=0
|
done
|
||||||
while IFS= read -r -d '' file; do
|
echo "Joomla manifest valid"
|
||||||
# Skip vendor, node_modules, and index.html stub files
|
;;
|
||||||
case "$file" in ./vendor/*|./node_modules/*) continue ;; esac
|
dolibarr)
|
||||||
# Check first 10 lines for JEXEC or JPATH guard
|
MOD_FILE=$(find . -maxdepth 4 -name "mod*.class.php" ! -path "./.git/*" -exec grep -l 'extends DolibarrModules' {} \; 2>/dev/null | head -1)
|
||||||
if ! head -20 "$file" | grep -qE "defined\s*\(\s*['\"](_JEXEC|JPATH_BASE|\\\\JPATH_PLATFORM)['\"]"; then
|
if [ -z "$MOD_FILE" ]; then
|
||||||
echo "::error file=${file}::Missing JEXEC guard: ${file}"
|
echo "::error::No mod*.class.php found"
|
||||||
ERRORS=$((ERRORS + 1))
|
exit 1
|
||||||
fi
|
fi
|
||||||
done < <(find . -name "*.php" -path "*/src/*" -not -path "./.git/*" -not -path "./vendor/*" -print0)
|
echo "Dolibarr module: ${MOD_FILE}"
|
||||||
if [ "$ERRORS" -gt 0 ]; then
|
;;
|
||||||
echo "::error::${ERRORS} PHP file(s) missing defined('_JEXEC') or die guard"
|
*)
|
||||||
echo "## JEXEC Guard Check: Failed" >> $GITHUB_STEP_SUMMARY
|
echo "Generic platform — no manifest validation"
|
||||||
echo "${ERRORS} file(s) in src/ are missing the Joomla execution guard." >> $GITHUB_STEP_SUMMARY
|
;;
|
||||||
exit 1
|
esac
|
||||||
fi
|
|
||||||
echo "JEXEC guard: OK"
|
- name: Check update stream format
|
||||||
|
run: |
|
||||||
- name: Joomla directory listing protection
|
PLATFORM="${{ steps.platform.outputs.platform }}"
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
case "$PLATFORM" in
|
||||||
run: |
|
joomla)
|
||||||
MISSING=0
|
if [ -f "updates.xml" ]; then
|
||||||
SOURCE_DIR="src"
|
if command -v php &> /dev/null; then
|
||||||
[ ! -d "$SOURCE_DIR" ] && exit 0
|
php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('updates.xml'); if(!\$x){foreach(libxml_get_errors() as \$e) echo \$e->message; exit(1);}" || { echo "::error::updates.xml is malformed"; exit 1; }
|
||||||
while IFS= read -r dir; do
|
fi
|
||||||
if [ ! -f "${dir}/index.html" ]; then
|
echo "updates.xml valid"
|
||||||
echo "::warning::Missing index.html in ${dir} (directory listing protection)"
|
fi
|
||||||
MISSING=$((MISSING + 1))
|
;;
|
||||||
fi
|
dolibarr)
|
||||||
done < <(find "$SOURCE_DIR" -type d -not -path "./.git/*" -not -path "*/vendor/*" -not -path "*/node_modules/*")
|
[ -f "update.txt" ] && echo "update.txt present" || echo "::warning::No update.txt"
|
||||||
if [ "$MISSING" -gt 0 ]; then
|
;;
|
||||||
echo "## Directory Protection" >> $GITHUB_STEP_SUMMARY
|
esac
|
||||||
echo "${MISSING} director(ies) missing index.html" >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
- name: Verify package source
|
||||||
echo "Directory protection: ${MISSING} missing (advisory)"
|
run: |
|
||||||
|
SOURCE_DIR="src"
|
||||||
- name: Joomla script file and asset checks
|
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
if [ ! -d "$SOURCE_DIR" ]; then
|
||||||
run: |
|
echo "::warning::No src/ or htdocs/ directory"
|
||||||
ERRORS=0
|
exit 0
|
||||||
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
fi
|
||||||
[ -z "$MANIFEST" ] && exit 0
|
FILE_COUNT=$(find "$SOURCE_DIR" -type f | wc -l)
|
||||||
MANIFEST_DIR=$(dirname "$MANIFEST")
|
echo "Source: ${FILE_COUNT} files"
|
||||||
|
[ "$FILE_COUNT" -gt 0 ] || { echo "::error::Source directory is empty"; exit 1; }
|
||||||
# Check scriptfile exists if declared
|
|
||||||
SCRIPTFILE=$(sed -n 's/.*<scriptfile>\([^<]*\)<\/scriptfile>.*/\1/p' "$MANIFEST" 2>/dev/null)
|
# ── Pre-Release RC Build ─────────────────────────────────────────────────
|
||||||
if [ -n "$SCRIPTFILE" ]; then
|
pre-release:
|
||||||
if [ ! -f "${MANIFEST_DIR}/${SCRIPTFILE}" ]; then
|
name: Build RC Package
|
||||||
echo "::error::Manifest declares <scriptfile>${SCRIPTFILE}</scriptfile> but file not found at ${MANIFEST_DIR}/${SCRIPTFILE}"
|
runs-on: ubuntu-latest
|
||||||
ERRORS=$((ERRORS + 1))
|
needs: [branch-policy, validate]
|
||||||
else
|
|
||||||
echo "Script file: ${MANIFEST_DIR}/${SCRIPTFILE} (OK)"
|
steps:
|
||||||
fi
|
- name: Trigger RC pre-release
|
||||||
fi
|
env:
|
||||||
|
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
# Require joomla.asset.json and validate it
|
REPO: ${{ github.repository }}
|
||||||
ASSET_JSON=$(find "$MANIFEST_DIR" -name "joomla.asset.json" -not -path "./.git/*" 2>/dev/null | head -1)
|
BRANCH: ${{ github.head_ref }}
|
||||||
if [ -z "$ASSET_JSON" ]; then
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
echo "::error::joomla.asset.json not found — Joomla asset system is required"
|
run: |
|
||||||
ERRORS=$((ERRORS + 1))
|
curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${GITEA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
||||||
else
|
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
||||||
if command -v php &> /dev/null; then
|
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
php -r "json_decode(file_get_contents('$ASSET_JSON')); if(json_last_error()!==JSON_ERROR_NONE){echo json_last_error_msg();exit(1);}" 2>&1 || {
|
|
||||||
echo "::error::joomla.asset.json is not valid JSON"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
echo "joomla.asset.json: valid"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Validate all XML files in src/ are well-formed
|
|
||||||
XML_ERRORS=0
|
|
||||||
if command -v php &> /dev/null; then
|
|
||||||
while IFS= read -r -d '' xmlfile; do
|
|
||||||
if ! php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('$xmlfile'); if(!\$x){foreach(libxml_get_errors() as \$e) echo trim(\$e->message) . ' in $xmlfile'; exit(1);}" 2>&1; then
|
|
||||||
XML_ERRORS=$((XML_ERRORS + 1))
|
|
||||||
fi
|
|
||||||
done < <(find "$MANIFEST_DIR" -name "*.xml" -not -path "./.git/*" -print0)
|
|
||||||
fi
|
|
||||||
if [ "$XML_ERRORS" -gt 0 ]; then
|
|
||||||
echo "::error::${XML_ERRORS} XML file(s) are malformed"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
else
|
|
||||||
echo "XML well-formedness: OK"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$ERRORS" -gt 0 ] && exit 1
|
|
||||||
echo "Joomla asset checks: OK"
|
|
||||||
|
|
||||||
- name: Validate platform manifest
|
|
||||||
run: |
|
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
case "$PLATFORM" in
|
|
||||||
joomla)
|
|
||||||
MANIFEST=$(find . -maxdepth 3 -name "*.xml" ! -path "./.git/*" -exec grep -l '<extension' {} \; 2>/dev/null | head -1)
|
|
||||||
if [ -z "$MANIFEST" ]; then
|
|
||||||
echo "::warning::No Joomla manifest found (WaaS site)"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
echo "Manifest: ${MANIFEST}"
|
|
||||||
if command -v php &> /dev/null; then
|
|
||||||
php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('$MANIFEST'); if(!\$x){foreach(libxml_get_errors() as \$e) echo \$e->message; exit(1);}" || { echo "::error::Manifest XML is malformed"; exit 1; }
|
|
||||||
fi
|
|
||||||
for ELEMENT in name version description; do
|
|
||||||
grep -q "<${ELEMENT}>" "$MANIFEST" || { echo "::error::Missing <${ELEMENT}> in manifest"; exit 1; }
|
|
||||||
done
|
|
||||||
# Block legacy raw/branch update server URLs on MokoGitea
|
|
||||||
RAW_URLS=$(grep -n 'raw/branch' "$MANIFEST" | grep -i 'mokoconsulting\|mokogitea\|git\.mokoconsulting\.tech' || true)
|
|
||||||
if [ -n "$RAW_URLS" ]; then
|
|
||||||
echo "::error::Manifest contains legacy raw/branch update server URL on MokoGitea. Use the Gitea Pages URL instead (e.g. /{REPO}/updates.xml not /{REPO}/raw/branch/main/updates.xml)"
|
|
||||||
echo "$RAW_URLS"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Joomla manifest valid"
|
|
||||||
;;
|
|
||||||
dolibarr)
|
|
||||||
MOD_FILE=$(find . -maxdepth 4 -name "mod*.class.php" ! -path "./.git/*" -exec grep -l 'extends DolibarrModules' {} \; 2>/dev/null | head -1)
|
|
||||||
if [ -z "$MOD_FILE" ]; then
|
|
||||||
echo "::error::No mod*.class.php found"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Dolibarr module: ${MOD_FILE}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Generic platform — no manifest validation"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Check update stream format
|
|
||||||
run: |
|
|
||||||
PLATFORM="${{ steps.platform.outputs.platform }}"
|
|
||||||
case "$PLATFORM" in
|
|
||||||
joomla)
|
|
||||||
if [ -f "updates.xml" ]; then
|
|
||||||
if command -v php &> /dev/null; then
|
|
||||||
php -r "libxml_use_internal_errors(true); \$x = simplexml_load_file('updates.xml'); if(!\$x){foreach(libxml_get_errors() as \$e) echo \$e->message; exit(1);}" || { echo "::error::updates.xml is malformed"; exit 1; }
|
|
||||||
fi
|
|
||||||
echo "updates.xml valid"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
dolibarr)
|
|
||||||
[ -f "update.txt" ] && echo "update.txt present" || echo "::warning::No update.txt"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
- name: Validate Joomla language files
|
|
||||||
if: steps.platform.outputs.platform == 'joomla'
|
|
||||||
run: |
|
|
||||||
ERRORS=0
|
|
||||||
WARNINGS=0
|
|
||||||
|
|
||||||
# Require both en-GB and en-US language directories
|
|
||||||
LANG_ROOT=$(find . -path "*/language" -type d -not -path "./.git/*" 2>/dev/null | head -1)
|
|
||||||
if [ -z "$LANG_ROOT" ]; then
|
|
||||||
echo "No language/ directory found — skipping"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "$LANG_ROOT/en-GB" ]; then
|
|
||||||
echo "::error::Missing en-GB language directory (${LANG_ROOT}/en-GB)"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
fi
|
|
||||||
if [ ! -d "$LANG_ROOT/en-US" ]; then
|
|
||||||
echo "::error::Missing en-US language directory (${LANG_ROOT}/en-US)"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check that en-GB and en-US have matching .ini files
|
|
||||||
if [ -d "$LANG_ROOT/en-GB" ] && [ -d "$LANG_ROOT/en-US" ]; then
|
|
||||||
for GB_INI in "$LANG_ROOT/en-GB"/*.ini; do
|
|
||||||
[ ! -f "$GB_INI" ] && continue
|
|
||||||
US_INI="$LANG_ROOT/en-US/$(basename "$GB_INI")"
|
|
||||||
if [ ! -f "$US_INI" ]; then
|
|
||||||
echo "::error::$(basename "$GB_INI") exists in en-GB but missing from en-US"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
for US_INI in "$LANG_ROOT/en-US"/*.ini; do
|
|
||||||
[ ! -f "$US_INI" ] && continue
|
|
||||||
GB_INI="$LANG_ROOT/en-GB/$(basename "$US_INI")"
|
|
||||||
if [ ! -f "$GB_INI" ]; then
|
|
||||||
echo "::error::$(basename "$US_INI") exists in en-US but missing from en-GB"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find all .ini language files
|
|
||||||
INI_FILES=$(find . -path "*/language/*/*.ini" -not -path "./.git/*" 2>/dev/null)
|
|
||||||
if [ -z "$INI_FILES" ]; then
|
|
||||||
echo "No .ini language files found"
|
|
||||||
[ "$ERRORS" -gt 0 ] && exit 1
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Found $(echo "$INI_FILES" | wc -l) language file(s)"
|
|
||||||
|
|
||||||
for FILE in $INI_FILES; do
|
|
||||||
FNAME=$(basename "$FILE")
|
|
||||||
LINENUM=0
|
|
||||||
SEEN_KEYS=""
|
|
||||||
|
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
|
||||||
LINENUM=$((LINENUM + 1))
|
|
||||||
|
|
||||||
# Skip empty lines and comments
|
|
||||||
[ -z "$line" ] && continue
|
|
||||||
echo "$line" | grep -qE '^\s*;' && continue
|
|
||||||
echo "$line" | grep -qE '^\s*$' && continue
|
|
||||||
|
|
||||||
# Must match KEY="VALUE" format
|
|
||||||
if ! echo "$line" | grep -qE '^[A-Z_][A-Z0-9_]*=".*"$'; then
|
|
||||||
echo "::error file=${FILE},line=${LINENUM}::Malformed line: ${line}"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract key and check for duplicates
|
|
||||||
KEY=$(echo "$line" | sed 's/=.*//')
|
|
||||||
if echo "$SEEN_KEYS" | grep -qx "$KEY"; then
|
|
||||||
echo "::error file=${FILE},line=${LINENUM}::Duplicate key: ${KEY}"
|
|
||||||
ERRORS=$((ERRORS + 1))
|
|
||||||
fi
|
|
||||||
SEEN_KEYS="${SEEN_KEYS}
|
|
||||||
${KEY}"
|
|
||||||
done < "$FILE"
|
|
||||||
|
|
||||||
echo " ${FILE}: checked ${LINENUM} lines"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Cross-check en-GB vs en-US key consistency
|
|
||||||
GB_DIR=$(find . -path "*/language/en-GB" -type d -not -path "./.git/*" 2>/dev/null | head -1)
|
|
||||||
US_DIR=$(find . -path "*/language/en-US" -type d -not -path "./.git/*" 2>/dev/null | head -1)
|
|
||||||
|
|
||||||
if [ -n "$GB_DIR" ] && [ -n "$US_DIR" ]; then
|
|
||||||
for GB_FILE in "$GB_DIR"/*.ini; do
|
|
||||||
[ ! -f "$GB_FILE" ] && continue
|
|
||||||
FNAME=$(basename "$GB_FILE")
|
|
||||||
US_FILE="$US_DIR/$FNAME"
|
|
||||||
[ ! -f "$US_FILE" ] && continue
|
|
||||||
|
|
||||||
GB_KEYS=$(grep -oP '^[A-Z_][A-Z0-9_]*(?==)' "$GB_FILE" 2>/dev/null | sort)
|
|
||||||
US_KEYS=$(grep -oP '^[A-Z_][A-Z0-9_]*(?==)' "$US_FILE" 2>/dev/null | sort)
|
|
||||||
|
|
||||||
# Keys in en-GB but not en-US
|
|
||||||
MISSING_US=$(comm -23 <(echo "$GB_KEYS") <(echo "$US_KEYS"))
|
|
||||||
if [ -n "$MISSING_US" ]; then
|
|
||||||
echo "::warning::Keys in en-GB/$FNAME but missing from en-US/$FNAME:"
|
|
||||||
echo "$MISSING_US" | while read -r k; do echo " - $k"; done
|
|
||||||
WARNINGS=$((WARNINGS + 1))
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Keys in en-US but not en-GB
|
|
||||||
MISSING_GB=$(comm -13 <(echo "$GB_KEYS") <(echo "$US_KEYS"))
|
|
||||||
if [ -n "$MISSING_GB" ]; then
|
|
||||||
echo "::warning::Keys in en-US/$FNAME but missing from en-GB/$FNAME:"
|
|
||||||
echo "$MISSING_GB" | while read -r k; do echo " - $k"; done
|
|
||||||
WARNINGS=$((WARNINGS + 1))
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
|
||||||
echo "### Language File Validation"
|
|
||||||
echo "| Metric | Count |"
|
|
||||||
echo "|---|---|"
|
|
||||||
echo "| Files checked | $(echo "$INI_FILES" | wc -l) |"
|
|
||||||
echo "| Errors | ${ERRORS} |"
|
|
||||||
echo "| Warnings | ${WARNINGS} |"
|
|
||||||
} >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
if [ "$ERRORS" -gt 0 ]; then
|
|
||||||
echo "::error::Language validation failed with ${ERRORS} error(s)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Language files: OK (${WARNINGS} warning(s))"
|
|
||||||
|
|
||||||
- name: Check changelog has unreleased entry
|
|
||||||
run: |
|
|
||||||
if [ ! -f "CHANGELOG.md" ]; then
|
|
||||||
echo "::warning::No CHANGELOG.md found"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
# Check for content under [Unreleased] section
|
|
||||||
if ! grep -q "## \[Unreleased\]" CHANGELOG.md; then
|
|
||||||
echo "::error::CHANGELOG.md missing [Unreleased] section"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# Check there's at least one entry (Added/Changed/Fixed/Removed) under Unreleased
|
|
||||||
UNRELEASED_CONTENT=$(sed -n '/## \[Unreleased\]/,/## \[/p' CHANGELOG.md | grep -cE '^\s*-\s' || true)
|
|
||||||
if [ "$UNRELEASED_CONTENT" -eq 0 ]; then
|
|
||||||
echo "::error::CHANGELOG.md [Unreleased] section has no entries. Add a changelog entry describing your changes."
|
|
||||||
echo "## Changelog Check: Failed" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "The \`[Unreleased]\` section in CHANGELOG.md has no entries." >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Add a line like \`- Description of your change\` under a heading (\`### Added\`, \`### Changed\`, \`### Fixed\`, etc.)" >> $GITHUB_STEP_SUMMARY
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Changelog: ${UNRELEASED_CONTENT} entry/entries in [Unreleased]"
|
|
||||||
|
|
||||||
- name: Verify package source
|
|
||||||
run: |
|
|
||||||
SOURCE_DIR="src"
|
|
||||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
||||||
if [ ! -d "$SOURCE_DIR" ]; then
|
|
||||||
echo "::warning::No src/ or htdocs/ directory"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
FILE_COUNT=$(find "$SOURCE_DIR" -type f | wc -l)
|
|
||||||
echo "Source: ${FILE_COUNT} files"
|
|
||||||
[ "$FILE_COUNT" -gt 0 ] || { echo "::error::Source directory is empty"; exit 1; }
|
|
||||||
|
|
||||||
# ── Pre-Release RC Build ─────────────────────────────────────────────────
|
|
||||||
pre-release:
|
|
||||||
name: Build RC Package
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [branch-policy, validate]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Trigger RC pre-release
|
|
||||||
env:
|
|
||||||
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
REPO: ${{ github.repository }}
|
|
||||||
BRANCH: ${{ github.head_ref }}
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
run: |
|
|
||||||
curl -s -X POST "${GITEA_URL}/api/v1/repos/${REPO}/actions/workflows/pre-release.yml/dispatches" -H "Authorization: token ${GITEA_TOKEN}" -H "Content-Type: application/json" -d "{\"ref\":\"${BRANCH}\",\"inputs\":{\"stability\":\"release-candidate\"}}"
|
|
||||||
echo "### Pre-Release" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
# ── Issue Reporter ──────────────────────────────────────────────────────
|
|
||||||
report-issues:
|
|
||||||
name: Report Issues
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [branch-policy, validate]
|
|
||||||
if: >-
|
|
||||||
always() &&
|
|
||||||
needs.validate.result == 'failure'
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
sparse-checkout: automation/ci-issue-reporter.sh
|
|
||||||
sparse-checkout-cone-mode: false
|
|
||||||
|
|
||||||
- name: "File issue for PR validation failure"
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
||||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
||||||
run: |
|
|
||||||
chmod +x automation/ci-issue-reporter.sh
|
|
||||||
./automation/ci-issue-reporter.sh \
|
|
||||||
--gate "PR Validation" \
|
|
||||||
--workflow "PR Check" \
|
|
||||||
--severity error \
|
|
||||||
--details "PR validation failed (syntax, manifest, changelog, or source checks). See the CI run for the specific check that failed."
|
|
||||||
|
|||||||
@@ -8,22 +8,15 @@
|
|||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||||
# PATH: /templates/workflows/universal/pre-release.yml.template
|
# PATH: /templates/workflows/universal/pre-release.yml.template
|
||||||
# VERSION: 05.01.00
|
# VERSION: 05.01.00
|
||||||
# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches
|
# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch
|
||||||
|
|
||||||
name: "Universal: Pre-Release"
|
name: "Universal: Pre-Release"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
- 'fix/**'
|
|
||||||
- 'patch/**'
|
|
||||||
- 'hotfix/**'
|
|
||||||
- 'bugfix/**'
|
|
||||||
- 'chore/**'
|
|
||||||
- alpha
|
|
||||||
- beta
|
|
||||||
- rc
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
stability:
|
stability:
|
||||||
@@ -46,11 +39,11 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})"
|
name: "Build Pre-Release (${{ inputs.stability || 'development' }})"
|
||||||
runs-on: release
|
runs-on: release
|
||||||
if: >-
|
if: >-
|
||||||
github.event_name == 'workflow_dispatch' ||
|
github.event_name == 'workflow_dispatch' ||
|
||||||
github.event_name == 'push'
|
(github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -58,50 +51,30 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
ref: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
- name: Setup moko-platform tools
|
- name: Setup moko-platform tools
|
||||||
env:
|
env:
|
||||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
run: |
|
run: |
|
||||||
# Use pre-installed /opt/moko-platform if available (updated by cron every 6h)
|
if ! command -v composer &> /dev/null; then
|
||||||
if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/cli/manifest_element.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
echo Using pre-installed /opt/moko-platform
|
|
||||||
echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo Falling back to fresh clone
|
|
||||||
if ! command -v composer > /dev/null 2>&1; then
|
|
||||||
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1
|
|
||||||
fi
|
|
||||||
rm -rf /tmp/moko-platform-api
|
|
||||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git
|
|
||||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api
|
|
||||||
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
|
||||||
echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV
|
|
||||||
fi
|
fi
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
|
/tmp/moko-platform-api
|
||||||
|
cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet
|
||||||
|
echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Detect platform
|
- name: Detect platform
|
||||||
id: platform
|
id: platform
|
||||||
run: |
|
run: |
|
||||||
# Auto-detect and update platform if not set in manifest
|
|
||||||
php ${MOKO_CLI}/platform_detect.php --path . --github-output 2>/dev/null || true
|
|
||||||
php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
||||||
|
|
||||||
- name: Resolve metadata and bump version
|
- name: Resolve metadata and bump version
|
||||||
id: meta
|
id: meta
|
||||||
run: |
|
run: |
|
||||||
# Auto-detect stability from branch name on push, or use input on dispatch
|
STABILITY="${{ inputs.stability || 'development' }}"
|
||||||
if [ "${{ github.event_name }}" = "push" ]; then
|
|
||||||
case "${{ github.ref_name }}" in
|
|
||||||
rc) STABILITY="release-candidate" ;;
|
|
||||||
alpha) STABILITY="alpha" ;;
|
|
||||||
beta) STABILITY="beta" ;;
|
|
||||||
*) STABILITY="development" ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
STABILITY="${{ inputs.stability || 'development' }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$STABILITY" in
|
case "$STABILITY" in
|
||||||
development) SUFFIX="-dev"; TAG="development" ;;
|
development) SUFFIX="-dev"; TAG="development" ;;
|
||||||
@@ -110,26 +83,20 @@ jobs:
|
|||||||
release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;;
|
release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Bump version via CLI: patch for dev/alpha/beta, minor for RC
|
# Read current version (bump already handled by push workflow)
|
||||||
case "$STABILITY" in
|
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null)
|
||||||
release-candidate) BUMP="minor" ;;
|
[ -z "$VERSION" ] && VERSION="00.00.01"
|
||||||
*) BUMP="patch" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
php ${MOKO_CLI}/version_bump.php --path . $([ "$BUMP" = "minor" ] && echo "--minor") 2>/dev/null || true
|
# Strip any existing suffix from version before applying stability
|
||||||
|
|
||||||
# Set stability suffix and verify consistency
|
|
||||||
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null || echo "00.00.01")
|
|
||||||
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
||||||
|
|
||||||
php ${MOKO_CLI}/version_set_platform.php \
|
php ${MOKO_CLI}/version_set_platform.php \
|
||||||
--path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true
|
--path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true
|
||||||
|
|
||||||
|
# Verify version consistency across all files
|
||||||
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
|
||||||
# Ensure licensing tags (updateservers, dlid) if enabled in manifest.xml
|
# Update VERSION variable with suffix
|
||||||
php ${MOKO_CLI}/manifest_licensing.php --path . --fix 2>/dev/null || true
|
|
||||||
|
|
||||||
# Append suffix for output
|
|
||||||
if [ -n "$SUFFIX" ]; then
|
if [ -n "$SUFFIX" ]; then
|
||||||
VERSION="${VERSION}${SUFFIX}"
|
VERSION="${VERSION}${SUFFIX}"
|
||||||
fi
|
fi
|
||||||
@@ -173,42 +140,7 @@ jobs:
|
|||||||
php ${MOKO_CLI}/release_create.php \
|
php ${MOKO_CLI}/release_create.php \
|
||||||
--path . --version "$VERSION" --tag "$TAG" \
|
--path . --version "$VERSION" --tag "$TAG" \
|
||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
--repo "${GITEA_REPO}" --branch "${{ github.ref_name }}" --prerelease
|
--repo "${GITEA_REPO}" --branch dev --prerelease
|
||||||
|
|
||||||
- name: Update release notes from CHANGELOG.md
|
|
||||||
run: |
|
|
||||||
TAG="${{ steps.meta.outputs.tag }}"
|
|
||||||
VERSION="${{ steps.meta.outputs.version }}"
|
|
||||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
||||||
|
|
||||||
# Extract [Unreleased] section from changelog (everything between [Unreleased] and next ## heading)
|
|
||||||
if [ -f "CHANGELOG.md" ]; then
|
|
||||||
NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md)
|
|
||||||
[ -z "$NOTES" ] && NOTES="Release ${VERSION}"
|
|
||||||
else
|
|
||||||
NOTES="Release ${VERSION}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update release body via API
|
|
||||||
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
||||||
"${API_BASE}/releases/tags/${TAG}" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
|
|
||||||
|
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
|
||||||
python3 -c "
|
|
||||||
import json, urllib.request
|
|
||||||
body = open('/dev/stdin').read()
|
|
||||||
payload = json.dumps({'body': body}).encode()
|
|
||||||
req = urllib.request.Request(
|
|
||||||
'${API_BASE}/releases/${RELEASE_ID}',
|
|
||||||
data=payload, method='PATCH',
|
|
||||||
headers={
|
|
||||||
'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}',
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
})
|
|
||||||
urllib.request.urlopen(req)
|
|
||||||
" <<< "$NOTES"
|
|
||||||
echo "Release notes updated from CHANGELOG.md"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Build package and upload
|
- name: Build package and upload
|
||||||
id: package
|
id: package
|
||||||
@@ -221,8 +153,55 @@ jobs:
|
|||||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
--repo "${GITEA_REPO}" --output /tmp || true
|
--repo "${GITEA_REPO}" --output /tmp || true
|
||||||
|
|
||||||
# updates.xml is generated dynamically by MokoGitea license server
|
- name: Update updates.xml
|
||||||
# No need to build, commit, or sync updates.xml from workflows
|
if: steps.platform.outputs.platform == 'joomla'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
|
STABILITY="${{ steps.meta.outputs.stability }}"
|
||||||
|
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
||||||
|
|
||||||
|
if [ ! -f "updates.xml" ]; then
|
||||||
|
echo "No updates.xml -- skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
SHA_FLAG=""
|
||||||
|
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
||||||
|
|
||||||
|
php ${MOKO_CLI}/updates_xml_build.php \
|
||||||
|
--path . --version "${VERSION}" --stability "${STABILITY}" \
|
||||||
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
${SHA_FLAG}
|
||||||
|
|
||||||
|
# Commit and push
|
||||||
|
if ! git diff --quiet updates.xml 2>/dev/null; then
|
||||||
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
|
git add updates.xml
|
||||||
|
git commit -m "chore: update ${STABILITY} channel ${VERSION} [skip ci]"
|
||||||
|
git push origin HEAD 2>&1 || echo "WARNING: push failed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: "Sync updates.xml to all branches"
|
||||||
|
if: steps.platform.outputs.platform == 'joomla'
|
||||||
|
run: |
|
||||||
|
CURRENT_BRANCH="${{ github.ref_name }}"
|
||||||
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
|
|
||||||
|
for BRANCH in main dev; do
|
||||||
|
[ "$BRANCH" = "$CURRENT_BRANCH" ] && continue
|
||||||
|
echo "Syncing updates.xml -> ${BRANCH}"
|
||||||
|
git fetch origin "${BRANCH}" 2>/dev/null || continue
|
||||||
|
git checkout "origin/${BRANCH}" -- updates.xml 2>/dev/null || continue
|
||||||
|
git checkout "${CURRENT_BRANCH}" -- updates.xml
|
||||||
|
if ! git diff --quiet updates.xml 2>/dev/null; then
|
||||||
|
git add updates.xml
|
||||||
|
git commit -m "chore: sync updates.xml from ${CURRENT_BRANCH} [skip ci]"
|
||||||
|
git push origin HEAD:refs/heads/${BRANCH} 2>&1 || echo "WARNING: push to ${BRANCH} failed"
|
||||||
|
fi
|
||||||
|
git checkout "${CURRENT_BRANCH}" 2>/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
- name: "Delete lesser pre-release channels (cascade)"
|
- name: "Delete lesser pre-release channels (cascade)"
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,311 @@
|
|||||||
|
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
#
|
||||||
|
# FILE INFORMATION
|
||||||
|
# DEFGROUP: Gitea.Workflow
|
||||||
|
# INGROUP: moko-platform.Universal
|
||||||
|
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||||
|
# PATH: /templates/workflows/update-server.yml
|
||||||
|
# VERSION: 05.00.00
|
||||||
|
# BRIEF: Pre-release build + update server XML for dev/alpha/beta/rc branches
|
||||||
|
#
|
||||||
|
# Thin wrapper around moko-platform CLI tools.
|
||||||
|
# Builds packages, updates updates.xml, and optionally deploys via SFTP.
|
||||||
|
#
|
||||||
|
# Joomla filters update entries by the user's "Minimum Stability" setting.
|
||||||
|
|
||||||
|
name: "Update Server"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'dev'
|
||||||
|
- 'dev/**'
|
||||||
|
- 'alpha/**'
|
||||||
|
- 'beta/**'
|
||||||
|
- 'rc/**'
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'htdocs/**'
|
||||||
|
pull_request:
|
||||||
|
types: [closed]
|
||||||
|
branches:
|
||||||
|
- 'dev'
|
||||||
|
- 'dev/**'
|
||||||
|
- 'alpha/**'
|
||||||
|
- 'beta/**'
|
||||||
|
- 'rc/**'
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- 'htdocs/**'
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
stability:
|
||||||
|
description: 'Stability tag'
|
||||||
|
required: true
|
||||||
|
default: 'development'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- development
|
||||||
|
- alpha
|
||||||
|
- beta
|
||||||
|
- rc
|
||||||
|
- stable
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||||
|
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||||
|
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
||||||
|
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-xml:
|
||||||
|
name: Update Server
|
||||||
|
runs-on: release
|
||||||
|
if: >-
|
||||||
|
github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup moko-platform tools
|
||||||
|
env:
|
||||||
|
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||||
|
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||||
|
COMPOSER_AUTH: '{"http-basic":{"git.mokoconsulting.tech":{"username":"token","password":"${{ secrets.MOKOGITEA_TOKEN }}"}}}'
|
||||||
|
run: |
|
||||||
|
if ! command -v composer &> /dev/null; then
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
if [ -d "/tmp/moko-platform" ]; then
|
||||||
|
echo "moko-platform already available — skipping clone"
|
||||||
|
else
|
||||||
|
git clone --depth 1 --branch main --quiet \
|
||||||
|
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
||||||
|
/tmp/moko-platform 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if [ -d "/tmp/moko-platform" ] && [ -f "/tmp/moko-platform/composer.json" ]; then
|
||||||
|
cd /tmp/moko-platform && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
echo "MOKO_CLI=/tmp/moko-platform/cli" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Detect platform
|
||||||
|
id: platform
|
||||||
|
run: php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
||||||
|
|
||||||
|
- name: Resolve stability and bump version
|
||||||
|
id: meta
|
||||||
|
run: |
|
||||||
|
BRANCH="${{ github.ref_name }}"
|
||||||
|
|
||||||
|
# Configure git for bot pushes
|
||||||
|
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
||||||
|
git config --local user.name "gitea-actions[bot]"
|
||||||
|
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||||
|
|
||||||
|
# Auto-bump patch version
|
||||||
|
php ${MOKO_CLI}/version_bump.php --path . 2>/dev/null || true
|
||||||
|
|
||||||
|
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null || echo "0.0.0")
|
||||||
|
|
||||||
|
# Determine stability from branch or manual input
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
STABILITY="${{ inputs.stability }}"
|
||||||
|
elif [[ "$BRANCH" == rc/* ]]; then
|
||||||
|
STABILITY="rc"
|
||||||
|
elif [[ "$BRANCH" == beta/* ]]; then
|
||||||
|
STABILITY="beta"
|
||||||
|
elif [[ "$BRANCH" == alpha/* ]]; then
|
||||||
|
STABILITY="alpha"
|
||||||
|
else
|
||||||
|
STABILITY="development"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Version suffix per stability stream
|
||||||
|
case "$STABILITY" in
|
||||||
|
development) SUFFIX="-dev"; TAG="development" ;;
|
||||||
|
alpha) SUFFIX="-alpha"; TAG="alpha" ;;
|
||||||
|
beta) SUFFIX="-beta"; TAG="beta" ;;
|
||||||
|
rc) SUFFIX="-rc"; TAG="release-candidate" ;;
|
||||||
|
*) SUFFIX=""; TAG="stable" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Propagate version with stability suffix to all manifest files
|
||||||
|
php ${MOKO_CLI}/version_set_platform.php \
|
||||||
|
--path . --version "$VERSION" --branch "$BRANCH" --stability "$STABILITY" 2>/dev/null || true
|
||||||
|
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
||||||
|
|
||||||
|
# Re-read version (now includes suffix from version_set_platform)
|
||||||
|
if [ -n "$SUFFIX" ]; then
|
||||||
|
VERSION="${VERSION}${SUFFIX}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "display_version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Commit version bump if changed
|
||||||
|
git add -A
|
||||||
|
git diff --cached --quiet || {
|
||||||
|
git commit -m "chore(version): auto-bump ${VERSION} [skip ci]" \
|
||||||
|
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
||||||
|
git push
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Create release and upload package
|
||||||
|
id: package
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
|
TAG="${{ steps.meta.outputs.tag }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
|
||||||
|
# Create or update Gitea release
|
||||||
|
php ${MOKO_CLI}/release_create.php \
|
||||||
|
--path . --version "$VERSION" --tag "$TAG" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --branch "${{ github.ref_name }}" --prerelease
|
||||||
|
|
||||||
|
# Build package and upload
|
||||||
|
php ${MOKO_CLI}/release_package.php \
|
||||||
|
--path . --version "$VERSION" --tag "$TAG" \
|
||||||
|
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
||||||
|
--repo "${GITEA_REPO}" --output /tmp || true
|
||||||
|
|
||||||
|
- name: Update updates.xml
|
||||||
|
if: steps.platform.outputs.platform == 'joomla'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
|
STABILITY="${{ steps.meta.outputs.stability }}"
|
||||||
|
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
||||||
|
|
||||||
|
if [ ! -f "updates.xml" ]; then
|
||||||
|
echo "No updates.xml — skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
SHA_FLAG=""
|
||||||
|
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
||||||
|
|
||||||
|
php ${MOKO_CLI}/updates_xml_build.php \
|
||||||
|
--path . --version "${VERSION}" --stability "${STABILITY}" \
|
||||||
|
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
||||||
|
${SHA_FLAG}
|
||||||
|
|
||||||
|
# Commit and push updates.xml
|
||||||
|
git add updates.xml
|
||||||
|
git diff --cached --quiet || {
|
||||||
|
git commit -m "chore: update ${STABILITY} channel ${VERSION} [skip ci]"
|
||||||
|
git push
|
||||||
|
}
|
||||||
|
|
||||||
|
- name: Sync updates.xml to main
|
||||||
|
if: github.ref_name != 'main' && steps.platform.outputs.platform == 'joomla'
|
||||||
|
run: |
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
GITEA_TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
||||||
|
|
||||||
|
FILE_SHA=$(curl -sf -H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${API_BASE}/contents/updates.xml?ref=main" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha',''))" 2>/dev/null || true)
|
||||||
|
|
||||||
|
if [ -n "$FILE_SHA" ] && [ -f "updates.xml" ]; then
|
||||||
|
python3 -c "
|
||||||
|
import base64, json, urllib.request, sys
|
||||||
|
with open('updates.xml', 'rb') as f:
|
||||||
|
content = base64.b64encode(f.read()).decode()
|
||||||
|
payload = json.dumps({
|
||||||
|
'content': content,
|
||||||
|
'sha': '${FILE_SHA}',
|
||||||
|
'message': 'chore: sync updates.xml from ${{ steps.meta.outputs.stability }} [skip ci]',
|
||||||
|
'branch': 'main'
|
||||||
|
}).encode()
|
||||||
|
req = urllib.request.Request(
|
||||||
|
'${API_BASE}/contents/updates.xml',
|
||||||
|
data=payload, method='PUT',
|
||||||
|
headers={
|
||||||
|
'Authorization': 'token ${GITEA_TOKEN}',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
})
|
||||||
|
try:
|
||||||
|
urllib.request.urlopen(req)
|
||||||
|
print('updates.xml synced to main')
|
||||||
|
except Exception as e:
|
||||||
|
print(f'WARNING: sync to main failed: {e}', file=sys.stderr)
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: SFTP deploy to dev server
|
||||||
|
if: contains(github.ref, 'dev/') || github.ref == 'refs/heads/dev'
|
||||||
|
env:
|
||||||
|
DEV_HOST: ${{ vars.DEV_FTP_HOST }}
|
||||||
|
DEV_PATH: ${{ vars.DEV_FTP_PATH }}
|
||||||
|
DEV_SUFFIX: ${{ vars.DEV_FTP_SUFFIX }}
|
||||||
|
DEV_USER: ${{ vars.DEV_FTP_USERNAME }}
|
||||||
|
DEV_PORT: ${{ vars.DEV_FTP_PORT }}
|
||||||
|
DEV_KEY: ${{ secrets.DEV_FTP_KEY }}
|
||||||
|
DEV_PASS: ${{ secrets.DEV_FTP_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
# Permission check: admin or maintain role required
|
||||||
|
ACTOR="${{ github.actor }}"
|
||||||
|
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||||
|
|
||||||
|
PERMISSION=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||||
|
"${API_BASE}/collaborators/${ACTOR}/permission" 2>/dev/null | \
|
||||||
|
python3 -c "import sys,json; print(json.load(sys.stdin).get('permission','read'))" 2>/dev/null || echo "read")
|
||||||
|
case "$PERMISSION" in
|
||||||
|
admin|maintain|write) ;;
|
||||||
|
*)
|
||||||
|
echo "Deploy denied: ${ACTOR} has '${PERMISSION}' — requires admin, maintain, or write"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
[ -z "$DEV_HOST" ] || [ -z "$DEV_PATH" ] && { echo "DEV FTP not configured — skipping SFTP"; exit 0; }
|
||||||
|
|
||||||
|
SOURCE_DIR="src"
|
||||||
|
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
||||||
|
[ ! -d "$SOURCE_DIR" ] && exit 0
|
||||||
|
|
||||||
|
PORT="${DEV_PORT:-22}"
|
||||||
|
REMOTE="${DEV_PATH%/}"
|
||||||
|
[ -n "$DEV_SUFFIX" ] && REMOTE="${REMOTE}/${DEV_SUFFIX#/}"
|
||||||
|
|
||||||
|
printf '{"host":"%s","port":%s,"username":"%s","remotePath":"%s"' \
|
||||||
|
"$DEV_HOST" "$PORT" "$DEV_USER" "$REMOTE" > /tmp/sftp-config.json
|
||||||
|
if [ -n "$DEV_KEY" ]; then
|
||||||
|
echo "$DEV_KEY" > /tmp/deploy_key && chmod 600 /tmp/deploy_key
|
||||||
|
printf ',"privateKeyPath":"/tmp/deploy_key"}' >> /tmp/sftp-config.json
|
||||||
|
else
|
||||||
|
printf ',"password":"%s"}' "$DEV_PASS" >> /tmp/sftp-config.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
PLATFORM=$(php ${MOKO_CLI}/platform_detect.php --path . 2>/dev/null || true)
|
||||||
|
if [ "$PLATFORM" = "waas-component" ] && [ -f "${MOKO_CLI}/../deploy/deploy-joomla.php" ]; then
|
||||||
|
php ${MOKO_CLI}/../deploy/deploy-joomla.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
||||||
|
elif [ -f "${MOKO_CLI}/../deploy/deploy-sftp.php" ]; then
|
||||||
|
php ${MOKO_CLI}/../deploy/deploy-sftp.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
||||||
|
fi
|
||||||
|
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
||||||
|
echo "SFTP deploy to dev complete" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.meta.outputs.version }}"
|
||||||
|
STABILITY="${{ steps.meta.outputs.stability }}"
|
||||||
|
DISPLAY="${{ steps.meta.outputs.display_version }}"
|
||||||
|
echo "## Update Server" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Stability | \`${STABILITY}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "| Version | \`${DISPLAY}\` |" >> $GITHUB_STEP_SUMMARY
|
||||||
+127
-13
@@ -8,26 +8,140 @@
|
|||||||
DEFGROUP: Joomla.Template.Site
|
DEFGROUP: Joomla.Template.Site
|
||||||
INGROUP: MokoOnyx.Documentation
|
INGROUP: MokoOnyx.Documentation
|
||||||
PATH: ./CHANGELOG.md
|
PATH: ./CHANGELOG.md
|
||||||
VERSION: 02.19.08
|
VERSION: 03.09.03
|
||||||
BRIEF: Changelog file documenting version history of MokoOnyx
|
BRIEF: Changelog file documenting version history of MokoOnyx
|
||||||
-->
|
-->
|
||||||
|
|
||||||
# Changelog — MokoOnyx (VERSION: 02.19.08)
|
# Changelog — MokoOnyx (VERSION: 03.09.03)
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- Strip Joomla-injected `p-2` padding class from Font Awesome icons in all menu overrides (default, mainmenu, horizontal)
|
All notable changes to the MokoOnyx Joomla template are documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [02.08.00-dev] --- 2026-05-28
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Migrated update server URL from raw file endpoint to Gitea Pages
|
- Migrated all workflow and template paths from `.github/` to `.mokogitea/`
|
||||||
- Release workflow no longer manages updates.xml (decoupled to Gitea Pages)
|
- Template source paths updated: `templates/gitea/` to `templates/mokogitea/`
|
||||||
- Added conflict-marker guard to PR check and release workflows
|
- HCL definition files removed -- Template repos are now the canonical source
|
||||||
- Added Joomla language file validation (syntax, duplicates, en-GB/en-US consistency)
|
|
||||||
- Added JEXEC guard, joomla.asset.json, XML well-formedness, and script file CI checks
|
|
||||||
- Removed RS_FTP_PATH_SUFFIX from repo health requirements
|
|
||||||
|
|
||||||
## [02.20.00] --- 2026-06-04
|
### Added
|
||||||
|
- `branch-cleanup.yml`: auto-delete merged feature branches after PR merge
|
||||||
|
|
||||||
## [02.18.00] --- 2026-06-02
|
### Removed
|
||||||
|
- Removed deploy-manual.yml workflow -- switching to Joomla update server method for extension distribution
|
||||||
|
- Removed deploy variables and secrets (DEV_FTP_*)
|
||||||
|
- **Theme preview removed** -- Removed unused language strings for theme preview feature (never wired into config)
|
||||||
|
- **Repo cleanup** -- Removed 38 unused files: Fredoka/Pacifico fonts, dead npm tooling (package.json, scripts/), tmp-overrides/, placeholder tests, orphaned workflow copies, stale READMEs
|
||||||
|
- **Broken font options removed** -- Removed Noto Sans and Fira Sans from font selector (CSS files never existed)
|
||||||
|
- **Docs moved to wiki** -- CONTRIBUTING.md, CODE_OF_CONDUCT.md, GOVERNANCE.md migrated to Gitea wiki
|
||||||
|
|
||||||
## [02.15.00] --- 2026-05-30
|
### Changed
|
||||||
|
- **repo-health.yml** -- Wiki-preferred documentation checks via Gitea API (wiki = full credit, repo file = advisory)
|
||||||
|
- **auto-release.yml Step 8b** -- Replaced inline Python with release_body_update.php CLI tool (fixes SIGPIPE exit 141)
|
||||||
|
- **pre-release.yml rewritten** -- Uses moko-platform CLI tools, PHP instead of Python, fixed broken platform detection
|
||||||
|
- **All workflow YAML files** -- Stripped non-ASCII characters (em dashes, arrows, emoji) for Gitea YAML parser compatibility
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **Menu icon padding removed** -- Removed hardcoded `p-2` class from all mod_menu icon spans (horizontal + mainmenu layouts); icons now inherit spacing from the parent link
|
||||||
|
- **Runner checkout failures** -- Fixed MySQL deadlocks in Gitea actions scheduler by restarting Gitea and recreating runners with --privileged flag
|
||||||
|
- **workflow_dispatch 500 error** -- Stripped UTF-8 multibyte characters from all YAML files that Gitea's Go parser rejected as control characters
|
||||||
|
|
||||||
|
## [02.06.00] - 2026-05-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **Community Builder plugin type** — Auto-release detects `<cbplugin>` manifests and uses `cb_` prefix
|
||||||
|
- **Platform auto-sense** — Workflow detects Joomla/Dolibarr/generic from file structure without manifest
|
||||||
|
- **Font Awesome + Bootstrap in component view** — Print/modal view now loads FA7 and Bootstrap 5
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Release workflow dispatch-only removed** — Auto-release triggers on PR merge to main (src/htdocs paths) + manual dispatch
|
||||||
|
- **Version bump protocol** — Releases use version as-is from main; dev bumped to next minor after release (Step 11)
|
||||||
|
- **GitHub mirror removed** — Gitea is the sole release platform
|
||||||
|
- **update-server.yml removed** — Merged into auto-release (stable) and pre-release (dev/rc) workflows
|
||||||
|
- **`.mokogitea/manifest.xml` precedence** — Platform detection reads .mokogitea first, falls back to .gitea
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **CSS variable fallbacks** — 341 `var()` calls now have explicit light theme fallback values
|
||||||
|
- **Dropdown menu background** — Uses `--nav-bg-color` instead of `--body-bg`
|
||||||
|
|
||||||
|
## [02.02.00] - 2026-05-16
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **template.css fallback values** — All var() fallbacks aligned with light.standard.css values
|
||||||
|
- **background-color mismatches** — Fixed 20+ properties incorrectly using `--body-color` as background
|
||||||
|
|
||||||
|
## [02.01.06] - 2026-05-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **Article metadata footer** — Renders Joomla custom fields (`jcfields`) as a styled metadata footer on article layouts, grouped by field group with responsive grid and BEM styling
|
||||||
|
- **Smart Visitor Detection** — Pushes anonymised visitor properties (login status, user group, page type) to the dataLayer for Google Analytics / Tag Manager. Sets GA4 `user_properties` for persistent session-scoped dimensions. No PII is sent. Default enabled when GTM or GA4 is active.
|
||||||
|
- **Auto-cascade workflow** — Forward-merges `main` → `dev` after every push; auto-creates a PR on conflict
|
||||||
|
- **Component/print-view stylesheet** — Dedicated `component.css` replaces `template.css` in the component view with print-optimised styles using theme variables
|
||||||
|
- **Print-view GA4 tracking** — Component view sends `content_group=print_view` to Google Analytics for tracking print/modal usage
|
||||||
|
- **Custom light theme in component view** — Component view now loads `light.custom.css` when configured
|
||||||
|
- **Auto-minification** — `user.css`, `user.js`, and custom theme files are automatically minified on page load via `MokoMinifyHelper`
|
||||||
|
- **Media folder cleanup on install/update** — `script.php` now removes stale `.min` files, deprecated assets, and unminified vendor files during install or update
|
||||||
|
- **Changelog auto-bump in auto-release** — `[Unreleased]` is automatically promoted to the release version on stable release, with a fresh `[Unreleased]` section inserted above
|
||||||
|
- **CI: PHPStan static analysis** — Added to CI pipeline
|
||||||
|
- **CI: Gitleaks secret scanning** — Added to CI pipeline
|
||||||
|
- **CI: CSS sync workflow** — Syncs CSS to template repo and checks client variable coverage
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Custom head params replaced with user files** — Removed `custom_head_start` / `custom_head_end` template params in favour of `user.css` and `user.js` (loaded via Web Asset Manager)
|
||||||
|
- **User override files added to .gitignore** — `user.css` and `user.js` are client-repo only; not committed to the template repo
|
||||||
|
- **Asset registry simplified** — Removed duplicate `.min` entries from `joomla.asset.json`; Joomla's Web Asset Manager auto-resolves `.min` variants when debug is off
|
||||||
|
- **Font Awesome vendor ships minified only** — Removed unminified FA7 Free CSS (saves ~21 kLOC); asset entries now point to `.min.css` directly
|
||||||
|
- **Workflows restructured — CI/CD workflows and issue templates reorganized under `.gitea/` with template sync
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- **Migration tab** — Removed MokoCassiopeia migration fieldset and associated language strings from template params
|
||||||
|
- **Migration description** — Removed migration callout and "formerly MokoCassiopeia" reference from template description
|
||||||
|
- **Custom head fields** — Removed `custom_head_start` / `custom_head_end` fields and `Custom Code` fieldset from template configuration
|
||||||
|
- **Footer from component view** — Removed footer module positions from `component.php` (print/modal view)
|
||||||
|
- **Unminified vendor CSS** — Removed `all.css`, `brands.css`, `fontawesome.css`, `regular.css`, `solid.css` from FA7 Free (21k+ lines)
|
||||||
|
|
||||||
|
## [03.10.00] - 2026-04-18
|
||||||
|
|
||||||
|
### Important
|
||||||
|
- **Template Consolidation** — This release finalised the MokoOnyx identity, adding automatic migration from legacy MokoCassiopeia installations. Settings, menu assignments, and files are imported on first page load.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **Offline page redesign** — Full-viewport background from Joomla offline_image or header background, glass card overlay, centered logo with glow, login accordion, copyright footer
|
||||||
|
- **CSS variable click-to-copy** — Text containing `--variable-name` patterns is wrapped in clickable chips that copy to clipboard with toast notification
|
||||||
|
- **Brand-aside 3-column layout** — Flex columns like top-a with card style
|
||||||
|
- **mod_stats table layout** — Converted from definition list to semantic table
|
||||||
|
- **Favicon multi-format support** — Now handles PNG, JPEG, GIF, WebP, BMP (not just PNG)
|
||||||
|
- **Theme variables** — `--theme-fab-bg`, `--theme-fab-color`, `--theme-fab-btn-bg`, `--theme-fab-border`, `--offline-card-bg`
|
||||||
|
- **Footer CSS variables** — Added to CSS Variables reference tab
|
||||||
|
- **Bridge migration script** — `helper/bridge.php` handles automatic MokoCassiopeia → MokoOnyx migration
|
||||||
|
- **Dedicated release runner** — Release workflows run on isolated `release` label runner
|
||||||
|
- **Runner fleet** — 3 CI + 1 release runner (12 concurrent jobs)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- **Gitea-primary CI/CD** — All workflows use Gitea API, GitHub is backup for stable/RC only
|
||||||
|
- **Theme switcher** — Larger, bordered, theme-aware colors (off-white on dark, primary on light)
|
||||||
|
- **Auto switch** — Red when off, green when on
|
||||||
|
- **A11y toolbar** — Theme-aware colors for dark mode visibility
|
||||||
|
- **Search button border** — Matches input border (`--input-border-color`)
|
||||||
|
- **Offline message** — 0=hidden, 1=custom message, 2=system language string
|
||||||
|
- **Light theme fonts** — Fixed trailing `)` syntax error, normalized quote style to match dark
|
||||||
|
- **`--accent-color-secondary`** — Unified to `#6fb3ff` across both themes
|
||||||
|
- **`--alert-color`** — Set to `#000` in light theme
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Brand showcase tab (redundant with theme preview)
|
||||||
|
- Position selectors for a11y/theme FAB (forced to bottom-right)
|
||||||
|
- Custom theme CSS from git tracking (site-specific, gitignored)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- SHA-256 checksum format — Removed `sha256:` prefix (Joomla expects raw hex)
|
||||||
|
- Favicon path resolution — Strips `#joomlaImage://` fragment, tries multiple path candidates
|
||||||
|
- `REQUIRE_SIGNIN_VIEW` — Set to `false` for public release downloads
|
||||||
|
- Release workflow — Uses Gitea API to update `updates.xml` on main (bypasses branch protection)
|
||||||
|
- Language loading on offline page — `com_users` and core language files loaded explicitly
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code when working with this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
**MokoOnyx** -- MokoOnyx - Joomla site template (successor to MokoCassiopeia)
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|---|---|
|
||||||
|
| **Platform** | joomla |
|
||||||
|
| **Language** | PHP |
|
||||||
|
| **Default branch** | main |
|
||||||
|
| **License** | GPL-3.0-or-later |
|
||||||
|
| **Wiki** | [MokoOnyx Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/wiki) |
|
||||||
|
| **Standards** | [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) |
|
||||||
|
|
||||||
|
## Common Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer install # Install PHP dependencies
|
||||||
|
```
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
This is a Joomla extension. Key directories:
|
||||||
|
- `src/` -- extension source (deployed to Joomla)
|
||||||
|
- `src/*.xml` -- manifest file (version, files, params)
|
||||||
|
- `src/src/` or `src/services/` -- PHP classes
|
||||||
|
- `src/language/` -- translation strings
|
||||||
|
- `src/media/` -- CSS/JS/images
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
|
||||||
|
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
||||||
|
|
||||||
|
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, or `*.min.css`/`*.min.js`
|
||||||
|
- **Attribution**: use `Authored-by: Moko Consulting` in commits
|
||||||
|
- **Branch strategy**: develop on `dev`, merge to `main` for release
|
||||||
|
- **Minification**: handled at build time (CI) and runtime (MokoMinifyHelper for Joomla templates)
|
||||||
|
- **Wiki**: documentation lives in the Gitea wiki, not in `docs/` files
|
||||||
|
- **Standards**: this repo follows [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)
|
||||||
-161
@@ -1,161 +0,0 @@
|
|||||||
# Contributing to Moko Consulting Projects
|
|
||||||
|
|
||||||
Thank you for your interest in contributing. All Moko Consulting repositories follow this universal workflow and version policy.
|
|
||||||
|
|
||||||
## Branching Workflow
|
|
||||||
|
|
||||||
```
|
|
||||||
feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge──> main
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step by step
|
|
||||||
|
|
||||||
1. **Create a feature branch** from `dev`:
|
|
||||||
```bash
|
|
||||||
git checkout dev && git pull
|
|
||||||
git checkout -b feature/my-change
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Work and commit** on your feature branch. Push to origin.
|
|
||||||
|
|
||||||
3. **Open a PR**: `feature/my-change` → `dev`. After review and checks, merge it.
|
|
||||||
|
|
||||||
4. **When ready for release**, open a **draft PR**: `dev` → `main`.
|
|
||||||
- This automatically renames the source branch to `rc` (release candidate)
|
|
||||||
- An RC pre-release is built and uploaded
|
|
||||||
|
|
||||||
5. **Alpha and beta branches** are created by manually renaming the branch before the RC stage:
|
|
||||||
- Rename `dev` to `alpha` for early testing → alpha pre-release is built
|
|
||||||
- Rename `alpha` to `beta` for feature-complete testing → beta pre-release is built
|
|
||||||
- When the draft PR is created, the branch is renamed to `rc`
|
|
||||||
|
|
||||||
6. **Once PR checks pass** on the `rc` branch, mark the PR as ready and merge to `main`.
|
|
||||||
|
|
||||||
7. **Merging to main** triggers the stable release pipeline:
|
|
||||||
- Minor version bump (e.g., `02.09.xx` → `02.10.00`)
|
|
||||||
- Stability suffix stripped (clean version)
|
|
||||||
- Gitea release created with ZIP/tar.gz packages
|
|
||||||
- `updates.xml` updated (Joomla extensions)
|
|
||||||
- `dev` branch recreated from `main`
|
|
||||||
|
|
||||||
### Branch summary
|
|
||||||
|
|
||||||
| Branch | Purpose | Created by |
|
|
||||||
|--------|---------|-----------|
|
|
||||||
| `feature/*` | New features and fixes | Developer |
|
|
||||||
| `dev` | Integration branch | Auto-recreated after release |
|
|
||||||
| `alpha` | Alpha pre-release testing | Manual rename from `dev` |
|
|
||||||
| `beta` | Beta pre-release testing | Manual rename from `alpha` |
|
|
||||||
| `rc` | Release candidate | Auto-renamed on draft PR to main |
|
|
||||||
| `main` | Stable releases | Protected, merge only |
|
|
||||||
| `version/XX.YY.ZZ` | Archived release snapshots | Auto-created by CI |
|
|
||||||
|
|
||||||
### Protected branches
|
|
||||||
|
|
||||||
| Branch | Direct push | Merge via |
|
|
||||||
|--------|------------|-----------|
|
|
||||||
| `main` | Blocked (CI bot whitelisted) | PR merge only |
|
|
||||||
| `dev` | Blocked (CI bot whitelisted) | PR merge from feature/* |
|
|
||||||
| `rc` | Blocked (CI bot whitelisted) | Auto-created on draft PR |
|
|
||||||
| `alpha` | Blocked (CI bot whitelisted) | Manual rename |
|
|
||||||
| `beta` | Blocked (CI bot whitelisted) | Manual rename |
|
|
||||||
| `feature/*` | Open | N/A (source branch) |
|
|
||||||
|
|
||||||
## Version Policy
|
|
||||||
|
|
||||||
### Format
|
|
||||||
|
|
||||||
All versions use `XX.YY.ZZ` — three two-digit segments, zero-padded:
|
|
||||||
|
|
||||||
- **XX** — Major version (breaking changes)
|
|
||||||
- **YY** — Minor version (new features, bumped on release to main)
|
|
||||||
- **ZZ** — Patch version (auto-incremented on every push to dev/feature branches)
|
|
||||||
|
|
||||||
Rollover: patch `99` → `00` increments minor; minor `99` → `00` increments major.
|
|
||||||
|
|
||||||
### Stability suffixes
|
|
||||||
|
|
||||||
Each branch appends a suffix to indicate stability:
|
|
||||||
|
|
||||||
| Branch | Suffix | Example |
|
|
||||||
|--------|--------|---------|
|
|
||||||
| `main` | (none) | `02.09.00` |
|
|
||||||
| `dev` | `-dev` | `02.09.01-dev` |
|
|
||||||
| `feature/*` | `-dev` | `02.09.01-dev` |
|
|
||||||
| `alpha` | `-alpha` | `02.09.01-alpha` |
|
|
||||||
| `beta` | `-beta` | `02.09.01-beta` |
|
|
||||||
| `rc` | `-rc` | `02.09.01-rc` |
|
|
||||||
|
|
||||||
### Auto version bump
|
|
||||||
|
|
||||||
On every push to `dev`, `feature/*`, or `patch/*`:
|
|
||||||
|
|
||||||
1. Patch version incremented
|
|
||||||
2. Stability suffix `-dev` applied
|
|
||||||
3. All version-bearing files updated (manifests, CHANGELOG, PHP headers, etc.)
|
|
||||||
4. Commit created with `[skip ci]` to avoid loops
|
|
||||||
|
|
||||||
### Release version flow
|
|
||||||
|
|
||||||
Version bumps happen at specific release events:
|
|
||||||
|
|
||||||
| Event | Bump | Example |
|
|
||||||
|-------|------|---------|
|
|
||||||
| Feature merged to dev | Patch bump after dev release | `02.09.01-dev` → release → `02.09.02-dev` |
|
|
||||||
| Dev promoted to RC | Minor bump | `02.09.02-dev` → `02.10.00-rc` |
|
|
||||||
| RC merged to main | Minor bump | `02.10.00-rc` → `02.11.00` (stable) |
|
|
||||||
| Dev recreated from main | Patch bump | `02.11.00` → `02.11.01-dev` |
|
|
||||||
|
|
||||||
### Release stream copies
|
|
||||||
|
|
||||||
When a higher-stability release is published, copies are created for all lesser streams with the same base version:
|
|
||||||
|
|
||||||
- **RC `02.10.00-rc`** also creates: `02.10.00-dev`, `02.10.00-alpha`, `02.10.00-beta`
|
|
||||||
- **Stable `02.11.00`** also creates: `02.11.00-dev`, `02.11.00-alpha`, `02.11.00-beta`, `02.11.00-rc`
|
|
||||||
|
|
||||||
This ensures Joomla sites on ANY stability channel see the update (Joomla only shows versions higher than what's installed).
|
|
||||||
|
|
||||||
### Version files
|
|
||||||
|
|
||||||
The version tools update all files containing version stamps:
|
|
||||||
|
|
||||||
- `.mokogitea/manifest.xml` (canonical source)
|
|
||||||
- Joomla XML manifests (`<version>` tag)
|
|
||||||
- `README.md`, `CHANGELOG.md` (`VERSION:` pattern)
|
|
||||||
- `package.json`, `pyproject.toml`
|
|
||||||
- Any text file with a `VERSION: XX.YY.ZZ` label
|
|
||||||
|
|
||||||
Files synced from other repos (with a `# REPO:` header) are not touched.
|
|
||||||
|
|
||||||
## Code Standards
|
|
||||||
|
|
||||||
- **PHP**: PSR-12, tabs for indentation
|
|
||||||
- **Copyright**: all files must include the Moko Consulting copyright header
|
|
||||||
- **License**: SPDX identifier `GPL-3.0-or-later` (or as specified per repo)
|
|
||||||
- **Attribution**: use `Authored-by: Moko Consulting` in commits, not individual names
|
|
||||||
|
|
||||||
## Commit Messages
|
|
||||||
|
|
||||||
Use conventional commit format:
|
|
||||||
|
|
||||||
```
|
|
||||||
type(scope): short description
|
|
||||||
|
|
||||||
Optional body with context.
|
|
||||||
|
|
||||||
Authored-by: Moko Consulting
|
|
||||||
```
|
|
||||||
|
|
||||||
Types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, `ci`
|
|
||||||
|
|
||||||
Special flags in commit messages:
|
|
||||||
- `[skip ci]` — skip all CI workflows
|
|
||||||
- `[skip bump]` — skip auto version bump only
|
|
||||||
|
|
||||||
## Reporting Issues
|
|
||||||
|
|
||||||
Use the repository's issue tracker with the appropriate template.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Moko Consulting <hello@mokoconsulting.tech>*
|
|
||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
INGROUP: MokoOnyx.Governance
|
INGROUP: MokoOnyx.Governance
|
||||||
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
FILE: SECURITY.md
|
FILE: SECURITY.md
|
||||||
VERSION: 02.19.08
|
VERSION: 03.09.03
|
||||||
BRIEF: Security policy and vulnerability reporting process for MokoOnyx.
|
BRIEF: Security policy and vulnerability reporting process for MokoOnyx.
|
||||||
PATH: /SECURITY.md
|
PATH: /SECURITY.md
|
||||||
NOTE: This policy is process oriented and does not replace secure engineering practices.
|
NOTE: This policy is process oriented and does not replace secure engineering practices.
|
||||||
|
|||||||
@@ -1,237 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# ============================================================================
|
|
||||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
#
|
|
||||||
# FILE INFORMATION
|
|
||||||
# DEFGROUP: Automation.CI
|
|
||||||
# INGROUP: moko-platform.Automation
|
|
||||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
||||||
# PATH: /automation/ci-issue-reporter.sh
|
|
||||||
# VERSION: 09.23.00
|
|
||||||
# BRIEF: Creates or updates a Gitea issue when a CI gate fails.
|
|
||||||
# Deduplicates by searching open issues with the "ci-auto" label
|
|
||||||
# whose title matches the gate. If a matching issue exists, a comment
|
|
||||||
# is appended instead of opening a duplicate.
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# ── Defaults ────────────────────────────────────────────────────────────────
|
|
||||||
GITEA_URL="${GITEA_URL:-https://git.mokoconsulting.tech}"
|
|
||||||
GITEA_TOKEN="${GITEA_TOKEN:-}"
|
|
||||||
REPO="${GITHUB_REPOSITORY:-}"
|
|
||||||
RUN_URL="${GITHUB_SERVER_URL:-${GITEA_URL}}/${REPO}/actions/runs/${GITHUB_RUN_ID:-0}"
|
|
||||||
LABEL_NAME="ci-auto"
|
|
||||||
LABEL_COLOR="#e11d48"
|
|
||||||
|
|
||||||
GATE=""
|
|
||||||
DETAILS=""
|
|
||||||
SEVERITY="error"
|
|
||||||
WORKFLOW=""
|
|
||||||
|
|
||||||
# ── Parse arguments ─────────────────────────────────────────────────────────
|
|
||||||
usage() {
|
|
||||||
cat <<EOF
|
|
||||||
Usage: ci-issue-reporter.sh --gate NAME --details TEXT [OPTIONS]
|
|
||||||
|
|
||||||
Required:
|
|
||||||
--gate CI gate name (e.g. "Code Quality", "Self-Health")
|
|
||||||
--details Human-readable failure description
|
|
||||||
|
|
||||||
Optional:
|
|
||||||
--severity "error" (default) or "warning"
|
|
||||||
--workflow Workflow name for the issue title
|
|
||||||
--repo owner/repo (default: \$GITHUB_REPOSITORY)
|
|
||||||
--run-url URL to the CI run (auto-detected from env)
|
|
||||||
--token Gitea API token (default: \$GITEA_TOKEN)
|
|
||||||
--url Gitea base URL (default: \$GITEA_URL)
|
|
||||||
EOF
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
case "$1" in
|
|
||||||
--gate) GATE="$2"; shift 2 ;;
|
|
||||||
--details) DETAILS="$2"; shift 2 ;;
|
|
||||||
--severity) SEVERITY="$2"; shift 2 ;;
|
|
||||||
--workflow) WORKFLOW="$2"; shift 2 ;;
|
|
||||||
--repo) REPO="$2"; shift 2 ;;
|
|
||||||
--run-url) RUN_URL="$2"; shift 2 ;;
|
|
||||||
--token) GITEA_TOKEN="$2"; shift 2 ;;
|
|
||||||
--url) GITEA_URL="$2"; shift 2 ;;
|
|
||||||
-h|--help) usage ;;
|
|
||||||
*) echo "Unknown option: $1"; usage ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
[[ -z "$GATE" ]] && { echo "ERROR: --gate is required"; usage; }
|
|
||||||
[[ -z "$DETAILS" ]] && { echo "ERROR: --details is required"; usage; }
|
|
||||||
[[ -z "$GITEA_TOKEN" ]] && { echo "ERROR: GITEA_TOKEN not set"; exit 1; }
|
|
||||||
[[ -z "$REPO" ]] && { echo "ERROR: GITHUB_REPOSITORY not set"; exit 1; }
|
|
||||||
|
|
||||||
API="${GITEA_URL}/api/v1/repos/${REPO}"
|
|
||||||
|
|
||||||
# ── Build title ─────────────────────────────────────────────────────────────
|
|
||||||
if [[ -n "$WORKFLOW" ]]; then
|
|
||||||
TITLE="[CI] ${WORKFLOW}: ${GATE} failed"
|
|
||||||
else
|
|
||||||
TITLE="[CI] ${GATE} failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ── Ensure label exists ─────────────────────────────────────────────────────
|
|
||||||
ensure_label() {
|
|
||||||
local exists
|
|
||||||
exists=$(curl -sf -o /dev/null -w '%{http_code}' \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API}/labels" 2>/dev/null || echo "000")
|
|
||||||
|
|
||||||
if [[ "$exists" == "200" ]]; then
|
|
||||||
# Check if label already exists
|
|
||||||
local found
|
|
||||||
found=$(curl -sf \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API}/labels" 2>/dev/null \
|
|
||||||
| grep -o "\"name\":\"${LABEL_NAME}\"" || true)
|
|
||||||
|
|
||||||
if [[ -z "$found" ]]; then
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/labels" \
|
|
||||||
-d "{\"name\":\"${LABEL_NAME}\",\"color\":\"${LABEL_COLOR}\",\"description\":\"Auto-created by CI issue reporter\"}" \
|
|
||||||
> /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# ── Search for existing open issue ──────────────────────────────────────────
|
|
||||||
find_existing_issue() {
|
|
||||||
# URL-encode the gate name for the query
|
|
||||||
local query
|
|
||||||
query=$(printf '%s' "[CI] ${GATE}" | sed 's/ /%20/g; s/\[/%5B/g; s/\]/%5D/g')
|
|
||||||
|
|
||||||
local response
|
|
||||||
response=$(curl -sf \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API}/issues?type=issues&state=open&labels=${LABEL_NAME}&q=${query}&limit=5" \
|
|
||||||
2>/dev/null || echo "[]")
|
|
||||||
|
|
||||||
# Extract the first matching issue number
|
|
||||||
echo "$response" \
|
|
||||||
| grep -oP '"number":\s*\K[0-9]+' \
|
|
||||||
| head -1
|
|
||||||
}
|
|
||||||
|
|
||||||
# ── Build issue body ────────────────────────────────────────────────────────
|
|
||||||
build_body() {
|
|
||||||
local severity_badge
|
|
||||||
if [[ "$SEVERITY" == "error" ]]; then
|
|
||||||
severity_badge="**Severity:** Error"
|
|
||||||
else
|
|
||||||
severity_badge="**Severity:** Warning"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat <<BODY
|
|
||||||
## CI Gate Failure: ${GATE}
|
|
||||||
|
|
||||||
${severity_badge}
|
|
||||||
**Workflow:** ${WORKFLOW:-unknown}
|
|
||||||
**Branch:** ${GITHUB_REF_NAME:-unknown}
|
|
||||||
**Commit:** \`${GITHUB_SHA:0:8}\`
|
|
||||||
**Run:** [View CI run](${RUN_URL})
|
|
||||||
|
|
||||||
### Details
|
|
||||||
|
|
||||||
${DETAILS}
|
|
||||||
|
|
||||||
### Resolution
|
|
||||||
|
|
||||||
Fix the issue described above and push a new commit. This issue will be closed automatically when the gate passes, or can be closed manually.
|
|
||||||
|
|
||||||
---
|
|
||||||
*Auto-created by [ci-issue-reporter](${GITEA_URL}/${REPO}/src/branch/main/automation/ci-issue-reporter.sh)*
|
|
||||||
BODY
|
|
||||||
}
|
|
||||||
|
|
||||||
# ── Build comment body (for existing issues) ────────────────────────────────
|
|
||||||
build_comment() {
|
|
||||||
cat <<COMMENT
|
|
||||||
### CI failure recurrence
|
|
||||||
|
|
||||||
**Branch:** ${GITHUB_REF_NAME:-unknown}
|
|
||||||
**Commit:** \`${GITHUB_SHA:0:8}\`
|
|
||||||
**Run:** [View CI run](${RUN_URL})
|
|
||||||
|
|
||||||
${DETAILS}
|
|
||||||
COMMENT
|
|
||||||
}
|
|
||||||
|
|
||||||
# ── Main ────────────────────────────────────────────────────────────────────
|
|
||||||
ensure_label
|
|
||||||
|
|
||||||
EXISTING=$(find_existing_issue)
|
|
||||||
|
|
||||||
if [[ -n "$EXISTING" ]]; then
|
|
||||||
# Append comment to existing issue
|
|
||||||
COMMENT_BODY=$(build_comment)
|
|
||||||
COMMENT_JSON=$(printf '%s' "$COMMENT_BODY" | python3 -c "
|
|
||||||
import sys, json
|
|
||||||
print(json.dumps({'body': sys.stdin.read()}))" 2>/dev/null)
|
|
||||||
|
|
||||||
HTTP=$(curl -sf -o /dev/null -w '%{http_code}' -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/issues/${EXISTING}/comments" \
|
|
||||||
-d "${COMMENT_JSON}" 2>/dev/null || echo "000")
|
|
||||||
|
|
||||||
if [[ "$HTTP" == "201" ]]; then
|
|
||||||
echo "Commented on existing issue #${EXISTING}"
|
|
||||||
else
|
|
||||||
echo "WARNING: Failed to comment on issue #${EXISTING} (HTTP ${HTTP})"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# Create new issue
|
|
||||||
ISSUE_BODY=$(build_body)
|
|
||||||
ISSUE_JSON=$(python3 -c "
|
|
||||||
import sys, json
|
|
||||||
body = sys.stdin.read()
|
|
||||||
print(json.dumps({
|
|
||||||
'title': sys.argv[1],
|
|
||||||
'body': body,
|
|
||||||
'labels': []
|
|
||||||
}))" "$TITLE" <<< "$ISSUE_BODY" 2>/dev/null)
|
|
||||||
|
|
||||||
# Create the issue
|
|
||||||
RESPONSE=$(curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/issues" \
|
|
||||||
-d "${ISSUE_JSON}" 2>/dev/null || echo "{}")
|
|
||||||
|
|
||||||
ISSUE_NUM=$(echo "$RESPONSE" | grep -oP '"number":\s*\K[0-9]+' | head -1)
|
|
||||||
|
|
||||||
if [[ -n "$ISSUE_NUM" ]]; then
|
|
||||||
# Apply label (separate call — more reliable across Gitea versions)
|
|
||||||
LABEL_ID=$(curl -sf \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
"${API}/labels" 2>/dev/null \
|
|
||||||
| grep -oP "\"id\":\s*\K[0-9]+(?=[^}]*\"name\":\s*\"${LABEL_NAME}\")" \
|
|
||||||
| head -1 || true)
|
|
||||||
|
|
||||||
if [[ -n "$LABEL_ID" ]]; then
|
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
"${API}/issues/${ISSUE_NUM}/labels" \
|
|
||||||
-d "{\"labels\":[${LABEL_ID}]}" \
|
|
||||||
> /dev/null 2>&1 || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Created issue #${ISSUE_NUM}: ${TITLE}"
|
|
||||||
else
|
|
||||||
echo "WARNING: Failed to create issue"
|
|
||||||
echo "Response: ${RESPONSE}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@@ -236,11 +236,11 @@ use Joomla\CMS\Log\Log;
|
|||||||
|
|
||||||
// Update the update server
|
// Update the update server
|
||||||
try {
|
try {
|
||||||
$onyxUpdatesUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/updates.xml';
|
$onyxUpdatesUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/raw/branch/main/updates.xml';
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->update('#__update_sites')
|
->update('#__update_sites')
|
||||||
->set($db->quoteName('location') . ' = ' . $db->quote($onyxUpdatesUrl))
|
->set($db->quoteName('location') . ' = ' . $db->quote($onyxUpdatesUrl))
|
||||||
->set($db->quoteName('name') . ' = ' . $db->quote('Template - MokoOnyx'))
|
->set($db->quoteName('name') . ' = ' . $db->quote($newDisplay))
|
||||||
->where($db->quoteName('location') . ' LIKE ' . $db->quote('%MokoCassiopeia%'));
|
->where($db->quoteName('location') . ' LIKE ' . $db->quote('%MokoCassiopeia%'));
|
||||||
$db->setQuery($query)->execute();
|
$db->setQuery($query)->execute();
|
||||||
$n = $db->getAffectedRows();
|
$n = $db->getAffectedRows();
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ class MokoMinifyHelper
|
|||||||
$js = preg_replace('/\s*([{}();,=+\-*\/<>!&|?:])\s*/', '$1', $js);
|
$js = preg_replace('/\s*([{}();,=+\-*\/<>!&|?:])\s*/', '$1', $js);
|
||||||
|
|
||||||
// Restore necessary spaces (after keywords)
|
// Restore necessary spaces (after keywords)
|
||||||
$js = preg_replace('/\b(var|let|const|return|typeof|instanceof|new|delete|throw|case|in|of)\b([^\s;})><=!&|?:,])/', '$1 $2', $js);
|
$js = preg_replace('/(var|let|const|return|typeof|instanceof|new|delete|throw|case|in|of)([^\s;})><=!&|?:,])/', '$1 $2', $js);
|
||||||
|
|
||||||
return trim($js);
|
return trim($js);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
*
|
||||||
|
* This file is part of a Moko Consulting project.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* FILE INFORMATION
|
||||||
|
* DEFGROUP: MokoOnyx.Override
|
||||||
|
* INGROUP: MokoOnyx
|
||||||
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
|
* PATH: /html/com_joomgallery/category/default.php
|
||||||
|
* VERSION: 01.00.00
|
||||||
|
* BRIEF: Category view override — password gate then loads default_cat sub-layout
|
||||||
|
*/
|
||||||
|
|
||||||
|
// No direct access
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper;
|
||||||
|
|
||||||
|
// Import CSS & JS
|
||||||
|
$wa = $this->document->getWebAssetManager();
|
||||||
|
$wa->useStyle('com_joomgallery.site');
|
||||||
|
$wa->useStyle('com_joomgallery.jg-icon-font');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php if ($this->item->pw_protected) : ?>
|
||||||
|
<div class="com-joomgallery-category--locked">
|
||||||
|
<form action="<?php echo Route::_('index.php?task=category.unlock&catid=' . $this->item->id); ?>" method="post" class="row g-3 align-items-end" autocomplete="off">
|
||||||
|
<div class="col-12">
|
||||||
|
<h3><i class="jg-icon-lock me-2" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_CATEGORY_PASSWORD_PROTECTED'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<label for="jg_password" class="form-label"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
|
||||||
|
<input type="password" name="password" id="jg_password" class="form-control" required />
|
||||||
|
</div>
|
||||||
|
<div class="col-auto">
|
||||||
|
<button type="submit" class="btn btn-primary" id="jg_unlock_button">
|
||||||
|
<i class="jg-icon-unlock me-1" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_CATEGORY_BUTTON_UNLOCK'); ?>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php echo HTMLHelper::_('form.token'); ?>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php echo $this->loadTemplate('cat'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
@@ -0,0 +1,219 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
*
|
||||||
|
* This file is part of a Moko Consulting project.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* FILE INFORMATION
|
||||||
|
* DEFGROUP: MokoOnyx.Override
|
||||||
|
* INGROUP: MokoOnyx
|
||||||
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
|
* PATH: /html/com_joomgallery/category/default_cat.php
|
||||||
|
* VERSION: 01.00.00
|
||||||
|
* BRIEF: Category sub-layout — subcategories grid + images grid with pagination
|
||||||
|
*/
|
||||||
|
|
||||||
|
// No direct access
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper;
|
||||||
|
use Joomla\CMS\Layout\LayoutHelper;
|
||||||
|
use Joomgallery\Component\Joomgallery\Administrator\Helper\JoomHelper;
|
||||||
|
|
||||||
|
// Image params
|
||||||
|
$image_type = $this->params['configs']->get('jg_category_view_type_image', 'thumbnail', 'STRING');
|
||||||
|
$gallery_class = $this->params['configs']->get('jg_category_view_class', 'masonry', 'STRING');
|
||||||
|
$num_columns = $this->params['configs']->get('jg_category_view_num_columns', 3, 'INT');
|
||||||
|
$image_class = $this->params['configs']->get('jg_category_view_image_class', 0, 'INT');
|
||||||
|
$justified_height = $this->params['configs']->get('jg_category_view_justified_height', 200, 'INT');
|
||||||
|
$justified_gap = $this->params['configs']->get('jg_category_view_justified_gap', 5, 'INT');
|
||||||
|
$image_link = $this->params['configs']->get('jg_category_view_image_link', 'defaultview', 'STRING');
|
||||||
|
$lightbox_image = $this->params['configs']->get('jg_category_view_lightbox_image', 'detail', 'STRING');
|
||||||
|
$pagination_type = $this->params['configs']->get('jg_category_view_pagination', 0, 'INT');
|
||||||
|
$show_subcategories = $this->params['configs']->get('jg_category_view_subcategories', 1, 'INT');
|
||||||
|
$subcategory_type_image = $this->params['configs']->get('jg_category_view_type_subcategory_image', 'thumbnail', 'STRING');
|
||||||
|
$num_columns_subcats = $this->params['configs']->get('jg_category_view_subcategories_num_columns', 3, 'INT');
|
||||||
|
|
||||||
|
// Import CSS & JS
|
||||||
|
$wa = $this->document->getWebAssetManager();
|
||||||
|
|
||||||
|
if ($gallery_class == 'masonry') {
|
||||||
|
$wa->useScript('com_joomgallery.masonry');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gallery_class == 'justified') {
|
||||||
|
$wa->useScript('com_joomgallery.justified');
|
||||||
|
$wa->addInlineStyle('.jg-images[class*=" justified-"] .jg-image-caption-hover { right: ' . $justified_gap . 'px; }');
|
||||||
|
}
|
||||||
|
|
||||||
|
$lightbox = false;
|
||||||
|
if ($image_link == 'lightgallery') {
|
||||||
|
$lightbox = true;
|
||||||
|
$wa->useScript('com_joomgallery.lightgallery');
|
||||||
|
$wa->useScript('com_joomgallery.lg-thumbnail');
|
||||||
|
$wa->useStyle('com_joomgallery.lightgallery-bundle');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialise the grid script
|
||||||
|
$iniJS = 'window.joomGrid = {';
|
||||||
|
$iniJS .= ' itemid: ' . $this->item->id . ',';
|
||||||
|
$iniJS .= ' pagination: ' . $pagination_type . ',';
|
||||||
|
$iniJS .= ' layout: "' . $gallery_class . '",';
|
||||||
|
$iniJS .= ' num_columns: ' . $num_columns . ',';
|
||||||
|
$iniJS .= ' lightbox: ' . ($lightbox ? 'true' : 'false') . ',';
|
||||||
|
$iniJS .= ' justified: {height: ' . $justified_height . ', gap: ' . $justified_gap . '}';
|
||||||
|
$iniJS .= '};';
|
||||||
|
|
||||||
|
$wa->addInlineScript($iniJS, ['position' => 'before'], [], ['com_joomgallery.joomgrid']);
|
||||||
|
$wa->useScript('com_joomgallery.joomgrid');
|
||||||
|
|
||||||
|
// Access check
|
||||||
|
$canEdit = $this->getAcl()->checkACL('edit', 'com_joomgallery.category', $this->item->id, $this->item->parent_id, true);
|
||||||
|
$canAdd = $this->getAcl()->checkACL('add', 'com_joomgallery.image', 0, $this->item->id, true);
|
||||||
|
$canDelete = $this->getAcl()->checkACL('delete', 'com_joomgallery.category', $this->item->id, $this->item->parent_id, true);
|
||||||
|
$canCheckin = $this->getAcl()->checkACL('editstate', 'com_joomgallery.category', $this->item->id, $this->item->parent_id, true) || $this->item->checked_out == Factory::getUser()->id;
|
||||||
|
$returnURL = base64_encode(JoomHelper::getViewRoute('category', $this->item->id, $this->item->parent_id, $this->item->language, $this->getLayout()));
|
||||||
|
|
||||||
|
$hasSubcats = $show_subcategories && !empty($this->item->children->items) && count($this->item->children->items) > 0;
|
||||||
|
$hasImages = !empty($this->item->images->items) && count($this->item->images->items) > 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="com-joomgallery-category" itemscope itemtype="https://schema.org/ImageGallery">
|
||||||
|
<?php // Page heading ?>
|
||||||
|
<?php if ($this->params['menu']->get('show_page_heading')) : ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h1><?php echo $this->escape($this->params['menu']->get('page_heading')); ?></h1>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Category title ?>
|
||||||
|
<h2 itemprop="name"><?php echo $this->escape($this->item->title); ?></h2>
|
||||||
|
|
||||||
|
<?php // Category description ?>
|
||||||
|
<?php if (!empty($this->item->description)) : ?>
|
||||||
|
<div class="com-joomgallery-category__description mb-3" itemprop="description">
|
||||||
|
<?php echo $this->item->description; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Admin buttons ?>
|
||||||
|
<?php if ($canEdit || $canCheckin || $canAdd || $canDelete) : ?>
|
||||||
|
<div class="com-joomgallery-category__actions btn-toolbar mb-3" role="toolbar" aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
|
||||||
|
<?php if ($canCheckin && $this->item->checked_out > 0) : ?>
|
||||||
|
<a class="btn btn-outline-secondary btn-sm me-2" href="<?php echo Route::_('index.php?option=com_joomgallery&task=category.checkin&id=' . $this->item->id . '&return=' . $returnURL . '&' . Session::getFormToken() . '=1'); ?>">
|
||||||
|
<i class="jg-icon-checkin me-1" aria-hidden="true"></i><?php echo Text::_('JLIB_HTML_CHECKIN'); ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($canEdit) : ?>
|
||||||
|
<a class="btn btn-outline-primary btn-sm me-2<?php echo ($this->item->checked_out > 0) ? ' disabled' : ''; ?>" href="<?php echo Route::_('index.php?option=com_joomgallery&task=category.edit&id=' . $this->item->id . '&return=' . $returnURL); ?>">
|
||||||
|
<i class="jg-icon-edit me-1" aria-hidden="true"></i><?php echo Text::_('JGLOBAL_EDIT'); ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($canAdd) : ?>
|
||||||
|
<a class="btn btn-outline-success btn-sm me-2<?php echo ($this->item->checked_out > 0) ? ' disabled' : ''; ?>" href="<?php echo Route::_('index.php?option=com_joomgallery&task=image.add&catid=' . $this->item->id . '&return=' . $returnURL); ?>">
|
||||||
|
<i class="jg-icon-upload me-1" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_IMG_UPLOAD_IMAGE'); ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($canDelete) : ?>
|
||||||
|
<a class="btn btn-outline-danger btn-sm<?php echo ($this->item->checked_out > 0) ? ' disabled' : ''; ?>" href="#deleteCatModal" role="button" data-bs-toggle="modal">
|
||||||
|
<i class="jg-icon-delete me-1" aria-hidden="true"></i><?php echo Text::_('JACTION_DELETE'); ?>
|
||||||
|
</a>
|
||||||
|
<?php echo HTMLHelper::_(
|
||||||
|
'bootstrap.renderModal',
|
||||||
|
'deleteCatModal',
|
||||||
|
[
|
||||||
|
'title' => Text::_('JACTION_DELETE'),
|
||||||
|
'modalWidth' => '50',
|
||||||
|
'bodyHeight' => '100',
|
||||||
|
'footer' => '<button class="btn btn-secondary" data-bs-dismiss="modal">' . Text::_('JCANCEL') . '</button>'
|
||||||
|
. '<a href="' . Route::_('index.php?option=com_joomgallery&task=category.remove&id=' . $this->item->id . '&return=' . $returnURL . '&' . Session::getFormToken() . '=1', false, 2) . '" class="btn btn-danger">' . Text::_('JACTION_DELETE') . '</a>',
|
||||||
|
],
|
||||||
|
Text::_('COM_JOOMGALLERY_COMMON_ALERT_SURE_DELETE_SELECTED_ITEM')
|
||||||
|
); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Subcategories ?>
|
||||||
|
<?php if ($hasSubcats) : ?>
|
||||||
|
<section class="com-joomgallery-category__subcategories mb-4" aria-label="<?php echo Text::_('COM_JOOMGALLERY_SUBCATEGORIES'); ?>">
|
||||||
|
<h3><?php echo Text::_('COM_JOOMGALLERY_SUBCATEGORIES'); ?></h3>
|
||||||
|
<?php
|
||||||
|
$catsData = [
|
||||||
|
'id' => (int) $this->item->id,
|
||||||
|
'items' => $this->item->children->items,
|
||||||
|
'num_columns' => (int) $num_columns_subcats,
|
||||||
|
'image_type' => $subcategory_type_image,
|
||||||
|
];
|
||||||
|
echo LayoutHelper::render('joomgallery.grids.categories', $catsData);
|
||||||
|
?>
|
||||||
|
</section>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Images ?>
|
||||||
|
<?php if ($hasImages) : ?>
|
||||||
|
<section class="com-joomgallery-category__images" aria-label="<?php echo Text::_('COM_JOOMGALLERY_IMAGES'); ?>">
|
||||||
|
<?php if ($hasSubcats) : ?>
|
||||||
|
<h3><?php echo Text::_('COM_JOOMGALLERY_IMAGES'); ?></h3>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$imgsData = [
|
||||||
|
'id' => (int) $this->item->id,
|
||||||
|
'layout' => $gallery_class,
|
||||||
|
'items' => $this->item->images->items,
|
||||||
|
'num_columns' => (int) $num_columns,
|
||||||
|
'caption_align' => 'center',
|
||||||
|
'image_class' => $image_class,
|
||||||
|
'image_type' => $image_type,
|
||||||
|
'lightbox_type' => $lightbox_image,
|
||||||
|
'image_link' => $image_link,
|
||||||
|
'image_title' => false,
|
||||||
|
'title_link' => 'defaultview',
|
||||||
|
'image_desc' => false,
|
||||||
|
'image_date' => false,
|
||||||
|
'image_author' => false,
|
||||||
|
'image_tags' => false,
|
||||||
|
];
|
||||||
|
echo LayoutHelper::render('joomgallery.grids.images', $imgsData);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php // Pagination ?>
|
||||||
|
<nav class="mt-4" aria-label="<?php echo Text::_('JLIB_HTML_PAGINATION'); ?>">
|
||||||
|
<?php echo $this->item->images->pagination->getListFooter(); ?>
|
||||||
|
</nav>
|
||||||
|
</section>
|
||||||
|
<?php elseif (!$hasSubcats) : ?>
|
||||||
|
<div class="alert alert-info" role="alert">
|
||||||
|
<p class="mb-0"><?php echo Text::_('COM_JOOMGALLERY_GALLERY_NO_IMAGES'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Back to parent category ?>
|
||||||
|
<?php if ($this->item->parent_id > 0 && $this->item->parent_id != 1) : ?>
|
||||||
|
<div class="mt-4">
|
||||||
|
<a class="btn btn-outline-secondary" href="<?php echo Route::_('index.php?option=com_joomgallery&view=category&id=' . (int) $this->item->parent_id); ?>">
|
||||||
|
<i class="jg-icon-arrow-left-alt me-1" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_BACK'); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
if (window.joomGrid.layout != 'justified') {
|
||||||
|
document.querySelectorAll('.' + window.joomGrid.imgclass).forEach(function(image) {
|
||||||
|
image.addEventListener('load', function() {
|
||||||
|
this.closest('.' + window.joomGrid.imgboxclass).classList.add('loaded');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE html><title></title>
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
*
|
||||||
|
* This file is part of a Moko Consulting project.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* FILE INFORMATION
|
||||||
|
* DEFGROUP: MokoOnyx.Override
|
||||||
|
* INGROUP: MokoOnyx
|
||||||
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
|
* PATH: /html/com_joomgallery/gallery/default.php
|
||||||
|
* VERSION: 01.00.00
|
||||||
|
* BRIEF: Gallery view override — main image grid with masonry/justified layout
|
||||||
|
*/
|
||||||
|
|
||||||
|
// No direct access
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Layout\LayoutHelper;
|
||||||
|
|
||||||
|
// Image params
|
||||||
|
$image_type = $this->params['configs']->get('jg_gallery_view_type_image', 'thumbnail', 'STRING');
|
||||||
|
$gallery_class = $this->params['configs']->get('jg_gallery_view_class', 'masonry', 'STRING');
|
||||||
|
$num_columns = $this->params['configs']->get('jg_gallery_view_num_columns', 3, 'INT');
|
||||||
|
$image_class = $this->params['configs']->get('jg_gallery_view_image_class', 0, 'INT');
|
||||||
|
$justified_height = $this->params['configs']->get('jg_gallery_view_justified_height', 200, 'INT');
|
||||||
|
$justified_gap = $this->params['configs']->get('jg_gallery_view_justified_gap', 5, 'INT');
|
||||||
|
$image_link = $this->params['configs']->get('jg_gallery_view_image_link', 'defaultview', 'STRING');
|
||||||
|
$lightbox_image = $this->params['configs']->get('jg_category_view_lightbox_image', 'detail', 'STRING');
|
||||||
|
$browse_categories_link = $this->params['configs']->get('jg_gallery_view_browse_categories_link', 1, 'INT');
|
||||||
|
|
||||||
|
// Import CSS & JS
|
||||||
|
$wa = $this->document->getWebAssetManager();
|
||||||
|
$wa->useStyle('com_joomgallery.site');
|
||||||
|
$wa->useStyle('com_joomgallery.jg-icon-font');
|
||||||
|
|
||||||
|
if ($gallery_class == 'masonry') {
|
||||||
|
$wa->useScript('com_joomgallery.masonry');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($gallery_class == 'justified') {
|
||||||
|
$wa->useScript('com_joomgallery.justified');
|
||||||
|
$wa->addInlineStyle('.jg-images[class*=" justified-"] .jg-image-caption-hover { right: ' . $justified_gap . 'px; }');
|
||||||
|
}
|
||||||
|
|
||||||
|
$lightbox = false;
|
||||||
|
if ($image_link == 'lightgallery') {
|
||||||
|
$lightbox = true;
|
||||||
|
$wa->useScript('com_joomgallery.lightgallery');
|
||||||
|
$wa->useScript('com_joomgallery.lg-thumbnail');
|
||||||
|
$wa->useStyle('com_joomgallery.lightgallery-bundle');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialise the grid script
|
||||||
|
$iniJS = 'window.joomGrid = {';
|
||||||
|
$iniJS .= ' itemid: ' . $this->item->id . ',';
|
||||||
|
$iniJS .= ' pagination: 0,';
|
||||||
|
$iniJS .= ' layout: "' . $gallery_class . '",';
|
||||||
|
$iniJS .= ' num_columns: ' . $num_columns . ',';
|
||||||
|
$iniJS .= ' lightbox: ' . ($lightbox ? 'true' : 'false') . ',';
|
||||||
|
$iniJS .= ' justified: {height: ' . $justified_height . ', gap: ' . $justified_gap . '}';
|
||||||
|
$iniJS .= '};';
|
||||||
|
|
||||||
|
$wa->addInlineScript($iniJS, ['position' => 'before'], [], ['com_joomgallery.joomgrid']);
|
||||||
|
$wa->useScript('com_joomgallery.joomgrid');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="com-joomgallery-gallery" itemscope itemtype="https://schema.org/ImageGallery">
|
||||||
|
<?php if ($this->params['menu']->get('show_page_heading')) : ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h1><?php echo $this->escape($this->params['menu']->get('page_heading')); ?></h1>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Browse categories link (top) ?>
|
||||||
|
<?php if ($browse_categories_link == '1') : ?>
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
<a class="btn btn-outline-primary" href="<?php echo Route::_('index.php?option=com_joomgallery&view=category&id=1'); ?>">
|
||||||
|
<i class="jg-icon-folder me-1" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_GALLERY_VIEW_BROWSE_CATEGORIES'); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if (count($this->item->images->items) == 0) : ?>
|
||||||
|
<div class="alert alert-info" role="alert">
|
||||||
|
<p class="mb-0"><?php echo Text::_('COM_JOOMGALLERY_GALLERY_NO_IMAGES'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php
|
||||||
|
$imgsData = [
|
||||||
|
'id' => (int) $this->item->id,
|
||||||
|
'layout' => $gallery_class,
|
||||||
|
'items' => $this->item->images->items,
|
||||||
|
'num_columns' => (int) $num_columns,
|
||||||
|
'caption_align' => 'center',
|
||||||
|
'image_class' => $image_class,
|
||||||
|
'image_type' => $image_type,
|
||||||
|
'lightbox_type' => $lightbox_image,
|
||||||
|
'image_link' => $image_link,
|
||||||
|
'image_title' => false,
|
||||||
|
'title_link' => 'defaultview',
|
||||||
|
'image_desc' => false,
|
||||||
|
'image_date' => false,
|
||||||
|
'image_author' => false,
|
||||||
|
'image_tags' => false,
|
||||||
|
];
|
||||||
|
?>
|
||||||
|
<?php echo LayoutHelper::render('joomgallery.grids.images', $imgsData); ?>
|
||||||
|
|
||||||
|
<?php // Pagination ?>
|
||||||
|
<nav class="mt-4" aria-label="<?php echo Text::_('JLIB_HTML_PAGINATION'); ?>">
|
||||||
|
<?php echo $this->item->images->pagination->getListFooter(); ?>
|
||||||
|
</nav>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Browse categories link (bottom) ?>
|
||||||
|
<?php if ($browse_categories_link == '2') : ?>
|
||||||
|
<div class="text-center mt-4">
|
||||||
|
<a class="btn btn-outline-primary" href="<?php echo Route::_('index.php?option=com_joomgallery&view=category&id=1'); ?>">
|
||||||
|
<i class="jg-icon-folder me-1" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_GALLERY_VIEW_BROWSE_CATEGORIES'); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
if (window.joomGrid.layout != 'justified') {
|
||||||
|
document.querySelectorAll('.' + window.joomGrid.imgclass).forEach(function(image) {
|
||||||
|
image.addEventListener('load', function() {
|
||||||
|
this.closest('.' + window.joomGrid.imgboxclass).classList.add('loaded');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE html><title></title>
|
||||||
@@ -0,0 +1,249 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
*
|
||||||
|
* This file is part of a Moko Consulting project.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* FILE INFORMATION
|
||||||
|
* DEFGROUP: MokoOnyx.Override
|
||||||
|
* INGROUP: MokoOnyx
|
||||||
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
|
* PATH: /html/com_joomgallery/image/default.php
|
||||||
|
* VERSION: 01.00.00
|
||||||
|
* BRIEF: Image detail view override — single image with metadata, tags, custom fields
|
||||||
|
*/
|
||||||
|
|
||||||
|
// No direct access
|
||||||
|
defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper;
|
||||||
|
use Joomla\CMS\Layout\FileLayout;
|
||||||
|
use Joomla\CMS\User\UserFactoryInterface;
|
||||||
|
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
|
||||||
|
use Joomgallery\Component\Joomgallery\Administrator\Helper\JoomHelper;
|
||||||
|
|
||||||
|
// Image params
|
||||||
|
$image_type = $this->params['configs']->get('jg_detail_view_type_image', 'detail', 'STRING');
|
||||||
|
$show_title = $this->params['configs']->get('jg_detail_view_show_title', 0, 'INT');
|
||||||
|
$show_category = $this->params['configs']->get('jg_detail_view_show_category', 0, 'INT');
|
||||||
|
$show_description = $this->params['configs']->get('jg_detail_view_show_description', 0, 'INT');
|
||||||
|
$show_imgdate = $this->params['configs']->get('jg_detail_view_show_imgdate', 0, 'INT');
|
||||||
|
$show_imgauthor = $this->params['configs']->get('jg_detail_view_show_imgauthor', 0, 'INT');
|
||||||
|
$show_created_by = $this->params['configs']->get('jg_detail_view_show_created_by', 0, 'INT');
|
||||||
|
$show_votes = $this->params['configs']->get('jg_detail_view_show_votes', 0, 'INT');
|
||||||
|
$show_rating = $this->params['configs']->get('jg_detail_view_show_rating', 0, 'INT');
|
||||||
|
$show_hits = $this->params['configs']->get('jg_detail_view_show_hits', 0, 'INT');
|
||||||
|
$show_downloads = $this->params['configs']->get('jg_detail_view_show_downloads', 0, 'INT');
|
||||||
|
$show_tags = $this->params['configs']->get('jg_detail_view_show_tags', 0, 'INT');
|
||||||
|
$show_metadata = $this->params['configs']->get('jg_detail_view_show_metadata', 0, 'INT');
|
||||||
|
|
||||||
|
// Import CSS & JS
|
||||||
|
$wa = $this->document->getWebAssetManager();
|
||||||
|
$wa->useStyle('com_joomgallery.site');
|
||||||
|
$wa->useStyle('com_joomgallery.jg-icon-font');
|
||||||
|
|
||||||
|
// Access check
|
||||||
|
$canEdit = $this->getAcl()->checkACL('edit', 'com_joomgallery.image', $this->item->id, $this->item->catid, true);
|
||||||
|
$canDelete = $this->getAcl()->checkACL('delete', 'com_joomgallery.image', $this->item->id, $this->item->catid, true);
|
||||||
|
$canCheckin = $this->getAcl()->checkACL('editstate', 'com_joomgallery.image', $this->item->id, $this->item->catid, true) || $this->item->checked_out == Factory::getUser()->id;
|
||||||
|
$returnURL = base64_encode(JoomHelper::getViewRoute('image', $this->item->id, $this->item->catid, $this->item->language, $this->getLayout()));
|
||||||
|
|
||||||
|
// Tags
|
||||||
|
$tagLayout = new FileLayout('joomgallery.content.tags');
|
||||||
|
$tags = $tagLayout->render($this->item->tags);
|
||||||
|
|
||||||
|
// Metadata
|
||||||
|
$metadataLayout = new FileLayout('joomgallery.content.metadata');
|
||||||
|
$metadata = $metadataLayout->render($this->item->imgmetadata);
|
||||||
|
|
||||||
|
// Custom Fields
|
||||||
|
$fields = FieldsHelper::getFields('com_joomgallery.image', $this->item);
|
||||||
|
|
||||||
|
// Check if we have any info rows to show
|
||||||
|
$hasInfo = $show_category || $show_imgdate || $show_imgauthor || $show_created_by
|
||||||
|
|| $show_votes || $show_rating || $show_hits || $show_downloads
|
||||||
|
|| $show_tags || $show_metadata || count($fields) > 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="com-joomgallery-image" itemscope itemtype="https://schema.org/ImageObject">
|
||||||
|
<?php if ($show_title) : ?>
|
||||||
|
<h2 itemprop="name"><?php echo $this->escape($this->item->title); ?></h2>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Back to category ?>
|
||||||
|
<a class="btn btn-outline-primary btn-sm mb-3" href="<?php echo Route::_('index.php?option=com_joomgallery&view=category&id=' . (int) $this->item->catid); ?>">
|
||||||
|
<i class="jg-icon-arrow-left-alt me-1" aria-hidden="true"></i><?php echo Text::_('COM_JOOMGALLERY_IMAGE_BACK_TO_CATEGORY') . ' ' . $this->escape($this->item->cattitle); ?>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<?php // Admin buttons ?>
|
||||||
|
<?php if ($canEdit || $canCheckin || $canDelete) : ?>
|
||||||
|
<div class="com-joomgallery-image__actions btn-toolbar mb-3" role="toolbar" aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
|
||||||
|
<?php if ($canCheckin && $this->item->checked_out > 0) : ?>
|
||||||
|
<a class="btn btn-outline-secondary btn-sm me-2" href="<?php echo Route::_('index.php?option=com_joomgallery&task=image.checkin&id=' . $this->item->id . '&return=' . $returnURL . '&' . Session::getFormToken() . '=1'); ?>">
|
||||||
|
<i class="jg-icon-checkin me-1" aria-hidden="true"></i><?php echo Text::_('JLIB_HTML_CHECKIN'); ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($canEdit) : ?>
|
||||||
|
<a class="btn btn-outline-primary btn-sm me-2<?php echo ($this->item->checked_out > 0) ? ' disabled' : ''; ?>" href="<?php echo Route::_('index.php?option=com_joomgallery&task=image.edit&id=' . $this->item->id . '&return=' . $returnURL); ?>">
|
||||||
|
<i class="jg-icon-edit me-1" aria-hidden="true"></i><?php echo Text::_('JGLOBAL_EDIT'); ?>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($canDelete) : ?>
|
||||||
|
<a class="btn btn-outline-danger btn-sm<?php echo ($this->item->checked_out > 0) ? ' disabled' : ''; ?>" href="#deleteImgModal" role="button" data-bs-toggle="modal">
|
||||||
|
<i class="jg-icon-delete me-1" aria-hidden="true"></i><?php echo Text::_('JACTION_DELETE'); ?>
|
||||||
|
</a>
|
||||||
|
<?php echo HTMLHelper::_(
|
||||||
|
'bootstrap.renderModal',
|
||||||
|
'deleteImgModal',
|
||||||
|
[
|
||||||
|
'title' => Text::_('JACTION_DELETE'),
|
||||||
|
'modalWidth' => '50',
|
||||||
|
'bodyHeight' => '100',
|
||||||
|
'footer' => '<button class="btn btn-secondary" data-bs-dismiss="modal">' . Text::_('JCANCEL') . '</button>'
|
||||||
|
. '<a href="' . Route::_('index.php?option=com_joomgallery&task=image.remove&id=' . $this->item->id . '&return=' . $returnURL . '&' . Session::getFormToken() . '=1', false, 2) . '" class="btn btn-danger">' . Text::_('COM_JOOMGALLERY_COMMON_DELETE_IMAGE_TIPCAPTION') . '</a>',
|
||||||
|
],
|
||||||
|
Text::_('COM_JOOMGALLERY_COMMON_ALERT_SURE_DELETE_SELECTED_ITEM')
|
||||||
|
); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Image ?>
|
||||||
|
<figure class="figure com-joomgallery-image__figure text-center w-100 mb-4">
|
||||||
|
<div id="jg-loader"></div>
|
||||||
|
<img
|
||||||
|
src="<?php echo JoomHelper::getImg($this->item, $image_type); ?>"
|
||||||
|
class="figure-img img-fluid rounded"
|
||||||
|
alt="<?php echo $this->escape($this->item->title); ?>"
|
||||||
|
style="width:auto;"
|
||||||
|
itemprop="contentUrl"
|
||||||
|
loading="lazy"
|
||||||
|
/>
|
||||||
|
<?php if ($show_description && !empty($this->item->description)) : ?>
|
||||||
|
<figcaption class="figure-caption" itemprop="description"><?php echo $this->item->description; ?></figcaption>
|
||||||
|
<?php endif; ?>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<?php // Image info table ?>
|
||||||
|
<?php if ($hasInfo) : ?>
|
||||||
|
<div class="com-joomgallery-image__info">
|
||||||
|
<h3><?php echo Text::_('COM_JOOMGALLERY_IMAGE_INFO'); ?></h3>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<tbody>
|
||||||
|
<?php if ($show_category) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('JCATEGORY'); ?></th>
|
||||||
|
<td>
|
||||||
|
<a href="<?php echo Route::_('index.php?option=com_joomgallery&view=category&id=' . (int) $this->item->catid); ?>">
|
||||||
|
<?php echo $this->escape($this->item->cattitle); ?>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_imgdate) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_DATE'); ?></th>
|
||||||
|
<td>
|
||||||
|
<time datetime="<?php echo HTMLHelper::_('date', $this->item->date, 'c'); ?>" itemprop="dateCreated">
|
||||||
|
<?php echo HTMLHelper::_('date', $this->item->date, Text::_('DATE_FORMAT_LC4')); ?>
|
||||||
|
</time>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_imgauthor) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('JAUTHOR'); ?></th>
|
||||||
|
<td itemprop="author"><?php echo $this->escape($this->item->author); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_created_by) : ?>
|
||||||
|
<?php $user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($this->item->created_by); ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_OWNER'); ?></th>
|
||||||
|
<td><?php echo $this->escape($user->name); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_votes) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_VOTES'); ?></th>
|
||||||
|
<td><?php echo $this->escape($this->item->votes); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_rating) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_IMAGE_RATING'); ?></th>
|
||||||
|
<td><?php echo $this->escape($this->item->rating); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_hits) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('JGLOBAL_HITS'); ?></th>
|
||||||
|
<td><?php echo (int) $this->item->hits; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_downloads) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_DOWNLOADS'); ?></th>
|
||||||
|
<td><?php echo (int) $this->item->downloads; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_tags) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_TAGS'); ?></th>
|
||||||
|
<td><?php echo $tags; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($show_metadata) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?php echo Text::_('COM_JOOMGALLERY_IMGMETADATA'); ?></th>
|
||||||
|
<td><?php echo $metadata; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php // Custom fields ?>
|
||||||
|
<?php if (count($fields) > 0) : ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row" colspan="2"><strong><?php echo Text::_('JGLOBAL_FIELDS'); ?></strong></th>
|
||||||
|
</tr>
|
||||||
|
<?php foreach ($fields as $field) : ?>
|
||||||
|
<?php if ($this->component->getAccess()->checkViewLevel($field->access) && $field->params->get('display') > 0) : ?>
|
||||||
|
<tr class="<?php echo $this->escape($field->params->get('render_class')); ?>">
|
||||||
|
<?php if ($field->params->get('showlabel', true)) : ?>
|
||||||
|
<th scope="row" class="<?php echo $this->escape($field->params->get('label_render_class')); ?>"><?php echo $this->escape($field->title); ?></th>
|
||||||
|
<?php else : ?>
|
||||||
|
<th scope="row"></th>
|
||||||
|
<?php endif; ?>
|
||||||
|
<td class="<?php echo $this->escape($field->params->get('value_render_class')); ?>"><?php echo $field->value; ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.onload = function() {
|
||||||
|
var el = document.querySelector('#jg-loader');
|
||||||
|
if (el) el.classList.add('hidden');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE html><title></title>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: MokoOnyx
|
* INGROUP: MokoOnyx
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
* PATH: /html/layouts/joomla/module/card.php
|
* PATH: /html/layouts/joomla/module/card.php
|
||||||
* VERSION: 02.19.08
|
* VERSION: 01.00.07
|
||||||
* BRIEF: Custom card module chrome — renders module titles for all modules
|
* BRIEF: Custom card module chrome — renders module titles for all modules
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* INGROUP: MokoOnyx.Layouts
|
* INGROUP: MokoOnyx.Layouts
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
* PATH: /src/html/layouts/mokoonyx/article-metadata.php
|
* PATH: /src/html/layouts/mokoonyx/article-metadata.php
|
||||||
* VERSION: 02.19.08
|
* VERSION: 03.09.04
|
||||||
* BRIEF: Article metadata footer layout -- renders jcfields grouped by field group
|
* BRIEF: Article metadata footer layout -- renders jcfields grouped by field group
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
*
|
|
||||||
* This file is part of a Moko Consulting project.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default menu — Component item layout (sidebar/footer vertical lists)
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
use Joomla\CMS\Filter\OutputFilter;
|
|
||||||
use Joomla\CMS\HTML\HTMLHelper;
|
|
||||||
|
|
||||||
$attributes = [];
|
|
||||||
|
|
||||||
if ($item->anchor_title) {
|
|
||||||
$attributes['title'] = $item->anchor_title;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->anchor_css) {
|
|
||||||
$attributes['class'] = $item->anchor_css;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->anchor_rel) {
|
|
||||||
$attributes['rel'] = $item->anchor_rel;
|
|
||||||
}
|
|
||||||
|
|
||||||
$linktype = $item->title;
|
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
|
||||||
} else {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->browserNav == 1) {
|
|
||||||
$attributes['target'] = '_blank';
|
|
||||||
$attributes['rel'] = 'noopener noreferrer';
|
|
||||||
} elseif ($item->browserNav == 2) {
|
|
||||||
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');
|
|
||||||
$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
|
|
||||||
}
|
|
||||||
|
|
||||||
$attributes['class'] = 'nav-link mod-menu__link';
|
|
||||||
|
|
||||||
echo HTMLHelper::_('link', OutputFilter::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT, 'UTF-8', false)), $linktype, $attributes);
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
*
|
|
||||||
* This file is part of a Moko Consulting project.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default menu — Heading item layout (sidebar/footer vertical lists)
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
$title = $item->anchor_title ? ' title="' . $item->anchor_title . '"' : '';
|
|
||||||
$anchor_css = $item->anchor_css ?: '';
|
|
||||||
|
|
||||||
$linktype = $item->title;
|
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
|
||||||
} else {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<span class="nav-link mod-menu__heading <?php echo $anchor_css; ?>"<?php echo $title; ?>><?php echo $linktype; ?></span>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
*
|
|
||||||
* This file is part of a Moko Consulting project.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default menu — Separator item layout (sidebar/footer vertical lists)
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
$title = $item->anchor_title ? ' title="' . $item->anchor_title . '"' : '';
|
|
||||||
$anchor_css = $item->anchor_css ?: '';
|
|
||||||
|
|
||||||
$linktype = $item->title;
|
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
|
||||||
} else {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<hr class="mod-menu__separator <?php echo $anchor_css; ?>"<?php echo $title; ?> />
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Copyright (C) 2025 Moko Consulting <hello@mokoconsulting.tech>
|
|
||||||
*
|
|
||||||
* This file is part of a Moko Consulting project.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default menu — URL item layout (sidebar/footer vertical lists)
|
|
||||||
*/
|
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
|
||||||
|
|
||||||
use Joomla\CMS\Filter\OutputFilter;
|
|
||||||
use Joomla\CMS\HTML\HTMLHelper;
|
|
||||||
|
|
||||||
$attributes = [];
|
|
||||||
|
|
||||||
if ($item->anchor_title) {
|
|
||||||
$attributes['title'] = $item->anchor_title;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->anchor_css) {
|
|
||||||
$attributes['class'] = $item->anchor_css;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->anchor_rel) {
|
|
||||||
$attributes['rel'] = $item->anchor_rel;
|
|
||||||
}
|
|
||||||
|
|
||||||
$linktype = $item->title;
|
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
|
||||||
} else {
|
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($item->browserNav == 1) {
|
|
||||||
$attributes['target'] = '_blank';
|
|
||||||
$attributes['rel'] = 'noopener noreferrer';
|
|
||||||
} elseif ($item->browserNav == 2) {
|
|
||||||
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');
|
|
||||||
$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
|
|
||||||
}
|
|
||||||
|
|
||||||
$linkClass = 'nav-link mod-menu__link';
|
|
||||||
|
|
||||||
if (isset($attributes['class'])) {
|
|
||||||
$attributes['class'] .= ' ' . $linkClass;
|
|
||||||
} else {
|
|
||||||
$attributes['class'] = $linkClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo HTMLHelper::_('link', OutputFilter::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT, 'UTF-8', false)), $linktype, $attributes);
|
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Horizontal menu — always-visible inline links that wrap on mobile.
|
* Main Menu - Mobile responsive collapsible dropdown menu override
|
||||||
* No hamburger, no collapse. Suitable for Quick Links, utility nav, topbar menus.
|
* Bootstrap 5 responsive navbar with hamburger menu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
@@ -22,13 +22,19 @@ if ($tagId = $params->get('tag_id', '')) {
|
|||||||
$id = ' id="' . $tagId . '"';
|
$id = ' id="' . $tagId . '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get module class suffix
|
||||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
|
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
|
||||||
|
|
||||||
|
// The menu class is deprecated. Use mod-menu instead
|
||||||
?>
|
?>
|
||||||
<nav class="mod-menu mod-menu-horizontal<?php echo $moduleclass_sfx; ?>"<?php echo $id; ?> aria-label="<?php echo htmlspecialchars($module->title, ENT_COMPAT, 'UTF-8'); ?>">
|
<nav class="mod-menu mod-menu-main navbar navbar-expand-lg<?php echo $moduleclass_sfx; ?>"<?php echo $id; ?>>
|
||||||
<ul class="nav mod-menu-horizontal__list flex-wrap">
|
<div class="container-fluid p-0">
|
||||||
|
<!-- Collapsible menu content — toggle controlled by .nav-mobile-bar in index.php -->
|
||||||
|
<div class="collapse navbar-collapse" id="moko-main-menu-collapse">
|
||||||
|
<ul class="navbar-nav mod-menu-main__list">
|
||||||
<?php foreach ($list as $i => &$item) :
|
<?php foreach ($list as $i => &$item) :
|
||||||
$itemParams = $item->getParams();
|
$itemParams = $item->getParams();
|
||||||
$class = 'nav-item mod-menu-horizontal__item item-' . $item->id;
|
$class = 'nav-item mod-menu-main__item item-' . $item->id;
|
||||||
|
|
||||||
if ($item->id == $default_id) {
|
if ($item->id == $default_id) {
|
||||||
$class .= ' default';
|
$class .= ' default';
|
||||||
@@ -77,14 +83,19 @@ $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COM
|
|||||||
break;
|
break;
|
||||||
endswitch;
|
endswitch;
|
||||||
|
|
||||||
|
// The next item is deeper.
|
||||||
if ($item->deeper) {
|
if ($item->deeper) {
|
||||||
echo '<ul class="dropdown-menu mod-menu-horizontal__dropdown">';
|
echo '<ul class="dropdown-menu mod-menu-main__dropdown">';
|
||||||
} elseif ($item->shallower) {
|
} elseif ($item->shallower) {
|
||||||
|
// The next item is shallower.
|
||||||
echo '</li>';
|
echo '</li>';
|
||||||
echo str_repeat('</ul></li>', $item->level_diff);
|
echo str_repeat('</ul></li>', $item->level_diff);
|
||||||
} else {
|
} else {
|
||||||
|
// The next item is on the same level.
|
||||||
echo '</li>';
|
echo '</li>';
|
||||||
}
|
}
|
||||||
endforeach;
|
endforeach;
|
||||||
?></ul>
|
?></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Horizontal menu — Component item layout
|
* Main Menu - Component item layout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
@@ -33,11 +33,12 @@ if ($item->anchor_rel) {
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
// The link is an icon
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
||||||
} else {
|
} else {
|
||||||
|
// If the icon itself is the link, it needs a visually hidden text
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,10 +48,12 @@ if ($item->browserNav == 1) {
|
|||||||
$attributes['rel'] = 'noopener noreferrer';
|
$attributes['rel'] = 'noopener noreferrer';
|
||||||
} elseif ($item->browserNav == 2) {
|
} elseif ($item->browserNav == 2) {
|
||||||
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');
|
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');
|
||||||
|
|
||||||
$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
|
$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkClass = 'nav-link mod-menu-horizontal__link';
|
// Add dropdown toggle for items with children
|
||||||
|
$linkClass = 'nav-link mod-menu-main__link';
|
||||||
if ($item->deeper) {
|
if ($item->deeper) {
|
||||||
$linkClass .= ' dropdown-toggle';
|
$linkClass .= ' dropdown-toggle';
|
||||||
$attributes['data-bs-toggle'] = 'dropdown';
|
$attributes['data-bs-toggle'] = 'dropdown';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Horizontal menu — Heading item layout
|
* Main Menu - Heading item layout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
@@ -19,16 +19,18 @@ $anchor_css = $item->anchor_css ?: '';
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
// The link is an icon
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
||||||
} else {
|
} else {
|
||||||
|
// If the icon itself is the link, it needs a visually hidden text
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$headingClass = 'nav-link mod-menu-horizontal__heading';
|
// Add dropdown toggle for items with children
|
||||||
|
$headingClass = 'nav-link mod-menu-main__heading';
|
||||||
if ($item->deeper) {
|
if ($item->deeper) {
|
||||||
$headingClass .= ' dropdown-toggle';
|
$headingClass .= ' dropdown-toggle';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Horizontal menu — Separator item layout
|
* Main Menu - Separator item layout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
@@ -19,14 +19,15 @@ $anchor_css = $item->anchor_css ?: '';
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
// The link is an icon
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
||||||
} else {
|
} else {
|
||||||
|
// If the icon itself is the link, it needs a visually hidden text
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<span class="dropdown-divider mod-menu-horizontal__separator <?php echo $anchor_css; ?>"<?php echo $title; ?>><?php echo $linktype; ?></span>
|
<span class="dropdown-divider mod-menu-main__separator <?php echo $anchor_css; ?>"<?php echo $title; ?>><?php echo $linktype; ?></span>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Horizontal menu — URL item layout
|
* Main Menu - URL item layout
|
||||||
*/
|
*/
|
||||||
|
|
||||||
defined('_JEXEC') or die;
|
defined('_JEXEC') or die;
|
||||||
@@ -33,11 +33,12 @@ if ($item->anchor_rel) {
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
// The link is an icon
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span>' . $item->title;
|
||||||
} else {
|
} else {
|
||||||
|
// If the icon itself is the link, it needs a visually hidden text
|
||||||
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
$linktype = '<span class="' . $item->menu_icon . '" aria-hidden="true"></span><span class="visually-hidden">' . $item->title . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,10 +48,12 @@ if ($item->browserNav == 1) {
|
|||||||
$attributes['rel'] = 'noopener noreferrer';
|
$attributes['rel'] = 'noopener noreferrer';
|
||||||
} elseif ($item->browserNav == 2) {
|
} elseif ($item->browserNav == 2) {
|
||||||
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');
|
$options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open');
|
||||||
|
|
||||||
$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
|
$attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;";
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkClass = 'nav-link mod-menu-horizontal__link';
|
// Add dropdown toggle for items with children
|
||||||
|
$linkClass = 'nav-link mod-menu-main__link';
|
||||||
if ($item->deeper) {
|
if ($item->deeper) {
|
||||||
$linkClass .= ' dropdown-toggle';
|
$linkClass .= ' dropdown-toggle';
|
||||||
$attributes['data-bs-toggle'] = 'dropdown';
|
$attributes['data-bs-toggle'] = 'dropdown';
|
||||||
@@ -58,6 +61,7 @@ if ($item->deeper) {
|
|||||||
$attributes['aria-expanded'] = 'false';
|
$attributes['aria-expanded'] = 'false';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Merge existing class with our class
|
||||||
if (isset($attributes['class'])) {
|
if (isset($attributes['class'])) {
|
||||||
$attributes['class'] .= ' ' . $linkClass;
|
$attributes['class'] .= ' ' . $linkClass;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -28,9 +28,14 @@ $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COM
|
|||||||
// The menu class is deprecated. Use mod-menu instead
|
// The menu class is deprecated. Use mod-menu instead
|
||||||
?>
|
?>
|
||||||
<nav class="mod-menu mod-menu-main navbar navbar-expand-lg<?php echo $moduleclass_sfx; ?>"<?php echo $id; ?>>
|
<nav class="mod-menu mod-menu-main navbar navbar-expand-lg<?php echo $moduleclass_sfx; ?>"<?php echo $id; ?>>
|
||||||
<div class="container-fluid p-0">
|
<div class="container-fluid">
|
||||||
<!-- Collapsible menu content — toggle controlled by .nav-mobile-bar in index.php -->
|
<!-- Hamburger toggle button for mobile -->
|
||||||
<div class="collapse navbar-collapse" id="moko-main-menu-collapse">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainMenuCollapse-<?php echo $module->id; ?>" aria-controls="mainMenuCollapse-<?php echo $module->id; ?>" aria-expanded="false" aria-label="Toggle Main Menu">
|
||||||
|
<span class="fa-solid fa-bars" aria-hidden="true"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- Collapsible menu content -->
|
||||||
|
<div class="collapse navbar-collapse" id="mainMenuCollapse-<?php echo $module->id; ?>">
|
||||||
<ul class="navbar-nav mod-menu-main__list">
|
<ul class="navbar-nav mod-menu-main__list">
|
||||||
<?php foreach ($list as $i => &$item) :
|
<?php foreach ($list as $i => &$item) :
|
||||||
$itemParams = $item->getParams();
|
$itemParams = $item->getParams();
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ if ($item->anchor_rel) {
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
// The link is an icon
|
// The link is an icon
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
// If the link text is to be displayed, the icon is added with aria-hidden
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ $anchor_css = $item->anchor_css ?: '';
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
// The link is an icon
|
// The link is an icon
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
// If the link text is to be displayed, the icon is added with aria-hidden
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ $anchor_css = $item->anchor_css ?: '';
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
// The link is an icon
|
// The link is an icon
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
// If the link text is to be displayed, the icon is added with aria-hidden
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ if ($item->anchor_rel) {
|
|||||||
$linktype = $item->title;
|
$linktype = $item->title;
|
||||||
|
|
||||||
if ($item->menu_icon) {
|
if ($item->menu_icon) {
|
||||||
// Strip Joomla-injected padding classes that conflict with FA icon sizing
|
|
||||||
$item->menu_icon = trim(preg_replace('/\bp-[0-5]\b/', '', $item->menu_icon));
|
|
||||||
// The link is an icon
|
// The link is an icon
|
||||||
if ($itemParams->get('menu_text', 1)) {
|
if ($itemParams->get('menu_text', 1)) {
|
||||||
// If the link text is to be displayed, the icon is added with aria-hidden
|
// If the link text is to be displayed, the icon is added with aria-hidden
|
||||||
|
|||||||
+2
-7
@@ -205,10 +205,7 @@ if ($this->countModules('drawer-left', true) || $this->countModules('drawer-righ
|
|||||||
|
|
||||||
// Container
|
// Container
|
||||||
$wrapper = $this->params->get('fluidContainer') ? 'wrapper-fluid' : 'wrapper-static';
|
$wrapper = $this->params->get('fluidContainer') ? 'wrapper-fluid' : 'wrapper-static';
|
||||||
$stickyHeader = $this->params->get('stickyHeader') ? 'position-sticky sticky-top' : '';
|
$stickyHeader = $this->params->get('stickyHeader') ? 'position-sticky sticky-top' : '';
|
||||||
$isHomePage = Factory::getApplication()->getMenu()->getActive() === Factory::getApplication()->getMenu()->getDefault();
|
|
||||||
$hideHeaderHome = $isHomePage && (int) $this->params->get('hideHeaderHome', 0);
|
|
||||||
$hideMenuHome = $isHomePage && (int) $this->params->get('hideMenuHome', 0);
|
|
||||||
|
|
||||||
// Meta
|
// Meta
|
||||||
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');
|
$this->setMetaData('viewport', 'width=device-width, initial-scale=1');
|
||||||
@@ -433,7 +430,6 @@ $wa->useScript('user.js'); // js/user.js
|
|||||||
<!-- End Google Analytics -->
|
<!-- End Google Analytics -->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!$hideHeaderHome) : ?>
|
|
||||||
<header id="top" class="header container-header full-width<?php echo $stickyHeader ? ' ' . $stickyHeader : ''; ?>" role="banner">
|
<header id="top" class="header container-header full-width<?php echo $stickyHeader ? ' ' . $stickyHeader : ''; ?>" role="banner">
|
||||||
|
|
||||||
<?php if ($this->countModules('topbar')) : ?>
|
<?php if ($this->countModules('topbar')) : ?>
|
||||||
@@ -497,7 +493,7 @@ $wa->useScript('user.js'); // js/user.js
|
|||||||
</button>
|
</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (($this->countModules('menu', true) || $this->countModules('search', true)) && !$hideMenuHome) : ?>
|
<?php if ($this->countModules('menu', true) || $this->countModules('search', true)) : ?>
|
||||||
<div class="grid-child container-nav">
|
<div class="grid-child container-nav">
|
||||||
<?php // Mobile: hamburger (left) + search icon (right) on one line ?>
|
<?php // Mobile: hamburger (left) + search icon (right) on one line ?>
|
||||||
<div class="nav-mobile-bar d-lg-none">
|
<div class="nav-mobile-bar d-lg-none">
|
||||||
@@ -525,7 +521,6 @@ $wa->useScript('user.js'); // js/user.js
|
|||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</header>
|
</header>
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="site-grid">
|
<div class="site-grid">
|
||||||
<?php if ($this->countModules('banner', true)) : ?>
|
<?php if ($this->countModules('banner', true)) : ?>
|
||||||
|
|||||||
@@ -61,10 +61,6 @@ TPL_MOKOONYX_FONT_NOTE_TEXT="Loading fonts from external sources might be agains
|
|||||||
|
|
||||||
; ===== Header & navigation (Theme tab) =====
|
; ===== Header & navigation (Theme tab) =====
|
||||||
TPL_MOKOONYX_STICKY_LABEL="Sticky Header"
|
TPL_MOKOONYX_STICKY_LABEL="Sticky Header"
|
||||||
TPL_MOKOONYX_HIDE_HEADER_HOME_LABEL="Hide Header on Home Page"
|
|
||||||
TPL_MOKOONYX_HIDE_HEADER_HOME_DESC="Hide the site header (logo, branding) on the front page only."
|
|
||||||
TPL_MOKOONYX_HIDE_MENU_HOME_LABEL="Hide Main Menu on Home Page"
|
|
||||||
TPL_MOKOONYX_HIDE_MENU_HOME_DESC="Hide the main navigation menu on the front page only."
|
|
||||||
TPL_MOKOONYX_BACKTOTOP="Back to Top"
|
TPL_MOKOONYX_BACKTOTOP="Back to Top"
|
||||||
TPL_MOKOONYX_TOC_TITLE="Table of Contents"
|
TPL_MOKOONYX_TOC_TITLE="Table of Contents"
|
||||||
TPL_MOKOONYX_BACKTOTOP_LABEL="Back-to-top Link"
|
TPL_MOKOONYX_BACKTOTOP_LABEL="Back-to-top Link"
|
||||||
|
|||||||
@@ -61,10 +61,6 @@ TPL_MOKOONYX_FONT_NOTE_TEXT="Loading fonts from external sources might be agains
|
|||||||
|
|
||||||
; ===== Header & navigation (Theme tab) =====
|
; ===== Header & navigation (Theme tab) =====
|
||||||
TPL_MOKOONYX_STICKY_LABEL="Sticky Header"
|
TPL_MOKOONYX_STICKY_LABEL="Sticky Header"
|
||||||
TPL_MOKOONYX_HIDE_HEADER_HOME_LABEL="Hide Header on Home Page"
|
|
||||||
TPL_MOKOONYX_HIDE_HEADER_HOME_DESC="Hide the site header (logo, branding) on the front page only."
|
|
||||||
TPL_MOKOONYX_HIDE_MENU_HOME_LABEL="Hide Main Menu on Home Page"
|
|
||||||
TPL_MOKOONYX_HIDE_MENU_HOME_DESC="Hide the main navigation menu on the front page only."
|
|
||||||
TPL_MOKOONYX_BACKTOTOP="Back to Top"
|
TPL_MOKOONYX_BACKTOTOP="Back to Top"
|
||||||
TPL_MOKOONYX_TOC_TITLE="Table of Contents"
|
TPL_MOKOONYX_TOC_TITLE="Table of Contents"
|
||||||
TPL_MOKOONYX_BACKTOTOP_LABEL="Back-to-top Link"
|
TPL_MOKOONYX_BACKTOTOP_LABEL="Back-to-top Link"
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* INGROUP: MokoOnyx.Accessibility
|
* INGROUP: MokoOnyx.Accessibility
|
||||||
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
* REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx
|
||||||
* PATH: ./media/css/a11y-high-contrast.css
|
* PATH: ./media/css/a11y-high-contrast.css
|
||||||
* VERSION: 02.19.08
|
* VERSION: 03.09.14
|
||||||
* BRIEF: High-contrast stylesheet for accessibility toolbar
|
* BRIEF: High-contrast stylesheet for accessibility toolbar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -23510,22 +23510,3 @@ font-size: 0.8125rem;
|
|||||||
.fa-solid {
|
.fa-solid {
|
||||||
margin-right: 0.25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fa-regular {
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
.blog-item .item-image {
|
|
||||||
height: 250px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blog-item .item-image img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fa-brands {
|
|
||||||
margin-right: 0.25rem;
|
|
||||||
}
|
|
||||||
/* patch release test */
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 168 KiB |
-281
@@ -34,9 +34,6 @@ class Tpl_MokoonyxInstallerScript implements InstallerScriptInterface
|
|||||||
private const OLD_DISPLAY = 'MokoCassiopeia';
|
private const OLD_DISPLAY = 'MokoCassiopeia';
|
||||||
private const NEW_DISPLAY = 'MokoOnyx';
|
private const NEW_DISPLAY = 'MokoOnyx';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function preflight(string $type, InstallerAdapter $parent): bool
|
public function preflight(string $type, InstallerAdapter $parent): bool
|
||||||
{
|
{
|
||||||
if (version_compare(PHP_VERSION, self::MIN_PHP, '<')) {
|
if (version_compare(PHP_VERSION, self::MIN_PHP, '<')) {
|
||||||
@@ -86,23 +83,16 @@ class Tpl_MokoonyxInstallerScript implements InstallerScriptInterface
|
|||||||
public function uninstall(InstallerAdapter $parent): bool
|
public function uninstall(InstallerAdapter $parent): bool
|
||||||
{
|
{
|
||||||
$this->logMessage('MokoOnyx template uninstalled.');
|
$this->logMessage('MokoOnyx template uninstalled.');
|
||||||
$this->saveDownloadKey();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function postflight(string $type, InstallerAdapter $parent): bool
|
public function postflight(string $type, InstallerAdapter $parent): bool
|
||||||
{
|
{
|
||||||
$this->restoreDownloadKey();
|
|
||||||
$this->warnMissingLicenseKey();
|
|
||||||
|
|
||||||
if ($type === 'install' || $type === 'update') {
|
if ($type === 'install' || $type === 'update') {
|
||||||
$this->migrateFromCassiopeia();
|
$this->migrateFromCassiopeia();
|
||||||
$this->replaceCassiopeiaReferences();
|
$this->replaceCassiopeiaReferences();
|
||||||
$this->clearFaviconStamp();
|
$this->clearFaviconStamp();
|
||||||
$this->cleanMediaFolder();
|
$this->cleanMediaFolder();
|
||||||
$this->removeDeletedFiles();
|
|
||||||
$this->removeDuplicateExtensions();
|
|
||||||
$this->lockExtension();
|
$this->lockExtension();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,189 +483,6 @@ class Tpl_MokoonyxInstallerScript implements InstallerScriptInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove duplicate MokoOnyx extension entries from #__extensions.
|
|
||||||
*
|
|
||||||
* Re-installs or migrations can leave ghost rows. We keep the one
|
|
||||||
* that is locked (the active template) and delete any extras.
|
|
||||||
* Also removes stale MokoCassiopeia entries if present.
|
|
||||||
*/
|
|
||||||
private function removeDuplicateExtensions(): void
|
|
||||||
{
|
|
||||||
$db = Factory::getDbo();
|
|
||||||
|
|
||||||
// Find all MokoOnyx template entries
|
|
||||||
$rows = $db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select(['extension_id', 'locked'])
|
|
||||||
->from('#__extensions')
|
|
||||||
->where($db->quoteName('element') . ' = ' . $db->quote(self::NEW_NAME))
|
|
||||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
|
|
||||||
->order('locked DESC, extension_id ASC')
|
|
||||||
)->loadObjectList();
|
|
||||||
|
|
||||||
if (count($rows) > 1) {
|
|
||||||
$keep = (int) $rows[0]->extension_id;
|
|
||||||
$removed = 0;
|
|
||||||
|
|
||||||
for ($i = 1; $i < count($rows); $i++) {
|
|
||||||
$staleId = (int) $rows[$i]->extension_id;
|
|
||||||
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__update_sites_extensions')
|
|
||||||
->where('extension_id = ' . $staleId)
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__extensions')
|
|
||||||
->where('extension_id = ' . $staleId)
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$removed++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($removed > 0) {
|
|
||||||
$this->logMessage("Removed {$removed} duplicate MokoOnyx extension(s). Kept ID {$keep}.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove faulty "template-mokoonyx" duplicate (wrong element name from bad install)
|
|
||||||
$faultyId = (int) $db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select('extension_id')
|
|
||||||
->from('#__extensions')
|
|
||||||
->where($db->quoteName('element') . ' = ' . $db->quote('template-mokoonyx'))
|
|
||||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
|
|
||||||
)->loadResult();
|
|
||||||
|
|
||||||
if ($faultyId) {
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__update_sites_extensions')
|
|
||||||
->where('extension_id = ' . $faultyId)
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__extensions')
|
|
||||||
->where('extension_id = ' . $faultyId)
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__template_styles')
|
|
||||||
->where($db->quoteName('template') . ' = ' . $db->quote('template-mokoonyx'))
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$this->logMessage('Removed faulty template-mokoonyx duplicate extension.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove stale MokoCassiopeia if not set as default
|
|
||||||
$oldExt = (int) $db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select('extension_id')
|
|
||||||
->from('#__extensions')
|
|
||||||
->where($db->quoteName('element') . ' = ' . $db->quote(self::OLD_NAME))
|
|
||||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
|
|
||||||
)->loadResult();
|
|
||||||
|
|
||||||
if ($oldExt) {
|
|
||||||
$isDefault = (int) $db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select('COUNT(*)')
|
|
||||||
->from('#__template_styles')
|
|
||||||
->where($db->quoteName('template') . ' = ' . $db->quote(self::OLD_NAME))
|
|
||||||
->where($db->quoteName('home') . ' = 1')
|
|
||||||
)->loadResult();
|
|
||||||
|
|
||||||
if ($isDefault === 0) {
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__update_sites_extensions')
|
|
||||||
->where('extension_id = ' . $oldExt)
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__extensions')
|
|
||||||
->where('extension_id = ' . $oldExt)
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->delete('#__template_styles')
|
|
||||||
->where($db->quoteName('template') . ' = ' . $db->quote(self::OLD_NAME))
|
|
||||||
)->execute();
|
|
||||||
|
|
||||||
$this->logMessage('Removed stale MokoCassiopeia extension and styles.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove files and directories that were shipped in previous versions
|
|
||||||
* but have since been deleted from the package.
|
|
||||||
*
|
|
||||||
* Joomla's installer never deletes files on upgrade — it only
|
|
||||||
* adds/overwrites. This method fills that gap so stale overrides
|
|
||||||
* and deprecated assets don't linger on disk.
|
|
||||||
*
|
|
||||||
* Maintain this list: when you delete a file from the repo, add its
|
|
||||||
* path here (relative to the template root) so existing installs
|
|
||||||
* get cleaned up on the next update.
|
|
||||||
*/
|
|
||||||
private function removeDeletedFiles(): void
|
|
||||||
{
|
|
||||||
$templateRoot = JPATH_ROOT . '/templates/' . self::NEW_NAME;
|
|
||||||
|
|
||||||
// Paths relative to templates/mokoonyx/
|
|
||||||
$deletedFiles = [
|
|
||||||
// JoomGallery template overrides — removed in 02.19.00
|
|
||||||
'html/com_joomgallery/category/default.php',
|
|
||||||
'html/com_joomgallery/category/default_cat.php',
|
|
||||||
'html/com_joomgallery/category/index.html',
|
|
||||||
'html/com_joomgallery/gallery/default.php',
|
|
||||||
'html/com_joomgallery/gallery/index.html',
|
|
||||||
'html/com_joomgallery/image/default.php',
|
|
||||||
'html/com_joomgallery/image/index.html',
|
|
||||||
];
|
|
||||||
|
|
||||||
// Directories to remove (only if empty after file deletion)
|
|
||||||
$deletedDirs = [
|
|
||||||
'html/com_joomgallery/image',
|
|
||||||
'html/com_joomgallery/gallery',
|
|
||||||
'html/com_joomgallery/category',
|
|
||||||
'html/com_joomgallery',
|
|
||||||
];
|
|
||||||
|
|
||||||
$removed = 0;
|
|
||||||
|
|
||||||
foreach ($deletedFiles as $relPath) {
|
|
||||||
$file = $templateRoot . '/' . $relPath;
|
|
||||||
if (is_file($file)) {
|
|
||||||
@unlink($file);
|
|
||||||
$removed++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($deletedDirs as $relPath) {
|
|
||||||
$dir = $templateRoot . '/' . $relPath;
|
|
||||||
if (is_dir($dir)) {
|
|
||||||
// Only remove if empty
|
|
||||||
$entries = @scandir($dir);
|
|
||||||
if ($entries && count($entries) <= 2) { // . and .. only
|
|
||||||
@rmdir($dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($removed > 0) {
|
|
||||||
$this->logMessage("Removed {$removed} deprecated file(s) from previous versions.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function logMessage(string $message, string $priority = 'info'): void
|
private function logMessage(string $message, string $priority = 'info'): void
|
||||||
{
|
{
|
||||||
$priorities = [
|
$priorities = [
|
||||||
@@ -692,92 +499,4 @@ class Tpl_MokoonyxInstallerScript implements InstallerScriptInterface
|
|||||||
|
|
||||||
Log::add($message, $priorities[$priority] ?? Log::INFO, 'mokoonyx');
|
Log::add($message, $priorities[$priority] ?? Log::INFO, 'mokoonyx');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ?string $savedDownloadKey = null;
|
|
||||||
|
|
||||||
private function saveDownloadKey(): void
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$db = \Joomla\CMS\Factory::getDbo();
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select($db->quoteName('us.extra_query'))
|
|
||||||
->from($db->quoteName('#__update_sites', 'us'))
|
|
||||||
->join('INNER', $db->quoteName('#__update_sites_extensions', 'use') . ' ON use.update_site_id = us.update_site_id')
|
|
||||||
->join('INNER', $db->quoteName('#__extensions', 'e') . ' ON e.extension_id = use.extension_id')
|
|
||||||
->where($db->quoteName('e.element') . ' = ' . $db->quote('mokoonyx'))
|
|
||||||
->setLimit(1)
|
|
||||||
);
|
|
||||||
$key = $db->loadResult();
|
|
||||||
if (!empty($key)) { $this->savedDownloadKey = $key; }
|
|
||||||
}
|
|
||||||
catch (\Throwable $e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function restoreDownloadKey(): void
|
|
||||||
{
|
|
||||||
if ($this->savedDownloadKey === null) { return; }
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$db = \Joomla\CMS\Factory::getDbo();
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select($db->quoteName('us.update_site_id'))
|
|
||||||
->from($db->quoteName('#__update_sites', 'us'))
|
|
||||||
->join('INNER', $db->quoteName('#__update_sites_extensions', 'use') . ' ON use.update_site_id = us.update_site_id')
|
|
||||||
->join('INNER', $db->quoteName('#__extensions', 'e') . ' ON e.extension_id = use.extension_id')
|
|
||||||
->where($db->quoteName('e.element') . ' = ' . $db->quote('mokoonyx'))
|
|
||||||
->setLimit(1)
|
|
||||||
);
|
|
||||||
$siteId = (int) $db->loadResult();
|
|
||||||
if ($siteId > 0)
|
|
||||||
{
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->update($db->quoteName('#__update_sites'))
|
|
||||||
->set($db->quoteName('extra_query') . ' = ' . $db->quote($this->savedDownloadKey))
|
|
||||||
->where($db->quoteName('update_site_id') . ' = ' . $siteId)
|
|
||||||
)->execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (\Throwable $e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function warnMissingLicenseKey(): void
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
$db = \Joomla\CMS\Factory::getDbo();
|
|
||||||
$db->setQuery(
|
|
||||||
$db->getQuery(true)
|
|
||||||
->select([$db->quoteName('update_site_id'), $db->quoteName('extra_query')])
|
|
||||||
->from($db->quoteName('#__update_sites'))
|
|
||||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoOnyx%') . ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoOnyx%') . ')')
|
|
||||||
->setLimit(1)
|
|
||||||
);
|
|
||||||
$site = $db->loadObject();
|
|
||||||
|
|
||||||
if ($site)
|
|
||||||
{
|
|
||||||
$eq = (string) ($site->extra_query ?? '');
|
|
||||||
if (!empty($eq) && strpos($eq, 'dlid=') !== false) { parse_str($eq, $p); if (!empty($p['dlid'])) { return; } }
|
|
||||||
$editUrl = 'index.php?option=com_installer&task=updatesite.edit&update_site_id=' . (int) $site->update_site_id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$editUrl = 'index.php?option=com_installer&view=updatesites';
|
|
||||||
}
|
|
||||||
|
|
||||||
\Joomla\CMS\Factory::getApplication()->enqueueMessage(
|
|
||||||
'<strong>Moko Consulting License Key Required</strong> — '
|
|
||||||
. 'No download key is configured. Updates will not be available until a valid license key is entered. '
|
|
||||||
. '<a href="' . $editUrl . '" class="btn btn-sm btn-warning ms-2">Enter License Key</a>',
|
|
||||||
'warning'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
catch (\Throwable $e) {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-13
@@ -31,18 +31,18 @@
|
|||||||
-->
|
-->
|
||||||
<extension type="template" client="site" method="upgrade">
|
<extension type="template" client="site" method="upgrade">
|
||||||
<updateservers>
|
<updateservers>
|
||||||
<server type="extension" name="Template - MokoOnyx">https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/updates.xml</server>
|
<server type="extension" priority="1" name="MokoOnyx Update Server (MokoGitea)">
|
||||||
|
https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/raw/branch/main/updates.xml
|
||||||
|
</server>
|
||||||
</updateservers>
|
</updateservers>
|
||||||
<dlid prefix="dlid=" suffix=""/>
|
<name>Template - MokoOnyx</name>
|
||||||
<name>mokoonyx</name>
|
<version>02.08.00-dev</version>
|
||||||
<version>02.19.08-dev</version>
|
|
||||||
<scriptfile>script.php</scriptfile>
|
<scriptfile>script.php</scriptfile>
|
||||||
<creationDate>2026-05-16</creationDate>
|
<creationDate>2026-05-16</creationDate>
|
||||||
<author>Jonathan Miller || Moko Consulting</author>
|
<author>Jonathan Miller || Moko Consulting</author>
|
||||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||||
<copyright>(C)GNU General Public License Version 3 - 2026 Moko Consulting</copyright>
|
<copyright>(C)GNU General Public License Version 3 - 2026 Moko Consulting</copyright>
|
||||||
<description><![CDATA[<p><img src="https://img.shields.io/gitea/v/release/MokoConsulting/MokoOnyx?gitea_url=https%3A%2F%2Fgit.mokoconsulting.tech&logo=gitea&logoColor=white&label=version" alt="Version" /> <img src="https://img.shields.io/badge/license-GPL--3.0--or--later-green.svg?logo=gnu&logoColor=white" alt="License" /> <img src="https://img.shields.io/badge/Joomla-5.x%20%7C%206.x-red.svg?logo=joomla&logoColor=white" alt="Joomla" /> <img src="https://img.shields.io/badge/PHP-8.1%2B-777BB4.svg?logo=php&logoColor=white" alt="PHP" /></p> <h3>MokoOnyx</h3> <p> <strong>MokoOnyx</strong> is a modern, lightweight enhancement layer built on Joomla's Cassiopeia template. It adds Font Awesome 7, Bootstrap 5 helpers, automatic Table of Contents, advanced Dark Mode theming, and optional Google Tag Manager / GA4 integration — all with minimal core overrides for maximum upgrade compatibility. </p> <h4>Custom Colour Themes</h4> <p> Copy <code>templates/mokoonyx/templates/light.custom.css</code> to <code>media/templates/site/mokoonyx/css/theme/light.custom.css</code> (or dark equivalent), customise the CSS variables, then select "Custom" in the Theme tab. </p> <h4>Custom CSS & JavaScript</h4> <ul> <li><code>media/templates/site/mokoonyx/css/user.css</code> — custom CSS overrides</li> <li><code>media/templates/site/mokoonyx/js/user.js</code> — custom JavaScript</li> </ul> <p>These files survive template updates.</p>]]></description>
|
<description><![CDATA[<p><img src="https://img.shields.io/gitea/v/release/MokoConsulting/MokoOnyx?gitea_url=https%3A%2F%2Fgit.mokoconsulting.tech&logo=gitea&logoColor=white&label=version" alt="Version" /> <img src="https://img.shields.io/badge/license-GPL--3.0--or--later-green.svg?logo=gnu&logoColor=white" alt="License" /> <img src="https://img.shields.io/badge/Joomla-5.x%20%7C%206.x-red.svg?logo=joomla&logoColor=white" alt="Joomla" /> <img src="https://img.shields.io/badge/PHP-8.1%2B-777BB4.svg?logo=php&logoColor=white" alt="PHP" /></p> <h3>MokoOnyx</h3> <p> <strong>MokoOnyx</strong> is a modern, lightweight enhancement layer built on Joomla's Cassiopeia template. It adds Font Awesome 7, Bootstrap 5 helpers, automatic Table of Contents, advanced Dark Mode theming, and optional Google Tag Manager / GA4 integration — all with minimal core overrides for maximum upgrade compatibility. </p> <h4>Custom Colour Themes</h4> <p> Copy <code>templates/mokoonyx/templates/light.custom.css</code> to <code>media/templates/site/mokoonyx/css/theme/light.custom.css</code> (or dark equivalent), customise the CSS variables, then select "Custom" in the Theme tab. </p> <h4>Custom CSS & JavaScript</h4> <ul> <li><code>media/templates/site/mokoonyx/css/user.css</code> — custom CSS overrides</li> <li><code>media/templates/site/mokoonyx/js/user.js</code> — custom JavaScript</li> </ul> <p>These files survive template updates.</p>]]></description>
|
||||||
<php_minimum>8.1.0</php_minimum>
|
|
||||||
<inheritable>1</inheritable>
|
<inheritable>1</inheritable>
|
||||||
<files>
|
<files>
|
||||||
<filename>component.php</filename>
|
<filename>component.php</filename>
|
||||||
@@ -237,14 +237,6 @@
|
|||||||
<option value="0">JNO</option>
|
<option value="0">JNO</option>
|
||||||
<option value="1">JYES</option>
|
<option value="1">JYES</option>
|
||||||
</field>
|
</field>
|
||||||
<field name="hideHeaderHome" type="radio" label="TPL_MOKOONYX_HIDE_HEADER_HOME_LABEL" description="TPL_MOKOONYX_HIDE_HEADER_HOME_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="integer">
|
|
||||||
<option value="0">JNO</option>
|
|
||||||
<option value="1">JYES</option>
|
|
||||||
</field>
|
|
||||||
<field name="hideMenuHome" type="radio" label="TPL_MOKOONYX_HIDE_MENU_HOME_LABEL" description="TPL_MOKOONYX_HIDE_MENU_HOME_DESC" layout="joomla.form.field.radio.switcher" default="0" filter="integer">
|
|
||||||
<option value="0">JNO</option>
|
|
||||||
<option value="1">JYES</option>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<!-- Accessibility -->
|
<!-- Accessibility -->
|
||||||
<field name="theme_sep_a11y" type="spacer" label="Accessibility" hr="false" class="text fw-bold" />
|
<field name="theme_sep_a11y" type="spacer" label="Accessibility" hr="false" class="text fw-bold" />
|
||||||
@@ -373,4 +365,5 @@
|
|||||||
</fields>
|
</fields>
|
||||||
</config>
|
</config>
|
||||||
</extension>
|
</extension>
|
||||||
|
<!-- dev release 01.00.26 -->
|
||||||
|
|
||||||
|
|||||||
+98
@@ -0,0 +1,98 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!-- Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
VERSION: 02.08.00-dev
|
||||||
|
-->
|
||||||
|
|
||||||
|
<updates>
|
||||||
|
<update>
|
||||||
|
<name>Template - Template - MokoOnyx</name>
|
||||||
|
<description>Template - Template - MokoOnyx development build.</description>
|
||||||
|
<element>mokoonyx</element>
|
||||||
|
<type>template</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.08.00-dev</version>
|
||||||
|
<creationDate>2026-05-28</creationDate>
|
||||||
|
<infourl title='Template - Template - MokoOnyx'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/tag/stable</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/download/stable/tpl_mokoonyx-02.08.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha256>56d21ee7ef25262a680f62b9f54f28e0c00a0aa795c80a797ee67532e251b20d</sha256>
|
||||||
|
<tags><tag>dev</tag></tags>
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Template - Template - MokoOnyx</name>
|
||||||
|
<description>Template - Template - MokoOnyx alpha build.</description>
|
||||||
|
<element>mokoonyx</element>
|
||||||
|
<type>template</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.08.00-dev</version>
|
||||||
|
<creationDate>2026-05-28</creationDate>
|
||||||
|
<infourl title='Template - Template - MokoOnyx'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/tag/stable</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/download/stable/tpl_mokoonyx-02.08.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha256>56d21ee7ef25262a680f62b9f54f28e0c00a0aa795c80a797ee67532e251b20d</sha256>
|
||||||
|
<tags><tag>alpha</tag></tags>
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Template - Template - MokoOnyx</name>
|
||||||
|
<description>Template - Template - MokoOnyx beta build.</description>
|
||||||
|
<element>mokoonyx</element>
|
||||||
|
<type>template</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.08.00-dev</version>
|
||||||
|
<creationDate>2026-05-28</creationDate>
|
||||||
|
<infourl title='Template - Template - MokoOnyx'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/tag/stable</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/download/stable/tpl_mokoonyx-02.08.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha256>56d21ee7ef25262a680f62b9f54f28e0c00a0aa795c80a797ee67532e251b20d</sha256>
|
||||||
|
<tags><tag>beta</tag></tags>
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Template - Template - MokoOnyx</name>
|
||||||
|
<description>Template - Template - MokoOnyx rc build.</description>
|
||||||
|
<element>mokoonyx</element>
|
||||||
|
<type>template</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.08.00-dev</version>
|
||||||
|
<creationDate>2026-05-28</creationDate>
|
||||||
|
<infourl title='Template - Template - MokoOnyx'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/tag/stable</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/download/stable/tpl_mokoonyx-02.08.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha256>56d21ee7ef25262a680f62b9f54f28e0c00a0aa795c80a797ee67532e251b20d</sha256>
|
||||||
|
<tags><tag>rc</tag></tags>
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Template - Template - MokoOnyx</name>
|
||||||
|
<description>Template - Template - MokoOnyx stable build.</description>
|
||||||
|
<element>mokoonyx</element>
|
||||||
|
<type>template</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>02.08.00-dev</version>
|
||||||
|
<creationDate>2026-05-28</creationDate>
|
||||||
|
<infourl title='Template - Template - MokoOnyx'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/tag/stable</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type='full' format='zip'>https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/download/stable/tpl_mokoonyx-02.08.00-dev.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<sha256>56d21ee7ef25262a680f62b9f54f28e0c00a0aa795c80a797ee67532e251b20d</sha256>
|
||||||
|
<tags><tag>stable</tag></tags>
|
||||||
|
<maintainer>Moko Consulting</maintainer>
|
||||||
|
<maintainerurl>https://mokoconsulting.tech</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="(5|6)\..*" />
|
||||||
|
</update>
|
||||||
|
</updates>
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
## Code of Conduct
|
|
||||||
|
|
||||||
This Code of Conduct establishes expectations for behavior within the MokoOnyx project community. The objective is to maintain a professional, inclusive, and respectful environment aligned with open source governance best practices.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies to all project spaces, including:
|
|
||||||
|
|
||||||
* Repositories, issues, pull requests, discussions, and security advisories.
|
|
||||||
* Project documentation, workflows, and release processes.
|
|
||||||
* Any communication channels officially associated with the project.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Participants are expected to:
|
|
||||||
|
|
||||||
* Communicate professionally and respectfully.
|
|
||||||
* Provide constructive feedback focused on technical merit and project objectives.
|
|
||||||
* Respect differing viewpoints, experience levels, and backgrounds.
|
|
||||||
* Follow documented contribution, security, and governance policies.
|
|
||||||
|
|
||||||
Unacceptable behavior includes:
|
|
||||||
|
|
||||||
* Harassment, discrimination, or exclusionary conduct.
|
|
||||||
* Personal attacks, insults, or inflammatory comments.
|
|
||||||
* Publishing private information without consent.
|
|
||||||
* Disruptive behavior that materially interferes with project operations.
|
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for:
|
|
||||||
|
|
||||||
* Clarifying standards when questions arise.
|
|
||||||
* Taking appropriate and proportionate corrective action when violations occur.
|
|
||||||
* Maintaining confidentiality to the extent practical during investigations.
|
|
||||||
|
|
||||||
## Reporting
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported through:
|
|
||||||
|
|
||||||
* Email: `hello@mokoconsulting.tech` with subject `CODE OF CONDUCT: MokoOnyx`.
|
|
||||||
|
|
||||||
Reports should include relevant context, links, screenshots, or other supporting information.
|
|
||||||
|
|
||||||
## Enforcement Guidelines
|
|
||||||
|
|
||||||
Corrective actions may include, but are not limited to:
|
|
||||||
|
|
||||||
* Private warning or request for corrective action.
|
|
||||||
* Temporary or permanent restriction from project participation.
|
|
||||||
* Removal of content that violates this Code of Conduct.
|
|
||||||
|
|
||||||
Decisions are made based on impact, severity, and pattern of behavior.
|
|
||||||
|
|
||||||
## No Retaliation
|
|
||||||
|
|
||||||
Retaliation against individuals who report concerns in good faith is not tolerated. Any retaliatory behavior will be treated as a separate violation.
|
|
||||||
|
|
||||||
## Jurisdiction
|
|
||||||
|
|
||||||
This project is managed from Tennessee, USA. This statement is informational and does not constitute legal advice.
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
|
|
||||||
MokoOnyx is configured through the Joomla template style editor at **System → Site Templates → MokoOnyx**. Parameters are organized into tabbed fieldsets.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Migration Tab
|
|
||||||
|
|
||||||
Informational notes about the MokoCassiopeia migration process. No editable parameters -- this tab provides guidance only.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Advanced Tab
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `developmentmode` | Toggle | Off | Enables development mode. When on, `.min` files are deleted and unminified source files are served. When off, minified files are auto-generated. |
|
|
||||||
| `fluidContainer` | Toggle | Static | Controls whether the main layout uses a fixed-width (`container`) or full-width (`container-fluid`) wrapper. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Favicon Tab
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `favicon_source` | Media picker | _(none)_ | Upload a PNG image. MokoOnyx auto-generates all required favicon sizes, `apple-touch-icon.png`, and `site.webmanifest` on the next page load. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Google Tab
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `googletagmanager` | Toggle | Off | Enable Google Tag Manager integration. |
|
|
||||||
| `googletagmanagerid` | Text | _(empty)_ | Your GTM container ID (e.g., `GTM-XXXXXXX`). Shown when GTM is enabled. |
|
|
||||||
| `googleanalytics` | Toggle | Off | Enable Google Analytics (GA4) integration. |
|
|
||||||
| `googleanalyticsid` | Text | _(empty)_ | Your GA4 measurement ID (e.g., `G-XXXXXXXXXX`). Shown when GA4 is enabled. |
|
|
||||||
| `googlesitekey` | Text | _(empty)_ | Google site verification meta tag value. |
|
|
||||||
| `googlevisitordetection` | Toggle | On | When enabled, sends visitor context to GTM/GA4: login status, user group, and page type. Shown when GTM or GA4 is enabled. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Custom Code Tab
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `custom_head_start` | Textarea | _(empty)_ | Raw HTML/JS injected at the **start** of `<head>`. Useful for consent managers or early scripts. |
|
|
||||||
| `custom_head_end` | Textarea | _(empty)_ | Raw HTML/JS injected at the **end** of `<head>`, before `</head>`. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Drawers Tab
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `drawerLeftIcon` | Text | `fa-solid fa-chevron-right` | Font Awesome class for the left drawer toggle button icon. |
|
|
||||||
| `drawerRightIcon` | Text | `fa-solid fa-chevron-left` | Font Awesome class for the right drawer toggle button icon. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Theme Tab
|
|
||||||
|
|
||||||
The Theme tab is the largest configuration area, organized into sub-sections.
|
|
||||||
|
|
||||||
### General
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `theme_enabled` | Toggle | On | Master switch for the theme system (light/dark mode). |
|
|
||||||
| `theme_control_type` | List | Radios | How the user switches themes: **Switch** (Light/Dark toggle), **Radios** (Light/Dark/System), or **None** (no visible control). |
|
|
||||||
| `theme_default_choice` | List | System | Default theme when no user preference is stored: **System**, **Light**, or **Dark**. |
|
|
||||||
| `theme_auto_dark` | Toggle | Off | Automatically switch to dark mode based on time of day. |
|
|
||||||
| `theme_meta_color_scheme` | Toggle | On | Output `<meta name="color-scheme">` tag for browser chrome theming. |
|
|
||||||
| `theme_meta_theme_color` | Toggle | On | Output `<meta name="theme-color">` tag for mobile browser address bar. |
|
|
||||||
| `theme_bridge_bs_aria` | Toggle | On | Bridge Bootstrap `data-bs-theme` attribute with ARIA attributes for screen readers. |
|
|
||||||
|
|
||||||
### Variables and Palettes
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `colorLightName` | List | Standard | Light theme palette: **Standard** (built-in) or **Custom** (loads `light.custom.css`). |
|
|
||||||
| `colorDarkName` | List | Standard | Dark theme palette: **Standard** (built-in) or **Custom** (loads `dark.custom.css`). |
|
|
||||||
|
|
||||||
See [Custom Themes](Custom-Themes) for how to create custom palettes.
|
|
||||||
|
|
||||||
### Typography
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `useFontScheme` | Grouped list | Roboto (local) | Font family. Options: **None**, **Roboto** (local), **Noto Sans** (local), **Fira Sans** (local). All local fonts are self-hosted for GDPR compliance. |
|
|
||||||
|
|
||||||
### Branding and Icons
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `brand` | Toggle | On | Show the brand/logo area in the header. |
|
|
||||||
| `logoFile` | Media picker | _(none)_ | Logo image file. Shown when brand is enabled. |
|
|
||||||
| `siteTitle` | Text | MokoOnyx | Site title displayed next to the logo. |
|
|
||||||
| `siteDescription` | Text | _(empty)_ | Tagline displayed below the site title. |
|
|
||||||
| `fA6KitCode` | Text | _(empty)_ | Font Awesome 7 Pro Kit code. If empty, the bundled Font Awesome 7 Free is used (2,000+ icons). |
|
|
||||||
|
|
||||||
### Header and Navigation
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `stickyHeader` | Toggle | Off | Make the header stick to the top of the viewport on scroll. |
|
|
||||||
| `backTop` | Toggle | Off | Show a "Back to Top" button when the user scrolls down. |
|
|
||||||
|
|
||||||
### Accessibility
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `a11y_toolbar_enabled` | Toggle | On | Master switch for the accessibility toolbar. |
|
|
||||||
| `a11y_text_resize` | Toggle | On | Allow users to increase/decrease text size. |
|
|
||||||
| `a11y_color_inversion` | Toggle | On | Allow users to invert page colors. |
|
|
||||||
| `a11y_high_contrast` | Toggle | On | Allow users to enable high-contrast mode. |
|
|
||||||
| `a11y_highlight_links` | Toggle | On | Allow users to highlight all links on the page. |
|
|
||||||
| `a11y_readable_font` | Toggle | On | Allow users to switch to a more readable font. |
|
|
||||||
| `a11y_pause_animations` | Toggle | On | Allow users to pause CSS animations. |
|
|
||||||
| `a11y_toolbar_pos` | Hidden | Bottom-right | Toolbar position (fixed to bottom-right in code). |
|
|
||||||
|
|
||||||
### Theme Toggle UI
|
|
||||||
|
|
||||||
| Parameter | Type | Default | Description |
|
|
||||||
|-----------|------|---------|-------------|
|
|
||||||
| `theme_fab_enabled` | Toggle | On | Show the floating action button (FAB) for theme switching. |
|
|
||||||
| `theme_fab_pos` | Hidden | Bottom-right | FAB position (fixed to bottom-right in code). |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## CSS Variables Tab
|
|
||||||
|
|
||||||
A read-only reference tab displaying all available CSS custom properties organized by category. See the [CSS Variables](CSS-Variables) page for the full reference.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
@@ -1,234 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# CSS Variables Reference
|
|
||||||
|
|
||||||
All CSS variables are defined in the theme palette files (`light.standard.css` / `dark.standard.css`) under `:root[data-bs-theme="light"]` or `:root[data-bs-theme="dark"]`. Override any of these in your [custom theme](Custom-Themes) files.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Brand and Theme Colors
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--color-primary` | `#112855` | `#112855` | Primary brand colour |
|
|
||||||
| `--accent-color-primary` | `#3f8ff0` | `#3f8ff0` | Primary accent colour |
|
|
||||||
| `--accent-color-secondary` | `#6fb3ff` | `#6fb3ff` | Secondary accent colour |
|
|
||||||
|
|
||||||
## Typography and Body
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--body-font-family` | System sans-serif stack | System sans-serif stack | Base font family |
|
|
||||||
| `--body-font-size` | `1rem` | `1rem` | Base font size |
|
|
||||||
| `--body-font-weight` | `400` | `400` | Base font weight |
|
|
||||||
| `--body-line-height` | `1.5` | `1.5` | Base line height |
|
|
||||||
| `--body-color` | `#22262a` | `#e6ebf1` | Body text colour |
|
|
||||||
| `--body-bg` | `#fff` | `#0e1318` | Body background colour |
|
|
||||||
| `--heading-color` | `inherit` | `#f1f5f9` | Heading text colour |
|
|
||||||
| `--emphasis-color` | `#000` | `#fff` | Emphasis text colour |
|
|
||||||
| `--secondary-color` | `#22262abf` | `#e6ebf1bf` | Secondary text colour |
|
|
||||||
| `--tertiary-color` | `#22262a80` | `#e6ebf180` | Tertiary text colour |
|
|
||||||
| `--muted-color` | `#6d757e` | `#6d757e` | Muted text colour |
|
|
||||||
| `--highlight-color` | `#22262a` | `#111` | Highlight text colour |
|
|
||||||
| `--highlight-bg` | `#fbeea8` | `#ffe28a1a` | Highlight background |
|
|
||||||
|
|
||||||
## Standard Colors
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default |
|
|
||||||
|----------|--------------|-------------|
|
|
||||||
| `--blue` | `#010156` | `#91a4ff` |
|
|
||||||
| `--indigo` | `#6812f3` | `#b19cff` |
|
|
||||||
| `--purple` | `#6f42c2` | `#c0a5ff` |
|
|
||||||
| `--pink` | `#e93f8e` | `#ff8fc0` |
|
|
||||||
| `--red` | `#a51f18` | `#ff7a73` |
|
|
||||||
| `--orange` | `#fd7e17` | `#ff9c4d` |
|
|
||||||
| `--yellow` | `#ad6200` | `#ffd166` |
|
|
||||||
| `--green` | `#448344` | `#78d694` |
|
|
||||||
| `--teal` | `#5abfdd` | `#76e3ff` |
|
|
||||||
| `--cyan` | `#30638d` | `#6fb7ff` |
|
|
||||||
|
|
||||||
## Gray Scale
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default |
|
|
||||||
|----------|--------------|-------------|
|
|
||||||
| `--gray-100` | `#f9fafb` | `#161a20` |
|
|
||||||
| `--gray-200` | `#eaedf0` | `#1b2027` |
|
|
||||||
| `--gray-300` | `#dfe3e7` | `#222831` |
|
|
||||||
| `--gray-400` | `#ced4da` | `#2b323b` |
|
|
||||||
| `--gray-500` | `#adb5bd` | `#36404a` |
|
|
||||||
| `--gray-600` | `#6d757e` | `#48525d` |
|
|
||||||
| `--gray-700` | `#484f56` | `#5b6672` |
|
|
||||||
| `--gray-800` | `#353b41` | `#cfd6de` |
|
|
||||||
| `--gray-900` | `#22262a` | `#e6ebf1` |
|
|
||||||
|
|
||||||
## Links
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--color-link` | `#224FAA` | `white` | Navigation link colour |
|
|
||||||
| `--color-hover` | `var(--accent-color-primary)` | `gray` | Navigation hover colour |
|
|
||||||
| `--link-color` | `#224faa` | `#8ab4f8` | Content link colour |
|
|
||||||
| `--link-hover-color` | `#424077` | `#c3d6ff` | Content link hover colour |
|
|
||||||
| `--link-decoration` | `underline` | `underline` | Link text decoration |
|
|
||||||
|
|
||||||
## Navigation
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--mainmenu-nav-link-color` | `white` | `#fff` | Main menu active link colour |
|
|
||||||
| `--nav-text-color` | `white` | `gray` | Navigation text colour |
|
|
||||||
| `--nav-bg-color` | `var(--color-link)` | `var(--color-primary)` | Navigation background colour |
|
|
||||||
|
|
||||||
## Layout and Spacing
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--padding-x` | `0.15rem` | `0.15rem` | Horizontal padding |
|
|
||||||
| `--padding-y` | `0.15rem` | `0.15rem` | Vertical padding |
|
|
||||||
| `--secondary-bg` | `#eaedf0` | `#151b22` | Secondary background |
|
|
||||||
| `--tertiary-bg` | `#f9fafb` | `#10151b` | Tertiary background |
|
|
||||||
| `--nav-toggle-size` | `3rem` | `3rem` | Mobile nav toggle size |
|
|
||||||
|
|
||||||
## Breakpoints
|
|
||||||
|
|
||||||
| Variable | Value | Description |
|
|
||||||
|----------|-------|-------------|
|
|
||||||
| `--bp-xs` | `0` | Extra small |
|
|
||||||
| `--bp-sm` | `576px` | Small |
|
|
||||||
| `--bp-md` | `768px` | Medium |
|
|
||||||
| `--bp-lg` | `992px` | Large |
|
|
||||||
| `--bp-xl` | `1200px` | Extra large |
|
|
||||||
|
|
||||||
## Borders
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default |
|
|
||||||
|----------|--------------|-------------|
|
|
||||||
| `--border-width` | `1px` | `1px` |
|
|
||||||
| `--border-style` | `solid` | `solid` |
|
|
||||||
| `--border-color` | `#dfe3e7` | `#2b323b` |
|
|
||||||
| `--border-radius` | `.25rem` | `.25rem` |
|
|
||||||
| `--border-radius-sm` | `.2rem` | `.2rem` |
|
|
||||||
| `--border-radius-lg` | `.3rem` | `.3rem` |
|
|
||||||
| `--border-radius-pill` | `50rem` | `50rem` |
|
|
||||||
|
|
||||||
## Shadows
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default |
|
|
||||||
|----------|--------------|-------------|
|
|
||||||
| `--box-shadow` | `0 .5rem 1rem #00000026` | `0 .5rem 1rem #00000066` |
|
|
||||||
| `--box-shadow-sm` | `0 .125rem .25rem #00000013` | `0 .125rem .25rem #00000040` |
|
|
||||||
| `--box-shadow-lg` | `0 1rem 3rem #0000002d` | `0 1rem 3rem #00000080` |
|
|
||||||
|
|
||||||
## Header Background
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--header-background-color` | `#adadad` | `#1a1f2b` | Header fallback colour |
|
|
||||||
| `--header-background-image` | `url(.../bg.svg)` | `url(.../bg.svg)` | Header background image |
|
|
||||||
| `--header-background-attachment` | `fixed` | `fixed` | CSS attachment |
|
|
||||||
| `--header-background-repeat` | `repeat` | `repeat` | CSS repeat |
|
|
||||||
|
|
||||||
## Container Backgrounds
|
|
||||||
|
|
||||||
Each container position (below-topbar, top-a, top-b, sidebar, bottom-a, bottom-b) has these variables:
|
|
||||||
|
|
||||||
| Variable Pattern | Description |
|
|
||||||
|-----------------|-------------|
|
|
||||||
| `--container-{position}-bg-image` | Background image (default: `none`) |
|
|
||||||
| `--container-{position}-bg-color` | Background colour (default: `transparent`) |
|
|
||||||
| `--container-{position}-bg-position` | Background position |
|
|
||||||
| `--container-{position}-bg-attachment` | Background attachment |
|
|
||||||
| `--container-{position}-bg-repeat` | Background repeat |
|
|
||||||
| `--container-{position}-bg-size` | Background size |
|
|
||||||
| `--container-{position}-border` | Border style |
|
|
||||||
| `--container-{position}-border-radius` | Border radius |
|
|
||||||
|
|
||||||
## Forms
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default |
|
|
||||||
|----------|--------------|-------------|
|
|
||||||
| `--input-color` | `hsl(210, 11%, 15%)` | `#e6ebf1` |
|
|
||||||
| `--input-bg` | `hsl(210, 20%, 98%)` | `#1a2332` |
|
|
||||||
| `--input-border-color` | `hsl(210, 14%, 83%)` | `#3a4250` |
|
|
||||||
| `--input-focus-border-color` | `#8894aa` | `#5472ff` |
|
|
||||||
| `--form-valid-color` | `#448344` | `#78d694` |
|
|
||||||
| `--form-invalid-color` | `#a51f18` | `#ff8e86` |
|
|
||||||
|
|
||||||
## Bootstrap Palette
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default |
|
|
||||||
|----------|--------------|-------------|
|
|
||||||
| `--primary` | `#010156` | `#010156` |
|
|
||||||
| `--secondary` | `#6d757e` | `#48525d` |
|
|
||||||
| `--success` | `#448344` | `#4aa664` |
|
|
||||||
| `--info` | `#30638d` | `#4f7aa0` |
|
|
||||||
| `--warning` | `#ad6200` | `#c77a00` |
|
|
||||||
| `--danger` | `#a51f18` | `#c23a31` |
|
|
||||||
| `--light` | `#f9fafb` | `#1b2027` |
|
|
||||||
| `--dark` | `#353b41` | `#0f1318` |
|
|
||||||
|
|
||||||
Each palette colour also has `-rgb`, `-text-emphasis`, `-bg-subtle`, and `-border-subtle` variants.
|
|
||||||
|
|
||||||
## Hero / Banner
|
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|----------|-------------|
|
|
||||||
| `--hero-height` | Banner height (default: `60vh`) |
|
|
||||||
| `--hero-color` | Banner text colour |
|
|
||||||
| `--hero-bg-repeat` | Background repeat |
|
|
||||||
| `--hero-bg-attachment` | Background attachment |
|
|
||||||
| `--hero-bg-position` | Background position |
|
|
||||||
| `--hero-bg-size` | Background size |
|
|
||||||
| `--hero-overlay-bg` | Overlay background colour |
|
|
||||||
| `--hero-primary-bg-color` | Primary variant background |
|
|
||||||
| `--hero-primary-overlay` | Primary variant overlay gradient |
|
|
||||||
| `--hero-secondary-bg-color` | Secondary variant background |
|
|
||||||
| `--hero-secondary-overlay` | Secondary variant overlay gradient |
|
|
||||||
| `--hero-card-*` | Hero card styling (bg, color, overlay, border-radius, padding, max-width) |
|
|
||||||
| `--hero-alt-card-*` | Alternative hero card styling |
|
|
||||||
|
|
||||||
## Block Colors
|
|
||||||
|
|
||||||
Used for top-a, top-b, bottom-a, bottom-b section backgrounds:
|
|
||||||
|
|
||||||
| Variable | Description |
|
|
||||||
|----------|-------------|
|
|
||||||
| `--block-color-1` through `--block-color-4` | Background colours |
|
|
||||||
| `--block-text-1` through `--block-text-4` | Text colours |
|
|
||||||
| `--block-highlight-bg` / `--block-highlight-text` | Highlight block |
|
|
||||||
| `--block-cta-bg` / `--block-cta-text` | Call-to-action block |
|
|
||||||
| `--block-alert-bg` / `--block-alert-text` | Alert block |
|
|
||||||
|
|
||||||
## Footer
|
|
||||||
|
|
||||||
| Variable | Default | Description |
|
|
||||||
|----------|---------|-------------|
|
|
||||||
| `--footer-padding-top` | `1rem` | Top padding |
|
|
||||||
| `--footer-padding-bottom` | `80px` | Bottom padding (accounts for FAB) |
|
|
||||||
| `--footer-grid-padding-y` | `2.5rem` | Grid vertical padding |
|
|
||||||
| `--footer-grid-padding-x` | `0.5em` | Grid horizontal padding |
|
|
||||||
|
|
||||||
## Theme FAB
|
|
||||||
|
|
||||||
| Variable | Light Default | Dark Default | Description |
|
|
||||||
|----------|--------------|-------------|-------------|
|
|
||||||
| `--theme-fab-bg` | `var(--color-primary)` | `#e6ebf1` | FAB background |
|
|
||||||
| `--theme-fab-color` | `#fff` | `#0e1318` | FAB icon colour |
|
|
||||||
| `--theme-fab-btn-bg` | `rgba(255,255,255,.15)` | `transparent` | FAB button background |
|
|
||||||
| `--theme-fab-border` | `rgba(255,255,255,0.3)` | `rgba(0,0,0,0.15)` | FAB border colour |
|
|
||||||
|
|
||||||
## Component-Specific Variables
|
|
||||||
|
|
||||||
Additional variables are defined for: VirtueMart (`--vm-*`), Gable (`--gab-*`), accordion, alert, badge, breadcrumb, cards, dropdown, list group, modal, nav tabs/pills, offcanvas, pagination, popover, progress, spinner, table, toast, and tooltip components. See the theme palette files for the complete list.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Custom Themes
|
|
||||||
|
|
||||||
MokoOnyx ships with **standard** light and dark palettes. You can create fully custom colour palettes by overriding CSS variables in dedicated files.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## How It Works
|
|
||||||
|
|
||||||
1. MokoOnyx loads a theme CSS file based on the `colorLightName` and `colorDarkName` template parameters
|
|
||||||
2. When set to **Standard**, it loads `light.standard.css` or `dark.standard.css`
|
|
||||||
3. When set to **Custom**, it loads `light.custom.css` or `dark.custom.css`
|
|
||||||
4. The theme file sets all CSS variables inside `:root[data-bs-theme="light"]` or `:root[data-bs-theme="dark"]`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Creating a Custom Palette
|
|
||||||
|
|
||||||
### Step 1: Copy the Template
|
|
||||||
|
|
||||||
MokoOnyx ships starter templates in the `templates/` directory within the template source:
|
|
||||||
|
|
||||||
```
|
|
||||||
templates/mokoonyx/templates/light.custom.css
|
|
||||||
templates/mokoonyx/templates/dark.custom.css
|
|
||||||
```
|
|
||||||
|
|
||||||
These are full copies of the standard palettes -- every variable is included so you have a complete starting point.
|
|
||||||
|
|
||||||
### Step 2: Place Files in the Media Directory
|
|
||||||
|
|
||||||
Copy your customized files to the **media** directory (this location survives template updates):
|
|
||||||
|
|
||||||
```
|
|
||||||
media/templates/site/mokoonyx/css/theme/light.custom.css
|
|
||||||
media/templates/site/mokoonyx/css/theme/dark.custom.css
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 3: Select "Custom" in Template Settings
|
|
||||||
|
|
||||||
1. Go to **System → Site Templates → MokoOnyx**
|
|
||||||
2. Open the **Theme** tab
|
|
||||||
3. Under **Variables & Palettes**:
|
|
||||||
- Set **Light Theme** to **Custom**
|
|
||||||
- Set **Dark Theme** to **Custom**
|
|
||||||
4. Save
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## File Locations
|
|
||||||
|
|
||||||
| File | Path | Purpose |
|
|
||||||
|------|------|---------|
|
|
||||||
| Light standard | `media/templates/site/mokoonyx/css/theme/light.standard.css` | Built-in light palette (do not edit) |
|
|
||||||
| Dark standard | `media/templates/site/mokoonyx/css/theme/dark.standard.css` | Built-in dark palette (do not edit) |
|
|
||||||
| Light custom | `media/templates/site/mokoonyx/css/theme/light.custom.css` | Your custom light palette |
|
|
||||||
| Dark custom | `media/templates/site/mokoonyx/css/theme/dark.custom.css` | Your custom dark palette |
|
|
||||||
| Light template | `templates/mokoonyx/templates/light.custom.css` | Starter template (copy from here) |
|
|
||||||
| Dark template | `templates/mokoonyx/templates/dark.custom.css` | Starter template (copy from here) |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Key Variables to Customize
|
|
||||||
|
|
||||||
The most impactful variables to change for a quick rebrand:
|
|
||||||
|
|
||||||
```css
|
|
||||||
:root[data-bs-theme="light"] {
|
|
||||||
/* Brand colours -- the foundation of the entire palette */
|
|
||||||
--color-primary: #112855;
|
|
||||||
--accent-color-primary: #3f8ff0;
|
|
||||||
--accent-color-secondary: #6fb3ff;
|
|
||||||
|
|
||||||
/* Body */
|
|
||||||
--body-color: #22262a;
|
|
||||||
--body-bg: #fff;
|
|
||||||
|
|
||||||
/* Links */
|
|
||||||
--color-link: #224FAA;
|
|
||||||
--link-color: #224faa;
|
|
||||||
--link-hover-color: #424077;
|
|
||||||
|
|
||||||
/* Navigation */
|
|
||||||
--mainmenu-nav-link-color: white;
|
|
||||||
--nav-text-color: white;
|
|
||||||
--nav-bg-color: var(--color-link);
|
|
||||||
|
|
||||||
/* Header */
|
|
||||||
--header-background-color: #adadad;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
See the [CSS Variables](CSS-Variables) page for a complete reference of all available variables.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Variable Sync on Update
|
|
||||||
|
|
||||||
When MokoOnyx is updated, the installer runs a **CSS variable sync** process. If new variables have been added to the standard palettes, they are automatically appended to your custom palette files with their default values. A notice is displayed in the admin panel telling you how many variables were added.
|
|
||||||
|
|
||||||
This ensures your custom palettes stay compatible with new template features without breaking existing customizations.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Custom CSS and JavaScript
|
|
||||||
|
|
||||||
For additional overrides beyond theme variables, use these files (also update-safe):
|
|
||||||
|
|
||||||
| File | Path |
|
|
||||||
|------|------|
|
|
||||||
| Custom CSS | `media/templates/site/mokoonyx/css/user.css` |
|
|
||||||
| Custom JS | `media/templates/site/mokoonyx/js/user.js` |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
@@ -1,289 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Development
|
|
||||||
|
|
||||||
This page covers the repository structure, build process, release workflow, and contributing guidelines for MokoOnyx.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Repository Structure
|
|
||||||
|
|
||||||
```
|
|
||||||
MokoOnyx/
|
|
||||||
├── src/ # Template source (this becomes the installable package)
|
|
||||||
│ ├── component.php # Component-only page layout
|
|
||||||
│ ├── error.php # Error page layout
|
|
||||||
│ ├── index.php # Main template entry point
|
|
||||||
│ ├── joomla.asset.json # Joomla Web Asset Manager definitions
|
|
||||||
│ ├── offline.php # Offline page layout
|
|
||||||
│ ├── script.php # Install/update/uninstall script
|
|
||||||
│ ├── sync_custom_vars.php # CSS variable sync for custom palettes
|
|
||||||
│ ├── templateDetails.xml # Joomla template manifest
|
|
||||||
│ ├── helper/ # PHP helper classes
|
|
||||||
│ │ └── minify.php # CSS/JS auto-minification
|
|
||||||
│ ├── html/ # Template overrides (modules, components, layouts)
|
|
||||||
│ ├── language/ # Language files (en-GB, en-US)
|
|
||||||
│ ├── media/ # Static assets (installed to media/templates/site/mokoonyx/)
|
|
||||||
│ │ ├── css/ # Stylesheets
|
|
||||||
│ │ │ ├── template.css # Main template stylesheet
|
|
||||||
│ │ │ ├── editor.css # Backend editor stylesheet
|
|
||||||
│ │ │ ├── offline.css # Offline page styles
|
|
||||||
│ │ │ ├── a11y-high-contrast.css # High-contrast accessibility mode
|
|
||||||
│ │ │ ├── user.css # User custom CSS (survives updates)
|
|
||||||
│ │ │ ├── fonts/ # Local font files (Roboto, Noto Sans, Fira Sans)
|
|
||||||
│ │ │ └── theme/ # Theme palette files
|
|
||||||
│ │ │ ├── light.standard.css
|
|
||||||
│ │ │ └── dark.standard.css
|
|
||||||
│ │ ├── js/ # JavaScript
|
|
||||||
│ │ │ ├── template.js # Main template JS
|
|
||||||
│ │ │ ├── gtm.js # Google Tag Manager integration
|
|
||||||
│ │ │ └── user.js # User custom JS (survives updates)
|
|
||||||
│ │ ├── images/ # Template images (bg.svg, etc.)
|
|
||||||
│ │ ├── fonts/ # Font files
|
|
||||||
│ │ └── vendor/ # Third-party assets (Font Awesome 7 Free)
|
|
||||||
│ └── templates/ # Starter files for users
|
|
||||||
│ ├── light.custom.css # Custom light palette template
|
|
||||||
│ ├── dark.custom.css # Custom dark palette template
|
|
||||||
│ └── brand-showcase.html # Brand showcase HTML template
|
|
||||||
├── Makefile # Build and validation automation
|
|
||||||
├── composer.json # PHP dependencies (moko-platform)
|
|
||||||
├── package.json # Node.js dependencies (minification)
|
|
||||||
├── phpcs.xml # PHP CodeSniffer configuration
|
|
||||||
├── phpstan.neon # PHPStan static analysis configuration
|
|
||||||
├── codeception.yml # Testing configuration
|
|
||||||
├── updates.xml # Joomla update server manifest
|
|
||||||
├── tests/ # Test suites
|
|
||||||
├── scripts/ # Build scripts
|
|
||||||
├── docs/ # Documentation source
|
|
||||||
└── build/ / dist/ # Build output (gitignored)
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
- **PHP** 8.1+
|
|
||||||
- **Composer** (for moko-platform CLI and dependencies)
|
|
||||||
- **Node.js** (optional, for build-time minification with terser/clean-css)
|
|
||||||
- **Make** (GNU Make or compatible)
|
|
||||||
- **zip** (or PowerShell for Windows)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Clone the repository
|
|
||||||
git clone https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx.git
|
|
||||||
cd MokoOnyx
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
make install-deps
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Building Packages
|
|
||||||
|
|
||||||
### Build an installable ZIP
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make build
|
|
||||||
```
|
|
||||||
|
|
||||||
This will:
|
|
||||||
|
|
||||||
1. Clean previous build artifacts (`build/` and `dist/`)
|
|
||||||
2. Minify CSS and JS assets
|
|
||||||
3. Copy `src/` contents to `build/package/`
|
|
||||||
4. Create `dist/mokoonyx-{version}.zip`
|
|
||||||
|
|
||||||
### Build a beta release
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make build-beta
|
|
||||||
```
|
|
||||||
|
|
||||||
Creates `dist/mokoonyx-{version}-beta.zip` (skips minification).
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Validation
|
|
||||||
|
|
||||||
MokoOnyx uses the **moko-platform CLI** for code quality checks.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run all validation checks
|
|
||||||
make validate
|
|
||||||
|
|
||||||
# Individual checks
|
|
||||||
make lint # PHP syntax check
|
|
||||||
make check-joomla # Joomla manifest validation
|
|
||||||
make check-version # Version consistency across files
|
|
||||||
make check-xml # XML well-formedness
|
|
||||||
make check-headers # License header verification
|
|
||||||
make check-secrets # Credential leak scanning
|
|
||||||
|
|
||||||
# Full repository health check
|
|
||||||
make health
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Releasing
|
|
||||||
|
|
||||||
### Full release pipeline
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make release
|
|
||||||
```
|
|
||||||
|
|
||||||
This runs the complete pipeline: `validate` → `build` → `checksum`
|
|
||||||
|
|
||||||
After the release package is built:
|
|
||||||
|
|
||||||
1. Tag the release: `git tag {version}`
|
|
||||||
2. Push tags: `git push origin --tags`
|
|
||||||
3. Create a Gitea release and attach the ZIP from `dist/`
|
|
||||||
|
|
||||||
### Generate checksums
|
|
||||||
|
|
||||||
```bash
|
|
||||||
make checksum
|
|
||||||
```
|
|
||||||
|
|
||||||
Creates SHA-256 checksums for all ZIP files in `dist/`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Available Make Targets
|
|
||||||
|
|
||||||
| Target | Description |
|
|
||||||
|--------|-------------|
|
|
||||||
| `make help` | Show all available targets |
|
|
||||||
| `make install-deps` | Install Composer dependencies |
|
|
||||||
| `make update-deps` | Update Composer dependencies |
|
|
||||||
| `make lint` | PHP syntax check |
|
|
||||||
| `make check-joomla` | Validate Joomla manifest |
|
|
||||||
| `make check-version` | Verify version consistency |
|
|
||||||
| `make check-headers` | Check license headers |
|
|
||||||
| `make check-secrets` | Scan for leaked credentials |
|
|
||||||
| `make check-xml` | Validate XML files |
|
|
||||||
| `make validate` | Run all validation checks |
|
|
||||||
| `make health` | Full repository health check |
|
|
||||||
| `make clean` | Clean build artifacts |
|
|
||||||
| `make minify` | Minify CSS/JS assets |
|
|
||||||
| `make build` | Build installable ZIP |
|
|
||||||
| `make build-beta` | Build beta release ZIP |
|
|
||||||
| `make checksum` | Generate SHA-256 checksums |
|
|
||||||
| `make release` | Full release pipeline |
|
|
||||||
| `make version` | Display version and extension info |
|
|
||||||
| `make security-check` | Composer security audit |
|
|
||||||
| `make all` | Full pipeline (deps, validate, build, checksum) |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
1. Fork the repository on [Gitea](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx)
|
|
||||||
2. Create a feature branch from `dev`
|
|
||||||
3. Make your changes in `src/`
|
|
||||||
4. Run `make validate` to ensure all checks pass
|
|
||||||
5. Submit a pull request against `dev`
|
|
||||||
|
|
||||||
### Code Standards
|
|
||||||
|
|
||||||
- All PHP files must include the GPL-3.0-or-later license header
|
|
||||||
- PHP code must pass syntax checks and PHPStan analysis
|
|
||||||
- XML files must be well-formed
|
|
||||||
- Version numbers must be consistent across `README.md`, `templateDetails.xml`, and other version-bearing files
|
|
||||||
- Attribution goes to **Moko Consulting**, not individual contributors
|
|
||||||
|
|
||||||
### Branching Model
|
|
||||||
|
|
||||||
| Branch | Purpose | Stability Suffix |
|
|
||||||
|--------|---------|-----------------|
|
|
||||||
| `main` | Stable releases | (none) |
|
|
||||||
| `dev` | Active development | `-dev` |
|
|
||||||
| `alpha` | Alpha pre-releases | `-alpha` |
|
|
||||||
| `beta` | Beta pre-releases | `-beta` |
|
|
||||||
| `rc` | Release candidates | `-rc` |
|
|
||||||
| `feature/*` | Feature development | `-dev` |
|
|
||||||
| `version/XX.YY.ZZ` | Archived release snapshots | (none) |
|
|
||||||
|
|
||||||
### Version Numbering
|
|
||||||
|
|
||||||
Versions use the format `XX.YY.ZZ` (two-digit segments, zero-padded):
|
|
||||||
|
|
||||||
- **XX** -- Major version (breaking changes)
|
|
||||||
- **YY** -- Minor version (new features, bumped on release to main)
|
|
||||||
- **ZZ** -- Patch version (auto-incremented on every push to dev/feature branches)
|
|
||||||
|
|
||||||
Stability suffixes are appended during development:
|
|
||||||
|
|
||||||
- `02.09.00-dev` -- Development build
|
|
||||||
- `02.09.00-alpha` -- Alpha pre-release
|
|
||||||
- `02.09.00-beta` -- Beta pre-release
|
|
||||||
- `02.09.00-rc` -- Release candidate
|
|
||||||
|
|
||||||
On merge to `main`, suffixes are stripped and the minor version is bumped.
|
|
||||||
|
|
||||||
### Auto Version Bump
|
|
||||||
|
|
||||||
On every push to `dev`, `alpha`, `beta`, `rc`, or `feature/*`:
|
|
||||||
|
|
||||||
1. The patch version is incremented (e.g., `02.08.05` -> `02.08.06`)
|
|
||||||
2. The stability suffix is applied based on the branch name
|
|
||||||
3. All version-bearing files are updated (manifests, CHANGELOG, PHP headers, etc.)
|
|
||||||
4. A commit is created with `[skip ci]` to avoid infinite loops
|
|
||||||
|
|
||||||
Commits with `[skip ci]` or `[skip bump]` in the message are ignored.
|
|
||||||
|
|
||||||
### Auto Release
|
|
||||||
|
|
||||||
When a PR is merged from `dev` to `main`:
|
|
||||||
|
|
||||||
1. The minor version is bumped (e.g., `02.08.xx` -> `02.09.00`)
|
|
||||||
2. Stability suffixes are stripped (stable release)
|
|
||||||
3. A Gitea release is created with the build package (ZIP + tar.gz + SHA-256)
|
|
||||||
4. `updates.xml` is updated for the Joomla update server
|
|
||||||
5. The `dev` branch is recreated from `main`
|
|
||||||
6. A `version/XX.YY.ZZ` archive branch is created
|
|
||||||
|
|
||||||
### Release Channels
|
|
||||||
|
|
||||||
The `updates.xml` file provides update streams for Joomla sites:
|
|
||||||
|
|
||||||
| Channel | Tag | Description |
|
|
||||||
|---------|-----|-------------|
|
|
||||||
| Development | `dev` | Latest dev build (or stable if higher) |
|
|
||||||
| Alpha | `alpha` | Alpha pre-release |
|
|
||||||
| Beta | `beta` | Beta pre-release |
|
|
||||||
| Release Candidate | `rc` | RC pre-release |
|
|
||||||
| Stable | `stable` | Production-ready release |
|
|
||||||
|
|
||||||
Joomla sites check the channel matching their configured stability level.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Testing
|
|
||||||
|
|
||||||
The repository includes a `codeception.yml` configuration for automated testing:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Run tests (requires Codeception via Composer)
|
|
||||||
vendor/bin/codecept run
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
## Governance Overview
|
|
||||||
|
|
||||||
This document defines the governance framework for the MokoOnyx project. The objective is to ensure clear ownership, predictable decision making, and accountable stewardship across development, releases, and community interaction.
|
|
||||||
|
|
||||||
## Project Ownership
|
|
||||||
|
|
||||||
MokoOnyx is owned and maintained by **Moko Consulting**. Final authority for project direction, releases, and policy enforcement resides with the project owner.
|
|
||||||
|
|
||||||
## Roles and Responsibilities
|
|
||||||
|
|
||||||
### Maintainers
|
|
||||||
|
|
||||||
Maintainers are responsible for:
|
|
||||||
|
|
||||||
* Setting technical direction and release priorities.
|
|
||||||
* Reviewing and approving pull requests.
|
|
||||||
* Managing releases and distribution artifacts.
|
|
||||||
* Enforcing repository policies, including security and conduct requirements.
|
|
||||||
|
|
||||||
### Contributors
|
|
||||||
|
|
||||||
Contributors may:
|
|
||||||
|
|
||||||
* Submit pull requests and issues.
|
|
||||||
* Propose enhancements and report defects.
|
|
||||||
* Participate in technical discussions.
|
|
||||||
|
|
||||||
Contributors do not have merge authority unless explicitly granted.
|
|
||||||
|
|
||||||
## Decision Making
|
|
||||||
|
|
||||||
Decisions are made using a maintainers led model:
|
|
||||||
|
|
||||||
* Routine changes are approved through pull request review.
|
|
||||||
* Material changes affecting architecture, branding, licensing, or release processes require maintainer consensus.
|
|
||||||
* The project owner retains final decision authority if consensus cannot be reached.
|
|
||||||
|
|
||||||
## Change Management
|
|
||||||
|
|
||||||
Significant changes should:
|
|
||||||
|
|
||||||
* Be documented through issues or pull requests with clear rationale.
|
|
||||||
* Consider backward compatibility and upgrade impact.
|
|
||||||
* Include documentation updates when behavior or usage changes.
|
|
||||||
|
|
||||||
## Release Authority
|
|
||||||
|
|
||||||
Only maintainers may:
|
|
||||||
|
|
||||||
* Cut releases and publish artifacts.
|
|
||||||
* Update version numbers and manifests.
|
|
||||||
* Publish update metadata or advisories.
|
|
||||||
|
|
||||||
Release processes follow documented workflows and automation standards.
|
|
||||||
|
|
||||||
## Security Governance
|
|
||||||
|
|
||||||
Security issues are governed by the Security Policy (SECURITY.md in the repository). Maintainers are responsible for confidential handling, coordinated disclosure, and publication of advisories when appropriate.
|
|
||||||
|
|
||||||
## Conduct Enforcement
|
|
||||||
|
|
||||||
Behavior within the project is governed by the [Code of Conduct](Code-of-Conduct). Maintainers are responsible for enforcement actions and escalation handling.
|
|
||||||
|
|
||||||
## Conflict Resolution
|
|
||||||
|
|
||||||
Conflicts are handled through:
|
|
||||||
|
|
||||||
* Direct discussion between involved parties when appropriate.
|
|
||||||
* Maintainer mediation when necessary.
|
|
||||||
* Final determination by the project owner if required.
|
|
||||||
|
|
||||||
## External Dependencies
|
|
||||||
|
|
||||||
The project depends on Joomla core and other third party components. Governance of upstream projects remains outside the scope of this repository, but upstream changes may influence project decisions.
|
|
||||||
|
|
||||||
## Jurisdiction
|
|
||||||
|
|
||||||
This project is managed from Tennessee, USA. This statement is informational and does not constitute legal advice.
|
|
||||||
-110
@@ -1,110 +0,0 @@
|
|||||||
# MokoOnyx
|
|
||||||
|
|
||||||
A modern, lightweight Joomla site template built on Cassiopeia with Font Awesome 7, Bootstrap 5, dark mode, and analytics integrations.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
| | |
|
|
||||||
|---|---|
|
|
||||||
| **Type** | Joomla Site Template |
|
|
||||||
| **Version** | 02.01.06 |
|
|
||||||
| **Joomla** | 5.x / 6.x |
|
|
||||||
| **PHP** | 8.1+ |
|
|
||||||
| **License** | GPL-3.0-or-later |
|
|
||||||
| **Replaces** | MokoCassiopeia (auto-migrates on install) |
|
|
||||||
| **Platform** | [Gitea](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) (primary) |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
MokoOnyx is an enhancement layer built on Joomla's Cassiopeia template. It maintains minimal core overrides for maximum upgrade compatibility while adding modern features and integrations.
|
|
||||||
|
|
||||||
On install, MokoOnyx automatically migrates settings, content references, and custom files from MokoCassiopeia. After installing, MokoCassiopeia can be safely uninstalled.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
| Feature | Description |
|
|
||||||
|---------|-------------|
|
|
||||||
| **Font Awesome 7** | Fully integrated into Joomla's asset manager with 2,000+ icons |
|
|
||||||
| **Bootstrap 5** | Extended utility classes and responsive grid system |
|
|
||||||
| **Dark Mode** | Built-in light/dark toggle with system preference detection |
|
|
||||||
| **Table of Contents** | Automatic TOC generation for long articles |
|
|
||||||
| **GTM / GA4** | Google Tag Manager and Analytics integration with smart visitor detection (login status, user group, page type) |
|
|
||||||
| **Template Overrides** | Overrides for all core Joomla modules, Community Builder, and DPCalendar |
|
|
||||||
| **Cassiopeia Base** | Minimal core overrides for maximum Joomla upgrade compatibility |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
1. Download the latest `mokoonyx-{version}.zip` from [Releases](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases)
|
|
||||||
2. Install via Joomla's Extension Manager (Extensions > Manage > Install)
|
|
||||||
3. Set MokoOnyx as the default site template (System > Site Templates)
|
|
||||||
4. If migrating from MokoCassiopeia, settings are auto-migrated on install
|
|
||||||
|
|
||||||
### Requirements
|
|
||||||
|
|
||||||
- Joomla 5.x or 6.x
|
|
||||||
- PHP 8.1 or higher
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Directory Structure
|
|
||||||
|
|
||||||
| Directory | Purpose |
|
|
||||||
|-----------|---------|
|
|
||||||
| `html/` | Template overrides for core modules and extensions |
|
|
||||||
| `css/` | Compiled stylesheets including dark mode |
|
|
||||||
| `js/` | JavaScript for TOC, dark mode toggle, analytics |
|
|
||||||
| `images/` | Template images and icons |
|
|
||||||
| `language/` | Language files |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
MokoOnyx template parameters are configured in the Joomla admin under System > Site Templates > MokoOnyx.
|
|
||||||
|
|
||||||
Key parameters include:
|
|
||||||
- **Dark Mode**: Enable/disable, set default mode
|
|
||||||
- **Font Awesome**: Enable/disable icon library loading
|
|
||||||
- **Google Tag Manager**: GTM container ID
|
|
||||||
- **GA4**: Measurement ID and tracking options
|
|
||||||
- **Table of Contents**: Auto-generate TOC for articles with heading threshold
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Related Wikis
|
|
||||||
|
|
||||||
| Repo | Purpose |
|
|
||||||
|------|---------|
|
|
||||||
| [Template-Client-WaaS](https://git.mokoconsulting.tech/MokoConsulting/Template-Client-WaaS/wiki) | Client site template (extends MokoOnyx) |
|
|
||||||
| [MokoWaaS](https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/wiki) | WaaS system plugin |
|
|
||||||
| [joomla-api-mcp](https://git.mokoconsulting.tech/MokoConsulting/joomla-api-mcp/wiki) | Joomla Web Services API MCP |
|
|
||||||
| [deploy-mcp](https://git.mokoconsulting.tech/MokoConsulting/deploy-mcp/wiki) | Git-based deployment MCP |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
> **[moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki)** -- central standards hub for all Moko Consulting projects.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## End-User Documentation
|
|
||||||
|
|
||||||
> **This wiki is for developers and contributors.** For end-user guides (installation, configuration, usage), see the Knowledge Base on our website:
|
|
||||||
>
|
|
||||||
> **[MokoOnyx Template Support Articles](https://mokoconsulting.tech/knowledge-base/mokoonyx-template)**
|
|
||||||
>
|
|
||||||
> The website documentation covers step-by-step instructions for non-technical users.
|
|
||||||
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Installation
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
| Requirement | Minimum Version |
|
|
||||||
|-------------|----------------|
|
|
||||||
| Joomla | 5.x or 6.x |
|
|
||||||
| PHP | 8.1 or higher |
|
|
||||||
|
|
||||||
## Download
|
|
||||||
|
|
||||||
Download the latest `mokoonyx-{version}.zip` from the [Releases page](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases/tag/stable).
|
|
||||||
|
|
||||||
## Install via Joomla Admin
|
|
||||||
|
|
||||||
1. Log in to your Joomla administrator panel
|
|
||||||
2. Navigate to **System → Install → Extensions**
|
|
||||||
3. Upload the `mokoonyx-{version}.zip` file
|
|
||||||
4. Wait for the installer to complete
|
|
||||||
|
|
||||||
The installer performs a preflight check to verify your PHP and Joomla versions meet the minimum requirements. If they do not, installation will be blocked with an error message.
|
|
||||||
|
|
||||||
## Set as Default Template
|
|
||||||
|
|
||||||
1. Navigate to **System → Site Templates**
|
|
||||||
2. Click the star icon next to **MokoOnyx** to set it as the default site template
|
|
||||||
|
|
||||||
## First Page Load (Migration)
|
|
||||||
|
|
||||||
If you are migrating from MokoCassiopeia, the migration runs automatically during install:
|
|
||||||
|
|
||||||
1. **Visit any page on your site** after installation -- the template activates immediately
|
|
||||||
2. Check **administrator/logs/mokoonyx.log.php** to confirm the migration completed
|
|
||||||
3. Once confirmed, uninstall MokoCassiopeia from **Extensions → Manage**
|
|
||||||
|
|
||||||
See the [Migration](Migration) page for full details on what gets migrated.
|
|
||||||
|
|
||||||
## Post-Install Notes
|
|
||||||
|
|
||||||
- The extension is automatically **locked** after install to prevent accidental uninstallation
|
|
||||||
- Stale `.min` files from previous versions are cleaned automatically
|
|
||||||
- Favicon stamps are cleared so favicons regenerate on the next page load
|
|
||||||
- MokoCassiopeia references in article content and modules are automatically updated to MokoOnyx
|
|
||||||
|
|
||||||
## Update Server
|
|
||||||
|
|
||||||
MokoOnyx includes an automatic update server. Joomla will notify you when new versions are available via **System → Update → Extensions**. Two update servers are configured for redundancy:
|
|
||||||
|
|
||||||
| Priority | Server |
|
|
||||||
|----------|--------|
|
|
||||||
| 1 | Gitea (git.mokoconsulting.tech) |
|
|
||||||
| 2 | GitHub (github.com) |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Migration from MokoCassiopeia
|
|
||||||
|
|
||||||
MokoOnyx is the successor to MokoCassiopeia. The migration runs **automatically during install/update** -- no manual steps are required beyond installing MokoOnyx.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## When Does Migration Run?
|
|
||||||
|
|
||||||
The migration runs in the `postflight()` method of the installer script (`script.php`), which executes during both `install` and `update` operations. It checks for existing MokoCassiopeia template styles in the database and only runs if they are found.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## What Gets Migrated
|
|
||||||
|
|
||||||
### 1. Template Styles and Parameters
|
|
||||||
|
|
||||||
- All MokoCassiopeia template styles are detected from the `#__template_styles` table
|
|
||||||
- For each MokoCassiopeia style, a matching MokoOnyx style is created with the same parameters
|
|
||||||
- The first MokoCassiopeia style's parameters are applied to the installer-created default MokoOnyx style
|
|
||||||
- Additional styles are created as new entries
|
|
||||||
- Parameter values are updated to replace `mokocassiopeia` references with `mokoonyx`
|
|
||||||
|
|
||||||
### 2. Default Template Assignment
|
|
||||||
|
|
||||||
If MokoCassiopeia was set as the default site template (`home = 1`), MokoOnyx automatically takes over as the default. The MokoCassiopeia style is unset as default.
|
|
||||||
|
|
||||||
### 3. Custom User Files
|
|
||||||
|
|
||||||
The following files are copied from the MokoCassiopeia media directory to MokoOnyx (only if the destination file does not already exist):
|
|
||||||
|
|
||||||
| File | Purpose |
|
|
||||||
|------|---------|
|
|
||||||
| `css/theme/light.custom.css` | Custom light palette |
|
|
||||||
| `css/theme/dark.custom.css` | Custom dark palette |
|
|
||||||
| `css/theme/light.custom.min.css` | Minified custom light palette |
|
|
||||||
| `css/theme/dark.custom.min.css` | Minified custom dark palette |
|
|
||||||
| `css/user.css` | Custom CSS overrides |
|
|
||||||
| `css/user.min.css` | Minified custom CSS |
|
|
||||||
| `js/user.js` | Custom JavaScript |
|
|
||||||
| `js/user.min.js` | Minified custom JavaScript |
|
|
||||||
|
|
||||||
Source: `media/templates/site/mokocassiopeia/`
|
|
||||||
Destination: `media/templates/site/mokoonyx/`
|
|
||||||
|
|
||||||
### 4. Content References
|
|
||||||
|
|
||||||
All references to "MokoCassiopeia" and "mokocassiopeia" in article content (`introtext` and `fulltext` columns) and module content are automatically replaced with "MokoOnyx" and "mokoonyx". This covers:
|
|
||||||
|
|
||||||
- Image paths (e.g., `media/templates/site/mokocassiopeia/...`)
|
|
||||||
- Template name references in custom HTML modules
|
|
||||||
- Any other text references in content
|
|
||||||
|
|
||||||
### 5. Additional Post-Install Tasks
|
|
||||||
|
|
||||||
These tasks run during every install/update (not just migration):
|
|
||||||
|
|
||||||
| Task | Description |
|
|
||||||
|------|-------------|
|
|
||||||
| **Favicon stamp cleared** | Deletes `.favicon_generated` stamp so favicons regenerate. Also removes the old `/images/favicons/` directory and root-level favicon files from previous versions. |
|
|
||||||
| **Media folder cleaned** | Removes stale `.min.css` and `.min.js` files (regenerated by `MokoMinifyHelper`), unminified vendor files, and deprecated files (`custom.css`, `custom.js`, `template-rtl.css`). |
|
|
||||||
| **Extension locked** | Sets `locked = 1` in `#__extensions` to prevent accidental uninstallation. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## How to Trigger Migration
|
|
||||||
|
|
||||||
Migration runs automatically during installation. If you need to observe the results:
|
|
||||||
|
|
||||||
1. Install MokoOnyx via **System → Install → Extensions**
|
|
||||||
2. Go to **System → Site Templates** and verify MokoOnyx appears with your settings
|
|
||||||
3. Visit any page on your site to confirm the template is active
|
|
||||||
4. Check **administrator/logs/mokoonyx.log.php** for migration log entries
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Re-Running Migration
|
|
||||||
|
|
||||||
The migration runs on every install/update operation via the `postflight()` method. It is safe to re-run because:
|
|
||||||
|
|
||||||
- Style creation checks for existing styles before creating duplicates
|
|
||||||
- File copies only occur when the destination file does not exist
|
|
||||||
- Content replacements are idempotent (replacing "MokoOnyx" with "MokoOnyx" is a no-op)
|
|
||||||
|
|
||||||
To force a fresh migration, you can reinstall MokoOnyx by uploading the ZIP package again.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## After Migration
|
|
||||||
|
|
||||||
Once you have confirmed everything is working:
|
|
||||||
|
|
||||||
1. Uninstall MokoCassiopeia from **Extensions → Manage**
|
|
||||||
2. Optionally clean up any remaining MokoCassiopeia files in `media/templates/site/mokocassiopeia/`
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
| Issue | Solution |
|
|
||||||
|-------|----------|
|
|
||||||
| Settings not migrated | Check `administrator/logs/mokoonyx.log.php` for error messages. Verify MokoCassiopeia styles exist in `#__template_styles`. |
|
|
||||||
| Custom theme files missing | Verify files exist in `media/templates/site/mokocassiopeia/css/theme/`. The copy only runs if the destination does not already exist -- if MokoOnyx files are already present, they are not overwritten. |
|
|
||||||
| Content references not updated | Check the log for "Content replacement failed" or "Module replacement failed" warnings. Database permissions may be insufficient. |
|
|
||||||
| PHP version error | MokoOnyx requires PHP 8.1+. The preflight check blocks installation if this is not met. |
|
|
||||||
| Joomla version error | MokoOnyx requires Joomla 4.4+. The preflight check blocks installation if this is not met. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Minification
|
|
||||||
|
|
||||||
MokoOnyx includes an automatic CSS/JS minification system that generates `.min` files at runtime based on the development mode setting.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## How It Works
|
|
||||||
|
|
||||||
The minification system is implemented in `MokoMinifyHelper` (`helper/minify.php`). It is called from the template's `index.php` on every page load and follows a simple rule:
|
|
||||||
|
|
||||||
- **Development mode OFF** (production): `.min` files are generated from source files when the source is newer or the `.min` file is missing
|
|
||||||
- **Development mode ON**: all `.min` files are **deleted** so the browser loads unminified source files for debugging
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Files Managed
|
|
||||||
|
|
||||||
### CSS Files
|
|
||||||
|
|
||||||
| Source File | Minified Output |
|
|
||||||
|-------------|----------------|
|
|
||||||
| `css/template.css` | `css/template.min.css` |
|
|
||||||
| `css/offline.css` | `css/offline.min.css` |
|
|
||||||
| `css/editor.css` | `css/editor.min.css` |
|
|
||||||
| `css/a11y-high-contrast.css` | `css/a11y-high-contrast.min.css` |
|
|
||||||
| `css/user.css` | `css/user.min.css` |
|
|
||||||
| `css/theme/light.standard.css` | `css/theme/light.standard.min.css` |
|
|
||||||
| `css/theme/dark.standard.css` | `css/theme/dark.standard.min.css` |
|
|
||||||
| `css/theme/light.custom.css` | `css/theme/light.custom.min.css` |
|
|
||||||
| `css/theme/dark.custom.css` | `css/theme/dark.custom.min.css` |
|
|
||||||
|
|
||||||
### JavaScript Files
|
|
||||||
|
|
||||||
| Source File | Minified Output |
|
|
||||||
|-------------|----------------|
|
|
||||||
| `js/template.js` | `js/template.min.js` |
|
|
||||||
| `js/gtm.js` | `js/gtm.min.js` |
|
|
||||||
| `js/user.js` | `js/user.min.js` |
|
|
||||||
|
|
||||||
All paths are relative to `media/templates/site/mokoonyx/`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Staleness Check
|
|
||||||
|
|
||||||
The system uses filesystem modification times to determine whether a `.min` file needs regenerating:
|
|
||||||
|
|
||||||
1. If the source file does not exist, skip it
|
|
||||||
2. If the `.min` file exists and its modification time is **newer or equal** to the source, skip it
|
|
||||||
3. Otherwise, read the source, minify it, and write the `.min` file
|
|
||||||
|
|
||||||
This means minification only runs when source files actually change, keeping page load overhead minimal.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## CSS Minification
|
|
||||||
|
|
||||||
The CSS minifier performs these transformations:
|
|
||||||
|
|
||||||
1. Remove CSS comments (preserving IE hacks)
|
|
||||||
2. Remove whitespace around `{ } : ; , > + ~`
|
|
||||||
3. Collapse remaining whitespace to single spaces
|
|
||||||
4. Remove trailing semicolons before closing braces (`;}` becomes `}`)
|
|
||||||
5. Strip leading/trailing whitespace
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## JavaScript Minification
|
|
||||||
|
|
||||||
The JS minifier performs these transformations:
|
|
||||||
|
|
||||||
1. Remove multi-line comments (`/* ... */`)
|
|
||||||
2. Remove single-line comments (`//`) while preserving URLs
|
|
||||||
3. Collapse whitespace
|
|
||||||
4. Remove spaces around operators and punctuation
|
|
||||||
5. Restore necessary spaces after keywords (`var`, `let`, `const`, `return`, `typeof`, `instanceof`, `new`, `delete`, `throw`, `case`, `in`, `of`)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Build-Time vs Runtime
|
|
||||||
|
|
||||||
| Context | What Happens |
|
|
||||||
|---------|-------------|
|
|
||||||
| **Runtime** (page load) | `MokoMinifyHelper::sync()` runs on every page load. In production mode, it checks timestamps and regenerates stale `.min` files. The overhead is negligible (filesystem stat calls only when files have not changed). |
|
|
||||||
| **Build-time** (`make build`) | The Makefile runs `make minify` before packaging. This uses the moko-platform `minify.js` script (Node.js) with `terser` and `clean-css` for higher-quality minification. |
|
|
||||||
| **Install/Update** | The installer script (`script.php`) deletes all `.min.css` and `.min.js` files in the `css/` and `js/` directories so they are cleanly regenerated by the runtime minifier on the first page load. Vendor `.min` files in `vendor/` are not touched. |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Debug Mode Behaviour
|
|
||||||
|
|
||||||
To debug CSS or JS issues:
|
|
||||||
|
|
||||||
1. Go to **System → Site Templates → MokoOnyx**
|
|
||||||
2. Open the **Advanced** tab
|
|
||||||
3. Set **Development Mode** to **Yes**
|
|
||||||
4. Save
|
|
||||||
|
|
||||||
This immediately deletes all `.min` files. The template will load the unminified source files, making browser DevTools inspection straightforward. Remember to turn development mode **off** for production.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# Roadmap
|
|
||||||
|
|
||||||
> Auto-generated from project milestones and issues.
|
|
||||||
> Last updated: 2026-05-11 17:09 UTC
|
|
||||||
|
|
||||||
## Active Milestones
|
|
||||||
|
|
||||||
_No active milestones._
|
|
||||||
|
|
||||||
## Backlog
|
|
||||||
|
|
||||||
_Issues not yet assigned to a milestone._
|
|
||||||
|
|
||||||
- [ ] feat: AI-generated page layouts from text prompts (#21) `type: feature`
|
|
||||||
- [ ] feat: Visual page builder with drag-and-drop (#20) `type: feature`
|
|
||||||
- [ ] feat: Export/import themes (#19) `type: feature`
|
|
||||||
- [ ] feat: CSS variable editor (#18) `type: feature`
|
|
||||||
- [ ] feat: Theme presets (#17) `type: feature`
|
|
||||||
- [ ] feat: Live preview customizer (#16) `type: feature`
|
|
||||||
- [ ] bug: site.webmanifest 404 — favicon generator not creating manifest (#1)
|
|
||||||
|
|
||||||
---
|
|
||||||
_Generated by [sync-roadmap-wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/actions) workflow._
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
[← Back to Home](Home)
|
|
||||||
|
|
||||||
# Template Overrides
|
|
||||||
|
|
||||||
MokoOnyx includes template overrides for Joomla core modules, third-party extensions, and layout files. These overrides are located in `templates/mokoonyx/html/`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Joomla Core Module Overrides
|
|
||||||
|
|
||||||
| Module | Override File(s) | Description |
|
|
||||||
|--------|-----------------|-------------|
|
|
||||||
| `mod_articles_archive` | `default.php` | Articles archive module |
|
|
||||||
| `mod_articles_categories` | `default.php` | Article categories listing |
|
|
||||||
| `mod_articles_category` | `default.php` | Articles from a single category |
|
|
||||||
| `mod_articles_latest` | `default.php` | Latest articles module |
|
|
||||||
| `mod_articles_news` | `default.php` | News flash / articles newsflash |
|
|
||||||
| `mod_articles_popular` | `default.php` | Most-read articles |
|
|
||||||
| `mod_banners` | `default.php` | Banner display module |
|
|
||||||
| `mod_breadcrumbs` | `default.php` | Breadcrumb navigation |
|
|
||||||
| `mod_custom` | `default.php`, `hero.php` | Custom HTML module (includes a hero layout variant) |
|
|
||||||
| `mod_feed` | `default.php` | RSS/Atom feed display |
|
|
||||||
| `mod_finder` | `default.php` | Smart Search box |
|
|
||||||
| `mod_footer` | `default.php` | Footer information |
|
|
||||||
| `mod_languages` | `default.php` | Language switcher |
|
|
||||||
| `mod_login` | `default.php` | Login form |
|
|
||||||
| `mod_menu` | `default.php`, `horizontal.php`, `horizontal_component.php`, `horizontal_heading.php`, `horizontal_separator.php`, `horizontal_url.php`, `mainmenu.php`, `mainmenu_component.php`, `mainmenu_heading.php`, `mainmenu_separator.php`, `mainmenu_url.php` | Menu module with horizontal and main menu layouts |
|
|
||||||
| `mod_random_image` | `default.php` | Random image display |
|
|
||||||
| `mod_related_items` | `default.php` | Related articles |
|
|
||||||
| `mod_stats` | `default.php` | Site statistics |
|
|
||||||
| `mod_syndicate` | `default.php` | Syndication / RSS link |
|
|
||||||
| `mod_tags_popular` | `default.php` | Popular tags |
|
|
||||||
| `mod_tags_similar` | `default.php` | Similar tags |
|
|
||||||
| `mod_users_latest` | `default.php` | Latest registered users |
|
|
||||||
| `mod_whosonline` | `default.php` | Who's online |
|
|
||||||
| `mod_wrapper` | `default.php` | iFrame wrapper |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Third-Party Extension Overrides
|
|
||||||
|
|
||||||
### Community Builder
|
|
||||||
|
|
||||||
| Module | Override File(s) | Description |
|
|
||||||
|--------|-----------------|-------------|
|
|
||||||
| `mod_cblogin` | `default.php`, `default_logout.php` | Community Builder login/logout module |
|
|
||||||
| `mod_comprofilermoderator` | `default.php` | CB moderator panel |
|
|
||||||
| `mod_comprofileronline` | `default.php` | CB online users |
|
|
||||||
|
|
||||||
### DPCalendar
|
|
||||||
|
|
||||||
| Module | Override File(s) | Description |
|
|
||||||
|--------|-----------------|-------------|
|
|
||||||
| `mod_dpcalendar_counter` | `default.php` | Event countdown timer |
|
|
||||||
| `mod_dpcalendar_map` | `default.php` | Event map display |
|
|
||||||
| `mod_dpcalendar_mini` | `default.php`, `default_icons.php`, `default_map.php`, `default_quickadd.php`, `_scripts.php` | Mini calendar widget |
|
|
||||||
| `mod_dpcalendar_upcoming` | `default.php`, `_scripts.php` | Upcoming events list |
|
|
||||||
|
|
||||||
### JoomGallery
|
|
||||||
|
|
||||||
| Component View | Override File(s) | Description |
|
|
||||||
|---------------|-----------------|-------------|
|
|
||||||
| `com_joomgallery/category` | `default.php`, `default_cat.php` | Gallery category view |
|
|
||||||
| `com_joomgallery/gallery` | `default.php` | Main gallery view |
|
|
||||||
| `com_joomgallery/image` | `default.php` | Single image view |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Component Overrides
|
|
||||||
|
|
||||||
| Component | View | Override File(s) | Description |
|
|
||||||
|-----------|------|-----------------|-------------|
|
|
||||||
| `com_content` | `article` | `toc-left.php`, `toc-right.php` | Article views with Table of Contents positioned left or right |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Layout Overrides
|
|
||||||
|
|
||||||
| Layout | Override File | Description |
|
|
||||||
|--------|--------------|-------------|
|
|
||||||
| `joomla.module` | `card.php` | Module chrome -- wraps any module in a Bootstrap card layout |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Hero Layout (mod_custom)
|
|
||||||
|
|
||||||
The `hero.php` layout for `mod_custom` provides a full-width hero/banner module. It uses the hero CSS variables (`--hero-*`) for styling. Assign a custom HTML module to positions like `banner` or `top-a` and select the "hero" layout in the module's Advanced tab.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Menu Layouts
|
|
||||||
|
|
||||||
MokoOnyx provides two specialized menu layouts:
|
|
||||||
|
|
||||||
- **horizontal** -- A horizontal navigation bar with dropdown support, used for the main site navigation
|
|
||||||
- **mainmenu** -- An enhanced main menu layout with support for component links, headings, separators, and URL items
|
|
||||||
|
|
||||||
Each layout has sub-templates for different menu item types: `_component`, `_heading`, `_separator`, and `_url`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Built with [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) -- Moko Consulting*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-09 | Moko Consulting | Initial version |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Repo: [MokoOnyx](https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx) · [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)*
|
|
||||||
|
|
||||||
| Field | Value |
|
|
||||||
|---|---|
|
|
||||||
| Minimum Version | 04.07.00 |
|
|
||||||
| Platform | joomla |
|
|
||||||
|
|
||||||
| Revision | Date | Author | Description |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 1.0 | 2026-05-16 | Moko Consulting | Standards compliance update |
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
## Contributing
|
|
||||||
|
|
||||||
This document defines how to contribute to Moko Consulting projects.
|
|
||||||
|
|
||||||
## Branching Strategy
|
|
||||||
|
|
||||||
All repositories follow this branching model:
|
|
||||||
|
|
||||||
```
|
|
||||||
feature/* --> dev --> main
|
|
||||||
```
|
|
||||||
|
|
||||||
| Branch | Purpose | Direct push? |
|
|
||||||
|--------|---------|-------------|
|
|
||||||
| `main` | Production/release branch | No -- PR merge only |
|
|
||||||
| `dev` | Integration branch | No -- PR merge only (CI bot whitelisted) |
|
|
||||||
| `feature/*` | Feature/bugfix work | Yes -- create freely |
|
|
||||||
| `rc/*` | Release candidates | No -- PR merge only |
|
|
||||||
| `alpha/*` | Alpha pre-releases | No -- PR merge only |
|
|
||||||
| `beta/*` | Beta pre-releases | No -- PR merge only |
|
|
||||||
| `version/*` | Release archive branches | Auto-created by CI |
|
|
||||||
|
|
||||||
### Workflow
|
|
||||||
|
|
||||||
1. Create a `feature/*` branch from `dev`
|
|
||||||
2. Make changes on the feature branch
|
|
||||||
3. Open a PR from `feature/*` to `dev`
|
|
||||||
4. After review, merge to `dev`
|
|
||||||
5. When ready for release, open a PR from `dev` to `main`
|
|
||||||
6. Merging to `main` triggers the auto-release pipeline
|
|
||||||
|
|
||||||
### Automated syncing
|
|
||||||
|
|
||||||
- `cascade-dev.yml` automatically forward-merges `main` to `dev` after every push to main
|
|
||||||
- If there are conflicts, a PR is created automatically
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
Contributors are expected to:
|
|
||||||
|
|
||||||
* Have a working understanding of the project's platform (Joomla, Dolibarr, or generic)
|
|
||||||
* Be familiar with Git and pull request workflows
|
|
||||||
* Review repository governance documents prior to submitting changes
|
|
||||||
|
|
||||||
### Quick Setup
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://git.mokoconsulting.tech/MokoConsulting/<repo>.git
|
|
||||||
cd <repo>
|
|
||||||
git checkout dev
|
|
||||||
git checkout -b feature/my-change
|
|
||||||
```
|
|
||||||
|
|
||||||
## Coding and Formatting Standards
|
|
||||||
|
|
||||||
All contributions must:
|
|
||||||
|
|
||||||
* Follow platform coding standards (Joomla, Dolibarr, PHP PSR) where applicable
|
|
||||||
* Conform to Moko Consulting repository standards for headers, metadata, and file structure
|
|
||||||
* Keep YAML workflow files ASCII-only (no em dashes, arrows, or emoji)
|
|
||||||
|
|
||||||
## Commit Messages
|
|
||||||
|
|
||||||
Commit messages should:
|
|
||||||
|
|
||||||
* Use conventional commits format: `type(scope): description`
|
|
||||||
* Types: feat, fix, chore, docs, refactor, test, ci
|
|
||||||
* Focus on what changed and why
|
|
||||||
* Include `[skip ci]` suffix for documentation-only changes
|
|
||||||
|
|
||||||
## Reporting Issues
|
|
||||||
|
|
||||||
Bug reports and enhancement requests should be filed as Gitea issues and include:
|
|
||||||
|
|
||||||
* Clear reproduction steps or use cases
|
|
||||||
* Expected versus actual behavior
|
|
||||||
* Relevant environment details
|
|
||||||
|
|
||||||
Security issues must follow the process in SECURITY.md and must not be reported publicly.
|
|
||||||
|
|
||||||
## Review Process
|
|
||||||
|
|
||||||
All pull requests are subject to review. Review criteria include:
|
|
||||||
|
|
||||||
* Technical correctness
|
|
||||||
* Alignment with project goals
|
|
||||||
* Maintainability and clarity
|
|
||||||
* Risk introduced to release and update processes
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
By contributing, you agree that your contributions will be licensed under GPL-3.0-or-later, consistent with the rest of the project.
|
|
||||||
Reference in New Issue
Block a user