Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50412f33ba | |||
| c54416f06e | |||
| 434505fd0b | |||
| 148e133fc3 | |||
| f660899677 | |||
| 116896b584 | |||
| eaf99d3743 | |||
| 701b64f5c2 | |||
| 526db6cf04 | |||
| a164f9b779 | |||
| 6da9059fe4 | |||
| 62658a9b30 | |||
| b72662406d | |||
| 6cac2c2dd0 | |||
| e1d8f381e2 | |||
| f15d22c091 | |||
| f0533877b2 | |||
| e74d53bb94 | |||
| 4857842959 | |||
| 0d061c6818 | |||
| 230f17b5bc | |||
| ef8e3bcfcf | |||
| adf55bc2b2 | |||
| cd8c1826fe | |||
| 0adc05fa2b | |||
| 1c1d168ffb | |||
| 824026ace2 | |||
| 55e47a4913 | |||
| 1b3c70dec6 | |||
| cec5f192c3 | |||
| 554818cc10 | |||
| 65b48b65ba | |||
| 173c868a56 | |||
| 7836522d8a | |||
| 786ce1b14a | |||
| f5fd4ac8da | |||
| 6f67bf97bd | |||
| d947a0e259 | |||
| 334c90fa02 | |||
| bbca20d795 | |||
| 705e2a2eaf | |||
| 61ce28c29e | |||
| efd604808e | |||
| 92efb3b4de | |||
| 6ae4ff9b83 | |||
| f0501d562c | |||
| 4606bec029 | |||
| 91e9a1005a | |||
| f4c4daee05 | |||
| 6696d08607 | |||
| 1150455e43 | |||
| b78609c929 | |||
| 1b40c627e2 | |||
| 3a57ae1584 | |||
| baacbb82a7 | |||
| 493666cabb | |||
| a6be4af9d0 | |||
| bc5976ef1a | |||
| e25846fded | |||
| 466448719b | |||
| 37edd57f85 | |||
| 2df322841e | |||
| 302851abb7 | |||
| ea4e211175 | |||
| 48b2745c42 | |||
| abc73045be | |||
| c244751bb0 | |||
| 6cd06d0aa0 | |||
| 21fde78e08 | |||
| be850dc676 | |||
| 54ea3f46e0 | |||
| 988c3a1ef6 | |||
| 84da84b62d | |||
| 8dc3234bd4 |
@@ -0,0 +1,83 @@
|
||||
# MokoSuiteCross
|
||||
|
||||
Cross-posting Joomla content to social media, email marketing, and chat platforms with plugin-based services.
|
||||
|
||||
## Quick Reference
|
||||
|
||||
| Field | Value |
|
||||
|---|---|
|
||||
| **Package** | `pkg_mokosuitecross` |
|
||||
| **Language** | PHP 8.1+ |
|
||||
| **Branch** | develop on `dev`, merge to `main` (protected) |
|
||||
| **Wiki** | [MokoSuiteCross Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/wiki) |
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
make build # Build package ZIP
|
||||
make lint # Run linters
|
||||
make validate # Validate structure
|
||||
make release # Full release pipeline
|
||||
make clean # Clean build artifacts
|
||||
composer install # Install PHP dependencies
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
Joomla **package** with core extensions + pluggable service plugins:
|
||||
|
||||
### com_mokosuitecross (Component)
|
||||
- Admin backend: dashboard, services, post queue, templates, logs
|
||||
- Joomla 5/6 MVC: Dashboard, Services, Posts, Logs (list/edit each)
|
||||
- Namespace: `Joomla\Component\MokoSuiteCross\Administrator`
|
||||
|
||||
### plg_system_mokosuitecross (System Plugin)
|
||||
- Hooks `onContentAfterSave` to trigger cross-posting on article publish
|
||||
- Dispatches to registered service plugins via `mokosuitecross` plugin group
|
||||
|
||||
### plg_content_mokosuitecross (Content Plugin)
|
||||
- Adds cross-post status badges to articles via `onContentBeforeDisplay`
|
||||
|
||||
### plg_webservices_mokosuitecross (WebServices Plugin)
|
||||
- REST API endpoints for posts and services
|
||||
|
||||
### Service Plugins (mokosuitecross group)
|
||||
Each platform is a separate plugin implementing `MokoSuiteCrossServiceInterface`:
|
||||
- `plg_mokosuitecross_facebook` — Facebook/Meta Graph API
|
||||
- `plg_mokosuitecross_twitter` — X/Twitter API v2
|
||||
- `plg_mokosuitecross_linkedin` — LinkedIn Share API
|
||||
- `plg_mokosuitecross_mastodon` — Mastodon API
|
||||
- `plg_mokosuitecross_bluesky` — Bluesky AT Protocol
|
||||
- `plg_mokosuitecross_mailchimp` — Mailchimp Campaigns API
|
||||
- `plg_mokosuitecross_telegram` — Telegram Bot API
|
||||
- `plg_mokosuitecross_discord` — Discord Webhooks
|
||||
- `plg_mokosuitecross_slack` — Slack Incoming Webhooks
|
||||
|
||||
### Database Schema
|
||||
|
||||
- `#__mokosuitecross_services` — service configs (credentials as individual fields, not JSON)
|
||||
- `#__mokosuitecross_posts` — post queue (status: queued/posting/posted/failed/scheduled)
|
||||
- `#__mokosuitecross_templates` — message templates per service type
|
||||
- `#__mokosuitecross_logs` — activity logs with level and context
|
||||
|
||||
## Rules
|
||||
|
||||
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, `*.min.css`/`*.min.js`
|
||||
- **Never commit** API keys, tokens, or credentials — these go in Joomla's encrypted params
|
||||
- **Attribution**: `Authored-by: Moko Consulting`
|
||||
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
||||
- **Minification**: handled at build time (CI)
|
||||
- **Wiki**: documentation lives in the Gitea wiki, not `docs/` files
|
||||
- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/mokoplatform/wiki/Home)
|
||||
- **UX**: service credentials as individual form fields, not JSON blobs; dashboard link in toolbar
|
||||
|
||||
## Coding Standards
|
||||
|
||||
- PHP 8.1+ minimum
|
||||
- Joomla 5/6 DI container pattern: `services/provider.php` → Extension class
|
||||
- Legacy stub `.php` file required for plugin loader but empty
|
||||
- `SubscriberInterface` for event subscription (not `on*` method naming)
|
||||
- `bind() → check() → store()` for Table operations (not `save()`)
|
||||
- Language file placement: site (no `folder`) vs admin (`folder="administrator"`)
|
||||
- SPDX license headers on all PHP files
|
||||
- Service plugins MUST implement `MokoSuiteCrossServiceInterface`
|
||||
@@ -0,0 +1,251 @@
|
||||
# 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
|
||||
+12
-7
@@ -1,21 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<moko-platform xmlns="https://standards.mokoconsulting.tech/moko-platform/1.0" schema-version="1.0">
|
||||
<mokoplatform xmlns="https://standards.mokoconsulting.tech/mokoplatform/1.0" schema-version="1.0">
|
||||
<identity>
|
||||
<name>MokoJoomCross</name>
|
||||
<display-name>Package - MokoJoomCross</display-name>
|
||||
<name>MokoSuiteCross</name>
|
||||
<display-name>Package - MokoSuiteCross</display-name>
|
||||
<org>MokoConsulting</org>
|
||||
<description>Cross-posting Joomla content to social media, email marketing, and chat platforms</description>
|
||||
<version>01.00.27</version>
|
||||
<version>01.02.00</version>
|
||||
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
|
||||
</identity>
|
||||
<governance>
|
||||
<platform>joomla</platform>
|
||||
<standards-version>05.00.00</standards-version>
|
||||
<standards-source>https://git.mokoconsulting.tech/MokoConsulting/moko-platform</standards-source>
|
||||
<standards-source>https://git.mokoconsulting.tech/MokoConsulting/mokoplatform</standards-source>
|
||||
</governance>
|
||||
<build>
|
||||
<language>PHP</language>
|
||||
<package-type>joomla-extension</package-type>
|
||||
<entry-point>src/</entry-point>
|
||||
<entry-point>source/</entry-point>
|
||||
</build>
|
||||
</moko-platform>
|
||||
<licensing>
|
||||
<enabled>true</enabled>
|
||||
<dlid>true</dlid>
|
||||
<update-server>https://git.mokoconsulting.tech/{org}/{repo}/updates.xml</update-server>
|
||||
</licensing>
|
||||
</mokoplatform>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/auto-bump.yml
|
||||
# VERSION: 09.02.00
|
||||
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
|
||||
|
||||
name: "Universal: Auto Version Bump"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- rc
|
||||
- 'feature/**'
|
||||
- 'patch/**'
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
bump:
|
||||
name: Version Bump
|
||||
runs-on: release
|
||||
if: >-
|
||||
!contains(github.event.head_commit.message, '[skip ci]') &&
|
||||
!contains(github.event.head_commit.message, '[skip bump]') &&
|
||||
!startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
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 "/opt/moko-platform/cli" ]; then
|
||||
echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV"
|
||||
else
|
||||
git clone --depth 1 --branch main --quiet \
|
||||
"https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/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"
|
||||
fi
|
||||
|
||||
- name: Bump version
|
||||
run: |
|
||||
php ${MOKO_CLI}/version_auto_bump.php \
|
||||
--path . --branch "${GITHUB_REF_NAME}" \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
||||
@@ -1,285 +1,324 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
||||
# VERSION: 05.00.00
|
||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||
#
|
||||
# +========================================================================+
|
||||
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
||||
# +========================================================================+
|
||||
# | |
|
||||
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
||||
# | |
|
||||
# | Platform-specific: |
|
||||
# | joomla: XML manifest, updates.xml, type-prefixed packages |
|
||||
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
||||
# | generic: README-only, no update stream |
|
||||
# | |
|
||||
# +========================================================================+
|
||||
|
||||
name: "Universal: Build & Release"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, closed]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
action:
|
||||
description: 'Action to perform'
|
||||
required: false
|
||||
type: choice
|
||||
default: release
|
||||
options:
|
||||
- release
|
||||
- promote-rc
|
||||
|
||||
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:
|
||||
# ── PR Opened → Rename branch to RC and build RC release ─────────────────────
|
||||
promote-rc:
|
||||
name: Promote to RC
|
||||
runs-on: release
|
||||
if: >-
|
||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
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
|
||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
||||
rm -rf /tmp/moko-platform-api
|
||||
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
|
||||
|
||||
- name: Rename branch to rc
|
||||
run: |
|
||||
php /tmp/moko-platform-api/cli/branch_rename.php \
|
||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
||||
--pr "${{ github.event.pull_request.number }}"
|
||||
|
||||
- name: Checkout rc and configure git
|
||||
run: |
|
||||
git fetch origin rc
|
||||
git checkout rc
|
||||
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"
|
||||
|
||||
- name: Publish RC release
|
||||
run: |
|
||||
php /tmp/moko-platform-api/cli/release_publish.php \
|
||||
--path . --stability rc --bump minor --branch rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--skip-update-stream
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
run: |
|
||||
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Branch renamed to rc, minor bump, RC release built (updates.xml managed by Gitea Pages)" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
||||
release:
|
||||
name: Build & Release Pipeline
|
||||
runs-on: release
|
||||
if: >-
|
||||
github.event.pull_request.merged == true ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git for bot pushes
|
||||
run: |
|
||||
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"
|
||||
|
||||
- name: Check for merge conflict markers
|
||||
run: |
|
||||
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)
|
||||
if [ -n "$CONFLICTS" ]; then
|
||||
echo "::error::Merge conflict markers found — aborting release"
|
||||
echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
fi
|
||||
echo "No conflict markers found"
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
||||
run: |
|
||||
# Ensure PHP + Composer are available
|
||||
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
|
||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
||||
rm -rf /tmp/moko-platform-api
|
||||
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
|
||||
|
||||
|
||||
- name: "Publish stable release"
|
||||
run: |
|
||||
php /tmp/moko-platform-api/cli/release_publish.php \
|
||||
--path . --stability stable --bump minor --branch main \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--skip-update-stream
|
||||
|
||||
# -- 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"
|
||||
|
||||
- name: "Step 11: Delete rc branch and recreate dev 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 rc branch (ephemeral — created by promote-rc)
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
||||
|
||||
# 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 "Pre-release branches cleaned, dev reset from main" >> $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
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: mokoplatform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/mokoplatform
|
||||
# PATH: /templates/workflows/universal/auto-release.yml.template
|
||||
# VERSION: 05.00.00
|
||||
# BRIEF: Universal build & release � detects platform from manifest.xml
|
||||
#
|
||||
# +========================================================================+
|
||||
# | UNIVERSAL BUILD & RELEASE PIPELINE |
|
||||
# +========================================================================+
|
||||
# | |
|
||||
# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. |
|
||||
# | |
|
||||
# | Platform-specific: |
|
||||
# | joomla: XML manifest, type-prefixed packages |
|
||||
# | dolibarr: mod*.class.php, update.txt, dev version reset |
|
||||
# | generic: README-only, no update stream |
|
||||
# | |
|
||||
# +========================================================================+
|
||||
|
||||
name: "Universal: Build & Release"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, closed]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
action:
|
||||
description: 'Action to perform'
|
||||
required: false
|
||||
type: choice
|
||||
default: release
|
||||
options:
|
||||
- release
|
||||
- promote-rc
|
||||
|
||||
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:
|
||||
# ── PR Opened → Rename branch to RC and build RC release ─────────────────────
|
||||
promote-rc:
|
||||
name: Promote to RC
|
||||
runs-on: release
|
||||
if: >-
|
||||
(github.event.action == 'opened' && github.event.pull_request.merged != true) ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup mokoplatform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
run: |
|
||||
if [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
||||
echo Using pre-installed /opt/mokoplatform
|
||||
echo MOKO_CLI=/opt/mokoplatform/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/mokoplatform-api
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokoplatform.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokoplatform-api
|
||||
cd /tmp/mokoplatform-api
|
||||
composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/mokoplatform-api/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Rename branch to rc
|
||||
run: |
|
||||
php ${MOKO_CLI}/branch_rename.php \
|
||||
--from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
--api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \
|
||||
--pr "${{ github.event.pull_request.number }}"
|
||||
|
||||
- name: Checkout rc and configure git
|
||||
run: |
|
||||
git fetch origin rc
|
||||
git checkout rc
|
||||
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"
|
||||
|
||||
- name: Publish RC release
|
||||
run: |
|
||||
php ${MOKO_CLI}/release_publish.php \
|
||||
--path . --stability rc --bump minor --branch rc \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
run: |
|
||||
echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# ── Merged PR → Build & Release (or promote RC to stable) ────────────────────
|
||||
release:
|
||||
name: Build & Release Pipeline
|
||||
runs-on: release
|
||||
if: >-
|
||||
github.event.pull_request.merged == true ||
|
||||
(github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
with:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git for bot pushes
|
||||
run: |
|
||||
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"
|
||||
|
||||
- name: Check for merge conflict markers
|
||||
run: |
|
||||
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)
|
||||
if [ -n "$CONFLICTS" ]; then
|
||||
echo "::error::Merge conflict markers found — aborting release"
|
||||
echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
fi
|
||||
echo "No conflict markers found"
|
||||
|
||||
- name: Setup mokoplatform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}'
|
||||
run: |
|
||||
if [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
||||
echo Using pre-installed /opt/mokoplatform
|
||||
echo MOKO_CLI=/opt/mokoplatform/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/mokoplatform-api
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokoplatform.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokoplatform-api
|
||||
cd /tmp/mokoplatform-api
|
||||
composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/mokoplatform-api/cli >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Publish stable release"
|
||||
run: |
|
||||
php ${MOKO_CLI}/release_publish.php \
|
||||
--path . --stability stable --bump minor --branch main \
|
||||
--token "${{ secrets.MOKOGITEA_TOKEN }}"
|
||||
|
||||
- name: Update release notes from CHANGELOG.md
|
||||
run: |
|
||||
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
||||
|
||||
# Extract [Unreleased] section from changelog
|
||||
if [ -f "CHANGELOG.md" ]; then
|
||||
NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md)
|
||||
[ -z "$NOTES" ] && NOTES="Stable release"
|
||||
else
|
||||
NOTES="Stable release"
|
||||
fi
|
||||
|
||||
# Update release body via API
|
||||
RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
"${API_BASE}/releases/tags/stable" | 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
|
||||
|
||||
# -- 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 ${MOKO_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"
|
||||
|
||||
- name: "Step 11: Delete rc branch and recreate dev 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 rc branch (ephemeral — created by promote-rc)
|
||||
curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \
|
||||
"${API_BASE}/branches/rc" 2>/dev/null \
|
||||
&& echo "Deleted rc branch" || echo "rc branch not found"
|
||||
|
||||
# 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 "Pre-release branches cleaned, dev reset from main" >> $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 ${MOKO_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
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Universal
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# PATH: /.mokogitea/workflows/branch-cleanup.yml
|
||||
# VERSION: 01.00.00
|
||||
# BRIEF: Delete feature branches after PR merge
|
||||
|
||||
name: "Branch Cleanup"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
name: Delete merged branch
|
||||
runs-on: ubuntu-latest
|
||||
if: >-
|
||||
github.event.pull_request.merged == true &&
|
||||
github.event.pull_request.head.ref != 'dev' &&
|
||||
github.event.pull_request.head.ref != 'main'
|
||||
|
||||
steps:
|
||||
- name: Delete source branch
|
||||
run: |
|
||||
BRANCH="${{ github.event.pull_request.head.ref }}"
|
||||
API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches"
|
||||
ENCODED=$(php -r "echo rawurlencode('${BRANCH}');")
|
||||
|
||||
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \
|
||||
-H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
||||
"${API}/${ENCODED}" 2>/dev/null || true)
|
||||
|
||||
if [ "$STATUS" = "204" ]; then
|
||||
echo "Deleted branch: ${BRANCH}" >> $GITHUB_STEP_SUMMARY
|
||||
elif [ "$STATUS" = "404" ]; then
|
||||
echo "Branch already deleted: ${BRANCH}" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "::warning::Failed to delete branch ${BRANCH} (HTTP ${STATUS})"
|
||||
fi
|
||||
@@ -0,0 +1,10 @@
|
||||
# DISABLED — auto-release Step 11 recreates dev from main after every release.
|
||||
# Cascade-dev is redundant and causes version conflicts when both main and dev
|
||||
# have different version numbers in templateDetails.xml / manifest.xml.
|
||||
name: "Cascade Main → Dev (DISABLED)"
|
||||
on: workflow_dispatch
|
||||
jobs:
|
||||
noop:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Cascade disabled — auto-release handles dev recreation"
|
||||
@@ -0,0 +1,204 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.CI
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
||||
# PATH: /.gitea/workflows/ci-generic.yml
|
||||
# VERSION: 01.00.00
|
||||
# BRIEF: CI pipeline — lint, validate, and test for generic projects (PHP + Node.js)
|
||||
|
||||
name: "Generic: Project CI"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- dev/**
|
||||
- rc/**
|
||||
- version/**
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- dev/**
|
||||
- rc/**
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
jobs:
|
||||
# ── Lint & Validate ───────────────────────────────────────────────────
|
||||
lint:
|
||||
name: Lint & Validate
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Detect toolchain
|
||||
id: detect
|
||||
run: |
|
||||
HAS_PHP=false
|
||||
HAS_NODE=false
|
||||
[ -f "composer.json" ] && HAS_PHP=true
|
||||
[ -f "package.json" ] && HAS_NODE=true
|
||||
echo "has_php=$HAS_PHP" >> "$GITHUB_OUTPUT"
|
||||
echo "has_node=$HAS_NODE" >> "$GITHUB_OUTPUT"
|
||||
echo "Toolchain: PHP=$HAS_PHP Node=$HAS_NODE"
|
||||
|
||||
- name: Setup PHP
|
||||
if: steps.detect.outputs.has_php == 'true'
|
||||
run: |
|
||||
if ! command -v php &> /dev/null; then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq php-cli php-mbstring php-xml >/dev/null 2>&1
|
||||
fi
|
||||
php -v
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.detect.outputs.has_node == 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install PHP dependencies
|
||||
if: steps.detect.outputs.has_php == 'true'
|
||||
run: |
|
||||
if [ -f "composer.json" ]; then
|
||||
composer install --no-interaction --prefer-dist --quiet 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
if: steps.detect.outputs.has_node == 'true'
|
||||
run: |
|
||||
if [ -f "package.json" ]; then
|
||||
npm ci --quiet 2>/dev/null || npm install --quiet 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: PHP syntax check
|
||||
if: steps.detect.outputs.has_php == 'true'
|
||||
run: |
|
||||
ERRORS=0
|
||||
while IFS= read -r -d '' file; do
|
||||
if ! php -l "$file" 2>&1 | grep -q "No syntax errors"; then
|
||||
echo "::error file=${file}::PHP syntax error"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
fi
|
||||
done < <(find . -name "*.php" -not -path "./.git/*" -not -path "./vendor/*" -not -path "./node_modules/*" -print0)
|
||||
|
||||
echo "## PHP Lint" >> $GITHUB_STEP_SUMMARY
|
||||
if [ "$ERRORS" -eq 0 ]; then
|
||||
echo "All PHP files passed syntax check." >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "${ERRORS} file(s) with syntax errors." >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: TypeScript/JavaScript lint
|
||||
if: steps.detect.outputs.has_node == 'true'
|
||||
run: |
|
||||
if [ -f "node_modules/.bin/eslint" ]; then
|
||||
npx eslint src/ --quiet 2>&1 || { echo "::error::ESLint errors found"; exit 1; }
|
||||
echo "## ESLint" >> $GITHUB_STEP_SUMMARY
|
||||
echo "All files passed ESLint." >> $GITHUB_STEP_SUMMARY
|
||||
elif [ -f ".eslintrc.json" ] || [ -f ".eslintrc.js" ] || [ -f "eslint.config.js" ]; then
|
||||
echo "::warning::ESLint config found but eslint not installed"
|
||||
else
|
||||
echo "No ESLint configured — skipping"
|
||||
fi
|
||||
|
||||
- name: TypeScript compile check
|
||||
if: steps.detect.outputs.has_node == 'true'
|
||||
run: |
|
||||
if [ -f "tsconfig.json" ] && [ -f "node_modules/.bin/tsc" ]; then
|
||||
npx tsc --noEmit 2>&1 || { echo "::error::TypeScript compilation errors"; exit 1; }
|
||||
echo "## TypeScript" >> $GITHUB_STEP_SUMMARY
|
||||
echo "TypeScript compilation passed." >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
- name: PHPStan static analysis
|
||||
if: steps.detect.outputs.has_php == 'true'
|
||||
run: |
|
||||
if [ -f "phpstan.neon" ] && [ -f "vendor/bin/phpstan" ]; then
|
||||
vendor/bin/phpstan analyse --no-progress 2>&1 || { echo "::warning::PHPStan found issues"; }
|
||||
fi
|
||||
|
||||
# ── Tests ─────────────────────────────────────────────────────────────
|
||||
test:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Detect toolchain
|
||||
id: detect
|
||||
run: |
|
||||
HAS_PHP=false
|
||||
HAS_NODE=false
|
||||
[ -f "composer.json" ] && HAS_PHP=true
|
||||
[ -f "package.json" ] && HAS_NODE=true
|
||||
echo "has_php=$HAS_PHP" >> "$GITHUB_OUTPUT"
|
||||
echo "has_node=$HAS_NODE" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup PHP
|
||||
if: steps.detect.outputs.has_php == 'true'
|
||||
run: |
|
||||
if ! command -v php &> /dev/null; then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq php-cli php-mbstring php-xml >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.detect.outputs.has_node == 'true'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
[ -f "composer.json" ] && composer install --no-interaction --prefer-dist --quiet 2>/dev/null || true
|
||||
[ -f "package.json" ] && { npm ci --quiet 2>/dev/null || npm install --quiet 2>/dev/null || true; }
|
||||
|
||||
- name: Run PHP tests
|
||||
if: steps.detect.outputs.has_php == 'true'
|
||||
run: |
|
||||
if [ -f "vendor/bin/phpunit" ]; then
|
||||
vendor/bin/phpunit --testdox 2>&1
|
||||
echo "## PHPUnit" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Tests passed." >> $GITHUB_STEP_SUMMARY
|
||||
elif [ -f "phpunit.xml" ] || [ -f "phpunit.xml.dist" ]; then
|
||||
echo "::warning::PHPUnit config found but phpunit not installed"
|
||||
else
|
||||
echo "No PHPUnit configured — skipping"
|
||||
fi
|
||||
|
||||
- name: Run Node.js tests
|
||||
if: steps.detect.outputs.has_node == 'true'
|
||||
run: |
|
||||
if jq -e '.scripts.test' package.json > /dev/null 2>&1; then
|
||||
npm test 2>&1
|
||||
echo "## Node.js Tests" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Tests passed." >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "No test script in package.json — skipping"
|
||||
fi
|
||||
|
||||
- name: Build check
|
||||
run: |
|
||||
if [ -f "Makefile" ]; then
|
||||
make build 2>&1 || echo "::warning::Build failed or not configured"
|
||||
elif [ -f "package.json" ] && jq -e '.scripts.build' package.json > /dev/null 2>&1; then
|
||||
npm run build 2>&1 || echo "::warning::Build failed"
|
||||
fi
|
||||
@@ -45,19 +45,22 @@ jobs:
|
||||
fi
|
||||
php -v && composer --version
|
||||
|
||||
- name: Clone MokoStandards
|
||||
- name: Setup moko-platform tools
|
||||
env:
|
||||
GA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }}
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }}
|
||||
MOKO_CLONE_HOST: ${{ secrets.MOKOGITEA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN || github.token }}
|
||||
MOKO_CLONE_HOST: ${{ secrets.GA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
||||
run: |
|
||||
git clone --depth 1 --branch main --quiet \
|
||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
||||
/tmp/mokostandards-api
|
||||
if [ -d "/tmp/moko-platform" ] || [ -d "/opt/moko-platform" ]; then
|
||||
echo "moko-platform already available on runner — 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 || echo "moko-platform clone skipped — continuing without it"
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_TOKEN || secrets.GA_TOKEN || github.token }}"}}'
|
||||
run: |
|
||||
if [ -f "composer.json" ]; then
|
||||
composer install \
|
||||
@@ -128,8 +131,8 @@ jobs:
|
||||
echo "Manifest is well-formed XML." >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
# Check required tags: name, version, author, namespace (Joomla 5+)
|
||||
for TAG in name version author namespace; do
|
||||
# Check required tags: name, version, author
|
||||
for TAG in name version author; do
|
||||
if ! grep -q "<${TAG}>" "$MANIFEST" 2>/dev/null; then
|
||||
echo "Missing required tag: \`<${TAG}>\`" >> $GITHUB_STEP_SUMMARY
|
||||
ERRORS=$((ERRORS + 1))
|
||||
@@ -137,6 +140,19 @@ jobs:
|
||||
echo "Found required tag: \`<${TAG}>\`" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
done
|
||||
|
||||
# Namespace is required for components/plugins but not packages
|
||||
EXT_TYPE=$(grep -oP '<extension[^>]*\btype="\K[^"]+' "$MANIFEST" | head -1)
|
||||
if [ "$EXT_TYPE" != "package" ]; then
|
||||
if ! grep -q "<namespace" "$MANIFEST" 2>/dev/null; then
|
||||
echo "Missing required tag: \`<namespace>\` (required for Joomla 5+ ${EXT_TYPE} extensions)" >> $GITHUB_STEP_SUMMARY
|
||||
ERRORS=$((ERRORS + 1))
|
||||
else
|
||||
echo "Found required tag: \`<namespace>\`" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
else
|
||||
echo "Package extension — \`<namespace>\` not required." >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${ERRORS}" -gt 0 ]; then
|
||||
@@ -354,7 +370,7 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_TOKEN || secrets.GA_TOKEN || github.token }}"}}'
|
||||
run: |
|
||||
if [ -f "composer.json" ]; then
|
||||
composer install \
|
||||
@@ -404,7 +420,7 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.MOKOGITEA_TOKEN || github.token }}"}}'
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_TOKEN || secrets.GA_TOKEN || github.token }}"}}'
|
||||
run: |
|
||||
if [ -f "composer.json" ]; then
|
||||
composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||
@@ -461,3 +477,24 @@ jobs:
|
||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
exit $EXIT
|
||||
|
||||
pre-release:
|
||||
name: Build RC Pre-Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint-and-validate, test]
|
||||
if: github.event_name == 'pull_request'
|
||||
|
||||
steps:
|
||||
- name: Trigger pre-release build
|
||||
env:
|
||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||
REPO: ${{ github.repository }}
|
||||
BRANCH: ${{ github.head_ref }}
|
||||
run: |
|
||||
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 "Triggered RC build on branch \`${BRANCH}\`" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Maintenance
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||
# PATH: /.gitea/workflows/cleanup.yml
|
||||
# VERSION: 01.00.00
|
||||
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
|
||||
|
||||
name: "Universal: Repository Cleanup"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 * * 0' # Weekly on Sunday at 03:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
name: Clean Merged Branches
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GA_TOKEN }}
|
||||
|
||||
- name: Delete merged branches
|
||||
env:
|
||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||
run: |
|
||||
echo "=== Merged Branch Cleanup ==="
|
||||
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||
|
||||
# List branches via API
|
||||
BRANCHES=$(curl -sS -H "Authorization: token ${GA_TOKEN}" \
|
||||
"${API}/branches?limit=50" | jq -r '.[].name')
|
||||
|
||||
DELETED=0
|
||||
for BRANCH in $BRANCHES; do
|
||||
# Skip protected branches
|
||||
case "$BRANCH" in
|
||||
main|master|develop|release/*|hotfix/*) continue ;;
|
||||
esac
|
||||
|
||||
# Check if branch is merged into main
|
||||
if git merge-base --is-ancestor "origin/${BRANCH}" origin/main 2>/dev/null; then
|
||||
echo " Deleting merged branch: ${BRANCH}"
|
||||
curl -sS -X DELETE -H "Authorization: token ${GA_TOKEN}" \
|
||||
"${API}/branches/${BRANCH}" 2>/dev/null || true
|
||||
DELETED=$((DELETED + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Deleted ${DELETED} merged branch(es)"
|
||||
|
||||
- name: Clean old workflow runs
|
||||
env:
|
||||
GA_TOKEN: ${{ secrets.GA_TOKEN }}
|
||||
run: |
|
||||
echo "=== Workflow Run Cleanup ==="
|
||||
API="${GITEA_URL}/api/v1/repos/${{ github.repository }}"
|
||||
CUTOFF=$(date -d "30 days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -v-30d +%Y-%m-%dT%H:%M:%SZ)
|
||||
|
||||
# Get old completed runs
|
||||
RUNS=$(curl -sS -H "Authorization: token ${GA_TOKEN}" \
|
||||
"${API}/actions/runs?status=completed&limit=50" | \
|
||||
jq -r ".workflow_runs[] | select(.created_at < \"${CUTOFF}\") | .id" 2>/dev/null)
|
||||
|
||||
DELETED=0
|
||||
for RUN_ID in $RUNS; do
|
||||
curl -sS -X DELETE -H "Authorization: token ${GA_TOKEN}" \
|
||||
"${API}/actions/runs/${RUN_ID}" 2>/dev/null || true
|
||||
DELETED=$((DELETED + 1))
|
||||
done
|
||||
|
||||
echo "Deleted ${DELETED} old workflow run(s)"
|
||||
@@ -0,0 +1,126 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Deploy
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API
|
||||
# PATH: /templates/workflows/joomla/deploy-manual.yml.template
|
||||
# VERSION: 04.07.00
|
||||
# BRIEF: Manual SFTP deploy to dev server for Joomla repos
|
||||
|
||||
name: "Universal: Deploy to Dev (Manual)"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
clear_remote:
|
||||
description: 'Delete all remote files before uploading'
|
||||
required: false
|
||||
default: 'false'
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: SFTP Deploy to Dev
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Setup PHP
|
||||
run: |
|
||||
php -v && composer --version
|
||||
|
||||
- name: Setup MokoStandards tools
|
||||
env:
|
||||
GA_TOKEN: ${{ secrets.GA_TOKEN || secrets.GA_TOKEN || github.token }}
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.GA_TOKEN || secrets.GA_TOKEN || github.token }}
|
||||
MOKO_CLONE_HOST: ${{ secrets.GA_TOKEN && 'git.mokoconsulting.tech/MokoConsulting' || 'github.com/mokoconsulting-tech' }}
|
||||
COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GA_TOKEN || github.token }}"}}'
|
||||
run: |
|
||||
git clone --depth 1 --branch main --quiet \
|
||||
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/MokoStandards-API.git" \
|
||||
/tmp/mokostandards-api 2>/dev/null || true
|
||||
if [ -d "/tmp/mokostandards-api" ] && [ -f "/tmp/mokostandards-api/composer.json" ]; then
|
||||
cd /tmp/mokostandards-api && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
||||
fi
|
||||
|
||||
- name: Check FTP configuration
|
||||
id: check
|
||||
env:
|
||||
HOST: ${{ vars.DEV_FTP_HOST }}
|
||||
PATH_VAR: ${{ vars.DEV_FTP_PATH }}
|
||||
PORT: ${{ vars.DEV_FTP_PORT }}
|
||||
run: |
|
||||
if [ -z "$HOST" ] || [ -z "$PATH_VAR" ]; then
|
||||
echo "DEV_FTP_HOST or DEV_FTP_PATH not configured -- cannot deploy"
|
||||
echo "skip=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
echo "skip=false" >> "$GITHUB_OUTPUT"
|
||||
echo "host=$HOST" >> "$GITHUB_OUTPUT"
|
||||
|
||||
REMOTE="${PATH_VAR%/}"
|
||||
echo "remote=$REMOTE" >> "$GITHUB_OUTPUT"
|
||||
|
||||
[ -z "$PORT" ] && PORT="22"
|
||||
echo "port=$PORT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Deploy via SFTP
|
||||
if: steps.check.outputs.skip != 'true'
|
||||
env:
|
||||
SFTP_KEY: ${{ secrets.DEV_FTP_KEY }}
|
||||
SFTP_PASS: ${{ secrets.DEV_FTP_PASSWORD }}
|
||||
SFTP_USER: ${{ vars.DEV_FTP_USERNAME }}
|
||||
run: |
|
||||
SOURCE_DIR="src"
|
||||
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
||||
[ ! -d "$SOURCE_DIR" ] && { echo "No src/ or htdocs/ -- nothing to deploy"; exit 0; }
|
||||
|
||||
printf '{"host":"%s","port":%s,"username":"%s","remotePath":"%s"' \
|
||||
"${{ steps.check.outputs.host }}" "${{ steps.check.outputs.port }}" "$SFTP_USER" "${{ steps.check.outputs.remote }}" \
|
||||
> /tmp/sftp-config.json
|
||||
|
||||
if [ -n "$SFTP_KEY" ]; then
|
||||
echo "$SFTP_KEY" > /tmp/deploy_key
|
||||
chmod 600 /tmp/deploy_key
|
||||
printf ',"privateKeyPath":"/tmp/deploy_key"}' >> /tmp/sftp-config.json
|
||||
else
|
||||
printf ',"password":"%s"}' "$SFTP_PASS" >> /tmp/sftp-config.json
|
||||
fi
|
||||
|
||||
DEPLOY_ARGS=(--path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json)
|
||||
[ "${{ inputs.clear_remote }}" = "true" ] && DEPLOY_ARGS+=(--clear-remote)
|
||||
|
||||
PLATFORM=$(php /tmp/mokostandards-api/cli/platform_detect.php --path . 2>/dev/null || true)
|
||||
if [ "$PLATFORM" = "waas-component" ] && [ -f "/tmp/mokostandards-api/deploy/deploy-joomla.php" ]; then
|
||||
php /tmp/mokostandards-api/deploy/deploy-joomla.php "${DEPLOY_ARGS[@]}"
|
||||
else
|
||||
php /tmp/mokostandards-api/deploy/deploy-sftp.php "${DEPLOY_ARGS[@]}"
|
||||
fi
|
||||
|
||||
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
||||
|
||||
- name: Summary
|
||||
if: always()
|
||||
run: |
|
||||
if [ "${{ steps.check.outputs.skip }}" = "true" ]; then
|
||||
echo "### Deploy Skipped -- FTP not configured" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "### Manual Dev Deploy Complete" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Host | \`${{ steps.check.outputs.host }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Remote | \`${{ steps.check.outputs.remote }}\` |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Clear | ${{ inputs.clear_remote }} |" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
@@ -0,0 +1,96 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Security
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards-API
|
||||
# PATH: /templates/workflows/gitleaks.yml.template
|
||||
# VERSION: 01.00.00
|
||||
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
|
||||
#
|
||||
# +========================================================================+
|
||||
# | SECRET SCANNING |
|
||||
# +========================================================================+
|
||||
# | |
|
||||
# | Scans commits for leaked secrets using Gitleaks. |
|
||||
# | |
|
||||
# | - PR scan: only new commits in the PR |
|
||||
# | - Scheduled: full repo scan weekly |
|
||||
# | - Alerts via ntfy on findings |
|
||||
# | |
|
||||
# +========================================================================+
|
||||
|
||||
name: "Universal: Secret Scanning"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 'dev/**'
|
||||
schedule:
|
||||
- cron: '0 5 * * 1' # Weekly Monday 05:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
|
||||
NTFY_TOPIC: ${{ vars.NTFY_TOPIC || 'gitea-security' }}
|
||||
|
||||
jobs:
|
||||
gitleaks:
|
||||
name: Gitleaks Secret Scan
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Gitleaks
|
||||
run: |
|
||||
GITLEAKS_VERSION="8.21.2"
|
||||
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
|
||||
| tar -xz -C /usr/local/bin gitleaks
|
||||
gitleaks version
|
||||
|
||||
- name: Scan for secrets
|
||||
id: scan
|
||||
run: |
|
||||
echo "### Secret Scanning" >> $GITHUB_STEP_SUMMARY
|
||||
ARGS="--source . --verbose --report-format json --report-path /tmp/gitleaks-report.json"
|
||||
|
||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||
# Scan only PR commits
|
||||
ARGS="$ARGS --log-opts=${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
|
||||
echo "Scanning PR commits only" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "Full repository scan" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
if gitleaks detect $ARGS 2>&1; then
|
||||
echo "result=clean" >> "$GITHUB_OUTPUT"
|
||||
echo "**No secrets detected.**" >> $GITHUB_STEP_SUMMARY
|
||||
else
|
||||
echo "result=found" >> "$GITHUB_OUTPUT"
|
||||
FINDINGS=$(jq length /tmp/gitleaks-report.json 2>/dev/null || echo "unknown")
|
||||
echo "**${FINDINGS} potential secret(s) detected.**" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Review the findings and rotate any exposed credentials immediately." >> $GITHUB_STEP_SUMMARY
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Notify on findings
|
||||
if: failure() && steps.scan.outputs.result == 'found'
|
||||
run: |
|
||||
REPO="${{ github.event.repository.name }}"
|
||||
curl -sS \
|
||||
-H "Title: ${REPO} — secrets detected in code" \
|
||||
-H "Tags: rotating_light,key" \
|
||||
-H "Priority: urgent" \
|
||||
-d "Gitleaks found potential secrets. Review and rotate credentials immediately." \
|
||||
"${NTFY_URL}/${NTFY_TOPIC}" || true
|
||||
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Automation
|
||||
# VERSION: 01.00.27
|
||||
# INGROUP: mokoplatform.Automation
|
||||
# VERSION: 01.02.00
|
||||
# BRIEF: Auto-create feature branch when an issue is opened
|
||||
|
||||
name: "Universal: Issue Branch"
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Notifications
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||
# PATH: /.gitea/workflows/notify.yml
|
||||
# VERSION: 01.00.00
|
||||
# BRIEF: Push notifications via ntfy on release success or workflow failure
|
||||
|
||||
name: "Universal: Notifications"
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- "Joomla Build & Release"
|
||||
- "Joomla Extension CI"
|
||||
- "Deploy"
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
|
||||
NTFY_TOPIC: ${{ vars.NTFY_TOPIC || 'gitea-releases' }}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
name: Send Notification
|
||||
runs-on: ubuntu-latest
|
||||
if: >-
|
||||
github.event.workflow_run.conclusion == 'success' ||
|
||||
github.event.workflow_run.conclusion == 'failure'
|
||||
|
||||
steps:
|
||||
- name: Notify on success (releases only)
|
||||
if: >-
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
contains(github.event.workflow_run.name, 'Release')
|
||||
run: |
|
||||
REPO="${{ github.event.repository.name }}"
|
||||
WORKFLOW="${{ github.event.workflow_run.name }}"
|
||||
URL="${{ github.event.workflow_run.html_url }}"
|
||||
|
||||
curl -sS \
|
||||
-H "Title: ${REPO} released" \
|
||||
-H "Tags: white_check_mark,package" \
|
||||
-H "Priority: default" \
|
||||
-H "Click: ${URL}" \
|
||||
-d "${WORKFLOW} completed successfully." \
|
||||
"${NTFY_URL}/${NTFY_TOPIC}"
|
||||
|
||||
- name: Notify on failure
|
||||
if: github.event.workflow_run.conclusion == 'failure'
|
||||
run: |
|
||||
REPO="${{ github.event.repository.name }}"
|
||||
WORKFLOW="${{ github.event.workflow_run.name }}"
|
||||
URL="${{ github.event.workflow_run.html_url }}"
|
||||
|
||||
curl -sS \
|
||||
-H "Title: ${REPO} workflow failed" \
|
||||
-H "Tags: x,warning" \
|
||||
-H "Priority: high" \
|
||||
-H "Click: ${URL}" \
|
||||
-d "${WORKFLOW} failed. Check the run for details." \
|
||||
"${NTFY_URL}/${NTFY_TOPIC}"
|
||||
+535
-508
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
||||
# INGROUP: mokoplatform.Release
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
|
||||
# PATH: /templates/workflows/universal/pre-release.yml.template
|
||||
# VERSION: 05.01.00
|
||||
# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch
|
||||
@@ -58,20 +58,26 @@ jobs:
|
||||
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }}
|
||||
|
||||
- name: Setup moko-platform tools
|
||||
- name: Setup mokoplatform tools
|
||||
env:
|
||||
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
||||
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
||||
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
|
||||
# Use pre-installed /opt/mokoplatform if available (updated by cron every 6h)
|
||||
if [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/cli/manifest_element.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
||||
echo Using pre-installed /opt/mokoplatform
|
||||
echo MOKO_CLI=/opt/mokoplatform/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/mokoplatform-api
|
||||
CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokoplatform.git
|
||||
git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokoplatform-api
|
||||
cd /tmp/mokoplatform-api && composer install --no-dev --no-interaction --quiet
|
||||
echo MOKO_CLI=/tmp/mokoplatform-api/cli >> $GITHUB_ENV
|
||||
fi
|
||||
rm -rf /tmp/moko-platform-api
|
||||
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
|
||||
id: platform
|
||||
@@ -111,6 +117,9 @@ jobs:
|
||||
--path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 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
|
||||
php ${MOKO_CLI}/manifest_licensing.php --path . --fix 2>/dev/null || true
|
||||
|
||||
# Append suffix for output
|
||||
if [ -n "$SUFFIX" ]; then
|
||||
VERSION="${VERSION}${SUFFIX}"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: moko-platform.Validation
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
|
||||
# INGROUP: mokoplatform.Validation
|
||||
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/mokoplatform
|
||||
# PATH: /templates/workflows/joomla/repo_health.yml.template
|
||||
# VERSION: 09.23.00
|
||||
# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts.
|
||||
@@ -296,17 +296,19 @@ jobs:
|
||||
missing_required=()
|
||||
missing_optional=()
|
||||
|
||||
# Source directory: src/ or htdocs/ (either is valid for extension repos)
|
||||
# Source directory: source/, src/, or htdocs/ (any is valid for extension repos)
|
||||
SOURCE_DIR=""
|
||||
if [ -d "src" ]; then
|
||||
if [ -d "source" ]; then
|
||||
SOURCE_DIR="source"
|
||||
elif [ -d "src" ]; then
|
||||
SOURCE_DIR="src"
|
||||
elif [ -d "htdocs" ]; then
|
||||
SOURCE_DIR="htdocs"
|
||||
elif [ -d "deploy" ] || [ -d "cli" ] || [ -d "monitoring" ]; then
|
||||
# Platform/tooling repos don't need src/
|
||||
# Platform/tooling repos don't need source/
|
||||
SOURCE_DIR=""
|
||||
else
|
||||
missing_required+=("src/ or htdocs/ (source directory required)")
|
||||
missing_required+=("source/ or src/ or htdocs/ (source directory required)")
|
||||
fi
|
||||
|
||||
for item in "${required_artifacts[@]}"; do
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# FILE INFORMATION
|
||||
# DEFGROUP: Gitea.Workflow
|
||||
# INGROUP: MokoStandards.Security
|
||||
# REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards
|
||||
# PATH: /.gitea/workflows/security-audit.yml
|
||||
# VERSION: 01.00.00
|
||||
# BRIEF: Dependency vulnerability scanning for composer and npm packages
|
||||
|
||||
name: "Universal: Security Audit"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 6 * * 1' # Weekly on Monday at 06:00 UTC
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'composer.json'
|
||||
- 'composer.lock'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
|
||||
NTFY_TOPIC: ${{ vars.NTFY_TOPIC || 'gitea-security' }}
|
||||
|
||||
jobs:
|
||||
audit:
|
||||
name: Dependency Audit
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Composer audit
|
||||
if: hashFiles('composer.lock') != ''
|
||||
run: |
|
||||
echo "=== Composer Security Audit ==="
|
||||
if ! command -v composer &> /dev/null; then
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq php-cli composer >/dev/null 2>&1
|
||||
fi
|
||||
composer audit --format=plain 2>&1 | tee /tmp/composer-audit.txt
|
||||
RESULT=$?
|
||||
if [ $RESULT -ne 0 ]; then
|
||||
echo "::warning::Composer vulnerabilities found"
|
||||
echo "composer_vulnerable=true" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "No known vulnerabilities in composer dependencies"
|
||||
fi
|
||||
|
||||
- name: NPM audit
|
||||
if: hashFiles('package-lock.json') != ''
|
||||
run: |
|
||||
echo "=== NPM Security Audit ==="
|
||||
npm audit --production 2>&1 | tee /tmp/npm-audit.txt || true
|
||||
if npm audit --production 2>&1 | grep -q "found 0 vulnerabilities"; then
|
||||
echo "No known vulnerabilities in npm dependencies"
|
||||
else
|
||||
echo "::warning::NPM vulnerabilities found"
|
||||
echo "npm_vulnerable=true" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Notify on vulnerabilities
|
||||
if: env.composer_vulnerable == 'true' || env.npm_vulnerable == 'true'
|
||||
run: |
|
||||
REPO="${{ github.event.repository.name }}"
|
||||
curl -sS \
|
||||
-H "Title: ${REPO} has vulnerable dependencies" \
|
||||
-H "Tags: lock,warning" \
|
||||
-H "Priority: high" \
|
||||
-d "Security audit found vulnerabilities. Review dependency updates." \
|
||||
"${NTFY_URL}/${NTFY_TOPIC}" || true
|
||||
@@ -0,0 +1,312 @@
|
||||
# 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
|
||||
# Always fetch latest CLI tools — never use stale cache from previous runs
|
||||
rm -rf /tmp/moko-platform
|
||||
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
|
||||
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")
|
||||
|
||||
# Strip any existing suffix before applying stability
|
||||
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
||||
|
||||
# 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
|
||||
+53
-19
@@ -1,18 +1,37 @@
|
||||
# Changelog
|
||||
|
||||
<!-- VERSION: 01.00.27 -->
|
||||
|
||||
All notable changes to MokoJoomCross will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
|
||||
<!-- VERSION: 01.02.00 -->
|
||||
|
||||
All notable changes to MokoSuiteCross will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
|
||||
## [01.02.00] --- 2026-06-21
|
||||
|
||||
### Changed
|
||||
- **Rebrand complete**: All 1,151 language key references renamed from `MOKOJOOMCROSS` to `MOKOSUITECROSS` across .ini, .xml, and .php files
|
||||
- **Event names**: All Joomla events renamed from `onMokoJoomCross*` to `onMokoSuiteCross*`
|
||||
- **Telegram default bot**: Updated from @MokoWaaSBot to @mokosuite_bot with obfuscated embedded token
|
||||
- **Branding**: All `MokoWaaS` references updated to `MokoSuite` across codebase, wiki, and docs
|
||||
- **Wiki**: Reorganized into folder structure (getting-started/, user-guide/, services/, developer/)
|
||||
- **README**: Updated with all 36 implemented service plugins and current feature list
|
||||
- **PR workflow**: Added README/CHANGELOG diff check — blocks PRs that modify source without updating CHANGELOG
|
||||
|
||||
### Fixed
|
||||
- **SendGrid**: Removed duplicate `curl_setopt_array` with undefined `$token` variable in `publish()`
|
||||
- **Reddit**: Removed duplicate `curl_setopt_array` with undefined `$token` variable in `publish()`
|
||||
- **TikTok**: Removed duplicate `curl_setopt_array` in `publish()`
|
||||
- **Pinterest**: Removed duplicate `curl_setopt_array` in `publish()`
|
||||
- **Telegram**: Added missing `<config>` section to plugin XML for parse_mode and disable_preview settings
|
||||
|
||||
### Fixed (previous)
|
||||
- **C-1 OauthController**: Added CSRF nonce validation to OAuth callback — session-based nonce is generated during `authorize()`, embedded in the state parameter, and verified in `callback()` to prevent CSRF attacks
|
||||
- **C-2 DispatchController**: Added POST method enforcement — rejects non-POST requests with 405 status
|
||||
- **C-5 ServiceModel**: Credential form fields (`cred_*`) are now collected into the `credentials` JSON column on save, and expanded back into individual fields on load — previously these fields were silently discarded
|
||||
- **H-1 Event pattern**: Fixed Joomla 5 SubscriberInterface incompatibility where `onMokoJoomCrossGetServices` by-reference pattern silently lost all service plugins — dispatchers now read plugin instances from Event ArrayAccess indices after dispatch
|
||||
- **H-1 Event pattern**: Fixed Joomla 5 SubscriberInterface incompatibility where `onMokoSuiteCrossGetServices` by-reference pattern silently lost all service plugins — dispatchers now read plugin instances from Event ArrayAccess indices after dispatch
|
||||
- **H-4 ServiceTable**: Added `check()` method with alias generation, required field validation (title, service_type), timestamp management, and JSON defaults for credentials/params
|
||||
- **H-9 WebhookService**: Fixed credential key mismatch — `publish()` and `validateCredentials()` now use keys matching the service.xml form fields (`url`, `method`, `auth_type`, `bearer_token`, `basic_username`, `basic_password`, `content_type`) and properly apply Bearer/Basic auth headers
|
||||
- **M-4 ServiceIconHelper**: Escaped `$extraClass` parameter in `renderIcon()` with `htmlspecialchars()` to prevent XSS
|
||||
@@ -41,17 +60,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- **Service Stats drill-down**: New `servicestats` view with per-service analytics — post counts, success rate, daily trend chart, recent posts table, and top articles list
|
||||
- **Dashboard service links**: Service breakdown table rows now link to the per-service stats view with service type icons
|
||||
- **Posts list icons**: Service type column in the posts list now shows the service icon
|
||||
- **Category routing rules**: New `#__mokojoomcross_category_rules` table to whitelist services per Joomla category — if rules exist for a category, only those services receive posts; no rules = all services (backward compatible)
|
||||
- **Category routing rules**: New `#__mokosuitecross_category_rules` table to whitelist services per Joomla category — if rules exist for a category, only those services receive posts; no rules = all services (backward compatible)
|
||||
- **CrossPostDispatcher**: Category rule filtering integrated before per-article service filter in the dispatch loop
|
||||
- **Template editor**: Live character counter below template body textarea with platform-aware limits (green/yellow/red badges)
|
||||
- **Template editor**: Added `{tags}`, `{hashtags}`, and `{field:xxx}` rows to the placeholder reference table
|
||||
- **Content plugin**: Cross-post history panel in article editor showing last 10 posts with status badges, service names, timestamps, and error messages
|
||||
- **Config**: New "Category Rules" fieldset with explanatory note about the feature
|
||||
|
||||
- **CrossPostDispatcher**: New static helper (`com_mokojoomcross/Helper/CrossPostDispatcher`) centralising dispatch logic for reuse by all source plugins
|
||||
- **CrossPostDispatcher**: New static helper (`com_mokosuitecross/Helper/CrossPostDispatcher`) centralising dispatch logic for reuse by all source plugins
|
||||
- **Content plugin**: Added `onContentAfterSave` and `onContentChangeState` handlers with Joomla 5/6 event compatibility, dispatching via `CrossPostDispatcher`
|
||||
- **plg_system_mokojoomcross_events**: New source plugin for MokoJoomCalendar — cross-posts calendar events when published
|
||||
- **plg_system_mokojoomcross_gallery**: New source plugin for MokoJoomGallery — cross-posts galleries and images when published
|
||||
- **plg_system_mokosuitecross_events**: New source plugin for MokoSuiteCalendar — cross-posts calendar events when published
|
||||
- **plg_system_mokosuitecross_gallery**: New source plugin for MokoSuiteGallery — cross-posts galleries and images when published
|
||||
|
||||
- **Credential fields**: Added fields for 19 previously missing services (Pinterest, Tumblr, TikTok, Nostr, ActivityPub, Brevo, ConvertKit, Constant Contact, Hashnode, Blogger, Google Business, RSS Feed config)
|
||||
- **Twitter**: Access Token and Access Token Secret fields for OAuth 1.0a
|
||||
@@ -80,7 +99,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- **Posts service filter**: SQL-driven service dropdown filter in posts list, plus search filter by article title or message content
|
||||
- **CSV export**: "Export CSV" toolbar button on posts list to download filtered post data as CSV
|
||||
- **WordPress canonical URL**: WordPress cross-posts now include an "Originally published at" source link appended to content with the Joomla article URL
|
||||
- **REST API dispatch endpoint**: `POST /api/v1/mokojoomcross/dispatch` — trigger cross-posts for an article via API with optional service filtering, duplicate guard, and template rendering
|
||||
- **REST API dispatch endpoint**: `POST /api/v1/mokosuitecross/dispatch` — trigger cross-posts for an article via API with optional service filtering, duplicate guard, and template rendering
|
||||
|
||||
|
||||
### Added (original)
|
||||
@@ -90,8 +109,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- System plugin hooks `onContentAfterSave` and `onContentChangeState`
|
||||
- Duplicate guard prevents re-posting to services that already received an article
|
||||
- Message template rendering with 8 placeholders: `{title}`, `{url}`, `{introtext}`, `{fulltext}`, `{image}`, `{category}`, `{author}`, `{date}`
|
||||
- Custom `mokojoomcross` plugin group for extensible service architecture
|
||||
- `MokoJoomCrossServiceInterface` contract for all service plugins
|
||||
- Custom `mokosuitecross` plugin group for extensible service architecture
|
||||
- `MokoSuiteCrossServiceInterface` contract for all service plugins
|
||||
|
||||
#### Admin Component (5 views)
|
||||
- **Dashboard** — summary cards, posts-by-service analytics with success rates, top cross-posted articles, recent activity feed, PP Pro migration banner, page-load processing warning
|
||||
@@ -101,7 +120,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- **Activity Logs** — list with level badges (info/warning/error), service column, context data, level and search filters
|
||||
|
||||
#### Queue Processing (3 methods)
|
||||
- Joomla Scheduled Task plugin (`plg_task_mokojoomcross`) — preferred, processes 20 posts per run
|
||||
- Joomla Scheduled Task plugin (`plg_task_mokosuitecross`) — preferred, processes 20 posts per run
|
||||
- Page-load fallback via system plugin `onAfterRender` — configurable throttle interval, backend/frontend/both
|
||||
- Shared `QueueProcessor` helper with DB lock to prevent concurrent execution
|
||||
- Failed post retry with configurable max retries and exponential delay
|
||||
@@ -129,7 +148,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
#### Service Plugins (34 platforms)
|
||||
|
||||
**Social Media (12)**
|
||||
- Facebook / Meta — Graph API v19.0, default MokoWaaS app mode, page feed posting
|
||||
- Facebook / Meta — Graph API v19.0, default MokoSuite app mode, page feed posting
|
||||
- X / Twitter — API v2, OAuth 2.0 Bearer Token, 280 char limit
|
||||
- LinkedIn — Share API v2, organization + personal profile, 3000 char limit
|
||||
- Mastodon — API v1, multi-instance, hashtags, 500 char limit
|
||||
@@ -143,9 +162,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- ActivityPub — generic Fediverse (Pleroma, Akkoma, Misskey, Pixelfed)
|
||||
|
||||
**Chat / Messaging (8)**
|
||||
- Telegram — Bot API, default @MokoWaaSBot + custom bot, HTML/Markdown, 4096 chars
|
||||
- Discord — Webhooks, default MokoWaaS webhook mode, embeds, 2000 chars
|
||||
- Slack — Incoming Webhooks, default MokoWaaS webhook mode, Block Kit
|
||||
- Telegram — Bot API, default @mokosuite_bot + custom bot, HTML/Markdown, 4096 chars
|
||||
- Discord — Webhooks, default MokoSuite webhook mode, embeds, 2000 chars
|
||||
- Slack — Incoming Webhooks, default MokoSuite webhook mode, Block Kit
|
||||
- Microsoft Teams — Incoming Webhooks, default mode, Adaptive Cards
|
||||
- Google Chat — Webhook API, card formatting
|
||||
- WhatsApp Business — Meta Cloud API, template + free-form messages
|
||||
@@ -196,6 +215,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||
- Windows Terminal profile in Joomla dropdown
|
||||
|
||||
|
||||
## [01.01.00] - 2026-06-19
|
||||
|
||||
### Added
|
||||
- Initial package structure with component, system plugin, content plugin, and webservices plugin
|
||||
- Admin component with dashboard, post queue, services management, and activity logs
|
||||
- System plugin triggering cross-post on article publish via `onContentAfterSave`
|
||||
- Content plugin adding cross-post controls to article editor
|
||||
- WebServices API plugin with REST endpoints for posts and services
|
||||
- Custom `mokosuitecross` plugin group for extensible service architecture
|
||||
- Service plugins: Facebook, X/Twitter, LinkedIn, Mastodon, Bluesky, Mailchimp, Telegram, Discord, Slack
|
||||
- Database tables: services, posts, templates, logs
|
||||
- Perfect Publisher Pro migration tool in installer script
|
||||
- Message template system with per-platform placeholders
|
||||
- Post queue with scheduled posting, retry logic, and delivery tracking
|
||||
|
||||
## [01.00] - 2026-05-28
|
||||
|
||||
### Added
|
||||
|
||||
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code when working with this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
**MokoJoomCross** -- Cross-posting Joomla content to social media, email marketing, and chat platforms
|
||||
**MokoSuiteCross** -- Cross-posting Joomla content to social media, email marketing, and chat platforms
|
||||
|
||||
| Field | Value |
|
||||
|---|---|
|
||||
@@ -12,7 +12,7 @@ This file provides guidance to Claude Code when working with this repository.
|
||||
| **Language** | PHP |
|
||||
| **Default branch** | main |
|
||||
| **License** | GPL-3.0-or-later |
|
||||
| **Wiki** | [MokoJoomCross Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomCross/wiki) |
|
||||
| **Wiki** | [MokoSuiteCross Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/wiki) |
|
||||
| **Standards** | [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) |
|
||||
|
||||
## Common Commands
|
||||
@@ -32,60 +32,60 @@ composer install # Install PHP dependencies
|
||||
|
||||
## Architecture
|
||||
|
||||
This is a Joomla **package** extension (`pkg_mokojoomcross`) containing sub-extensions:
|
||||
This is a Joomla **package** extension (`pkg_mokosuitecross`) containing sub-extensions:
|
||||
|
||||
### com_mokojoomcross (Component)
|
||||
### com_mokosuitecross (Component)
|
||||
- Admin backend for managing services, post queue, templates, and logs
|
||||
- Joomla 5/6 MVC: Dashboard, Services, Posts, Logs (list/edit each)
|
||||
- Namespace: `Joomla\Component\MokoJoomCross\Administrator`
|
||||
- Database tables: `#__mokojoomcross_services`, `#__mokojoomcross_posts`, `#__mokojoomcross_templates`, `#__mokojoomcross_logs`
|
||||
- Namespace: `Joomla\Component\MokoSuiteCross\Administrator`
|
||||
- Database tables: `#__mokosuitecross_services`, `#__mokosuitecross_posts`, `#__mokosuitecross_templates`, `#__mokosuitecross_logs`
|
||||
|
||||
### plg_system_mokojoomcross (System Plugin)
|
||||
### plg_system_mokosuitecross (System Plugin)
|
||||
- Hooks `onContentAfterSave` to trigger cross-posting when articles are published
|
||||
- Dispatches to registered service plugins via the `mokojoomcross` plugin group
|
||||
- Namespace: `Joomla\Plugin\System\MokoJoomCross`
|
||||
- Dispatches to registered service plugins via the `mokosuitecross` plugin group
|
||||
- Namespace: `Joomla\Plugin\System\MokoSuiteCross`
|
||||
|
||||
### plg_content_mokojoomcross (Content Plugin)
|
||||
### plg_content_mokosuitecross (Content Plugin)
|
||||
- Hooks `onContentBeforeDisplay` to add cross-post status badges to articles
|
||||
- Namespace: `Joomla\Plugin\Content\MokoJoomCross`
|
||||
- Namespace: `Joomla\Plugin\Content\MokoSuiteCross`
|
||||
|
||||
### plg_webservices_mokojoomcross (WebServices Plugin)
|
||||
### plg_webservices_mokosuitecross (WebServices Plugin)
|
||||
- REST API endpoints for posts and services
|
||||
- Namespace: `Joomla\Plugin\WebServices\MokoJoomCross`
|
||||
- Namespace: `Joomla\Plugin\WebServices\MokoSuiteCross`
|
||||
|
||||
### Service Plugins (mokojoomcross group)
|
||||
Each platform is a separate plugin in the custom `mokojoomcross` plugin group:
|
||||
- `plg_mokojoomcross_facebook` — Facebook/Meta Graph API
|
||||
- `plg_mokojoomcross_twitter` — X/Twitter API v2
|
||||
- `plg_mokojoomcross_linkedin` — LinkedIn Share API
|
||||
- `plg_mokojoomcross_mastodon` — Mastodon API
|
||||
- `plg_mokojoomcross_bluesky` — Bluesky AT Protocol
|
||||
- `plg_mokojoomcross_mailchimp` — Mailchimp Campaigns API
|
||||
- `plg_mokojoomcross_telegram` — Telegram Bot API (default @MokoWaaSBot + custom bot)
|
||||
- `plg_mokojoomcross_discord` — Discord Webhooks
|
||||
- `plg_mokojoomcross_slack` — Slack Incoming Webhooks
|
||||
### Service Plugins (mokosuitecross group)
|
||||
Each platform is a separate plugin in the custom `mokosuitecross` plugin group:
|
||||
- `plg_mokosuitecross_facebook` — Facebook/Meta Graph API
|
||||
- `plg_mokosuitecross_twitter` — X/Twitter API v2
|
||||
- `plg_mokosuitecross_linkedin` — LinkedIn Share API
|
||||
- `plg_mokosuitecross_mastodon` — Mastodon API
|
||||
- `plg_mokosuitecross_bluesky` — Bluesky AT Protocol
|
||||
- `plg_mokosuitecross_mailchimp` — Mailchimp Campaigns API
|
||||
- `plg_mokosuitecross_telegram` — Telegram Bot API (default @mokosuite_bot + custom bot)
|
||||
- `plg_mokosuitecross_discord` — Discord Webhooks
|
||||
- `plg_mokosuitecross_slack` — Slack Incoming Webhooks
|
||||
|
||||
### Database Schema
|
||||
|
||||
Four tables:
|
||||
|
||||
`#__mokojoomcross_services`:
|
||||
`#__mokosuitecross_services`:
|
||||
- `id`, `title`, `alias`, `service_type` (facebook, twitter, etc.)
|
||||
- `credentials` (JSON encrypted), `params` (JSON)
|
||||
- `published`, `ordering`, `created`, `modified`, `created_by`
|
||||
|
||||
`#__mokojoomcross_posts`:
|
||||
`#__mokosuitecross_posts`:
|
||||
- `id`, `article_id` (FK to #__content), `service_id` (FK)
|
||||
- `status` (queued/posting/posted/failed/scheduled)
|
||||
- `message`, `platform_post_id`, `platform_response` (JSON)
|
||||
- `scheduled_at`, `posted_at`, `retry_count`
|
||||
- `created`, `modified`
|
||||
|
||||
`#__mokojoomcross_templates`:
|
||||
`#__mokosuitecross_templates`:
|
||||
- `id`, `service_type`, `title`, `template_body`
|
||||
- `published`, `ordering`, `created`, `modified`
|
||||
|
||||
`#__mokojoomcross_logs`:
|
||||
`#__mokosuitecross_logs`:
|
||||
- `id`, `post_id` (FK), `service_id` (FK)
|
||||
- `level` (info/warning/error), `message`, `context` (JSON)
|
||||
- `created`
|
||||
@@ -109,4 +109,4 @@ Four tables:
|
||||
- `bind() → check() → store()` for Table operations (not `save()`)
|
||||
- Language file placement: site (no `folder`) vs admin (`folder="administrator"`)
|
||||
- SPDX license headers on all PHP files
|
||||
- Service plugins MUST implement `MokoJoomCrossServiceInterface`
|
||||
- Service plugins MUST implement `MokoSuiteCrossServiceInterface`
|
||||
|
||||
+161
-161
@@ -1,161 +1,161 @@
|
||||
# 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>*
|
||||
# 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>*
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# MokoJoomCross — Cross-posting Joomla content to social media, email marketing, and chat platforms
|
||||
# MokoSuiteCross — Cross-posting Joomla content to social media, email marketing, and chat platforms
|
||||
|
||||
# ==============================================================================
|
||||
# CONFIGURATION - Customize these for your extension
|
||||
# ==============================================================================
|
||||
|
||||
# Extension Configuration
|
||||
EXTENSION_NAME := mokojoomcross
|
||||
EXTENSION_NAME := mokosuitecross
|
||||
EXTENSION_TYPE := package
|
||||
# Options: module, plugin, component, package, template
|
||||
EXTENSION_VERSION := 1.0.0
|
||||
|
||||
@@ -1,50 +1,99 @@
|
||||
# MokoJoomCross
|
||||
# MokoSuiteCross
|
||||
|
||||
<!-- VERSION: 01.00.27 -->
|
||||
<!-- VERSION: 01.02.00 -->
|
||||
|
||||
Cross-posting Joomla content to social media, email marketing, and chat platforms for Joomla 5/6.
|
||||
|
||||
## Overview
|
||||
|
||||
MokoJoomCross automatically publishes your Joomla articles to multiple platforms when you hit publish. Connect your social media accounts, email marketing tools, and chat channels — then cross-post with one click. Each platform is a separate plugin, so you only install what you need and third-party developers can add new services.
|
||||
MokoSuiteCross automatically publishes your Joomla articles to multiple platforms when you hit publish. Connect your social media accounts, email marketing tools, and chat channels — then cross-post with one click. Each platform is a separate plugin, so you only install what you need and third-party developers can add new services.
|
||||
|
||||
## Features
|
||||
|
||||
- **One-click cross-posting** — Publish to all connected platforms when an article goes live
|
||||
- **Plugin-based services** — Each platform is a separate plugin; install only what you need
|
||||
- **Default bot mode** — Pre-configured bots for Telegram (@mokosuite_bot), Discord, and Slack — just add your channel
|
||||
- **Post queue** — Scheduled posting, retry on failure, detailed delivery logs
|
||||
- **Message templates** — Customize post format per platform with placeholders ({title}, {url}, {intro}, {image})
|
||||
- **Message templates** — Customize post format per platform with placeholders ({title}, {url}, {intro}, {image}, {tags}, {field:xxx})
|
||||
- **Post history** — Track what was posted where, with platform response data
|
||||
- **Evergreen re-sharing** — Automatically re-share articles on a configurable interval
|
||||
- **Category routing** — Route articles to specific services by Joomla category
|
||||
- **Migration** — Import settings from Perfect Publisher Pro
|
||||
- **REST API** — WebServices plugin for headless/external integration
|
||||
|
||||
### Supported Platforms
|
||||
### Supported Platforms (36)
|
||||
|
||||
#### Social Media
|
||||
| Platform | Plugin | Status |
|
||||
|----------|--------|--------|
|
||||
| Facebook / Meta | `plg_mokojoomcross_facebook` | Planned |
|
||||
| X / Twitter | `plg_mokojoomcross_twitter` | Planned |
|
||||
| LinkedIn | `plg_mokojoomcross_linkedin` | Planned |
|
||||
| Mastodon | `plg_mokojoomcross_mastodon` | Planned |
|
||||
| Bluesky | `plg_mokojoomcross_bluesky` | Planned |
|
||||
| Mailchimp | `plg_mokojoomcross_mailchimp` | Planned |
|
||||
| Telegram | `plg_mokojoomcross_telegram` | Planned |
|
||||
| Discord | `plg_mokojoomcross_discord` | Planned |
|
||||
| Slack | `plg_mokojoomcross_slack` | Planned |
|
||||
| Facebook / Meta | `plg_mokosuitecross_facebook` | Implemented |
|
||||
| X / Twitter | `plg_mokosuitecross_twitter` | Implemented |
|
||||
| LinkedIn | `plg_mokosuitecross_linkedin` | Implemented |
|
||||
| Mastodon | `plg_mokosuitecross_mastodon` | Implemented |
|
||||
| Bluesky | `plg_mokosuitecross_bluesky` | Implemented |
|
||||
| Threads | `plg_mokosuitecross_threads` | Implemented |
|
||||
| Pinterest | `plg_mokosuitecross_pinterest` | Implemented |
|
||||
| Reddit | `plg_mokosuitecross_reddit` | Implemented |
|
||||
| TikTok | `plg_mokosuitecross_tiktok` | Implemented |
|
||||
| Tumblr | `plg_mokosuitecross_tumblr` | Implemented |
|
||||
|
||||
#### Email Marketing
|
||||
| Platform | Plugin | Status |
|
||||
|----------|--------|--------|
|
||||
| Mailchimp | `plg_mokosuitecross_mailchimp` | Implemented |
|
||||
| SendGrid | `plg_mokosuitecross_sendgrid` | Implemented |
|
||||
| Brevo | `plg_mokosuitecross_brevo` | Implemented |
|
||||
| Constant Contact | `plg_mokosuitecross_constantcontact` | Implemented |
|
||||
| ConvertKit | `plg_mokosuitecross_convertkit` | Implemented |
|
||||
|
||||
#### Chat / Messaging
|
||||
| Platform | Plugin | Status |
|
||||
|----------|--------|--------|
|
||||
| Telegram | `plg_mokosuitecross_telegram` | Implemented |
|
||||
| Discord | `plg_mokosuitecross_discord` | Implemented |
|
||||
| Slack | `plg_mokosuitecross_slack` | Implemented |
|
||||
| Microsoft Teams | `plg_mokosuitecross_teams` | Implemented |
|
||||
| WhatsApp | `plg_mokosuitecross_whatsapp` | Implemented |
|
||||
| Google Chat | `plg_mokosuitecross_googlechat` | Implemented |
|
||||
| Matrix | `plg_mokosuitecross_matrix` | Implemented |
|
||||
| Ntfy | `plg_mokosuitecross_ntfy` | Implemented |
|
||||
|
||||
#### Publishing Platforms
|
||||
| Platform | Plugin | Status |
|
||||
|----------|--------|--------|
|
||||
| WordPress | `plg_mokosuitecross_wordpress` | Implemented |
|
||||
| Medium | `plg_mokosuitecross_medium` | Implemented |
|
||||
| Dev.to | `plg_mokosuitecross_devto` | Implemented |
|
||||
| Ghost | `plg_mokosuitecross_ghost` | Implemented |
|
||||
| Hashnode | `plg_mokosuitecross_hashnode` | Implemented |
|
||||
| Blogger | `plg_mokosuitecross_blogger` | Implemented |
|
||||
|
||||
#### Other
|
||||
| Platform | Plugin | Status |
|
||||
|----------|--------|--------|
|
||||
| Webhook | `plg_mokosuitecross_webhook` | Implemented |
|
||||
| RSS Feed | `plg_mokosuitecross_rssfeed` | Implemented |
|
||||
| ActivityPub | `plg_mokosuitecross_activitypub` | Implemented |
|
||||
| Google Business | `plg_mokosuitecross_googlebusiness` | Implemented |
|
||||
| Nostr | `plg_mokosuitecross_nostr` | Stub (WebSocket deferred) |
|
||||
|
||||
## Installation
|
||||
|
||||
1. Download the latest `pkg_mokojoomcross-*.zip` from [Releases](https://git.mokoconsulting.tech/MokoConsulting/MokoJoomCross/releases)
|
||||
1. Download the latest `pkg_mokosuitecross-*.zip` from [Releases](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/releases)
|
||||
2. In Joomla Administrator → Extensions → Install → Upload Package File
|
||||
3. System and content plugins are enabled automatically on install
|
||||
4. Navigate to Components → MokoJoomCross to connect your first service
|
||||
4. Navigate to Components → MokoSuiteCross to connect your first service
|
||||
|
||||
## Documentation
|
||||
|
||||
See the [Wiki](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/wiki) for full documentation.
|
||||
|
||||
## Migrating from Perfect Publisher Pro
|
||||
|
||||
MokoJoomCross includes a built-in migration tool:
|
||||
MokoSuiteCross includes a built-in migration tool:
|
||||
|
||||
1. Install MokoJoomCross (Perfect Publisher Pro can remain installed)
|
||||
2. Navigate to Components → MokoJoomCross → Dashboard
|
||||
1. Install MokoSuiteCross (Perfect Publisher Pro can remain installed)
|
||||
2. Navigate to Components → MokoSuiteCross → Dashboard
|
||||
3. Click "Migrate from Perfect Publisher Pro"
|
||||
4. Review detected services and confirm import
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "mokoconsulting/mokojoomcross",
|
||||
"name": "mokoconsulting/mokosuitecross",
|
||||
"description": "Cross-posting Joomla content to social media, email marketing, and chat platforms",
|
||||
"type": "joomla-package",
|
||||
"version": "01.00.00",
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
; MokoSuiteCross - Package System Language File
|
||||
; Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
; License: GPL-3.0-or-later
|
||||
|
||||
PKG_MOKOSUITECROSS="MokoSuiteCross"
|
||||
PKG_MOKOSUITECROSS_DESCRIPTION="Cross-posting Joomla content to social media, email marketing, and chat platforms. Automatically publish articles to Facebook, X/Twitter, LinkedIn, Mastodon, Bluesky, Mailchimp, Telegram, Discord, and Slack."
|
||||
PKG_MOKOSUITECROSS_PHP_VERSION_ERROR="MokoSuiteCross requires PHP %s or later."
|
||||
PKG_MOKOSUITECROSS_MIGRATION_DETECTED="Perfect Publisher Pro detected! Navigate to Components → MokoSuiteCross → Dashboard to migrate your settings."
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<access component="com_mokojoomcross">
|
||||
<access component="com_mokosuitecross">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" />
|
||||
<action name="core.options" title="JACTION_OPTIONS" />
|
||||
@@ -8,7 +8,7 @@
|
||||
<action name="core.delete" title="JACTION_DELETE" />
|
||||
<action name="core.edit" title="JACTION_EDIT" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" />
|
||||
<action name="mokojoomcross.crosspost" title="COM_MOKOJOOMCROSS_ACTION_CROSSPOST" />
|
||||
<action name="mokojoomcross.migrate" title="COM_MOKOJOOMCROSS_ACTION_MIGRATE" />
|
||||
<action name="mokosuitecross.crosspost" title="COM_MOKOSUITECROSS_ACTION_CROSSPOST" />
|
||||
<action name="mokosuitecross.migrate" title="COM_MOKOSUITECROSS_ACTION_MIGRATE" />
|
||||
</section>
|
||||
</access>
|
||||
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config>
|
||||
<fieldset name="component" label="COM_MOKOSUITECROSS_CONFIG_COMPONENT">
|
||||
<field
|
||||
name="auto_post_on_publish"
|
||||
type="radio"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_AUTO_POST"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_AUTO_POST_DESC"
|
||||
default="1"
|
||||
class="btn-group">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="post_on_first_publish_only"
|
||||
type="radio"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_FIRST_PUBLISH_ONLY"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_FIRST_PUBLISH_ONLY_DESC"
|
||||
default="0"
|
||||
class="btn-group"
|
||||
showon="auto_post_on_publish:1">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="retry_max"
|
||||
type="number"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_RETRY_MAX"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_RETRY_MAX_DESC"
|
||||
default="3"
|
||||
min="0"
|
||||
max="10"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="retry_delay"
|
||||
type="number"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_RETRY_DELAY"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_RETRY_DELAY_DESC"
|
||||
default="300"
|
||||
min="60"
|
||||
max="3600"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="log_retention_days"
|
||||
type="number"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_LOG_RETENTION"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_LOG_RETENTION_DESC"
|
||||
default="90"
|
||||
min="7"
|
||||
max="365"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="default_template"
|
||||
type="textarea"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_DEFAULT_TEMPLATE"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_DEFAULT_TEMPLATE_DESC"
|
||||
default="{title}\n\n{introtext}\n\n{url}"
|
||||
rows="4"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="evergreen" label="COM_MOKOSUITECROSS_CONFIG_EVERGREEN">
|
||||
<field
|
||||
name="evergreen_enabled"
|
||||
type="radio"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_EVERGREEN_ENABLED"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_EVERGREEN_ENABLED_DESC"
|
||||
default="1"
|
||||
class="btn-group">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="evergreen_default_interval"
|
||||
type="number"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_EVERGREEN_DEFAULT_INTERVAL"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_EVERGREEN_DEFAULT_INTERVAL_DESC"
|
||||
default="30"
|
||||
min="1"
|
||||
max="365"
|
||||
showon="evergreen_enabled:1"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="evergreen_max_per_run"
|
||||
type="number"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_EVERGREEN_MAX_PER_RUN"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_EVERGREEN_MAX_PER_RUN_DESC"
|
||||
default="3"
|
||||
min="1"
|
||||
max="20"
|
||||
showon="evergreen_enabled:1"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="queue" label="COM_MOKOSUITECROSS_CONFIG_QUEUE">
|
||||
<field
|
||||
name="queue_processing"
|
||||
type="list"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_QUEUE_PROCESSING"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_QUEUE_PROCESSING_DESC"
|
||||
default="scheduler">
|
||||
<option value="scheduler">COM_MOKOSUITECROSS_CONFIG_QUEUE_SCHEDULER</option>
|
||||
<option value="pageload">COM_MOKOSUITECROSS_CONFIG_QUEUE_PAGELOAD</option>
|
||||
<option value="both">COM_MOKOSUITECROSS_CONFIG_QUEUE_BOTH</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="pageload_client"
|
||||
type="list"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_PAGELOAD_CLIENT"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_PAGELOAD_CLIENT_DESC"
|
||||
default="both"
|
||||
showon="queue_processing:pageload,both">
|
||||
<option value="both">COM_MOKOSUITECROSS_CONFIG_PAGELOAD_BOTH</option>
|
||||
<option value="admin">COM_MOKOSUITECROSS_CONFIG_PAGELOAD_ADMIN</option>
|
||||
<option value="site">COM_MOKOSUITECROSS_CONFIG_PAGELOAD_SITE</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="pageload_interval"
|
||||
type="number"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_PAGELOAD_INTERVAL"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_PAGELOAD_INTERVAL_DESC"
|
||||
default="300"
|
||||
min="60"
|
||||
max="3600"
|
||||
showon="queue_processing:pageload,both"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="category_rules" label="COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES">
|
||||
<field
|
||||
name="category_rules_note"
|
||||
type="note"
|
||||
label="COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES_NOTE"
|
||||
description="COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES_NOTE_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
</config>
|
||||
+7
-7
@@ -4,16 +4,16 @@
|
||||
<field
|
||||
name="search"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SEARCH"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SEARCH"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="level"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_LEVEL"
|
||||
label="COM_MOKOSUITECROSS_FILTER_LEVEL"
|
||||
onchange="this.form.submit();">
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_LEVEL</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_LEVEL</option>
|
||||
<option value="info">Info</option>
|
||||
<option value="warning">Warning</option>
|
||||
<option value="error">Error</option>
|
||||
@@ -28,10 +28,10 @@
|
||||
default="a.created DESC"
|
||||
onchange="this.form.submit();">
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="a.created ASC">COM_MOKOJOOMCROSS_CREATED_ASC</option>
|
||||
<option value="a.created DESC">COM_MOKOJOOMCROSS_CREATED_DESC</option>
|
||||
<option value="a.level ASC">COM_MOKOJOOMCROSS_LEVEL_ASC</option>
|
||||
<option value="a.level DESC">COM_MOKOJOOMCROSS_LEVEL_DESC</option>
|
||||
<option value="a.created ASC">COM_MOKOSUITECROSS_CREATED_ASC</option>
|
||||
<option value="a.created DESC">COM_MOKOSUITECROSS_CREATED_DESC</option>
|
||||
<option value="a.level ASC">COM_MOKOSUITECROSS_LEVEL_ASC</option>
|
||||
<option value="a.level DESC">COM_MOKOSUITECROSS_LEVEL_DESC</option>
|
||||
</field>
|
||||
</fields>
|
||||
</form>
|
||||
+10
-10
@@ -4,16 +4,16 @@
|
||||
<field
|
||||
name="search"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SEARCH"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SEARCH"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="status"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_STATUS"
|
||||
label="COM_MOKOSUITECROSS_FILTER_STATUS"
|
||||
onchange="this.form.submit();">
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_STATUS</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_STATUS</option>
|
||||
<option value="queued">Queued</option>
|
||||
<option value="posting">Posting</option>
|
||||
<option value="posted">Posted</option>
|
||||
@@ -24,14 +24,14 @@
|
||||
<field
|
||||
name="service_id"
|
||||
type="sql"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SERVICE_TYPE"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SERVICE_TYPE"
|
||||
onchange="this.form.submit();"
|
||||
sql_select="id, CONCAT(title, ' (', service_type, ')') AS title"
|
||||
sql_from="#__mokojoomcross_services"
|
||||
sql_from="#__mokosuitecross_services"
|
||||
key_field="id"
|
||||
value_field="title"
|
||||
sql_order="ordering ASC">
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_SERVICE</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_SERVICE</option>
|
||||
</field>
|
||||
</fields>
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
default="a.created DESC"
|
||||
onchange="this.form.submit();">
|
||||
<option value="">JGLOBAL_SORT_BY</option>
|
||||
<option value="a.created ASC">COM_MOKOJOOMCROSS_CREATED_ASC</option>
|
||||
<option value="a.created DESC">COM_MOKOJOOMCROSS_CREATED_DESC</option>
|
||||
<option value="a.status ASC">COM_MOKOJOOMCROSS_STATUS_ASC</option>
|
||||
<option value="a.status DESC">COM_MOKOJOOMCROSS_STATUS_DESC</option>
|
||||
<option value="a.created ASC">COM_MOKOSUITECROSS_CREATED_ASC</option>
|
||||
<option value="a.created DESC">COM_MOKOSUITECROSS_CREATED_DESC</option>
|
||||
<option value="a.status ASC">COM_MOKOSUITECROSS_STATUS_ASC</option>
|
||||
<option value="a.status DESC">COM_MOKOSUITECROSS_STATUS_DESC</option>
|
||||
</field>
|
||||
</fields>
|
||||
</form>
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
<field
|
||||
name="search"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SEARCH"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SEARCH"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<field
|
||||
name="service_type"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SERVICE_TYPE"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SERVICE_TYPE"
|
||||
onchange="this.form.submit();">
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_SERVICE_TYPE</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_SERVICE_TYPE</option>
|
||||
<option value="facebook">Facebook</option>
|
||||
<option value="twitter">X / Twitter</option>
|
||||
<option value="linkedin">LinkedIn</option>
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
<field
|
||||
name="search"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SEARCH"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SEARCH"
|
||||
hint="JSEARCH_FILTER"
|
||||
/>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
<field
|
||||
name="service_type"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FILTER_SERVICE_TYPE"
|
||||
label="COM_MOKOSUITECROSS_FILTER_SERVICE_TYPE"
|
||||
onchange="this.form.submit();">
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_SERVICE_TYPE</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_SERVICE_TYPE</option>
|
||||
<option value="default">Default</option>
|
||||
<option value="facebook">Facebook</option>
|
||||
<option value="twitter">X / Twitter</option>
|
||||
+21
-21
@@ -9,8 +9,8 @@
|
||||
<field
|
||||
name="article_id"
|
||||
type="sql"
|
||||
label="COM_MOKOJOOMCROSS_POST_ARTICLE"
|
||||
description="COM_MOKOJOOMCROSS_POST_ARTICLE_DESC"
|
||||
label="COM_MOKOSUITECROSS_POST_ARTICLE"
|
||||
description="COM_MOKOSUITECROSS_POST_ARTICLE_DESC"
|
||||
required="true"
|
||||
sql_select="id, title"
|
||||
sql_from="#__content"
|
||||
@@ -20,17 +20,17 @@
|
||||
value_field="title"
|
||||
sql_order="title ASC"
|
||||
>
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_ARTICLE</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_ARTICLE</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="service_id"
|
||||
type="sql"
|
||||
label="COM_MOKOJOOMCROSS_POST_SERVICE"
|
||||
description="COM_MOKOJOOMCROSS_POST_SERVICE_DESC"
|
||||
label="COM_MOKOSUITECROSS_POST_SERVICE"
|
||||
description="COM_MOKOSUITECROSS_POST_SERVICE_DESC"
|
||||
required="true"
|
||||
sql_select="id, CONCAT(title, ' (', service_type, ')') AS title"
|
||||
sql_from="#__mokojoomcross_services"
|
||||
sql_from="#__mokosuitecross_services"
|
||||
sql_filter="true"
|
||||
sql_default_title="- Select Service -"
|
||||
sql_where="published = 1"
|
||||
@@ -38,14 +38,14 @@
|
||||
value_field="title"
|
||||
sql_order="ordering ASC"
|
||||
>
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_SERVICE</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_SERVICE</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="message"
|
||||
type="textarea"
|
||||
label="COM_MOKOJOOMCROSS_POST_MESSAGE"
|
||||
description="COM_MOKOJOOMCROSS_POST_MESSAGE_DESC"
|
||||
label="COM_MOKOSUITECROSS_POST_MESSAGE"
|
||||
description="COM_MOKOSUITECROSS_POST_MESSAGE_DESC"
|
||||
rows="6"
|
||||
cols="60"
|
||||
required="true"
|
||||
@@ -54,36 +54,36 @@
|
||||
<field
|
||||
name="status"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_POST_STATUS"
|
||||
label="COM_MOKOSUITECROSS_POST_STATUS"
|
||||
default="queued">
|
||||
<option value="queued">COM_MOKOJOOMCROSS_STATUS_QUEUED</option>
|
||||
<option value="scheduled">COM_MOKOJOOMCROSS_STATUS_SCHEDULED</option>
|
||||
<option value="posted">COM_MOKOJOOMCROSS_STATUS_POSTED</option>
|
||||
<option value="failed">COM_MOKOJOOMCROSS_STATUS_FAILED</option>
|
||||
<option value="queued">COM_MOKOSUITECROSS_STATUS_QUEUED</option>
|
||||
<option value="scheduled">COM_MOKOSUITECROSS_STATUS_SCHEDULED</option>
|
||||
<option value="posted">COM_MOKOSUITECROSS_STATUS_POSTED</option>
|
||||
<option value="failed">COM_MOKOSUITECROSS_STATUS_FAILED</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="scheduled_at"
|
||||
type="calendar"
|
||||
label="COM_MOKOJOOMCROSS_POST_SCHEDULED_AT"
|
||||
description="COM_MOKOJOOMCROSS_POST_SCHEDULED_AT_DESC"
|
||||
label="COM_MOKOSUITECROSS_POST_SCHEDULED_AT"
|
||||
description="COM_MOKOSUITECROSS_POST_SCHEDULED_AT_DESC"
|
||||
showtime="true"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="readonly" label="COM_MOKOJOOMCROSS_POST_RESULTS">
|
||||
<fieldset name="readonly" label="COM_MOKOSUITECROSS_POST_RESULTS">
|
||||
<field
|
||||
name="platform_post_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_POST_PLATFORM_ID"
|
||||
label="COM_MOKOSUITECROSS_POST_PLATFORM_ID"
|
||||
readonly="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="error_message"
|
||||
type="textarea"
|
||||
label="COM_MOKOJOOMCROSS_POST_ERROR"
|
||||
label="COM_MOKOSUITECROSS_POST_ERROR"
|
||||
readonly="true"
|
||||
rows="3"
|
||||
/>
|
||||
@@ -91,14 +91,14 @@
|
||||
<field
|
||||
name="retry_count"
|
||||
type="number"
|
||||
label="COM_MOKOJOOMCROSS_POST_RETRY_COUNT"
|
||||
label="COM_MOKOSUITECROSS_POST_RETRY_COUNT"
|
||||
readonly="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="posted_at"
|
||||
type="calendar"
|
||||
label="COM_MOKOJOOMCROSS_POST_POSTED_AT"
|
||||
label="COM_MOKOSUITECROSS_POST_POSTED_AT"
|
||||
readonly="true"
|
||||
showtime="true"
|
||||
format="%Y-%m-%d %H:%M:%S"
|
||||
+165
-165
@@ -24,10 +24,10 @@
|
||||
<field
|
||||
name="service_type"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FIELD_SERVICE_TYPE"
|
||||
label="COM_MOKOSUITECROSS_FIELD_SERVICE_TYPE"
|
||||
required="true"
|
||||
default="">
|
||||
<option value="">COM_MOKOJOOMCROSS_SELECT_SERVICE_TYPE</option>
|
||||
<option value="">COM_MOKOSUITECROSS_SELECT_SERVICE_TYPE</option>
|
||||
<!-- Social Media -->
|
||||
<option value="facebook">Facebook / Meta</option>
|
||||
<option value="twitter">X / Twitter</option>
|
||||
@@ -91,33 +91,33 @@
|
||||
<!-- ============================================================ -->
|
||||
|
||||
<!-- Mode selector for services with default bot support -->
|
||||
<fieldset name="credentials" label="COM_MOKOJOOMCROSS_FIELDSET_CREDENTIALS">
|
||||
<fieldset name="credentials" label="COM_MOKOSUITECROSS_FIELDSET_CREDENTIALS">
|
||||
|
||||
<field
|
||||
name="cred_mode"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FIELD_CRED_MODE"
|
||||
description="COM_MOKOJOOMCROSS_FIELD_CRED_MODE_DESC"
|
||||
label="COM_MOKOSUITECROSS_FIELD_CRED_MODE"
|
||||
description="COM_MOKOSUITECROSS_FIELD_CRED_MODE_DESC"
|
||||
default="default"
|
||||
showon="service_type:telegram,discord,slack,teams,facebook,threads">
|
||||
<option value="default">COM_MOKOJOOMCROSS_CRED_MODE_DEFAULT</option>
|
||||
<option value="custom">COM_MOKOJOOMCROSS_CRED_MODE_CUSTOM</option>
|
||||
<option value="default">COM_MOKOSUITECROSS_CRED_MODE_DEFAULT</option>
|
||||
<option value="custom">COM_MOKOSUITECROSS_CRED_MODE_CUSTOM</option>
|
||||
</field>
|
||||
|
||||
<!-- ======== TELEGRAM ======== -->
|
||||
<field
|
||||
name="cred_telegram_chat_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TELEGRAM_CHAT_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TELEGRAM_CHAT_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TELEGRAM_CHAT_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_TELEGRAM_CHAT_ID_DESC"
|
||||
showon="service_type:telegram"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_telegram_bot_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TELEGRAM_BOT_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TELEGRAM_BOT_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TELEGRAM_BOT_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_TELEGRAM_BOT_TOKEN_DESC"
|
||||
showon="service_type:telegram[AND]cred_mode:custom"
|
||||
size="60"
|
||||
/>
|
||||
@@ -126,24 +126,24 @@
|
||||
<field
|
||||
name="cred_discord_webhook_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_DISCORD_WEBHOOK"
|
||||
description="COM_MOKOJOOMCROSS_CRED_DISCORD_WEBHOOK_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_DISCORD_WEBHOOK"
|
||||
description="COM_MOKOSUITECROSS_CRED_DISCORD_WEBHOOK_DESC"
|
||||
showon="service_type:discord[AND]cred_mode:custom"
|
||||
size="80"
|
||||
/>
|
||||
<field
|
||||
name="cred_discord_username"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_DISCORD_USERNAME"
|
||||
description="COM_MOKOJOOMCROSS_CRED_DISCORD_USERNAME_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_DISCORD_USERNAME"
|
||||
description="COM_MOKOSUITECROSS_CRED_DISCORD_USERNAME_DESC"
|
||||
showon="service_type:discord"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_discord_avatar_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_DISCORD_AVATAR"
|
||||
description="COM_MOKOJOOMCROSS_CRED_DISCORD_AVATAR_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_DISCORD_AVATAR"
|
||||
description="COM_MOKOSUITECROSS_CRED_DISCORD_AVATAR_DESC"
|
||||
showon="service_type:discord"
|
||||
size="80"
|
||||
/>
|
||||
@@ -152,8 +152,8 @@
|
||||
<field
|
||||
name="cred_slack_webhook_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_SLACK_WEBHOOK"
|
||||
description="COM_MOKOJOOMCROSS_CRED_SLACK_WEBHOOK_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_SLACK_WEBHOOK"
|
||||
description="COM_MOKOSUITECROSS_CRED_SLACK_WEBHOOK_DESC"
|
||||
showon="service_type:slack[AND]cred_mode:custom"
|
||||
size="80"
|
||||
/>
|
||||
@@ -162,8 +162,8 @@
|
||||
<field
|
||||
name="cred_teams_webhook_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TEAMS_WEBHOOK"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TEAMS_WEBHOOK_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TEAMS_WEBHOOK"
|
||||
description="COM_MOKOSUITECROSS_CRED_TEAMS_WEBHOOK_DESC"
|
||||
showon="service_type:teams[AND]cred_mode:custom"
|
||||
size="80"
|
||||
/>
|
||||
@@ -172,8 +172,8 @@
|
||||
<field
|
||||
name="cred_googlechat_webhook_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GOOGLECHAT_WEBHOOK"
|
||||
description="COM_MOKOJOOMCROSS_CRED_GOOGLECHAT_WEBHOOK_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_GOOGLECHAT_WEBHOOK"
|
||||
description="COM_MOKOSUITECROSS_CRED_GOOGLECHAT_WEBHOOK_DESC"
|
||||
showon="service_type:googlechat"
|
||||
size="80"
|
||||
/>
|
||||
@@ -182,16 +182,16 @@
|
||||
<field
|
||||
name="cred_facebook_page_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_FACEBOOK_PAGE_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_FACEBOOK_PAGE_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_FACEBOOK_PAGE_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_FACEBOOK_PAGE_ID_DESC"
|
||||
showon="service_type:facebook"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_facebook_page_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_FACEBOOK_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_FACEBOOK_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_FACEBOOK_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_FACEBOOK_TOKEN_DESC"
|
||||
showon="service_type:facebook[AND]cred_mode:custom"
|
||||
size="60"
|
||||
/>
|
||||
@@ -200,14 +200,14 @@
|
||||
<field
|
||||
name="cred_threads_user_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_THREADS_USER_ID"
|
||||
label="COM_MOKOSUITECROSS_CRED_THREADS_USER_ID"
|
||||
showon="service_type:threads"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_threads_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_THREADS_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_THREADS_TOKEN"
|
||||
showon="service_type:threads[AND]cred_mode:custom"
|
||||
size="60"
|
||||
/>
|
||||
@@ -216,32 +216,32 @@
|
||||
<field
|
||||
name="cred_twitter_api_key"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TWITTER_API_KEY"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TWITTER_API_KEY_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TWITTER_API_KEY"
|
||||
description="COM_MOKOSUITECROSS_CRED_TWITTER_API_KEY_DESC"
|
||||
showon="service_type:twitter"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_twitter_api_secret"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TWITTER_API_SECRET"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TWITTER_API_SECRET_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TWITTER_API_SECRET"
|
||||
description="COM_MOKOSUITECROSS_CRED_TWITTER_API_SECRET_DESC"
|
||||
showon="service_type:twitter"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_twitter_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TWITTER_ACCESS_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TWITTER_ACCESS_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN_DESC"
|
||||
showon="service_type:twitter"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_twitter_access_token_secret"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TWITTER_ACCESS_TOKEN_SECRET"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TWITTER_ACCESS_TOKEN_SECRET_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN_SECRET"
|
||||
description="COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN_SECRET_DESC"
|
||||
showon="service_type:twitter"
|
||||
size="60"
|
||||
/>
|
||||
@@ -250,23 +250,23 @@
|
||||
<field
|
||||
name="cred_linkedin_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_LINKEDIN_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_LINKEDIN_TOKEN"
|
||||
showon="service_type:linkedin"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_linkedin_organization_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_LINKEDIN_ORG_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_LINKEDIN_ORG_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_LINKEDIN_ORG_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_LINKEDIN_ORG_ID_DESC"
|
||||
showon="service_type:linkedin"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_linkedin_refresh_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_LINKEDIN_REFRESH_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_LINKEDIN_REFRESH_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_LINKEDIN_REFRESH_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_LINKEDIN_REFRESH_TOKEN_DESC"
|
||||
showon="service_type:linkedin"
|
||||
size="60"
|
||||
/>
|
||||
@@ -275,8 +275,8 @@
|
||||
<field
|
||||
name="cred_mastodon_instance_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MASTODON_INSTANCE"
|
||||
description="COM_MOKOJOOMCROSS_CRED_MASTODON_INSTANCE_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_MASTODON_INSTANCE"
|
||||
description="COM_MOKOSUITECROSS_CRED_MASTODON_INSTANCE_DESC"
|
||||
showon="service_type:mastodon"
|
||||
size="40"
|
||||
default="https://mastodon.social"
|
||||
@@ -284,7 +284,7 @@
|
||||
<field
|
||||
name="cred_mastodon_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MASTODON_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_MASTODON_TOKEN"
|
||||
showon="service_type:mastodon"
|
||||
size="60"
|
||||
/>
|
||||
@@ -293,24 +293,24 @@
|
||||
<field
|
||||
name="cred_bluesky_handle"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BLUESKY_HANDLE"
|
||||
description="COM_MOKOJOOMCROSS_CRED_BLUESKY_HANDLE_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_BLUESKY_HANDLE"
|
||||
description="COM_MOKOSUITECROSS_CRED_BLUESKY_HANDLE_DESC"
|
||||
showon="service_type:bluesky"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_bluesky_app_password"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BLUESKY_APP_PWD"
|
||||
description="COM_MOKOJOOMCROSS_CRED_BLUESKY_APP_PWD_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_BLUESKY_APP_PWD"
|
||||
description="COM_MOKOSUITECROSS_CRED_BLUESKY_APP_PWD_DESC"
|
||||
showon="service_type:bluesky"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_bluesky_pds_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BLUESKY_PDS_URL"
|
||||
description="COM_MOKOJOOMCROSS_CRED_BLUESKY_PDS_URL_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_BLUESKY_PDS_URL"
|
||||
description="COM_MOKOSUITECROSS_CRED_BLUESKY_PDS_URL_DESC"
|
||||
showon="service_type:bluesky"
|
||||
size="40"
|
||||
default="https://bsky.social"
|
||||
@@ -320,22 +320,22 @@
|
||||
<field
|
||||
name="cred_whatsapp_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WHATSAPP_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_WHATSAPP_TOKEN"
|
||||
showon="service_type:whatsapp"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_whatsapp_phone_number_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WHATSAPP_PHONE_ID"
|
||||
label="COM_MOKOSUITECROSS_CRED_WHATSAPP_PHONE_ID"
|
||||
showon="service_type:whatsapp"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_whatsapp_recipient"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WHATSAPP_RECIPIENT"
|
||||
description="COM_MOKOJOOMCROSS_CRED_WHATSAPP_RECIPIENT_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_WHATSAPP_RECIPIENT"
|
||||
description="COM_MOKOSUITECROSS_CRED_WHATSAPP_RECIPIENT_DESC"
|
||||
showon="service_type:whatsapp"
|
||||
size="40"
|
||||
/>
|
||||
@@ -344,32 +344,32 @@
|
||||
<field
|
||||
name="cred_mailchimp_api_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_KEY"
|
||||
description="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_KEY_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_MAILCHIMP_KEY"
|
||||
description="COM_MOKOSUITECROSS_CRED_MAILCHIMP_KEY_DESC"
|
||||
showon="service_type:mailchimp"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_mailchimp_list_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_LIST"
|
||||
description="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_LIST_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_MAILCHIMP_LIST"
|
||||
description="COM_MOKOSUITECROSS_CRED_MAILCHIMP_LIST_DESC"
|
||||
showon="service_type:mailchimp"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_mailchimp_from_name"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_FROM_NAME"
|
||||
description="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_FROM_NAME_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_NAME"
|
||||
description="COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_NAME_DESC"
|
||||
showon="service_type:mailchimp"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_mailchimp_from_email"
|
||||
type="email"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_FROM_EMAIL"
|
||||
description="COM_MOKOJOOMCROSS_CRED_MAILCHIMP_FROM_EMAIL_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_EMAIL"
|
||||
description="COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_EMAIL_DESC"
|
||||
showon="service_type:mailchimp"
|
||||
size="40"
|
||||
/>
|
||||
@@ -378,30 +378,30 @@
|
||||
<field
|
||||
name="cred_sendgrid_api_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_SENDGRID_KEY"
|
||||
label="COM_MOKOSUITECROSS_CRED_SENDGRID_KEY"
|
||||
showon="service_type:sendgrid"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_sendgrid_list_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_SENDGRID_LIST"
|
||||
label="COM_MOKOSUITECROSS_CRED_SENDGRID_LIST"
|
||||
showon="service_type:sendgrid"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_sendgrid_from_email"
|
||||
type="email"
|
||||
label="COM_MOKOJOOMCROSS_CRED_SENDGRID_FROM_EMAIL"
|
||||
description="COM_MOKOJOOMCROSS_CRED_SENDGRID_FROM_EMAIL_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_EMAIL"
|
||||
description="COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_EMAIL_DESC"
|
||||
showon="service_type:sendgrid"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_sendgrid_from_name"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_SENDGRID_FROM_NAME"
|
||||
description="COM_MOKOJOOMCROSS_CRED_SENDGRID_FROM_NAME_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_NAME"
|
||||
description="COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_NAME_DESC"
|
||||
showon="service_type:sendgrid"
|
||||
size="40"
|
||||
/>
|
||||
@@ -410,8 +410,8 @@
|
||||
<field
|
||||
name="cred_webhook_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_URL"
|
||||
description="COM_MOKOJOOMCROSS_CRED_WEBHOOK_URL_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_URL"
|
||||
description="COM_MOKOSUITECROSS_CRED_WEBHOOK_URL_DESC"
|
||||
showon="service_type:webhook"
|
||||
size="80"
|
||||
required="true"
|
||||
@@ -419,7 +419,7 @@
|
||||
<field
|
||||
name="cred_webhook_method"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_METHOD"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_METHOD"
|
||||
showon="service_type:webhook"
|
||||
default="POST">
|
||||
<option value="POST">POST</option>
|
||||
@@ -428,40 +428,40 @@
|
||||
<field
|
||||
name="cred_webhook_auth_type"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_AUTH_TYPE"
|
||||
description="COM_MOKOJOOMCROSS_CRED_WEBHOOK_AUTH_TYPE_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_AUTH_TYPE"
|
||||
description="COM_MOKOSUITECROSS_CRED_WEBHOOK_AUTH_TYPE_DESC"
|
||||
showon="service_type:webhook"
|
||||
default="none">
|
||||
<option value="none">COM_MOKOJOOMCROSS_WEBHOOK_AUTH_NONE</option>
|
||||
<option value="bearer">COM_MOKOJOOMCROSS_WEBHOOK_AUTH_BEARER</option>
|
||||
<option value="basic">COM_MOKOJOOMCROSS_WEBHOOK_AUTH_BASIC</option>
|
||||
<option value="none">COM_MOKOSUITECROSS_WEBHOOK_AUTH_NONE</option>
|
||||
<option value="bearer">COM_MOKOSUITECROSS_WEBHOOK_AUTH_BEARER</option>
|
||||
<option value="basic">COM_MOKOSUITECROSS_WEBHOOK_AUTH_BASIC</option>
|
||||
</field>
|
||||
<field
|
||||
name="cred_webhook_bearer_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_BEARER_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_WEBHOOK_BEARER_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_BEARER_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_WEBHOOK_BEARER_TOKEN_DESC"
|
||||
showon="service_type:webhook[AND]cred_webhook_auth_type:bearer"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_webhook_basic_username"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_BASIC_USER"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_BASIC_USER"
|
||||
showon="service_type:webhook[AND]cred_webhook_auth_type:basic"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_webhook_basic_password"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_BASIC_PWD"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_BASIC_PWD"
|
||||
showon="service_type:webhook[AND]cred_webhook_auth_type:basic"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_webhook_content_type"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WEBHOOK_CONTENT_TYPE"
|
||||
label="COM_MOKOSUITECROSS_CRED_WEBHOOK_CONTENT_TYPE"
|
||||
showon="service_type:webhook"
|
||||
default="json">
|
||||
<option value="json">application/json</option>
|
||||
@@ -472,7 +472,7 @@
|
||||
<field
|
||||
name="cred_matrix_homeserver"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MATRIX_HOMESERVER"
|
||||
label="COM_MOKOSUITECROSS_CRED_MATRIX_HOMESERVER"
|
||||
showon="service_type:matrix"
|
||||
size="40"
|
||||
default="https://matrix.org"
|
||||
@@ -480,15 +480,15 @@
|
||||
<field
|
||||
name="cred_matrix_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MATRIX_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_MATRIX_TOKEN"
|
||||
showon="service_type:matrix"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_matrix_room_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MATRIX_ROOM"
|
||||
description="COM_MOKOJOOMCROSS_CRED_MATRIX_ROOM_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_MATRIX_ROOM"
|
||||
description="COM_MOKOSUITECROSS_CRED_MATRIX_ROOM_DESC"
|
||||
showon="service_type:matrix"
|
||||
size="40"
|
||||
/>
|
||||
@@ -497,7 +497,7 @@
|
||||
<field
|
||||
name="cred_ntfy_server_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_NTFY_SERVER"
|
||||
label="COM_MOKOSUITECROSS_CRED_NTFY_SERVER"
|
||||
showon="service_type:ntfy"
|
||||
size="40"
|
||||
default="https://ntfy.sh"
|
||||
@@ -505,8 +505,8 @@
|
||||
<field
|
||||
name="cred_ntfy_topic"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_NTFY_TOPIC"
|
||||
description="COM_MOKOJOOMCROSS_CRED_NTFY_TOPIC_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_NTFY_TOPIC"
|
||||
description="COM_MOKOSUITECROSS_CRED_NTFY_TOPIC_DESC"
|
||||
showon="service_type:ntfy"
|
||||
size="40"
|
||||
required="true"
|
||||
@@ -514,8 +514,8 @@
|
||||
<field
|
||||
name="cred_ntfy_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_NTFY_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_NTFY_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_NTFY_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_NTFY_TOKEN_DESC"
|
||||
showon="service_type:ntfy"
|
||||
size="40"
|
||||
/>
|
||||
@@ -524,41 +524,41 @@
|
||||
<field
|
||||
name="cred_wordpress_site_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WP_SITE"
|
||||
label="COM_MOKOSUITECROSS_CRED_WP_SITE"
|
||||
showon="service_type:wordpress"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_wordpress_username"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WP_USER"
|
||||
label="COM_MOKOSUITECROSS_CRED_WP_USER"
|
||||
showon="service_type:wordpress"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_wordpress_app_password"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WP_APP_PWD"
|
||||
description="COM_MOKOJOOMCROSS_CRED_WP_APP_PWD_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_WP_APP_PWD"
|
||||
description="COM_MOKOSUITECROSS_CRED_WP_APP_PWD_DESC"
|
||||
showon="service_type:wordpress"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_wordpress_default_status"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_CRED_WP_DEFAULT_STATUS"
|
||||
description="COM_MOKOJOOMCROSS_CRED_WP_DEFAULT_STATUS_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_WP_DEFAULT_STATUS"
|
||||
description="COM_MOKOSUITECROSS_CRED_WP_DEFAULT_STATUS_DESC"
|
||||
showon="service_type:wordpress"
|
||||
default="draft">
|
||||
<option value="draft">COM_MOKOJOOMCROSS_STATUS_DRAFT</option>
|
||||
<option value="publish">COM_MOKOJOOMCROSS_STATUS_PUBLISH</option>
|
||||
<option value="draft">COM_MOKOSUITECROSS_STATUS_DRAFT</option>
|
||||
<option value="publish">COM_MOKOSUITECROSS_STATUS_PUBLISH</option>
|
||||
</field>
|
||||
|
||||
<!-- ======== MEDIUM ======== -->
|
||||
<field
|
||||
name="cred_medium_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_MEDIUM_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_MEDIUM_TOKEN"
|
||||
showon="service_type:medium"
|
||||
size="60"
|
||||
/>
|
||||
@@ -567,15 +567,15 @@
|
||||
<field
|
||||
name="cred_devto_api_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_DEVTO_KEY"
|
||||
label="COM_MOKOSUITECROSS_CRED_DEVTO_KEY"
|
||||
showon="service_type:devto"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_devto_organization_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_DEVTO_ORG_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_DEVTO_ORG_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_DEVTO_ORG_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_DEVTO_ORG_ID_DESC"
|
||||
showon="service_type:devto"
|
||||
size="40"
|
||||
/>
|
||||
@@ -584,63 +584,63 @@
|
||||
<field
|
||||
name="cred_ghost_site_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GHOST_SITE"
|
||||
label="COM_MOKOSUITECROSS_CRED_GHOST_SITE"
|
||||
showon="service_type:ghost"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_ghost_admin_api_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GHOST_KEY"
|
||||
label="COM_MOKOSUITECROSS_CRED_GHOST_KEY"
|
||||
showon="service_type:ghost"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_ghost_default_status"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GHOST_DEFAULT_STATUS"
|
||||
description="COM_MOKOJOOMCROSS_CRED_GHOST_DEFAULT_STATUS_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_GHOST_DEFAULT_STATUS"
|
||||
description="COM_MOKOSUITECROSS_CRED_GHOST_DEFAULT_STATUS_DESC"
|
||||
showon="service_type:ghost"
|
||||
default="draft">
|
||||
<option value="draft">COM_MOKOJOOMCROSS_STATUS_DRAFT</option>
|
||||
<option value="published">COM_MOKOJOOMCROSS_STATUS_PUBLISHED</option>
|
||||
<option value="draft">COM_MOKOSUITECROSS_STATUS_DRAFT</option>
|
||||
<option value="published">COM_MOKOSUITECROSS_STATUS_PUBLISHED</option>
|
||||
</field>
|
||||
|
||||
<!-- ======== REDDIT ======== -->
|
||||
<field
|
||||
name="cred_reddit_client_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_REDDIT_CLIENT_ID"
|
||||
label="COM_MOKOSUITECROSS_CRED_REDDIT_CLIENT_ID"
|
||||
showon="service_type:reddit"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_reddit_client_secret"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_REDDIT_SECRET"
|
||||
label="COM_MOKOSUITECROSS_CRED_REDDIT_SECRET"
|
||||
showon="service_type:reddit"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_reddit_username"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_REDDIT_USER"
|
||||
label="COM_MOKOSUITECROSS_CRED_REDDIT_USER"
|
||||
showon="service_type:reddit"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_reddit_password"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_REDDIT_PASSWORD"
|
||||
description="COM_MOKOJOOMCROSS_CRED_REDDIT_PASSWORD_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_REDDIT_PASSWORD"
|
||||
description="COM_MOKOSUITECROSS_CRED_REDDIT_PASSWORD_DESC"
|
||||
showon="service_type:reddit"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_reddit_subreddit"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_REDDIT_SUBREDDIT"
|
||||
description="COM_MOKOJOOMCROSS_CRED_REDDIT_SUBREDDIT_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_REDDIT_SUBREDDIT"
|
||||
description="COM_MOKOSUITECROSS_CRED_REDDIT_SUBREDDIT_DESC"
|
||||
showon="service_type:reddit"
|
||||
size="40"
|
||||
/>
|
||||
@@ -649,16 +649,16 @@
|
||||
<field
|
||||
name="cred_pinterest_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_PINTEREST_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_PINTEREST_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_PINTEREST_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_PINTEREST_TOKEN_DESC"
|
||||
showon="service_type:pinterest"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_pinterest_board_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_PINTEREST_BOARD"
|
||||
description="COM_MOKOJOOMCROSS_CRED_PINTEREST_BOARD_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_PINTEREST_BOARD"
|
||||
description="COM_MOKOSUITECROSS_CRED_PINTEREST_BOARD_DESC"
|
||||
showon="service_type:pinterest"
|
||||
size="40"
|
||||
/>
|
||||
@@ -667,16 +667,16 @@
|
||||
<field
|
||||
name="cred_tumblr_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TUMBLR_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TUMBLR_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TUMBLR_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_TUMBLR_TOKEN_DESC"
|
||||
showon="service_type:tumblr"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_tumblr_blog_name"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TUMBLR_BLOG"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TUMBLR_BLOG_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TUMBLR_BLOG"
|
||||
description="COM_MOKOSUITECROSS_CRED_TUMBLR_BLOG_DESC"
|
||||
showon="service_type:tumblr"
|
||||
size="40"
|
||||
/>
|
||||
@@ -685,22 +685,22 @@
|
||||
<field
|
||||
name="cred_tiktok_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TIKTOK_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_TIKTOK_TOKEN"
|
||||
showon="service_type:tiktok"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_tiktok_refresh_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TIKTOK_REFRESH_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_TIKTOK_REFRESH_TOKEN"
|
||||
showon="service_type:tiktok"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_tiktok_open_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_TIKTOK_OPEN_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_TIKTOK_OPEN_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_TIKTOK_OPEN_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_TIKTOK_OPEN_ID_DESC"
|
||||
showon="service_type:tiktok"
|
||||
size="40"
|
||||
/>
|
||||
@@ -709,16 +709,16 @@
|
||||
<field
|
||||
name="cred_nostr_private_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_NOSTR_PRIVKEY"
|
||||
description="COM_MOKOJOOMCROSS_CRED_NOSTR_PRIVKEY_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_NOSTR_PRIVKEY"
|
||||
description="COM_MOKOSUITECROSS_CRED_NOSTR_PRIVKEY_DESC"
|
||||
showon="service_type:nostr"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_nostr_relays"
|
||||
type="textarea"
|
||||
label="COM_MOKOJOOMCROSS_CRED_NOSTR_RELAYS"
|
||||
description="COM_MOKOJOOMCROSS_CRED_NOSTR_RELAYS_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_NOSTR_RELAYS"
|
||||
description="COM_MOKOSUITECROSS_CRED_NOSTR_RELAYS_DESC"
|
||||
showon="service_type:nostr"
|
||||
rows="3"
|
||||
cols="60"
|
||||
@@ -728,16 +728,16 @@
|
||||
<field
|
||||
name="cred_activitypub_instance_url"
|
||||
type="url"
|
||||
label="COM_MOKOJOOMCROSS_CRED_ACTIVITYPUB_INSTANCE"
|
||||
description="COM_MOKOJOOMCROSS_CRED_ACTIVITYPUB_INSTANCE_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_INSTANCE"
|
||||
description="COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_INSTANCE_DESC"
|
||||
showon="service_type:activitypub"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_activitypub_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_ACTIVITYPUB_TOKEN"
|
||||
description="COM_MOKOJOOMCROSS_CRED_ACTIVITYPUB_TOKEN_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_TOKEN"
|
||||
description="COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_TOKEN_DESC"
|
||||
showon="service_type:activitypub"
|
||||
size="60"
|
||||
/>
|
||||
@@ -746,30 +746,30 @@
|
||||
<field
|
||||
name="cred_brevo_api_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BREVO_KEY"
|
||||
label="COM_MOKOSUITECROSS_CRED_BREVO_KEY"
|
||||
showon="service_type:brevo"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_brevo_list_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BREVO_LIST"
|
||||
description="COM_MOKOJOOMCROSS_CRED_BREVO_LIST_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_BREVO_LIST"
|
||||
description="COM_MOKOSUITECROSS_CRED_BREVO_LIST_DESC"
|
||||
showon="service_type:brevo"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_brevo_sender_email"
|
||||
type="email"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BREVO_SENDER_EMAIL"
|
||||
description="COM_MOKOJOOMCROSS_CRED_BREVO_SENDER_EMAIL_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_BREVO_SENDER_EMAIL"
|
||||
description="COM_MOKOSUITECROSS_CRED_BREVO_SENDER_EMAIL_DESC"
|
||||
showon="service_type:brevo"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_brevo_sender_name"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BREVO_SENDER_NAME"
|
||||
label="COM_MOKOSUITECROSS_CRED_BREVO_SENDER_NAME"
|
||||
showon="service_type:brevo"
|
||||
size="40"
|
||||
/>
|
||||
@@ -778,14 +778,14 @@
|
||||
<field
|
||||
name="cred_convertkit_api_key"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_CONVERTKIT_KEY"
|
||||
label="COM_MOKOSUITECROSS_CRED_CONVERTKIT_KEY"
|
||||
showon="service_type:convertkit"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_convertkit_api_secret"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_CONVERTKIT_SECRET"
|
||||
label="COM_MOKOSUITECROSS_CRED_CONVERTKIT_SECRET"
|
||||
showon="service_type:convertkit"
|
||||
size="60"
|
||||
/>
|
||||
@@ -794,22 +794,22 @@
|
||||
<field
|
||||
name="cred_constantcontact_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_CONSTANTCONTACT_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_TOKEN"
|
||||
showon="service_type:constantcontact"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_constantcontact_refresh_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_CONSTANTCONTACT_REFRESH_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_REFRESH_TOKEN"
|
||||
showon="service_type:constantcontact"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_constantcontact_list_ids"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_CONSTANTCONTACT_LISTS"
|
||||
description="COM_MOKOJOOMCROSS_CRED_CONSTANTCONTACT_LISTS_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_LISTS"
|
||||
description="COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_LISTS_DESC"
|
||||
showon="service_type:constantcontact"
|
||||
size="40"
|
||||
/>
|
||||
@@ -818,15 +818,15 @@
|
||||
<field
|
||||
name="cred_hashnode_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_HASHNODE_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_HASHNODE_TOKEN"
|
||||
showon="service_type:hashnode"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_hashnode_publication_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_HASHNODE_PUB_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_HASHNODE_PUB_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_HASHNODE_PUB_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_HASHNODE_PUB_ID_DESC"
|
||||
showon="service_type:hashnode"
|
||||
size="40"
|
||||
/>
|
||||
@@ -835,22 +835,22 @@
|
||||
<field
|
||||
name="cred_blogger_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BLOGGER_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_BLOGGER_TOKEN"
|
||||
showon="service_type:blogger"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_blogger_refresh_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BLOGGER_REFRESH_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_BLOGGER_REFRESH_TOKEN"
|
||||
showon="service_type:blogger"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_blogger_blog_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_BLOGGER_BLOG_ID"
|
||||
description="COM_MOKOJOOMCROSS_CRED_BLOGGER_BLOG_ID_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_BLOGGER_BLOG_ID"
|
||||
description="COM_MOKOSUITECROSS_CRED_BLOGGER_BLOG_ID_DESC"
|
||||
showon="service_type:blogger"
|
||||
size="40"
|
||||
/>
|
||||
@@ -859,30 +859,30 @@
|
||||
<field
|
||||
name="cred_googlebusiness_access_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GBUSINESS_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_GBUSINESS_TOKEN"
|
||||
showon="service_type:googlebusiness"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_googlebusiness_refresh_token"
|
||||
type="password"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GBUSINESS_REFRESH_TOKEN"
|
||||
label="COM_MOKOSUITECROSS_CRED_GBUSINESS_REFRESH_TOKEN"
|
||||
showon="service_type:googlebusiness"
|
||||
size="60"
|
||||
/>
|
||||
<field
|
||||
name="cred_googlebusiness_location_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GBUSINESS_LOCATION"
|
||||
description="COM_MOKOJOOMCROSS_CRED_GBUSINESS_LOCATION_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_GBUSINESS_LOCATION"
|
||||
description="COM_MOKOSUITECROSS_CRED_GBUSINESS_LOCATION_DESC"
|
||||
showon="service_type:googlebusiness"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_googlebusiness_account_id"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_GBUSINESS_ACCOUNT"
|
||||
description="COM_MOKOJOOMCROSS_CRED_GBUSINESS_ACCOUNT_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_GBUSINESS_ACCOUNT"
|
||||
description="COM_MOKOSUITECROSS_CRED_GBUSINESS_ACCOUNT_DESC"
|
||||
showon="service_type:googlebusiness"
|
||||
size="40"
|
||||
/>
|
||||
@@ -891,16 +891,16 @@
|
||||
<field
|
||||
name="cred_rssfeed_title"
|
||||
type="text"
|
||||
label="COM_MOKOJOOMCROSS_CRED_RSSFEED_TITLE"
|
||||
description="COM_MOKOJOOMCROSS_CRED_RSSFEED_TITLE_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_RSSFEED_TITLE"
|
||||
description="COM_MOKOSUITECROSS_CRED_RSSFEED_TITLE_DESC"
|
||||
showon="service_type:rssfeed"
|
||||
size="40"
|
||||
/>
|
||||
<field
|
||||
name="cred_rssfeed_max_items"
|
||||
type="number"
|
||||
label="COM_MOKOJOOMCROSS_CRED_RSSFEED_MAX_ITEMS"
|
||||
description="COM_MOKOJOOMCROSS_CRED_RSSFEED_MAX_ITEMS_DESC"
|
||||
label="COM_MOKOSUITECROSS_CRED_RSSFEED_MAX_ITEMS"
|
||||
description="COM_MOKOSUITECROSS_CRED_RSSFEED_MAX_ITEMS_DESC"
|
||||
showon="service_type:rssfeed"
|
||||
default="50"
|
||||
min="1"
|
||||
+5
-5
@@ -17,10 +17,10 @@
|
||||
<field
|
||||
name="service_type"
|
||||
type="list"
|
||||
label="COM_MOKOJOOMCROSS_FIELD_SERVICE_TYPE"
|
||||
description="COM_MOKOJOOMCROSS_TEMPLATE_SERVICE_TYPE_DESC"
|
||||
label="COM_MOKOSUITECROSS_FIELD_SERVICE_TYPE"
|
||||
description="COM_MOKOSUITECROSS_TEMPLATE_SERVICE_TYPE_DESC"
|
||||
default="default">
|
||||
<option value="default">COM_MOKOJOOMCROSS_TEMPLATE_TYPE_DEFAULT</option>
|
||||
<option value="default">COM_MOKOSUITECROSS_TEMPLATE_TYPE_DEFAULT</option>
|
||||
<option value="facebook">Facebook</option>
|
||||
<option value="twitter">X / Twitter</option>
|
||||
<option value="linkedin">LinkedIn</option>
|
||||
@@ -35,8 +35,8 @@
|
||||
<field
|
||||
name="template_body"
|
||||
type="textarea"
|
||||
label="COM_MOKOJOOMCROSS_TEMPLATE_BODY"
|
||||
description="COM_MOKOJOOMCROSS_TEMPLATE_BODY_DESC"
|
||||
label="COM_MOKOSUITECROSS_TEMPLATE_BODY"
|
||||
description="COM_MOKOSUITECROSS_TEMPLATE_BODY_DESC"
|
||||
rows="10"
|
||||
cols="60"
|
||||
required="true"
|
||||
@@ -0,0 +1,513 @@
|
||||
; MokoSuiteCross — Admin Backend Language File
|
||||
; Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
; License: GPL-3.0-or-later
|
||||
|
||||
COM_MOKOSUITECROSS="MokoSuiteCross"
|
||||
COM_MOKOSUITECROSS_DESCRIPTION="Cross-posting Joomla content to social media, email marketing, and chat platforms"
|
||||
|
||||
; Submenu
|
||||
COM_MOKOSUITECROSS_SUBMENU_DASHBOARD="Dashboard"
|
||||
COM_MOKOSUITECROSS_SUBMENU_POSTS="Post Queue"
|
||||
COM_MOKOSUITECROSS_SUBMENU_SERVICES="Services"
|
||||
COM_MOKOSUITECROSS_SUBMENU_LOGS="Activity Logs"
|
||||
|
||||
; Dashboard
|
||||
COM_MOKOSUITECROSS_DASHBOARD_ACTIVE_SERVICES="Active Services"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_QUEUED="Queued"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_POSTED="Posted"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_FAILED="Failed"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_QUICK_LINKS="Quick Links"
|
||||
|
||||
; Migration
|
||||
COM_MOKOSUITECROSS_MIGRATION_TITLE="Migrate from Perfect Publisher Pro"
|
||||
COM_MOKOSUITECROSS_MIGRATION_DESCRIPTION="We detected Perfect Publisher Pro settings. Import your service configurations to MokoSuiteCross."
|
||||
COM_MOKOSUITECROSS_MIGRATION_BUTTON="Start Migration"
|
||||
COM_MOKOSUITECROSS_MIGRATION_SUCCESS="Migration complete: %d service(s) imported, %d skipped."
|
||||
COM_MOKOSUITECROSS_MIGRATION_ERROR="Migration encountered errors: %s"
|
||||
|
||||
; Services
|
||||
COM_MOKOSUITECROSS_FIELD_SERVICE_TYPE="Service Type"
|
||||
COM_MOKOSUITECROSS_SELECT_SERVICE_TYPE="- Select Service Type -"
|
||||
COM_MOKOSUITECROSS_FIELDSET_CREDENTIALS="API Credentials"
|
||||
COM_MOKOSUITECROSS_FIELD_CREDENTIALS="Credentials (JSON)"
|
||||
COM_MOKOSUITECROSS_FIELD_CREDENTIALS_DESC="JSON object with API keys and tokens for this service. Keys vary by platform."
|
||||
|
||||
; Posts
|
||||
COM_MOKOSUITECROSS_FILTER_SEARCH="Search"
|
||||
COM_MOKOSUITECROSS_FILTER_STATUS="Status"
|
||||
COM_MOKOSUITECROSS_SELECT_STATUS="- Select Status -"
|
||||
COM_MOKOSUITECROSS_FILTER_SERVICE_TYPE="Service Type"
|
||||
COM_MOKOSUITECROSS_CREATED_ASC="Created ascending"
|
||||
COM_MOKOSUITECROSS_CREATED_DESC="Created descending"
|
||||
COM_MOKOSUITECROSS_STATUS_ASC="Status ascending"
|
||||
COM_MOKOSUITECROSS_STATUS_DESC="Status descending"
|
||||
|
||||
; Actions
|
||||
COM_MOKOSUITECROSS_ACTION_CROSSPOST="Cross-post"
|
||||
COM_MOKOSUITECROSS_ACTION_MIGRATE="Migrate"
|
||||
|
||||
; Configuration
|
||||
COM_MOKOSUITECROSS_CONFIG_COMPONENT="MokoSuiteCross Settings"
|
||||
COM_MOKOSUITECROSS_CONFIG_AUTO_POST="Auto-post on Publish"
|
||||
COM_MOKOSUITECROSS_CONFIG_AUTO_POST_DESC="Automatically cross-post articles when they are published"
|
||||
COM_MOKOSUITECROSS_CONFIG_RETRY_MAX="Max Retries"
|
||||
COM_MOKOSUITECROSS_CONFIG_RETRY_MAX_DESC="Maximum number of retry attempts for failed posts"
|
||||
COM_MOKOSUITECROSS_CONFIG_RETRY_DELAY="Retry Delay (seconds)"
|
||||
COM_MOKOSUITECROSS_CONFIG_RETRY_DELAY_DESC="Seconds to wait before retrying a failed post"
|
||||
COM_MOKOSUITECROSS_CONFIG_LOG_RETENTION="Log Retention (days)"
|
||||
COM_MOKOSUITECROSS_CONFIG_LOG_RETENTION_DESC="Number of days to keep activity logs"
|
||||
COM_MOKOSUITECROSS_CONFIG_DEFAULT_TEMPLATE="Default Message Template"
|
||||
COM_MOKOSUITECROSS_CONFIG_DEFAULT_TEMPLATE_DESC="Default template for cross-posts. Placeholders: {title}, {url}, {introtext}, {image}, {category}, {author}"
|
||||
|
||||
; Table headings
|
||||
COM_MOKOSUITECROSS_HEADING_STATUS="Status"
|
||||
COM_MOKOSUITECROSS_HEADING_ARTICLE="Article"
|
||||
COM_MOKOSUITECROSS_HEADING_SERVICE="Service"
|
||||
COM_MOKOSUITECROSS_HEADING_MESSAGE="Message"
|
||||
COM_MOKOSUITECROSS_HEADING_POSTED_AT="Posted"
|
||||
COM_MOKOSUITECROSS_HEADING_CREATED="Created"
|
||||
COM_MOKOSUITECROSS_HEADING_LEVEL="Level"
|
||||
COM_MOKOSUITECROSS_HEADING_MODE="Mode"
|
||||
|
||||
; Dashboard
|
||||
COM_MOKOSUITECROSS_DASHBOARD_RECENT_ACTIVITY="Recent Activity"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_NO_RECENT="No recent activity."
|
||||
COM_MOKOSUITECROSS_DASHBOARD_TOTAL_POSTS="Total Posts"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_PAGELOAD_WARNING_TITLE="Page-load queue processing is active"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_PAGELOAD_WARNING="You are using page-load processing for the cross-post queue. This is a fallback method and may be unreliable on low-traffic sites. For production use, switch to Joomla Scheduled Tasks: create a task of type <strong>MokoSuiteCross - Process Queue</strong> in System → Scheduled Tasks, then set queue processing to <strong>Scheduler only</strong> in component options."
|
||||
|
||||
; Evergreen Configuration
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN="Evergreen Re-sharing"
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN_ENABLED="Enable Evergreen"
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN_ENABLED_DESC="Allow articles marked as evergreen to be automatically re-shared on a recurring schedule."
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN_DEFAULT_INTERVAL="Default Interval (days)"
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN_DEFAULT_INTERVAL_DESC="Default number of days between re-shares when no per-article interval is set."
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN_MAX_PER_RUN="Max Re-shares Per Run"
|
||||
COM_MOKOSUITECROSS_CONFIG_EVERGREEN_MAX_PER_RUN_DESC="Maximum number of evergreen articles to re-share in a single queue processing run. Prevents flooding platforms."
|
||||
|
||||
; Queue Processing Configuration
|
||||
COM_MOKOSUITECROSS_CONFIG_QUEUE="Queue Processing"
|
||||
COM_MOKOSUITECROSS_CONFIG_QUEUE_PROCESSING="Processing Method"
|
||||
COM_MOKOSUITECROSS_CONFIG_QUEUE_PROCESSING_DESC="How queued posts, retries, and scheduled posts are processed. Scheduler (recommended) uses Joomla's built-in Task Scheduler. Page-load piggybacks on page requests."
|
||||
COM_MOKOSUITECROSS_CONFIG_QUEUE_SCHEDULER="Scheduler only (recommended)"
|
||||
COM_MOKOSUITECROSS_CONFIG_QUEUE_PAGELOAD="Page-load only (fallback)"
|
||||
COM_MOKOSUITECROSS_CONFIG_QUEUE_BOTH="Both (scheduler + page-load)"
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_CLIENT="Page-load Client"
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_CLIENT_DESC="Which Joomla application triggers page-load processing."
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_BOTH="Backend and Frontend"
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_ADMIN="Backend only"
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_SITE="Frontend only"
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_INTERVAL="Page-load Interval (seconds)"
|
||||
COM_MOKOSUITECROSS_CONFIG_PAGELOAD_INTERVAL_DESC="Minimum seconds between page-load queue runs. Lower = more responsive but more DB queries per page load."
|
||||
|
||||
; Submenu (extended)
|
||||
COM_MOKOSUITECROSS_SUBMENU_TEMPLATES="Templates"
|
||||
|
||||
; Template Management
|
||||
COM_MOKOSUITECROSS_TEMPLATE_BODY="Template Body"
|
||||
COM_MOKOSUITECROSS_TEMPLATE_BODY_DESC="Message template with placeholders. Use the reference panel on the right for available placeholders."
|
||||
COM_MOKOSUITECROSS_TEMPLATE_SERVICE_TYPE_DESC="Which platform this template is for. 'Default' is the fallback when no platform-specific template exists."
|
||||
COM_MOKOSUITECROSS_TEMPLATE_TYPE_DEFAULT="Default (fallback)"
|
||||
COM_MOKOSUITECROSS_TEMPLATE_PREVIEW="Preview"
|
||||
COM_MOKOSUITECROSS_TEMPLATE_PLACEHOLDERS="Available Placeholders"
|
||||
|
||||
; Placeholders
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_TITLE="Article title"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_URL="Article URL"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_INTROTEXT="Intro text (280 chars, no HTML)"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_FULLTEXT="Full text (500 chars, no HTML)"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_IMAGE="Intro image URL"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_CATEGORY="Category name"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_AUTHOR="Author name"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_DATE="Publish date (YYYY-MM-DD)"
|
||||
|
||||
; Logs
|
||||
COM_MOKOSUITECROSS_FILTER_LEVEL="Level"
|
||||
COM_MOKOSUITECROSS_SELECT_LEVEL="- Select Level -"
|
||||
COM_MOKOSUITECROSS_LEVEL_ASC="Level ascending"
|
||||
COM_MOKOSUITECROSS_LEVEL_DESC="Level descending"
|
||||
|
||||
; Analytics Dashboard
|
||||
COM_MOKOSUITECROSS_DASHBOARD_SERVICE_BREAKDOWN="Posts by Service"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_TOP_ARTICLES="Most Cross-Posted Articles"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_SUCCESS_RATE="Success Rate"
|
||||
|
||||
; OAuth
|
||||
COM_MOKOSUITECROSS_OAUTH_NO_SERVICE="No service specified for OAuth authorization."
|
||||
COM_MOKOSUITECROSS_OAUTH_SERVICE_NOT_FOUND="Service not found."
|
||||
COM_MOKOSUITECROSS_OAUTH_NO_CLIENT_ID="No OAuth Client ID configured for %s. Set it in Extensions → Plugins → MokoSuiteCross - %s."
|
||||
COM_MOKOSUITECROSS_OAUTH_NOT_SUPPORTED="OAuth is not supported for %s."
|
||||
COM_MOKOSUITECROSS_OAUTH_PLATFORM_ERROR="Platform returned error: %s"
|
||||
COM_MOKOSUITECROSS_OAUTH_INVALID_CALLBACK="Invalid OAuth callback — missing code or state."
|
||||
COM_MOKOSUITECROSS_OAUTH_INVALID_STATE="Invalid OAuth state parameter."
|
||||
COM_MOKOSUITECROSS_OAUTH_TOKEN_ERROR="Token exchange failed: %s"
|
||||
COM_MOKOSUITECROSS_OAUTH_SUCCESS="%s connected successfully! Access token stored."
|
||||
|
||||
; Post edit
|
||||
COM_MOKOSUITECROSS_NEW_POST="New Post"
|
||||
COM_MOKOSUITECROSS_EDIT_POST="Edit Post"
|
||||
COM_MOKOSUITECROSS_POST_ARTICLE="Article"
|
||||
COM_MOKOSUITECROSS_POST_ARTICLE_DESC="The Joomla article to cross-post."
|
||||
COM_MOKOSUITECROSS_SELECT_ARTICLE="- Select Article -"
|
||||
COM_MOKOSUITECROSS_POST_SERVICE="Service"
|
||||
COM_MOKOSUITECROSS_POST_SERVICE_DESC="The service to post to."
|
||||
COM_MOKOSUITECROSS_SELECT_SERVICE="- Select Service -"
|
||||
COM_MOKOSUITECROSS_POST_MESSAGE="Message"
|
||||
COM_MOKOSUITECROSS_POST_MESSAGE_DESC="The message to send to the platform. Use template placeholders or write a custom message."
|
||||
COM_MOKOSUITECROSS_POST_STATUS="Status"
|
||||
COM_MOKOSUITECROSS_STATUS_QUEUED="Queued"
|
||||
COM_MOKOSUITECROSS_STATUS_SCHEDULED="Scheduled"
|
||||
COM_MOKOSUITECROSS_STATUS_POSTED="Posted"
|
||||
COM_MOKOSUITECROSS_STATUS_FAILED="Failed"
|
||||
COM_MOKOSUITECROSS_POST_SCHEDULED_AT="Scheduled Date/Time"
|
||||
COM_MOKOSUITECROSS_POST_SCHEDULED_AT_DESC="When to send this post. Leave empty to process immediately. Set a future date to schedule."
|
||||
COM_MOKOSUITECROSS_POST_RESULTS="Post Results"
|
||||
COM_MOKOSUITECROSS_POST_PLATFORM_ID="Platform Post ID"
|
||||
COM_MOKOSUITECROSS_POST_ERROR="Error Message"
|
||||
COM_MOKOSUITECROSS_POST_RETRY_COUNT="Retry Count"
|
||||
COM_MOKOSUITECROSS_POST_POSTED_AT="Posted At"
|
||||
COM_MOKOSUITECROSS_POST_CREATE_HELP="Create a manual cross-post. Select an article and service, write your message, and optionally set a scheduled date. Leave the schedule empty to queue for immediate processing."
|
||||
COM_MOKOSUITECROSS_POST_REQUEUE="Re-queue for Posting"
|
||||
COM_MOKOSUITECROSS_POST_REQUEUE_HELP="Reset this post to queued status so it will be processed again on the next queue run."
|
||||
|
||||
; Service edit
|
||||
COM_MOKOSUITECROSS_NEW_SERVICE="New Service"
|
||||
COM_MOKOSUITECROSS_EDIT_SERVICE="Edit Service"
|
||||
COM_MOKOSUITECROSS_SERVICE_DETAILS="Service Details"
|
||||
COM_MOKOSUITECROSS_CREDENTIALS_HELP="Fill in the connection details for the selected platform. Fields change based on the service type you choose above."
|
||||
|
||||
; Credential mode
|
||||
COM_MOKOSUITECROSS_FIELD_CRED_MODE="Connection Mode"
|
||||
COM_MOKOSUITECROSS_FIELD_CRED_MODE_DESC="Default uses the pre-configured MokoSuite account. Custom lets you use your own API credentials."
|
||||
COM_MOKOSUITECROSS_CRED_MODE_DEFAULT="Default (MokoSuite)"
|
||||
COM_MOKOSUITECROSS_CRED_MODE_CUSTOM="Custom (your own credentials)"
|
||||
|
||||
; Telegram
|
||||
COM_MOKOSUITECROSS_CRED_TELEGRAM_CHAT_ID="Chat ID"
|
||||
COM_MOKOSUITECROSS_CRED_TELEGRAM_CHAT_ID_DESC="Telegram channel, group, or user chat ID. Channel IDs start with -100. Get yours from @userinfobot."
|
||||
COM_MOKOSUITECROSS_CRED_TELEGRAM_BOT_TOKEN="Bot Token"
|
||||
COM_MOKOSUITECROSS_CRED_TELEGRAM_BOT_TOKEN_DESC="Your custom Telegram bot token from @BotFather. Only needed in Custom mode."
|
||||
|
||||
; Discord
|
||||
COM_MOKOSUITECROSS_CRED_DISCORD_WEBHOOK="Webhook URL"
|
||||
COM_MOKOSUITECROSS_CRED_DISCORD_WEBHOOK_DESC="Discord channel webhook URL. Create one in Channel Settings → Integrations → Webhooks."
|
||||
|
||||
; Slack
|
||||
COM_MOKOSUITECROSS_CRED_SLACK_WEBHOOK="Webhook URL"
|
||||
COM_MOKOSUITECROSS_CRED_SLACK_WEBHOOK_DESC="Slack Incoming Webhook URL. Create one at api.slack.com/apps."
|
||||
|
||||
; Teams
|
||||
COM_MOKOSUITECROSS_CRED_TEAMS_WEBHOOK="Webhook URL"
|
||||
COM_MOKOSUITECROSS_CRED_TEAMS_WEBHOOK_DESC="Microsoft Teams Incoming Webhook URL. Create in channel Connectors."
|
||||
|
||||
; Google Chat
|
||||
COM_MOKOSUITECROSS_CRED_GOOGLECHAT_WEBHOOK="Webhook URL"
|
||||
COM_MOKOSUITECROSS_CRED_GOOGLECHAT_WEBHOOK_DESC="Google Chat space webhook URL."
|
||||
|
||||
; Facebook
|
||||
COM_MOKOSUITECROSS_CRED_FACEBOOK_PAGE_ID="Facebook Page ID"
|
||||
COM_MOKOSUITECROSS_CRED_FACEBOOK_PAGE_ID_DESC="Your Facebook Page numeric ID. Find it in Page Settings → About."
|
||||
COM_MOKOSUITECROSS_CRED_FACEBOOK_TOKEN="Page Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_FACEBOOK_TOKEN_DESC="Long-lived Page Access Token. Use the Authorize button below or generate via Meta Business Suite."
|
||||
|
||||
; Threads
|
||||
COM_MOKOSUITECROSS_CRED_THREADS_USER_ID="Threads User ID"
|
||||
COM_MOKOSUITECROSS_CRED_THREADS_TOKEN="Access Token"
|
||||
|
||||
; Twitter (OAuth 1.0a)
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_API_KEY="API Key (Consumer Key)"
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_API_KEY_DESC="Consumer Key from the Twitter Developer Portal → Keys and Tokens."
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_API_SECRET="API Secret (Consumer Secret)"
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_API_SECRET_DESC="Consumer Secret from the Twitter Developer Portal → Keys and Tokens."
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN_DESC="User access token from the Developer Portal → Keys and Tokens → Authentication Tokens."
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN_SECRET="Access Token Secret"
|
||||
COM_MOKOSUITECROSS_CRED_TWITTER_ACCESS_TOKEN_SECRET_DESC="User access token secret from the Developer Portal → Keys and Tokens → Authentication Tokens."
|
||||
|
||||
; LinkedIn
|
||||
COM_MOKOSUITECROSS_CRED_LINKEDIN_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_LINKEDIN_ORG_ID="Organization ID"
|
||||
COM_MOKOSUITECROSS_CRED_LINKEDIN_ORG_ID_DESC="LinkedIn Company Page ID. Leave empty to post as yourself."
|
||||
|
||||
; Mastodon
|
||||
COM_MOKOSUITECROSS_CRED_MASTODON_INSTANCE="Instance URL"
|
||||
COM_MOKOSUITECROSS_CRED_MASTODON_INSTANCE_DESC="Your Mastodon server (e.g. https://mastodon.social)"
|
||||
COM_MOKOSUITECROSS_CRED_MASTODON_TOKEN="Access Token"
|
||||
|
||||
; Bluesky
|
||||
COM_MOKOSUITECROSS_CRED_BLUESKY_HANDLE="Handle"
|
||||
COM_MOKOSUITECROSS_CRED_BLUESKY_HANDLE_DESC="Your Bluesky handle (e.g. user.bsky.social)"
|
||||
COM_MOKOSUITECROSS_CRED_BLUESKY_APP_PWD="App Password"
|
||||
COM_MOKOSUITECROSS_CRED_BLUESKY_APP_PWD_DESC="Generate in Bluesky Settings → Advanced → App Passwords."
|
||||
|
||||
; WhatsApp
|
||||
COM_MOKOSUITECROSS_CRED_WHATSAPP_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_WHATSAPP_PHONE_ID="Phone Number ID"
|
||||
COM_MOKOSUITECROSS_CRED_WHATSAPP_RECIPIENT="Recipient Number"
|
||||
COM_MOKOSUITECROSS_CRED_WHATSAPP_RECIPIENT_DESC="Phone number to send to, with country code (e.g. +1234567890)"
|
||||
|
||||
; Mailchimp
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_KEY="API Key"
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_KEY_DESC="Mailchimp API key (ends with -us1, -us2, etc.)"
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_LIST="Audience/List ID"
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_LIST_DESC="The audience to send campaigns to. Find in Audience → Settings → Audience ID."
|
||||
|
||||
; SendGrid
|
||||
COM_MOKOSUITECROSS_CRED_SENDGRID_KEY="API Key"
|
||||
COM_MOKOSUITECROSS_CRED_SENDGRID_LIST="Contact List ID"
|
||||
|
||||
; Webhook
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_URL="Webhook URL"
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_URL_DESC="The URL to send article data to. Works with Zapier, IFTTT, n8n, Make, or any custom endpoint."
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_METHOD="HTTP Method"
|
||||
|
||||
; Matrix
|
||||
COM_MOKOSUITECROSS_CRED_MATRIX_HOMESERVER="Homeserver URL"
|
||||
COM_MOKOSUITECROSS_CRED_MATRIX_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_MATRIX_ROOM="Room ID"
|
||||
COM_MOKOSUITECROSS_CRED_MATRIX_ROOM_DESC="Matrix room ID (e.g. !abc123:matrix.org)"
|
||||
|
||||
; Ntfy
|
||||
COM_MOKOSUITECROSS_CRED_NTFY_SERVER="Server URL"
|
||||
COM_MOKOSUITECROSS_CRED_NTFY_TOPIC="Topic Name"
|
||||
COM_MOKOSUITECROSS_CRED_NTFY_TOPIC_DESC="The notification topic (e.g. my-site-updates). Subscribers use this to receive push notifications."
|
||||
COM_MOKOSUITECROSS_CRED_NTFY_TOKEN="Auth Token"
|
||||
COM_MOKOSUITECROSS_CRED_NTFY_TOKEN_DESC="Optional authentication token if your ntfy server requires it."
|
||||
|
||||
; WordPress
|
||||
COM_MOKOSUITECROSS_CRED_WP_SITE="WordPress Site URL"
|
||||
COM_MOKOSUITECROSS_CRED_WP_USER="Username"
|
||||
COM_MOKOSUITECROSS_CRED_WP_APP_PWD="Application Password"
|
||||
COM_MOKOSUITECROSS_CRED_WP_APP_PWD_DESC="Generate in WordPress → Users → Profile → Application Passwords."
|
||||
|
||||
; Medium
|
||||
COM_MOKOSUITECROSS_CRED_MEDIUM_TOKEN="Integration Token"
|
||||
|
||||
; Dev.to
|
||||
COM_MOKOSUITECROSS_CRED_DEVTO_KEY="API Key"
|
||||
|
||||
; Ghost
|
||||
COM_MOKOSUITECROSS_CRED_GHOST_SITE="Ghost Site URL"
|
||||
COM_MOKOSUITECROSS_CRED_GHOST_KEY="Admin API Key"
|
||||
|
||||
; Reddit
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_CLIENT_ID="App Client ID"
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_SECRET="App Secret"
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_USER="Reddit Username"
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_SUBREDDIT="Subreddit"
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_SUBREDDIT_DESC="Subreddit to post to (without r/ prefix)"
|
||||
|
||||
; Authorize / OAuth
|
||||
COM_MOKOSUITECROSS_AUTHORIZE_BUTTON="Connect to %s"
|
||||
COM_MOKOSUITECROSS_AUTHORIZE_HELP="Click to open the authorization page. You'll be redirected back after granting access. Your token will be saved automatically."
|
||||
COM_MOKOSUITECROSS_OAUTH_HELP_TITLE="Authorization Required"
|
||||
COM_MOKOSUITECROSS_OAUTH_HELP_BODY="This service requires OAuth authorization. Save the service first, then click the Connect button below to authorize access."
|
||||
|
||||
; LinkedIn (additional)
|
||||
COM_MOKOSUITECROSS_CRED_LINKEDIN_REFRESH_TOKEN="Refresh Token"
|
||||
COM_MOKOSUITECROSS_CRED_LINKEDIN_REFRESH_TOKEN_DESC="OAuth refresh token for automatic access token renewal."
|
||||
|
||||
; Bluesky (additional)
|
||||
COM_MOKOSUITECROSS_CRED_BLUESKY_PDS_URL="PDS URL"
|
||||
COM_MOKOSUITECROSS_CRED_BLUESKY_PDS_URL_DESC="Personal Data Server URL. Default is https://bsky.social. Only change for self-hosted PDS."
|
||||
|
||||
; Discord (additional)
|
||||
COM_MOKOSUITECROSS_CRED_DISCORD_USERNAME="Display Name Override"
|
||||
COM_MOKOSUITECROSS_CRED_DISCORD_USERNAME_DESC="Override the webhook's default display name. Leave empty to use the webhook name."
|
||||
COM_MOKOSUITECROSS_CRED_DISCORD_AVATAR="Avatar URL Override"
|
||||
COM_MOKOSUITECROSS_CRED_DISCORD_AVATAR_DESC="Override the webhook's default avatar with a custom image URL."
|
||||
|
||||
; Mailchimp (additional)
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_NAME="From Name"
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_NAME_DESC="Sender name for campaigns. Leave empty to use the audience default."
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_EMAIL="From Email"
|
||||
COM_MOKOSUITECROSS_CRED_MAILCHIMP_FROM_EMAIL_DESC="Sender email for campaigns. Must be a verified sending domain."
|
||||
|
||||
; SendGrid (additional)
|
||||
COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_EMAIL="From Email"
|
||||
COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_EMAIL_DESC="Verified sender email address for Single Sends."
|
||||
COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_NAME="From Name"
|
||||
COM_MOKOSUITECROSS_CRED_SENDGRID_FROM_NAME_DESC="Display name for the sender."
|
||||
|
||||
; Reddit (additional)
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_PASSWORD="Account Password"
|
||||
COM_MOKOSUITECROSS_CRED_REDDIT_PASSWORD_DESC="Required for Reddit script-type OAuth. The password for the Reddit account."
|
||||
|
||||
; WordPress (additional)
|
||||
COM_MOKOSUITECROSS_CRED_WP_DEFAULT_STATUS="Default Post Status"
|
||||
COM_MOKOSUITECROSS_CRED_WP_DEFAULT_STATUS_DESC="Whether cross-posted articles appear as drafts or are published immediately."
|
||||
|
||||
; Dev.to (additional)
|
||||
COM_MOKOSUITECROSS_CRED_DEVTO_ORG_ID="Organization ID"
|
||||
COM_MOKOSUITECROSS_CRED_DEVTO_ORG_ID_DESC="Optional. Publish under a Dev.to organization instead of your personal account."
|
||||
|
||||
; Ghost (additional)
|
||||
COM_MOKOSUITECROSS_CRED_GHOST_DEFAULT_STATUS="Default Post Status"
|
||||
COM_MOKOSUITECROSS_CRED_GHOST_DEFAULT_STATUS_DESC="Whether cross-posted articles are saved as drafts or published immediately."
|
||||
|
||||
; Status options (shared)
|
||||
COM_MOKOSUITECROSS_STATUS_DRAFT="Draft"
|
||||
COM_MOKOSUITECROSS_STATUS_PUBLISH="Publish"
|
||||
COM_MOKOSUITECROSS_STATUS_PUBLISHED="Published"
|
||||
|
||||
; Pinterest
|
||||
COM_MOKOSUITECROSS_CRED_PINTEREST_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_PINTEREST_TOKEN_DESC="Pinterest API v5 access token from the Developer Portal."
|
||||
COM_MOKOSUITECROSS_CRED_PINTEREST_BOARD="Board ID"
|
||||
COM_MOKOSUITECROSS_CRED_PINTEREST_BOARD_DESC="The board to pin to. Find the ID in the board URL or via the API."
|
||||
|
||||
; Tumblr
|
||||
COM_MOKOSUITECROSS_CRED_TUMBLR_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_TUMBLR_TOKEN_DESC="Tumblr OAuth access token."
|
||||
COM_MOKOSUITECROSS_CRED_TUMBLR_BLOG="Blog Name"
|
||||
COM_MOKOSUITECROSS_CRED_TUMBLR_BLOG_DESC="Your Tumblr blog name (e.g. myblog — without .tumblr.com)."
|
||||
|
||||
; TikTok
|
||||
COM_MOKOSUITECROSS_CRED_TIKTOK_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_TIKTOK_REFRESH_TOKEN="Refresh Token"
|
||||
COM_MOKOSUITECROSS_CRED_TIKTOK_OPEN_ID="Open ID"
|
||||
COM_MOKOSUITECROSS_CRED_TIKTOK_OPEN_ID_DESC="Your TikTok Open ID from the developer app authorization."
|
||||
|
||||
; Nostr
|
||||
COM_MOKOSUITECROSS_CRED_NOSTR_PRIVKEY="Private Key"
|
||||
COM_MOKOSUITECROSS_CRED_NOSTR_PRIVKEY_DESC="Nostr private key in hex or nsec format. Used to sign events."
|
||||
COM_MOKOSUITECROSS_CRED_NOSTR_RELAYS="Relay URLs"
|
||||
COM_MOKOSUITECROSS_CRED_NOSTR_RELAYS_DESC="Comma-separated list of relay WebSocket URLs (e.g. wss://relay.damus.io, wss://nos.lol)."
|
||||
|
||||
; ActivityPub
|
||||
COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_INSTANCE="Instance URL"
|
||||
COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_INSTANCE_DESC="Fediverse instance URL (Pleroma, Akkoma, Misskey, Pixelfed, etc.)."
|
||||
COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_ACTIVITYPUB_TOKEN_DESC="API access token from the instance's developer settings."
|
||||
|
||||
; Brevo (Sendinblue)
|
||||
COM_MOKOSUITECROSS_CRED_BREVO_KEY="API Key"
|
||||
COM_MOKOSUITECROSS_CRED_BREVO_LIST="Contact List ID"
|
||||
COM_MOKOSUITECROSS_CRED_BREVO_LIST_DESC="Brevo contact list ID to send campaigns to."
|
||||
COM_MOKOSUITECROSS_CRED_BREVO_SENDER_EMAIL="Sender Email"
|
||||
COM_MOKOSUITECROSS_CRED_BREVO_SENDER_EMAIL_DESC="Must be a verified sender in your Brevo account."
|
||||
COM_MOKOSUITECROSS_CRED_BREVO_SENDER_NAME="Sender Name"
|
||||
|
||||
; ConvertKit
|
||||
COM_MOKOSUITECROSS_CRED_CONVERTKIT_KEY="API Key"
|
||||
COM_MOKOSUITECROSS_CRED_CONVERTKIT_SECRET="API Secret"
|
||||
|
||||
; Constant Contact
|
||||
COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_REFRESH_TOKEN="Refresh Token"
|
||||
COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_LISTS="Contact List IDs"
|
||||
COM_MOKOSUITECROSS_CRED_CONSTANTCONTACT_LISTS_DESC="Comma-separated list IDs to include in the campaign."
|
||||
|
||||
; Hashnode
|
||||
COM_MOKOSUITECROSS_CRED_HASHNODE_TOKEN="Personal Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_HASHNODE_PUB_ID="Publication ID"
|
||||
COM_MOKOSUITECROSS_CRED_HASHNODE_PUB_ID_DESC="Your Hashnode publication ID. Find in Dashboard → General settings."
|
||||
|
||||
; Google Blogger
|
||||
COM_MOKOSUITECROSS_CRED_BLOGGER_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_BLOGGER_REFRESH_TOKEN="Refresh Token"
|
||||
COM_MOKOSUITECROSS_CRED_BLOGGER_BLOG_ID="Blog ID"
|
||||
COM_MOKOSUITECROSS_CRED_BLOGGER_BLOG_ID_DESC="Numeric Blog ID from Blogger settings or the Blogger API."
|
||||
|
||||
; Google Business Profile
|
||||
COM_MOKOSUITECROSS_CRED_GBUSINESS_TOKEN="Access Token"
|
||||
COM_MOKOSUITECROSS_CRED_GBUSINESS_REFRESH_TOKEN="Refresh Token"
|
||||
COM_MOKOSUITECROSS_CRED_GBUSINESS_LOCATION="Location ID"
|
||||
COM_MOKOSUITECROSS_CRED_GBUSINESS_LOCATION_DESC="Google Business location ID (e.g. locations/1234567890)."
|
||||
COM_MOKOSUITECROSS_CRED_GBUSINESS_ACCOUNT="Account ID"
|
||||
COM_MOKOSUITECROSS_CRED_GBUSINESS_ACCOUNT_DESC="Google Business account ID (e.g. accounts/1234567890)."
|
||||
|
||||
; RSS Feed
|
||||
COM_MOKOSUITECROSS_CRED_RSSFEED_TITLE="Feed Title"
|
||||
COM_MOKOSUITECROSS_CRED_RSSFEED_TITLE_DESC="Title for the generated RSS feed. Defaults to the site name."
|
||||
COM_MOKOSUITECROSS_CRED_RSSFEED_MAX_ITEMS="Max Feed Items"
|
||||
COM_MOKOSUITECROSS_CRED_RSSFEED_MAX_ITEMS_DESC="Maximum number of items to include in the feed."
|
||||
|
||||
; Webhook (additional)
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_AUTH_TYPE="Authentication"
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_AUTH_TYPE_DESC="Authentication method for the webhook endpoint."
|
||||
COM_MOKOSUITECROSS_WEBHOOK_AUTH_NONE="None"
|
||||
COM_MOKOSUITECROSS_WEBHOOK_AUTH_BEARER="Bearer Token"
|
||||
COM_MOKOSUITECROSS_WEBHOOK_AUTH_BASIC="Basic Auth"
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_BEARER_TOKEN="Bearer Token"
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_BEARER_TOKEN_DESC="Authentication token sent as Authorization: Bearer {token}."
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_BASIC_USER="Username"
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_BASIC_PWD="Password"
|
||||
COM_MOKOSUITECROSS_CRED_WEBHOOK_CONTENT_TYPE="Content Type"
|
||||
|
||||
; Service help link
|
||||
COM_MOKOSUITECROSS_SERVICE_HELP_LINK="%s Setup Guide"
|
||||
|
||||
; Setup help panel
|
||||
COM_MOKOSUITECROSS_SETUP_HELP_TITLE="How to set up"
|
||||
COM_MOKOSUITECROSS_SETUP_HELP_INTRO="Setting up a new service is easy:"
|
||||
COM_MOKOSUITECROSS_SETUP_STEP1="Choose a service type from the dropdown"
|
||||
COM_MOKOSUITECROSS_SETUP_STEP2="Fill in the connection details that appear"
|
||||
COM_MOKOSUITECROSS_SETUP_STEP3="For OAuth services, save first, then click Connect"
|
||||
COM_MOKOSUITECROSS_SETUP_STEP4="Set status to Published and save"
|
||||
|
||||
; Test Connection
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_TITLE="Test Connection"
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_DESC="Verify that your credentials are valid and the service is reachable."
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_BUTTON="Test Connection"
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_TESTING="Testing..."
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_SUCCESS="Connection successful"
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_FAILED="Connection failed"
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_ERROR="Could not reach the server. Please try again."
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_NO_SERVICE="No service specified for test."
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_NOT_FOUND="Service record not found."
|
||||
COM_MOKOSUITECROSS_TEST_CONNECTION_NO_PLUGIN="No service plugin available for type '%s'."
|
||||
|
||||
; Bulk Queue Actions
|
||||
COM_MOKOSUITECROSS_TOOLBAR_RETRY_FAILED="Retry Failed"
|
||||
COM_MOKOSUITECROSS_TOOLBAR_PURGE_POSTED="Purge Posted"
|
||||
COM_MOKOSUITECROSS_POSTS_N_RETRIED="%d failed post(s) re-queued for retry."
|
||||
COM_MOKOSUITECROSS_POSTS_N_RETRIED_1="1 failed post re-queued for retry."
|
||||
COM_MOKOSUITECROSS_POSTS_N_PURGED="%d posted record(s) purged."
|
||||
COM_MOKOSUITECROSS_POSTS_N_PURGED_1="1 posted record purged."
|
||||
COM_MOKOSUITECROSS_POSTS_N_SCHEDULED="%d post(s) scheduled."
|
||||
COM_MOKOSUITECROSS_POSTS_NO_ITEM_SELECTED="No posts selected."
|
||||
COM_MOKOSUITECROSS_SCHEDULE_NO_DATE="Please select a date and time for scheduling."
|
||||
COM_MOKOSUITECROSS_TOOLBAR_SCHEDULE="Schedule"
|
||||
COM_MOKOSUITECROSS_TOOLBAR_RETRY_SELECTED="Retry Selected"
|
||||
|
||||
; Queue Depth Warning
|
||||
COM_MOKOSUITECROSS_DASHBOARD_QUEUE_DEPTH_WARNING_TITLE="Large queue backlog"
|
||||
COM_MOKOSUITECROSS_DASHBOARD_QUEUE_DEPTH_WARNING="There are %d posts waiting in the queue. Please verify that the Joomla Task Scheduler is running and the MokoSuiteCross scheduled task is enabled in System → Scheduled Tasks."
|
||||
|
||||
; First-Publish-Only
|
||||
COM_MOKOSUITECROSS_CONFIG_FIRST_PUBLISH_ONLY="First Publish Only"
|
||||
COM_MOKOSUITECROSS_CONFIG_FIRST_PUBLISH_ONLY_DESC="When enabled, articles are only cross-posted on their first save as published. Subsequent edits to already-published articles will not trigger new cross-posts."
|
||||
|
||||
; Trend Chart
|
||||
COM_MOKOSUITECROSS_DASHBOARD_TREND_CHART="Daily Post Trend"
|
||||
|
||||
; Date Range Period Filter
|
||||
COM_MOKOSUITECROSS_PERIOD_7_DAYS="Last 7 days"
|
||||
COM_MOKOSUITECROSS_PERIOD_30_DAYS="Last 30 days"
|
||||
COM_MOKOSUITECROSS_PERIOD_90_DAYS="Last 90 days"
|
||||
COM_MOKOSUITECROSS_PERIOD_ALL_TIME="All time"
|
||||
|
||||
; Hashtag Placeholders
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_TAGS="Article tags (comma-separated)"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_HASHTAGS="Article tags as hashtags (#Tag1 #Tag2)"
|
||||
COM_MOKOSUITECROSS_PLACEHOLDER_CUSTOM_FIELD="Custom field value (replace xxx with field name)"
|
||||
|
||||
; CSV Export
|
||||
COM_MOKOSUITECROSS_EXPORT_CSV="Export CSV"
|
||||
|
||||
; Service Stats (drill-down)
|
||||
COM_MOKOSUITECROSS_SERVICESTATS_RECENT_POSTS="Recent Posts"
|
||||
COM_MOKOSUITECROSS_SERVICESTATS_NO_POSTS="No posts for this service yet."
|
||||
COM_MOKOSUITECROSS_SERVICESTATS_TOP_ARTICLES="Top Articles for This Service"
|
||||
|
||||
; API Dispatch
|
||||
COM_MOKOSUITECROSS_DISPATCH_MISSING_ARTICLE="Missing or invalid article_id in request body."
|
||||
COM_MOKOSUITECROSS_DISPATCH_INVALID_SERVICES="service_ids must be a non-empty array of service IDs."
|
||||
COM_MOKOSUITECROSS_DISPATCH_ARTICLE_NOT_FOUND="Article not found."
|
||||
COM_MOKOSUITECROSS_DISPATCH_NO_SERVICES="No enabled services found matching the request."
|
||||
|
||||
; Category Rules
|
||||
COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES="Category Rules"
|
||||
COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES_NOTE="Category Routing"
|
||||
COM_MOKOSUITECROSS_CONFIG_CATEGORY_RULES_NOTE_DESC="Category routing rules let you map Joomla categories to specific cross-post services. When rules exist for a category, only those services receive posts. When no rules exist, all services are used (default behaviour). Rules are managed in the database table #__mokosuitecross_category_rules. A full admin UI will be added in a future release."
|
||||
@@ -0,0 +1,11 @@
|
||||
; MokoSuiteCross — System Language File
|
||||
; Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
; License: GPL-3.0-or-later
|
||||
|
||||
COM_MOKOSUITECROSS="MokoSuiteCross"
|
||||
COM_MOKOSUITECROSS_DESCRIPTION="Cross-posting Joomla content to social media, email marketing, and chat platforms"
|
||||
COM_MOKOSUITECROSS_SUBMENU_DASHBOARD="Dashboard"
|
||||
COM_MOKOSUITECROSS_SUBMENU_POSTS="Post Queue"
|
||||
COM_MOKOSUITECROSS_SUBMENU_SERVICES="Services"
|
||||
COM_MOKOSUITECROSS_SUBMENU_TEMPLATES="Templates"
|
||||
COM_MOKOSUITECROSS_SUBMENU_LOGS="Activity Logs"
|
||||
+13
-13
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="component" method="upgrade">
|
||||
<name>com_mokojoomcross</name>
|
||||
<version>01.00.27-dev</version>
|
||||
<name>com_mokosuitecross</name>
|
||||
<version>01.02.00-rc</version>
|
||||
<creationDate>2026-05-28</creationDate>
|
||||
<author>Moko Consulting</author>
|
||||
<authorEmail>hello@mokoconsulting.tech</authorEmail>
|
||||
<authorUrl>https://mokoconsulting.tech</authorUrl>
|
||||
<copyright>Copyright (C) 2026 Moko Consulting. All rights reserved.</copyright>
|
||||
<license>GPL-3.0-or-later</license>
|
||||
<description>COM_MOKOJOOMCROSS_DESCRIPTION</description>
|
||||
<description>COM_MOKOSUITECROSS_DESCRIPTION</description>
|
||||
|
||||
<namespace path="src">Joomla\Component\MokoJoomCross</namespace>
|
||||
<namespace path="src">Joomla\Component\MokoSuiteCross</namespace>
|
||||
|
||||
<scriptfile>script.php</scriptfile>
|
||||
|
||||
@@ -37,19 +37,19 @@
|
||||
</files>
|
||||
|
||||
<languages>
|
||||
<language tag="en-GB">site/language/en-GB/com_mokojoomcross.ini</language>
|
||||
<language tag="en-GB" folder="administrator">language/en-GB/com_mokojoomcross.ini</language>
|
||||
<language tag="en-GB" folder="administrator">language/en-GB/com_mokojoomcross.sys.ini</language>
|
||||
<language tag="en-GB">site/language/en-GB/com_mokosuitecross.ini</language>
|
||||
<language tag="en-GB" folder="administrator">language/en-GB/com_mokosuitecross.ini</language>
|
||||
<language tag="en-GB" folder="administrator">language/en-GB/com_mokosuitecross.sys.ini</language>
|
||||
</languages>
|
||||
|
||||
<administration>
|
||||
<menu img="class:share-alt">COM_MOKOJOOMCROSS</menu>
|
||||
<menu img="class:share-alt">COM_MOKOSUITECROSS</menu>
|
||||
<submenu>
|
||||
<menu link="option=com_mokojoomcross&view=dashboard">COM_MOKOJOOMCROSS_SUBMENU_DASHBOARD</menu>
|
||||
<menu link="option=com_mokojoomcross&view=posts">COM_MOKOJOOMCROSS_SUBMENU_POSTS</menu>
|
||||
<menu link="option=com_mokojoomcross&view=services">COM_MOKOJOOMCROSS_SUBMENU_SERVICES</menu>
|
||||
<menu link="option=com_mokojoomcross&view=templates">COM_MOKOJOOMCROSS_SUBMENU_TEMPLATES</menu>
|
||||
<menu link="option=com_mokojoomcross&view=logs">COM_MOKOJOOMCROSS_SUBMENU_LOGS</menu>
|
||||
<menu link="option=com_mokosuitecross&view=dashboard">COM_MOKOSUITECROSS_SUBMENU_DASHBOARD</menu>
|
||||
<menu link="option=com_mokosuitecross&view=posts">COM_MOKOSUITECROSS_SUBMENU_POSTS</menu>
|
||||
<menu link="option=com_mokosuitecross&view=services">COM_MOKOSUITECROSS_SUBMENU_SERVICES</menu>
|
||||
<menu link="option=com_mokosuitecross&view=templates">COM_MOKOSUITECROSS_SUBMENU_TEMPLATES</menu>
|
||||
<menu link="option=com_mokosuitecross&view=logs">COM_MOKOSUITECROSS_SUBMENU_LOGS</menu>
|
||||
</submenu>
|
||||
<files>
|
||||
<filename>access.xml</filename>
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
@@ -13,7 +13,7 @@ defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Installer\InstallerAdapter;
|
||||
|
||||
class Com_MokoJoomCrossInstallerScript
|
||||
class Com_MokoSuiteCrossInstallerScript
|
||||
{
|
||||
public function preflight(string $type, InstallerAdapter $parent): bool
|
||||
{
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
@@ -16,7 +16,7 @@ use Joomla\CMS\Extension\ComponentInterface;
|
||||
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
|
||||
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
|
||||
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Extension\MokoJoomCrossComponent;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Extension\MokoSuiteCrossComponent;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
|
||||
@@ -30,13 +30,13 @@ return new class () implements ServiceProviderInterface {
|
||||
*/
|
||||
public function register(Container $container): void
|
||||
{
|
||||
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\MokoJoomCross'));
|
||||
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\MokoJoomCross'));
|
||||
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\MokoSuiteCross'));
|
||||
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\MokoSuiteCross'));
|
||||
|
||||
$container->set(
|
||||
ComponentInterface::class,
|
||||
function (Container $container) {
|
||||
$component = new MokoJoomCrossComponent(
|
||||
$component = new MokoSuiteCrossComponent(
|
||||
$container->get(ComponentDispatcherFactoryInterface::class)
|
||||
);
|
||||
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
; MokoJoomCross — Site Frontend Language File
|
||||
; MokoSuiteCross — Site Frontend Language File
|
||||
; Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
; License: GPL-3.0-or-later
|
||||
|
||||
COM_MOKOJOOMCROSS="MokoJoomCross"
|
||||
COM_MOKOSUITECROSS="MokoSuiteCross"
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Site\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Site\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
+10
-10
@@ -1,8 +1,8 @@
|
||||
-- MokoJoomCross 01.00.00 — Initial schema
|
||||
-- MokoSuiteCross 01.00.00 — Initial schema
|
||||
-- Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__mokojoomcross_services` (
|
||||
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_services` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
`alias` varchar(400) NOT NULL DEFAULT '',
|
||||
@@ -21,10 +21,10 @@ CREATE TABLE IF NOT EXISTS `#__mokojoomcross_services` (
|
||||
KEY `idx_service_type` (`service_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__mokojoomcross_posts` (
|
||||
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_posts` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`article_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to #__content.id',
|
||||
`service_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to #__mokojoomcross_services.id',
|
||||
`service_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to #__mokosuitecross_services.id',
|
||||
`status` varchar(20) NOT NULL DEFAULT 'queued' COMMENT 'queued, posting, posted, failed, scheduled',
|
||||
`message` text NOT NULL COMMENT 'Rendered message sent to platform',
|
||||
`platform_post_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'Post ID returned by platform',
|
||||
@@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS `#__mokojoomcross_posts` (
|
||||
KEY `idx_scheduled` (`scheduled_at`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__mokojoomcross_templates` (
|
||||
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_templates` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`service_type` varchar(50) NOT NULL DEFAULT '' COMMENT 'Platform this template is for (or "default")',
|
||||
`title` varchar(255) NOT NULL DEFAULT '',
|
||||
@@ -56,10 +56,10 @@ CREATE TABLE IF NOT EXISTS `#__mokojoomcross_templates` (
|
||||
KEY `idx_published` (`published`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__mokojoomcross_logs` (
|
||||
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_logs` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`post_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to #__mokojoomcross_posts.id',
|
||||
`service_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to #__mokojoomcross_services.id',
|
||||
`post_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to #__mokosuitecross_posts.id',
|
||||
`service_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to #__mokosuitecross_services.id',
|
||||
`level` varchar(20) NOT NULL DEFAULT 'info' COMMENT 'info, warning, error',
|
||||
`message` text NOT NULL,
|
||||
`context` text NOT NULL COMMENT 'JSON — additional context data',
|
||||
@@ -72,7 +72,7 @@ CREATE TABLE IF NOT EXISTS `#__mokojoomcross_logs` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- Insert default templates
|
||||
INSERT INTO `#__mokojoomcross_templates` (`service_type`, `title`, `template_body`, `published`, `ordering`, `created`) VALUES
|
||||
INSERT INTO `#__mokosuitecross_templates` (`service_type`, `title`, `template_body`, `published`, `ordering`, `created`) VALUES
|
||||
('default', 'Default Template', '{title}\n\n{introtext}\n\n{url}', 1, 1, NOW()),
|
||||
('twitter', 'Twitter/X Default', '{title}\n\n{url}', 1, 2, NOW()),
|
||||
('mastodon', 'Mastodon Default', '{title}\n\n{introtext}\n\n{url}\n\n#Joomla', 1, 3, NOW()),
|
||||
@@ -94,7 +94,7 @@ INSERT INTO `#__mokojoomcross_templates` (`service_type`, `title`, `template_bod
|
||||
('reddit', 'Reddit Default', '{title}', 1, 19, NOW()),
|
||||
('pinterest', 'Pinterest Default', '{title} - {introtext}', 1, 20, NOW());
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__mokojoomcross_category_rules` (
|
||||
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_category_rules` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`category_id` int(10) unsigned NOT NULL,
|
||||
`service_id` int(10) unsigned NOT NULL,
|
||||
@@ -0,0 +1,5 @@
|
||||
-- MokoSuiteCross — Uninstall
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_logs`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_posts`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_templates`;
|
||||
DROP TABLE IF EXISTS `#__mokosuitecross_services`;
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
-- MokoJoomCross 01.00.00 — Initial release
|
||||
-- MokoSuiteCross 01.00.00 — Initial release
|
||||
-- No update queries needed for initial version
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
-- MokoJoomCross 01.01.00 — Category routing rules
|
||||
-- MokoSuiteCross 01.01.00 — Category routing rules
|
||||
-- Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-- Note: also in install.mysql.sql for fresh installs; IF NOT EXISTS prevents conflicts
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `#__mokojoomcross_category_rules` (
|
||||
CREATE TABLE IF NOT EXISTS `#__mokosuitecross_category_rules` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`category_id` int(10) unsigned NOT NULL,
|
||||
`service_id` int(10) unsigned NOT NULL,
|
||||
+10
-10
@@ -1,22 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Helper\MigrationHelper;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Helper\MigrationHelper;
|
||||
|
||||
class DashboardController extends BaseController
|
||||
{
|
||||
@@ -30,9 +30,9 @@ class DashboardController extends BaseController
|
||||
$this->checkToken();
|
||||
|
||||
// Check ACL
|
||||
if (!$this->app->getIdentity()->authorise('mokojoomcross.migrate', 'com_mokojoomcross')) {
|
||||
if (!$this->app->getIdentity()->authorise('mokosuitecross.migrate', 'com_mokosuitecross')) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=dashboard', false),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=dashboard', false),
|
||||
Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'),
|
||||
'error'
|
||||
);
|
||||
@@ -44,8 +44,8 @@ class DashboardController extends BaseController
|
||||
|
||||
if (!empty($result['errors'])) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=dashboard', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_MIGRATION_ERROR', implode('; ', $result['errors'])),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=dashboard', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_MIGRATION_ERROR', implode('; ', $result['errors'])),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -53,8 +53,8 @@ class DashboardController extends BaseController
|
||||
}
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=dashboard', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_MIGRATION_SUCCESS', $result['migrated'], $result['skipped']),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=dashboard', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_MIGRATION_SUCCESS', $result['migrated'], $result['skipped']),
|
||||
'success'
|
||||
);
|
||||
}
|
||||
+25
-18
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -18,13 +18,13 @@ use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Helper\CrossPostDispatcher;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Service\MokoJoomCrossServiceInterface;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Helper\CrossPostDispatcher;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Service\MokoSuiteCrossServiceInterface;
|
||||
|
||||
/**
|
||||
* REST API controller for dispatching cross-posts.
|
||||
*
|
||||
* Endpoint: POST /api/index.php/v1/mokojoomcross/dispatch
|
||||
* Endpoint: POST /api/index.php/v1/mokosuitecross/dispatch
|
||||
*
|
||||
* JSON body:
|
||||
* {
|
||||
@@ -55,13 +55,20 @@ class DispatchController extends BaseController
|
||||
return;
|
||||
}
|
||||
|
||||
// ACL check — require core.manage on the component
|
||||
if (!Factory::getApplication()->getIdentity()->authorise('core.manage', 'com_mokosuitecross')) {
|
||||
$this->sendJsonResponse(['error' => 'Forbidden'], 403);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Read JSON body
|
||||
$input = json_decode(file_get_contents('php://input'), true) ?: [];
|
||||
$articleId = (int) ($input['article_id'] ?? 0);
|
||||
$serviceIds = $input['service_ids'] ?? null;
|
||||
|
||||
if ($articleId < 1) {
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOJOOMCROSS_DISPATCH_MISSING_ARTICLE')], 400);
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOSUITECROSS_DISPATCH_MISSING_ARTICLE')], 400);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -69,7 +76,7 @@ class DispatchController extends BaseController
|
||||
// Validate service_ids if provided
|
||||
if ($serviceIds !== null) {
|
||||
if (!is_array($serviceIds) || empty($serviceIds)) {
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOJOOMCROSS_DISPATCH_INVALID_SERVICES')], 400);
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOSUITECROSS_DISPATCH_INVALID_SERVICES')], 400);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -89,7 +96,7 @@ class DispatchController extends BaseController
|
||||
$article = $db->loadObject();
|
||||
|
||||
if (!$article) {
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOJOOMCROSS_DISPATCH_ARTICLE_NOT_FOUND')], 404);
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOSUITECROSS_DISPATCH_ARTICLE_NOT_FOUND')], 404);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +104,7 @@ class DispatchController extends BaseController
|
||||
// Load enabled services, optionally filtered by service_ids
|
||||
$query = $db->getQuery(true)
|
||||
->select('*')
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('published') . ' = 1')
|
||||
->order($db->quoteName('ordering') . ' ASC');
|
||||
|
||||
@@ -109,7 +116,7 @@ class DispatchController extends BaseController
|
||||
$services = $db->loadObjectList() ?: [];
|
||||
|
||||
if (empty($services)) {
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOJOOMCROSS_DISPATCH_NO_SERVICES')], 404);
|
||||
$this->sendJsonResponse(['error' => Text::_('COM_MOKOSUITECROSS_DISPATCH_NO_SERVICES')], 404);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -118,13 +125,13 @@ class DispatchController extends BaseController
|
||||
// In Joomla 5+ with SubscriberInterface, plugins receive the Event object
|
||||
// as their first argument. When they do $services[] = $this, they append to
|
||||
// the Event via ArrayAccess at numeric indices starting at 1.
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
|
||||
$servicePlugins = [];
|
||||
$event = new \Joomla\Event\Event('onMokoJoomCrossGetServices', [$servicePlugins]);
|
||||
$event = new \Joomla\Event\Event('onMokoSuiteCrossGetServices', [$servicePlugins]);
|
||||
|
||||
try {
|
||||
$app->getDispatcher()->dispatch('onMokoJoomCrossGetServices', $event);
|
||||
$app->getDispatcher()->dispatch('onMokoSuiteCrossGetServices', $event);
|
||||
} catch (\Throwable $e) {
|
||||
// Dispatcher may not be available
|
||||
}
|
||||
@@ -140,7 +147,7 @@ class DispatchController extends BaseController
|
||||
$pluginMap = [];
|
||||
|
||||
foreach ($servicePlugins as $plugin) {
|
||||
if ($plugin instanceof MokoJoomCrossServiceInterface) {
|
||||
if ($plugin instanceof MokoSuiteCrossServiceInterface) {
|
||||
$pluginMap[$plugin->getServiceType()] = $plugin;
|
||||
}
|
||||
}
|
||||
@@ -169,7 +176,7 @@ class DispatchController extends BaseController
|
||||
// Duplicate guard — skip if article already posted/queued for this service
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('article_id') . ' = ' . (int) $article->id)
|
||||
->where($db->quoteName('service_id') . ' = ' . (int) $service->id)
|
||||
->where($db->quoteName('status') . ' IN (' . $db->quote('queued') . ',' . $db->quote('posted') . ',' . $db->quote('posting') . ')');
|
||||
@@ -203,7 +210,7 @@ class DispatchController extends BaseController
|
||||
'modified' => $now,
|
||||
];
|
||||
|
||||
$db->insertObject('#__mokojoomcross_posts', $post);
|
||||
$db->insertObject('#__mokosuitecross_posts', $post);
|
||||
$postId = (int) $db->insertid();
|
||||
|
||||
$createdIds[] = [
|
||||
@@ -223,7 +230,7 @@ class DispatchController extends BaseController
|
||||
'created' => $now,
|
||||
];
|
||||
|
||||
$db->insertObject('#__mokojoomcross_logs', $log);
|
||||
$db->insertObject('#__mokosuitecross_logs', $log);
|
||||
}
|
||||
|
||||
$this->sendJsonResponse([
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
+34
-32
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -18,7 +18,7 @@ use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Helper\OAuthHelper;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Helper\OAuthHelper;
|
||||
|
||||
/**
|
||||
* OAuth controller for handling browser-based authorization flows.
|
||||
@@ -36,12 +36,14 @@ class OauthController extends BaseController
|
||||
*/
|
||||
public function authorize(): void
|
||||
{
|
||||
$this->checkToken();
|
||||
|
||||
$serviceId = $this->input->getInt('service_id', 0);
|
||||
|
||||
if (!$serviceId) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_OAUTH_NO_SERVICE'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::_('COM_MOKOSUITECROSS_OAUTH_NO_SERVICE'),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -52,7 +54,7 @@ class OauthController extends BaseController
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select('*')
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('id') . ' = ' . $serviceId);
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -60,8 +62,8 @@ class OauthController extends BaseController
|
||||
|
||||
if (!$service) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_OAUTH_SERVICE_NOT_FOUND'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::_('COM_MOKOSUITECROSS_OAUTH_SERVICE_NOT_FOUND'),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -69,16 +71,16 @@ class OauthController extends BaseController
|
||||
}
|
||||
|
||||
// Get client ID from plugin params
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
$pluginParams = PluginHelper::getPlugin('mokojoomcross', $service->service_type);
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
$pluginParams = PluginHelper::getPlugin('mokosuitecross', $service->service_type);
|
||||
$params = json_decode($pluginParams->params ?? '{}', true) ?: [];
|
||||
|
||||
$clientId = $params['client_id'] ?? '';
|
||||
|
||||
if (empty($clientId)) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_OAUTH_NO_CLIENT_ID', ucfirst($service->service_type)),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_OAUTH_NO_CLIENT_ID', ucfirst($service->service_type)),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -87,14 +89,14 @@ class OauthController extends BaseController
|
||||
|
||||
// Generate CSRF nonce and store in session
|
||||
$nonce = bin2hex(random_bytes(16));
|
||||
Factory::getApplication()->getSession()->set('mokojoomcross.oauth_nonce', $nonce);
|
||||
Factory::getApplication()->getSession()->set('mokosuitecross.oauth_nonce', $nonce);
|
||||
|
||||
$url = OAuthHelper::getAuthorizeUrl($service->service_type, $serviceId, $clientId, $nonce);
|
||||
|
||||
if (!$url) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_OAUTH_NOT_SUPPORTED', ucfirst($service->service_type)),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_OAUTH_NOT_SUPPORTED', ucfirst($service->service_type)),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -117,8 +119,8 @@ class OauthController extends BaseController
|
||||
|
||||
if ($error) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_OAUTH_PLATFORM_ERROR', $error),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_OAUTH_PLATFORM_ERROR', $error),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -127,8 +129,8 @@ class OauthController extends BaseController
|
||||
|
||||
if (empty($code) || empty($state)) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_OAUTH_INVALID_CALLBACK'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::_('COM_MOKOSUITECROSS_OAUTH_INVALID_CALLBACK'),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -142,8 +144,8 @@ class OauthController extends BaseController
|
||||
|
||||
if (!$serviceId || !$serviceType) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_OAUTH_INVALID_STATE'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::_('COM_MOKOSUITECROSS_OAUTH_INVALID_STATE'),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -152,13 +154,13 @@ class OauthController extends BaseController
|
||||
|
||||
// CSRF nonce validation — compare state nonce against session
|
||||
$session = Factory::getApplication()->getSession();
|
||||
$sessionNonce = $session->get('mokojoomcross.oauth_nonce', '');
|
||||
$session->clear('mokojoomcross.oauth_nonce');
|
||||
$sessionNonce = $session->get('mokosuitecross.oauth_nonce', '');
|
||||
$session->clear('mokosuitecross.oauth_nonce');
|
||||
|
||||
if (empty($stateNonce) || !hash_equals($sessionNonce, $stateNonce)) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=services', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_OAUTH_INVALID_STATE'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=services', false),
|
||||
Text::_('COM_MOKOSUITECROSS_OAUTH_INVALID_STATE'),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -166,8 +168,8 @@ class OauthController extends BaseController
|
||||
}
|
||||
|
||||
// Get client credentials from plugin params
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
$pluginParams = PluginHelper::getPlugin('mokojoomcross', $serviceType);
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
$pluginParams = PluginHelper::getPlugin('mokosuitecross', $serviceType);
|
||||
$params = json_decode($pluginParams->params ?? '{}', true) ?: [];
|
||||
|
||||
$clientId = $params['client_id'] ?? '';
|
||||
@@ -177,8 +179,8 @@ class OauthController extends BaseController
|
||||
|
||||
if (!empty($tokenData['error'])) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&task=service.edit&id=' . $serviceId, false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_OAUTH_TOKEN_ERROR', $tokenData['error']),
|
||||
Route::_('index.php?option=com_mokosuitecross&task=service.edit&id=' . $serviceId, false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_OAUTH_TOKEN_ERROR', $tokenData['error']),
|
||||
'error'
|
||||
);
|
||||
|
||||
@@ -188,8 +190,8 @@ class OauthController extends BaseController
|
||||
OAuthHelper::storeToken($serviceId, $tokenData);
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&task=service.edit&id=' . $serviceId, false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_OAUTH_SUCCESS', ucfirst($serviceType)),
|
||||
Route::_('index.php?option=com_mokosuitecross&task=service.edit&id=' . $serviceId, false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_OAUTH_SUCCESS', ucfirst($serviceType)),
|
||||
'success'
|
||||
);
|
||||
}
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
+31
-28
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -39,8 +39,8 @@ class PostsController extends AdminController
|
||||
|
||||
if (empty($ids)) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_POSTS_NO_ITEM_SELECTED'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::_('COM_MOKOSUITECROSS_POSTS_NO_ITEM_SELECTED'),
|
||||
'warning'
|
||||
);
|
||||
return;
|
||||
@@ -48,8 +48,8 @@ class PostsController extends AdminController
|
||||
|
||||
if (empty($scheduledAt)) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_SCHEDULE_NO_DATE'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::_('COM_MOKOSUITECROSS_SCHEDULE_NO_DATE'),
|
||||
'warning'
|
||||
);
|
||||
return;
|
||||
@@ -60,8 +60,8 @@ class PostsController extends AdminController
|
||||
$scheduledAt = $scheduledDate->toSql();
|
||||
} catch (\Throwable $e) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_SCHEDULE_INVALID_DATE'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::_('COM_MOKOSUITECROSS_SCHEDULE_INVALID_DATE'),
|
||||
'error'
|
||||
);
|
||||
return;
|
||||
@@ -72,19 +72,22 @@ class PostsController extends AdminController
|
||||
|
||||
foreach ($ids as $id) {
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('scheduled_at') . ' = ' . $db->quote($scheduledAt))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('queued'))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote($now))
|
||||
->where($db->quoteName('id') . ' = ' . (int) $id);
|
||||
->where($db->quoteName('id') . ' = ' . (int) $id)
|
||||
->where($db->quoteName('status') . ' IN ('
|
||||
. $db->quote('queued') . ',' . $db->quote('failed') . ','
|
||||
. $db->quote('permanently_failed') . ',' . $db->quote('cancelled') . ')');
|
||||
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_POSTS_N_SCHEDULED', count($ids)),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_POSTS_N_SCHEDULED', count($ids)),
|
||||
'success'
|
||||
);
|
||||
}
|
||||
@@ -102,18 +105,18 @@ class PostsController extends AdminController
|
||||
|
||||
if (empty($ids)) {
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::_('COM_MOKOJOOMCROSS_POSTS_NO_ITEM_SELECTED'),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::_('COM_MOKOSUITECROSS_POSTS_NO_ITEM_SELECTED'),
|
||||
'warning'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$count = \Joomla\Component\MokoJoomCross\Administrator\Helper\QueueProcessor::retryPosts($ids);
|
||||
$count = \Joomla\Component\MokoSuiteCross\Administrator\Helper\QueueProcessor::retryPosts($ids);
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::sprintf('COM_MOKOJOOMCROSS_POSTS_N_RETRIED', $count),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::sprintf('COM_MOKOSUITECROSS_POSTS_N_RETRIED', $count),
|
||||
'success'
|
||||
);
|
||||
}
|
||||
@@ -130,7 +133,7 @@ class PostsController extends AdminController
|
||||
$db = Factory::getDbo();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('queued'))
|
||||
->set($db->quoteName('retry_count') . ' = 0')
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(''))
|
||||
@@ -143,8 +146,8 @@ class PostsController extends AdminController
|
||||
$count = $db->getAffectedRows();
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::plural('COM_MOKOJOOMCROSS_POSTS_N_RETRIED', $count),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::plural('COM_MOKOSUITECROSS_POSTS_N_RETRIED', $count),
|
||||
'success'
|
||||
);
|
||||
}
|
||||
@@ -158,7 +161,7 @@ class PostsController extends AdminController
|
||||
{
|
||||
$this->checkToken('get');
|
||||
|
||||
if (!$this->app->getIdentity()->authorise('core.manage', 'com_mokojoomcross')) {
|
||||
if (!$this->app->getIdentity()->authorise('core.manage', 'com_mokosuitecross')) {
|
||||
throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
|
||||
}
|
||||
|
||||
@@ -177,10 +180,10 @@ class PostsController extends AdminController
|
||||
$db->quoteName('a.platform_post_id'),
|
||||
$db->quoteName('a.created'),
|
||||
])
|
||||
->from($db->quoteName('#__mokojoomcross_posts', 'a'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'a'))
|
||||
->join('LEFT', $db->quoteName('#__content', 'c')
|
||||
. ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('a.article_id'))
|
||||
->join('LEFT', $db->quoteName('#__mokojoomcross_services', 's')
|
||||
->join('LEFT', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('a.service_id'))
|
||||
->order($db->quoteName('a.created') . ' DESC');
|
||||
|
||||
@@ -208,7 +211,7 @@ class PostsController extends AdminController
|
||||
$db->setQuery($query);
|
||||
$rows = $db->loadAssocList() ?: [];
|
||||
|
||||
$filename = 'mokojoomcross-posts-' . Factory::getDate()->format('Y-m-d') . '.csv';
|
||||
$filename = 'mokosuitecross-posts-' . Factory::getDate()->format('Y-m-d') . '.csv';
|
||||
|
||||
$app->setHeader('Content-Type', 'text/csv; charset=utf-8');
|
||||
$app->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '"');
|
||||
@@ -238,7 +241,7 @@ class PostsController extends AdminController
|
||||
$db = Factory::getDbo();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->delete($db->quoteName('#__mokojoomcross_posts'))
|
||||
->delete($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote('posted'));
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -247,8 +250,8 @@ class PostsController extends AdminController
|
||||
$count = $db->getAffectedRows();
|
||||
|
||||
$this->setRedirect(
|
||||
Route::_('index.php?option=com_mokojoomcross&view=posts', false),
|
||||
Text::plural('COM_MOKOJOOMCROSS_POSTS_N_PURGED', $count),
|
||||
Route::_('index.php?option=com_mokosuitecross&view=posts', false),
|
||||
Text::plural('COM_MOKOSUITECROSS_POSTS_N_PURGED', $count),
|
||||
'success'
|
||||
);
|
||||
}
|
||||
+27
-16
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -18,7 +18,7 @@ use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Response\JsonResponse;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Service\MokoJoomCrossServiceInterface;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Service\MokoSuiteCrossServiceInterface;
|
||||
|
||||
class ServiceController extends FormController
|
||||
{
|
||||
@@ -29,52 +29,63 @@ class ServiceController extends FormController
|
||||
*/
|
||||
public function testConnection(): void
|
||||
{
|
||||
$this->checkToken();
|
||||
|
||||
if (!$this->app->getIdentity()->authorise('core.manage', 'com_mokosuitecross')) {
|
||||
throw new \RuntimeException(Text::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
|
||||
}
|
||||
|
||||
$app = $this->app;
|
||||
$id = (int) $this->input->getInt('id', 0);
|
||||
|
||||
try {
|
||||
if ($id <= 0) {
|
||||
throw new \RuntimeException(Text::_('COM_MOKOJOOMCROSS_TEST_CONNECTION_NO_SERVICE'));
|
||||
throw new \RuntimeException(Text::_('COM_MOKOSUITECROSS_TEST_CONNECTION_NO_SERVICE'));
|
||||
}
|
||||
|
||||
// Load the service record
|
||||
$db = Factory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('*')
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('id') . ' = ' . $id);
|
||||
$db->setQuery($query);
|
||||
$service = $db->loadObject();
|
||||
|
||||
if (!$service) {
|
||||
throw new \RuntimeException(Text::_('COM_MOKOJOOMCROSS_TEST_CONNECTION_NOT_FOUND'));
|
||||
throw new \RuntimeException(Text::_('COM_MOKOSUITECROSS_TEST_CONNECTION_NOT_FOUND'));
|
||||
}
|
||||
|
||||
// Get service plugins via dispatcher
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
// Get service plugins via dispatcher (Joomla 5+ Event ArrayAccess pattern)
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
|
||||
$servicePlugins = [];
|
||||
$app->getDispatcher()->dispatch(
|
||||
'onMokoJoomCrossGetServices',
|
||||
new \Joomla\Event\Event('onMokoJoomCrossGetServices', [&$servicePlugins])
|
||||
);
|
||||
$event = new \Joomla\Event\Event('onMokoSuiteCrossGetServices', [$servicePlugins]);
|
||||
$app->getDispatcher()->dispatch('onMokoSuiteCrossGetServices', $event);
|
||||
|
||||
$idx = 1;
|
||||
|
||||
while (isset($event[$idx])) {
|
||||
$servicePlugins[] = $event[$idx];
|
||||
$idx++;
|
||||
}
|
||||
|
||||
// Find the matching plugin
|
||||
$plugin = null;
|
||||
|
||||
foreach ($servicePlugins as $sp) {
|
||||
if ($sp instanceof MokoJoomCrossServiceInterface && $sp->getServiceType() === $service->service_type) {
|
||||
if ($sp instanceof MokoSuiteCrossServiceInterface && $sp->getServiceType() === $service->service_type) {
|
||||
$plugin = $sp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$plugin) {
|
||||
throw new \RuntimeException(Text::sprintf('COM_MOKOJOOMCROSS_TEST_CONNECTION_NO_PLUGIN', $service->service_type));
|
||||
throw new \RuntimeException(Text::sprintf('COM_MOKOSUITECROSS_TEST_CONNECTION_NO_PLUGIN', $service->service_type));
|
||||
}
|
||||
|
||||
// Decode credentials and validate
|
||||
$credentials = json_decode($service->credentials ?: '{}', true) ?: [];
|
||||
$credentials = \Joomla\Component\MokoSuiteCross\Administrator\Helper\CredentialHelper::decrypt($service->credentials ?: '');
|
||||
$result = $plugin->validateCredentials($credentials);
|
||||
|
||||
$app->mimeType = 'application/json';
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Controller;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Controller;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
+4
-4
@@ -1,20 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Extension;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Extension;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Extension\MVCComponent;
|
||||
|
||||
class MokoJoomCrossComponent extends MVCComponent
|
||||
class MokoSuiteCrossComponent extends MVCComponent
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
/**
|
||||
* Encrypts and decrypts service credentials using libsodium.
|
||||
*
|
||||
* Uses Joomla's $secret from configuration.php as the key source.
|
||||
* Falls back to plaintext JSON if sodium is unavailable or decryption
|
||||
* fails (backward compat with existing unencrypted credentials).
|
||||
*/
|
||||
class CredentialHelper
|
||||
{
|
||||
private const PREFIX = 'enc:sodium:';
|
||||
|
||||
/**
|
||||
* Encrypt a credentials array to a storable string.
|
||||
*
|
||||
* @param array $credentials Credentials to encrypt
|
||||
*
|
||||
* @return string Encrypted string prefixed with "enc:sodium:", or plain JSON as fallback
|
||||
*/
|
||||
public static function encrypt(array $credentials): string
|
||||
{
|
||||
$json = json_encode($credentials);
|
||||
|
||||
if (!function_exists('sodium_crypto_secretbox')) {
|
||||
return $json;
|
||||
}
|
||||
|
||||
try {
|
||||
$key = self::deriveKey();
|
||||
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
|
||||
$cipher = sodium_crypto_secretbox($json, $nonce, $key);
|
||||
|
||||
return self::PREFIX . base64_encode($nonce . $cipher);
|
||||
} catch (\Throwable $e) {
|
||||
return $json;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrypt a credentials string back to an array.
|
||||
*
|
||||
* Handles both encrypted (prefixed) and legacy plaintext JSON.
|
||||
*
|
||||
* @param string $stored Stored credential string
|
||||
*
|
||||
* @return array Decoded credentials
|
||||
*/
|
||||
public static function decrypt(string $stored): array
|
||||
{
|
||||
if (empty($stored)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Legacy plaintext JSON — no prefix
|
||||
if (!str_starts_with($stored, self::PREFIX)) {
|
||||
return json_decode($stored, true) ?: [];
|
||||
}
|
||||
|
||||
if (!function_exists('sodium_crypto_secretbox_open')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
$key = self::deriveKey();
|
||||
$payload = base64_decode(substr($stored, strlen(self::PREFIX)));
|
||||
|
||||
if ($payload === false || strlen($payload) < SODIUM_CRYPTO_SECRETBOX_NONCEBYTES) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$nonce = substr($payload, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
|
||||
$cipher = substr($payload, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
|
||||
$plain = sodium_crypto_secretbox_open($cipher, $nonce, $key);
|
||||
|
||||
if ($plain === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return json_decode($plain, true) ?: [];
|
||||
} catch (\Throwable $e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Derive a 32-byte encryption key from Joomla's secret.
|
||||
*/
|
||||
private static function deriveKey(): string
|
||||
{
|
||||
$secret = Factory::getApplication()->get('secret', '');
|
||||
|
||||
return sodium_crypto_generichash($secret, '', SODIUM_CRYPTO_SECRETBOX_KEYBYTES);
|
||||
}
|
||||
}
|
||||
+80
-62
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Helper;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -17,14 +17,14 @@ use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Service\MokoJoomCrossServiceInterface;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Service\MokoSuiteCrossServiceInterface;
|
||||
|
||||
/**
|
||||
* Static dispatcher for cross-posting content from any source plugin.
|
||||
*
|
||||
* Centralises the dispatch logic that was previously only in the system plugin,
|
||||
* so content-type source plugins (articles, calendar events, gallery items) can
|
||||
* trigger cross-posts without coupling to plg_system_mokojoomcross.
|
||||
* trigger cross-posts without coupling to plg_system_mokosuitecross.
|
||||
*/
|
||||
class CrossPostDispatcher
|
||||
{
|
||||
@@ -42,7 +42,7 @@ class CrossPostDispatcher
|
||||
// Load all enabled services
|
||||
$query = $db->getQuery(true)
|
||||
->select('*')
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('published') . ' = 1')
|
||||
->order($db->quoteName('ordering') . ' ASC');
|
||||
|
||||
@@ -54,17 +54,17 @@ class CrossPostDispatcher
|
||||
}
|
||||
|
||||
// Import service plugins so they register with the dispatcher
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
|
||||
// Collect registered service plugin instances.
|
||||
// In Joomla 5+ with SubscriberInterface, plugins receive the Event object
|
||||
// as their first argument. When they do $services[] = $this, they append to
|
||||
// the Event via ArrayAccess at numeric indices starting at 1.
|
||||
$servicePlugins = [];
|
||||
$event = new \Joomla\Event\Event('onMokoJoomCrossGetServices', [$servicePlugins]);
|
||||
$event = new \Joomla\Event\Event('onMokoSuiteCrossGetServices', [$servicePlugins]);
|
||||
|
||||
try {
|
||||
Factory::getApplication()->getDispatcher()->dispatch('onMokoJoomCrossGetServices', $event);
|
||||
Factory::getApplication()->getDispatcher()->dispatch('onMokoSuiteCrossGetServices', $event);
|
||||
} catch (\Throwable $e) {
|
||||
// Dispatcher may not be available in all contexts
|
||||
}
|
||||
@@ -81,17 +81,17 @@ class CrossPostDispatcher
|
||||
$pluginMap = [];
|
||||
|
||||
foreach ($servicePlugins as $plugin) {
|
||||
if ($plugin instanceof MokoJoomCrossServiceInterface) {
|
||||
if ($plugin instanceof MokoSuiteCrossServiceInterface) {
|
||||
$pluginMap[$plugin->getServiceType()] = $plugin;
|
||||
}
|
||||
}
|
||||
|
||||
$componentParams = ComponentHelper::getParams('com_mokojoomcross');
|
||||
$componentParams = ComponentHelper::getParams('com_mokosuitecross');
|
||||
|
||||
// Per-article selective cross-posting (#19)
|
||||
$attribs = json_decode($article->attribs ?? '{}', true) ?: [];
|
||||
$selectedServiceIds = $attribs['mokojoomcross_services'] ?? null;
|
||||
$skipCrossPost = !empty($attribs['mokojoomcross_skip']);
|
||||
$selectedServiceIds = $attribs['mokosuitecross_services'] ?? null;
|
||||
$skipCrossPost = !empty($attribs['mokosuitecross_skip']);
|
||||
|
||||
if ($skipCrossPost) {
|
||||
return;
|
||||
@@ -110,7 +110,7 @@ class CrossPostDispatcher
|
||||
if (!empty($article->catid)) {
|
||||
$query = $db->getQuery(true)
|
||||
->select('service_id')
|
||||
->from($db->quoteName('#__mokojoomcross_category_rules'))
|
||||
->from($db->quoteName('#__mokosuitecross_category_rules'))
|
||||
->where($db->quoteName('category_id') . ' = ' . (int) $article->catid)
|
||||
->where($db->quoteName('published') . ' = 1');
|
||||
$db->setQuery($query);
|
||||
@@ -128,7 +128,7 @@ class CrossPostDispatcher
|
||||
$serviceIdList = implode(',', array_map(function ($s) { return (int) $s->id; }, $services));
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('service_id'))
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('article_id') . ' = ' . (int) $article->id)
|
||||
->where($db->quoteName('service_id') . ' IN (' . $serviceIdList . ')')
|
||||
->where($db->quoteName('status') . ' IN (' . $db->quote('queued') . ',' . $db->quote('posted') . ',' . $db->quote('posting') . ')');
|
||||
@@ -141,7 +141,7 @@ class CrossPostDispatcher
|
||||
$typeQuotes[] = $db->quote('default');
|
||||
$query = $db->getQuery(true)
|
||||
->select([$db->quoteName('service_type'), $db->quoteName('template_body')])
|
||||
->from($db->quoteName('#__mokojoomcross_templates'))
|
||||
->from($db->quoteName('#__mokosuitecross_templates'))
|
||||
->where($db->quoteName('published') . ' = 1')
|
||||
->where($db->quoteName('service_type') . ' IN (' . implode(',', $typeQuotes) . ')')
|
||||
->order($db->quoteName('service_type') . ' ASC');
|
||||
@@ -154,6 +154,9 @@ class CrossPostDispatcher
|
||||
$templateMap[$row->service_type] = $row->template_body;
|
||||
}
|
||||
|
||||
// Pre-build article metadata once (category, author, tags) — avoids N queries per service
|
||||
$articleMeta = self::buildArticleMeta($article);
|
||||
|
||||
foreach ($services as $service) {
|
||||
// Category routing filter — if rules exist, only post to whitelisted services
|
||||
if ($categoryServiceIds !== null && !in_array((int) $service->id, $categoryServiceIds, true)) {
|
||||
@@ -174,7 +177,7 @@ class CrossPostDispatcher
|
||||
continue;
|
||||
}
|
||||
|
||||
$message = self::renderTemplate($article, $service, $templateMap);
|
||||
$message = self::renderTemplate($article, $service, $templateMap, $articleMeta);
|
||||
|
||||
// Extract intro image for media attachment
|
||||
$media = [];
|
||||
@@ -198,7 +201,7 @@ class CrossPostDispatcher
|
||||
'modified' => Factory::getDate()->toSql(),
|
||||
];
|
||||
|
||||
$db->insertObject('#__mokojoomcross_posts', $post);
|
||||
$db->insertObject('#__mokosuitecross_posts', $post);
|
||||
$postId = $db->insertid();
|
||||
|
||||
// Resolve article URL
|
||||
@@ -224,19 +227,19 @@ class CrossPostDispatcher
|
||||
/**
|
||||
* Execute a cross-post via the service plugin.
|
||||
*/
|
||||
private static function executePost($db, int $postId, MokoJoomCrossServiceInterface $plugin, string $message, object $service, array $media = [], string $articleUrl = ''): void
|
||||
private static function executePost($db, int $postId, MokoSuiteCrossServiceInterface $plugin, string $message, object $service, array $media = [], string $articleUrl = ''): void
|
||||
{
|
||||
// Mark as posting
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('posting'))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
->where($db->quoteName('id') . ' = ' . $postId)
|
||||
);
|
||||
$db->execute();
|
||||
|
||||
$credentials = json_decode($service->credentials ?: '{}', true) ?: [];
|
||||
$credentials = CredentialHelper::decrypt($service->credentials ?: '');
|
||||
$params = json_decode($service->params ?: '{}', true) ?: [];
|
||||
|
||||
if (!empty($articleUrl)) {
|
||||
@@ -248,8 +251,8 @@ class CrossPostDispatcher
|
||||
$dispatcher = Factory::getApplication()->getDispatcher();
|
||||
|
||||
try {
|
||||
$beforeEvent = new \Joomla\Event\Event('onMokoJoomCrossBeforePost', [$postId, &$message, $service->service_type, &$cancel]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossBeforePost', $beforeEvent);
|
||||
$beforeEvent = new \Joomla\Event\Event('onMokoSuiteCrossBeforePost', [$postId, &$message, $service->service_type, &$cancel]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossBeforePost', $beforeEvent);
|
||||
} catch (\Throwable $e) {
|
||||
// Dispatcher may not be available
|
||||
}
|
||||
@@ -257,7 +260,7 @@ class CrossPostDispatcher
|
||||
if ($cancel) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('cancelled'))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
->where($db->quoteName('id') . ' = ' . $postId)
|
||||
@@ -265,7 +268,7 @@ class CrossPostDispatcher
|
||||
$db->execute();
|
||||
|
||||
self::log($db, $postId, $service->id, 'info',
|
||||
sprintf('Post to %s cancelled by onMokoJoomCrossBeforePost event', $service->service_type));
|
||||
sprintf('Post to %s cancelled by onMokoSuiteCrossBeforePost event', $service->service_type));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -276,7 +279,7 @@ class CrossPostDispatcher
|
||||
if (!empty($result['success'])) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('posted'))
|
||||
->set($db->quoteName('platform_post_id') . ' = ' . $db->quote($result['platform_post_id'] ?? ''))
|
||||
->set($db->quoteName('platform_response') . ' = ' . $db->quote(json_encode($result['response'] ?? [])))
|
||||
@@ -290,8 +293,8 @@ class CrossPostDispatcher
|
||||
sprintf('Posted to %s (platform ID: %s)', $service->service_type, $result['platform_post_id'] ?? 'n/a'));
|
||||
|
||||
try {
|
||||
$afterEvent = new \Joomla\Event\Event('onMokoJoomCrossAfterPost', [$postId, $service->service_type, $result]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossAfterPost', $afterEvent);
|
||||
$afterEvent = new \Joomla\Event\Event('onMokoSuiteCrossAfterPost', [$postId, $service->service_type, $result]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossAfterPost', $afterEvent);
|
||||
} catch (\Throwable $e) {
|
||||
// Non-critical
|
||||
}
|
||||
@@ -300,7 +303,7 @@ class CrossPostDispatcher
|
||||
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('failed'))
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(mb_substr($errorMsg, 0, 1000)))
|
||||
->set($db->quoteName('platform_response') . ' = ' . $db->quote(json_encode($result['response'] ?? [])))
|
||||
@@ -313,8 +316,8 @@ class CrossPostDispatcher
|
||||
sprintf('Failed to post to %s: %s', $service->service_type, $errorMsg));
|
||||
|
||||
try {
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoJoomCrossPostFailed', [$postId, $service->service_type, $errorMsg]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossPostFailed', $failedEvent);
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoSuiteCrossPostFailed', [$postId, $service->service_type, $errorMsg]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossPostFailed', $failedEvent);
|
||||
} catch (\Throwable $e) {
|
||||
// Non-critical
|
||||
}
|
||||
@@ -322,7 +325,7 @@ class CrossPostDispatcher
|
||||
} catch (\Throwable $e) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('failed'))
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(mb_substr($e->getMessage(), 0, 1000)))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
@@ -334,8 +337,8 @@ class CrossPostDispatcher
|
||||
sprintf('Exception posting to %s: %s', $service->service_type, $e->getMessage()));
|
||||
|
||||
try {
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoJoomCrossPostFailed', [$postId, $service->service_type, $e->getMessage()]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossPostFailed', $failedEvent);
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoSuiteCrossPostFailed', [$postId, $service->service_type, $e->getMessage()]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossPostFailed', $failedEvent);
|
||||
} catch (\Throwable $ex) {
|
||||
// Non-critical
|
||||
}
|
||||
@@ -343,36 +346,21 @@ class CrossPostDispatcher
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the message template for a service.
|
||||
* Build article metadata (category, author, tags, image) for template rendering.
|
||||
* Call once per article, then pass to renderTemplate() for each service.
|
||||
*
|
||||
* @param object $article Article object
|
||||
*
|
||||
* @return array Pre-resolved metadata for template placeholders
|
||||
*/
|
||||
public static function renderTemplate(object $article, object $service, array $templateMap = []): string
|
||||
public static function buildArticleMeta(object $article): array
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Use pre-loaded template map if available, otherwise query
|
||||
if (!empty($templateMap)) {
|
||||
$template = $templateMap[$service->service_type] ?? $templateMap['default'] ?? "{title}\n\n{url}";
|
||||
} else {
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('template_body'))
|
||||
->from($db->quoteName('#__mokojoomcross_templates'))
|
||||
->where($db->quoteName('published') . ' = 1')
|
||||
->where('(' . $db->quoteName('service_type') . ' = ' . $db->quote($service->service_type)
|
||||
. ' OR ' . $db->quoteName('service_type') . ' = ' . $db->quote('default') . ')')
|
||||
->order('CASE WHEN ' . $db->quoteName('service_type') . ' = '
|
||||
. $db->quote($service->service_type) . ' THEN 0 ELSE 1 END')
|
||||
->setLimit(1);
|
||||
|
||||
$db->setQuery($query);
|
||||
$template = $db->loadResult() ?: "{title}\n\n{url}";
|
||||
}
|
||||
|
||||
// Build SEF article URL
|
||||
$url = $article->_article_url
|
||||
?? (Uri::root() . 'index.php?option=com_content&view=article&id=' . $article->id
|
||||
. (!empty($article->catid) ? '&catid=' . $article->catid : ''));
|
||||
|
||||
// Resolve category name
|
||||
$categoryName = '';
|
||||
|
||||
if (!empty($article->catid)) {
|
||||
@@ -384,7 +372,6 @@ class CrossPostDispatcher
|
||||
$categoryName = $db->loadResult() ?: '';
|
||||
}
|
||||
|
||||
// Resolve author name
|
||||
$authorName = '';
|
||||
|
||||
if (!empty($article->created_by)) {
|
||||
@@ -396,7 +383,6 @@ class CrossPostDispatcher
|
||||
$authorName = $db->loadResult() ?: '';
|
||||
}
|
||||
|
||||
// Extract intro image
|
||||
$introImage = '';
|
||||
$images = json_decode($article->images ?? '{}');
|
||||
|
||||
@@ -404,7 +390,6 @@ class CrossPostDispatcher
|
||||
$introImage = Uri::root() . ltrim($images->image_intro, '/');
|
||||
}
|
||||
|
||||
// Resolve article tags
|
||||
$tagNames = [];
|
||||
|
||||
if (!empty($article->id)) {
|
||||
@@ -425,8 +410,7 @@ class CrossPostDispatcher
|
||||
return '#' . preg_replace('/\s+/', '', $tag);
|
||||
}, $tagNames));
|
||||
|
||||
// Replace placeholders
|
||||
$replacements = [
|
||||
return [
|
||||
'{title}' => $article->title ?? '',
|
||||
'{introtext}' => strip_tags(mb_substr($article->introtext ?? '', 0, 280)),
|
||||
'{fulltext}' => strip_tags(mb_substr($article->fulltext ?? '', 0, 500)),
|
||||
@@ -438,6 +422,40 @@ class CrossPostDispatcher
|
||||
'{tags}' => $tagsComma,
|
||||
'{hashtags}' => $hashtags,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the message template for a service.
|
||||
*
|
||||
* @param object $article Article object
|
||||
* @param object $service Service object
|
||||
* @param array $templateMap Pre-loaded template map (service_type => body)
|
||||
* @param array $articleMeta Pre-built article metadata from buildArticleMeta()
|
||||
*/
|
||||
public static function renderTemplate(object $article, object $service, array $templateMap = [], array $articleMeta = []): string
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Use pre-loaded template map if available, otherwise query
|
||||
if (!empty($templateMap)) {
|
||||
$template = $templateMap[$service->service_type] ?? $templateMap['default'] ?? "{title}\n\n{url}";
|
||||
} else {
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('template_body'))
|
||||
->from($db->quoteName('#__mokosuitecross_templates'))
|
||||
->where($db->quoteName('published') . ' = 1')
|
||||
->where('(' . $db->quoteName('service_type') . ' = ' . $db->quote($service->service_type)
|
||||
. ' OR ' . $db->quoteName('service_type') . ' = ' . $db->quote('default') . ')')
|
||||
->order('CASE WHEN ' . $db->quoteName('service_type') . ' = '
|
||||
. $db->quote($service->service_type) . ' THEN 0 ELSE 1 END')
|
||||
->setLimit(1);
|
||||
|
||||
$db->setQuery($query);
|
||||
$template = $db->loadResult() ?: "{title}\n\n{url}";
|
||||
}
|
||||
|
||||
// Use pre-built metadata if available, otherwise build on the fly
|
||||
$replacements = !empty($articleMeta) ? $articleMeta : self::buildArticleMeta($article);
|
||||
|
||||
$message = str_replace(array_keys($replacements), array_values($replacements), $template);
|
||||
|
||||
@@ -471,6 +489,6 @@ class CrossPostDispatcher
|
||||
'created' => Factory::getDate()->toSql(),
|
||||
];
|
||||
|
||||
$db->insertObject('#__mokojoomcross_logs', $log);
|
||||
$db->insertObject('#__mokosuitecross_logs', $log);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
/**
|
||||
* Migration helper for importing settings from Perfect Publisher Pro (com_autotweet).
|
||||
*
|
||||
* PP Pro stores channels in #__autotweet_channels with a channeltype_id FK
|
||||
* to #__autotweet_channeltypes. Each channel has a JSON params column
|
||||
* containing OAuth tokens, API keys, webhook URLs, etc.
|
||||
*
|
||||
* This helper reads those channels and creates MokoSuiteCross service records.
|
||||
*/
|
||||
class MigrationHelper
|
||||
{
|
||||
/**
|
||||
* Channel type name → MokoSuiteCross service type mapping.
|
||||
* PP Pro channeltype names vary; we match common patterns.
|
||||
*/
|
||||
private const CHANNEL_MAP = [
|
||||
'facebook' => 'facebook',
|
||||
'fb' => 'facebook',
|
||||
'twitter' => 'twitter',
|
||||
'tw' => 'twitter',
|
||||
'linkedin' => 'linkedin',
|
||||
'li' => 'linkedin',
|
||||
'telegram' => 'telegram',
|
||||
'tg' => 'telegram',
|
||||
'discord' => 'discord',
|
||||
'slack' => 'slack',
|
||||
'mastodon' => 'mastodon',
|
||||
];
|
||||
|
||||
/**
|
||||
* Run the full migration from Perfect Publisher Pro.
|
||||
*
|
||||
* Strategy:
|
||||
* 1. Try reading #__autotweet_channels (PP Pro's channel table)
|
||||
* 2. Fall back to reading component params if table doesn't exist
|
||||
* 3. Create disabled MokoSuiteCross service records
|
||||
*
|
||||
* @return array ['migrated' => int, 'skipped' => int, 'errors' => string[]]
|
||||
*/
|
||||
public static function migrate(): array
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$result = ['migrated' => 0, 'skipped' => 0, 'errors' => []];
|
||||
|
||||
// Check if PP Pro is installed
|
||||
if (!self::isPPProInstalled($db)) {
|
||||
$result['errors'][] = 'Perfect Publisher Pro (com_autotweet) is not installed.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Try channel-based migration first (PP Pro stores configs in #__autotweet_channels)
|
||||
if (self::hasChannelTable($db)) {
|
||||
$result = self::migrateFromChannels($db, $result);
|
||||
} else {
|
||||
// Fall back to component params extraction
|
||||
$result = self::migrateFromParams($db, $result);
|
||||
}
|
||||
|
||||
// Clear migration flag from MokoSuiteCross params
|
||||
self::clearMigrationFlag($db);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if PP Pro is installed.
|
||||
*/
|
||||
private static function isPPProInstalled($db): bool
|
||||
{
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where('(' . $db->quoteName('element') . ' = ' . $db->quote('com_autotweet')
|
||||
. ' OR ' . $db->quoteName('element') . ' LIKE ' . $db->quote('%perfectpublisher%') . ')')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'));
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
return (int) $db->loadResult() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the autotweet_channels table exists.
|
||||
*/
|
||||
private static function hasChannelTable($db): bool
|
||||
{
|
||||
$prefix = $db->getPrefix();
|
||||
|
||||
try {
|
||||
$db->setQuery('SHOW TABLES LIKE ' . $db->quote($prefix . 'autotweet_channels'));
|
||||
|
||||
return !empty($db->loadResult());
|
||||
} catch (\Throwable $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate from #__autotweet_channels table (primary method).
|
||||
*/
|
||||
private static function migrateFromChannels($db, array $result): array
|
||||
{
|
||||
// Load channels with their type names
|
||||
$query = $db->getQuery(true)
|
||||
->select('c.id, c.name, c.published, c.params')
|
||||
->select($db->quoteName('ct.name', 'type_name'))
|
||||
->from($db->quoteName('#__autotweet_channels', 'c'))
|
||||
->join('LEFT', $db->quoteName('#__autotweet_channeltypes', 'ct')
|
||||
. ' ON ' . $db->quoteName('ct.id') . ' = ' . $db->quoteName('c.channeltype_id'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$channels = $db->loadObjectList();
|
||||
|
||||
if (empty($channels)) {
|
||||
$result['errors'][] = 'No channels found in Perfect Publisher Pro.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
foreach ($channels as $channel) {
|
||||
$typeName = strtolower(trim($channel->type_name ?? ''));
|
||||
|
||||
// Match to MokoSuiteCross service type
|
||||
$mjcType = null;
|
||||
|
||||
foreach (self::CHANNEL_MAP as $pattern => $serviceType) {
|
||||
if (str_contains($typeName, $pattern)) {
|
||||
$mjcType = $serviceType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$mjcType) {
|
||||
$result['skipped']++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for duplicate (same type + migrated alias)
|
||||
$alias = $mjcType . '-pp-' . $channel->id;
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('alias') . ' = ' . $db->quote($alias));
|
||||
$db->setQuery($query);
|
||||
|
||||
if ((int) $db->loadResult() > 0) {
|
||||
$result['skipped']++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse channel params to extract credentials
|
||||
$channelParams = json_decode($channel->params ?: '{}', true) ?: [];
|
||||
$credentials = self::mapChannelCredentials($mjcType, $channelParams);
|
||||
|
||||
if (empty($credentials)) {
|
||||
$result['skipped']++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create MokoSuiteCross service record
|
||||
$service = (object) [
|
||||
'title' => $channel->name ?: ucfirst($mjcType) . ' (PP Pro #' . $channel->id . ')',
|
||||
'alias' => $alias,
|
||||
'service_type' => $mjcType,
|
||||
'credentials' => json_encode($credentials),
|
||||
'params' => '{}',
|
||||
'published' => 0, // Disabled — user must verify before enabling
|
||||
'ordering' => 0,
|
||||
'created' => Factory::getDate()->toSql(),
|
||||
'modified' => Factory::getDate()->toSql(),
|
||||
'created_by' => Factory::getApplication()->getIdentity()->id ?? 0,
|
||||
];
|
||||
|
||||
try {
|
||||
$db->insertObject('#__mokosuitecross_services', $service);
|
||||
$result['migrated']++;
|
||||
} catch (\Throwable $e) {
|
||||
$result['errors'][] = sprintf('Failed to create %s service: %s', $mjcType, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Map PP Pro channel params to MokoSuiteCross credential format.
|
||||
*
|
||||
* PP Pro stores various keys in channel params depending on the type.
|
||||
* We normalize them to MokoSuiteCross's expected credential structure.
|
||||
*/
|
||||
private static function mapChannelCredentials(string $serviceType, array $channelParams): array
|
||||
{
|
||||
$creds = ['mode' => 'custom'];
|
||||
|
||||
// Common OAuth fields PP Pro uses
|
||||
$oauthFields = ['access_token', 'access_secret', 'client_id', 'client_secret',
|
||||
'api_key', 'api_secret', 'app_id', 'app_secret', 'token'];
|
||||
|
||||
switch ($serviceType) {
|
||||
case 'facebook':
|
||||
$creds['page_access_token'] = $channelParams['access_token'] ?? $channelParams['token'] ?? '';
|
||||
$creds['page_id'] = $channelParams['page_id'] ?? $channelParams['pageid'] ?? '';
|
||||
break;
|
||||
|
||||
case 'twitter':
|
||||
$creds['bearer_token'] = $channelParams['bearer_token'] ?? '';
|
||||
$creds['api_key'] = $channelParams['api_key'] ?? $channelParams['consumer_key'] ?? '';
|
||||
$creds['api_secret'] = $channelParams['api_secret'] ?? $channelParams['consumer_secret'] ?? '';
|
||||
$creds['access_token'] = $channelParams['access_token'] ?? '';
|
||||
$creds['access_token_secret'] = $channelParams['access_secret'] ?? $channelParams['access_token_secret'] ?? '';
|
||||
break;
|
||||
|
||||
case 'linkedin':
|
||||
$creds['access_token'] = $channelParams['access_token'] ?? $channelParams['token'] ?? '';
|
||||
$creds['organization_id'] = $channelParams['company_id'] ?? $channelParams['organization_id'] ?? '';
|
||||
$creds['person_id'] = $channelParams['person_id'] ?? $channelParams['member_id'] ?? '';
|
||||
break;
|
||||
|
||||
case 'telegram':
|
||||
$creds['bot_token'] = $channelParams['bot_token'] ?? $channelParams['token'] ?? $channelParams['api_key'] ?? '';
|
||||
$creds['chat_id'] = $channelParams['chat_id'] ?? $channelParams['channel_id'] ?? '';
|
||||
break;
|
||||
|
||||
case 'discord':
|
||||
$creds['webhook_url'] = $channelParams['webhook_url'] ?? $channelParams['webhook'] ?? '';
|
||||
break;
|
||||
|
||||
case 'slack':
|
||||
$creds['webhook_url'] = $channelParams['webhook_url'] ?? $channelParams['webhook'] ?? '';
|
||||
break;
|
||||
|
||||
case 'mastodon':
|
||||
$creds['instance_url'] = $channelParams['instance_url'] ?? $channelParams['server'] ?? '';
|
||||
$creds['access_token'] = $channelParams['access_token'] ?? $channelParams['token'] ?? '';
|
||||
break;
|
||||
|
||||
default:
|
||||
// Generic: copy all non-empty params
|
||||
foreach ($channelParams as $key => $value) {
|
||||
if (!empty($value) && is_string($value)) {
|
||||
$creds[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove empty credential values and the mode key for check
|
||||
$check = array_filter($creds, fn($v, $k) => $k !== 'mode' && !empty($v), ARRAY_FILTER_USE_BOTH);
|
||||
|
||||
return empty($check) ? [] : $creds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fallback: migrate from component params when channel table doesn't exist.
|
||||
*/
|
||||
private static function migrateFromParams($db, array $result): array
|
||||
{
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where('(' . $db->quoteName('element') . ' = ' . $db->quote('com_autotweet')
|
||||
. ' OR ' . $db->quoteName('element') . ' LIKE ' . $db->quote('%perfectpublisher%') . ')')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$rawParams = $db->loadResult();
|
||||
|
||||
if (!$rawParams) {
|
||||
$result['errors'][] = 'No PP Pro configuration found.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$params = json_decode($rawParams, true);
|
||||
|
||||
if (!is_array($params)) {
|
||||
$result['errors'][] = 'Could not parse PP Pro configuration.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Extract services from component params using prefix patterns
|
||||
$servicePatterns = [
|
||||
'facebook' => ['facebook_', 'fb_'],
|
||||
'twitter' => ['twitter_', 'tw_'],
|
||||
'linkedin' => ['linkedin_', 'li_'],
|
||||
'telegram' => ['telegram_', 'tg_'],
|
||||
];
|
||||
|
||||
foreach ($servicePatterns as $mjcType => $prefixes) {
|
||||
$credentials = ['mode' => 'custom'];
|
||||
$found = false;
|
||||
|
||||
foreach ($params as $key => $value) {
|
||||
foreach ($prefixes as $prefix) {
|
||||
if (str_starts_with($key, $prefix) && !empty($value)) {
|
||||
$cleanKey = substr($key, strlen($prefix));
|
||||
$credentials[$cleanKey] = $value;
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$result['skipped']++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Duplicate check
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('service_type') . ' = ' . $db->quote($mjcType))
|
||||
->where($db->quoteName('alias') . ' LIKE ' . $db->quote('%-migrated%'));
|
||||
$db->setQuery($query);
|
||||
|
||||
if ((int) $db->loadResult() > 0) {
|
||||
$result['skipped']++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$service = (object) [
|
||||
'title' => ucfirst($mjcType) . ' (migrated from PP Pro)',
|
||||
'alias' => $mjcType . '-migrated',
|
||||
'service_type' => $mjcType,
|
||||
'credentials' => json_encode($credentials),
|
||||
'params' => '{}',
|
||||
'published' => 0,
|
||||
'ordering' => 0,
|
||||
'created' => Factory::getDate()->toSql(),
|
||||
'modified' => Factory::getDate()->toSql(),
|
||||
'created_by' => Factory::getApplication()->getIdentity()->id ?? 0,
|
||||
];
|
||||
|
||||
try {
|
||||
$db->insertObject('#__mokosuitecross_services', $service);
|
||||
$result['migrated']++;
|
||||
} catch (\Throwable $e) {
|
||||
$result['errors'][] = sprintf('Failed to create %s: %s', $mjcType, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the migration flag from MokoSuiteCross component params.
|
||||
*/
|
||||
private static function clearMigrationFlag($db): void
|
||||
{
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$params = json_decode($db->loadResult() ?: '{}', true) ?: [];
|
||||
|
||||
unset($params['migration_available'], $params['migration_source_params']);
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote(json_encode($params)))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Helper;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -22,7 +22,7 @@ use Joomla\CMS\Language\Text;
|
||||
* Uses Joomla 5+ toolbar submenu API when available, falling back to the
|
||||
* deprecated Sidebar API for Joomla 4 compatibility.
|
||||
*/
|
||||
class MokoJoomCrossHelper
|
||||
class MokoSuiteCrossHelper
|
||||
{
|
||||
/**
|
||||
* Configure the submenu links.
|
||||
@@ -36,11 +36,11 @@ class MokoJoomCrossHelper
|
||||
public static function addSubmenu(string $activeView): void
|
||||
{
|
||||
$views = [
|
||||
'dashboard' => 'COM_MOKOJOOMCROSS_SUBMENU_DASHBOARD',
|
||||
'posts' => 'COM_MOKOJOOMCROSS_SUBMENU_POSTS',
|
||||
'services' => 'COM_MOKOJOOMCROSS_SUBMENU_SERVICES',
|
||||
'templates' => 'COM_MOKOJOOMCROSS_SUBMENU_TEMPLATES',
|
||||
'logs' => 'COM_MOKOJOOMCROSS_SUBMENU_LOGS',
|
||||
'dashboard' => 'COM_MOKOSUITECROSS_SUBMENU_DASHBOARD',
|
||||
'posts' => 'COM_MOKOSUITECROSS_SUBMENU_POSTS',
|
||||
'services' => 'COM_MOKOSUITECROSS_SUBMENU_SERVICES',
|
||||
'templates' => 'COM_MOKOSUITECROSS_SUBMENU_TEMPLATES',
|
||||
'logs' => 'COM_MOKOSUITECROSS_SUBMENU_LOGS',
|
||||
];
|
||||
|
||||
// Joomla 5+ toolbar submenu
|
||||
@@ -51,7 +51,7 @@ class MokoJoomCrossHelper
|
||||
if ($toolbar && method_exists($toolbar, 'linkButton')) {
|
||||
foreach ($views as $view => $langKey) {
|
||||
$toolbar->linkButton($view, Text::_($langKey))
|
||||
->url('index.php?option=com_mokojoomcross&view=' . $view)
|
||||
->url('index.php?option=com_mokosuitecross&view=' . $view)
|
||||
->active($activeView === $view);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class MokoJoomCrossHelper
|
||||
foreach ($views as $view => $langKey) {
|
||||
\Joomla\CMS\HTML\Sidebar::addEntry(
|
||||
Text::_($langKey),
|
||||
'index.php?option=com_mokojoomcross&view=' . $view,
|
||||
'index.php?option=com_mokosuitecross&view=' . $view,
|
||||
$activeView === $view
|
||||
);
|
||||
}
|
||||
+10
-10
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Helper;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -92,7 +92,7 @@ class OAuthHelper
|
||||
$challenge = rtrim(strtr(base64_encode(hash('sha256', $verifier, true)), '+/', '-_'), '=');
|
||||
|
||||
// Store verifier in session for token exchange
|
||||
Factory::getApplication()->getSession()->set('mokojoomcross.pkce_verifier', $verifier);
|
||||
Factory::getApplication()->getSession()->set('mokosuitecross.pkce_verifier', $verifier);
|
||||
|
||||
$params['code_challenge'] = $challenge;
|
||||
$params['code_challenge_method'] = 'S256';
|
||||
@@ -129,7 +129,7 @@ class OAuthHelper
|
||||
|
||||
// Twitter PKCE
|
||||
if ($serviceType === 'twitter') {
|
||||
$verifier = Factory::getApplication()->getSession()->get('mokojoomcross.pkce_verifier', '');
|
||||
$verifier = Factory::getApplication()->getSession()->get('mokosuitecross.pkce_verifier', '');
|
||||
$postData['code_verifier'] = $verifier;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class OAuthHelper
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('credentials'))
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('id') . ' = ' . $serviceId);
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -187,8 +187,8 @@ class OAuthHelper
|
||||
}
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_services'))
|
||||
->set($db->quoteName('credentials') . ' = ' . $db->quote(json_encode($credentials)))
|
||||
->update($db->quoteName('#__mokosuitecross_services'))
|
||||
->set($db->quoteName('credentials') . ' = ' . $db->quote(CredentialHelper::encrypt($credentials)))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
->where($db->quoteName('id') . ' = ' . $serviceId);
|
||||
|
||||
@@ -232,7 +232,7 @@ class OAuthHelper
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('service_type'))
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('id') . ' = ' . $serviceId);
|
||||
$db->setQuery($query);
|
||||
$serviceType = $db->loadResult();
|
||||
@@ -306,6 +306,6 @@ class OAuthHelper
|
||||
*/
|
||||
public static function getCallbackUrl(): string
|
||||
{
|
||||
return Uri::root() . 'administrator/index.php?option=com_mokojoomcross&task=oauth.callback';
|
||||
return Uri::root() . 'administrator/index.php?option=com_mokosuitecross&task=oauth.callback';
|
||||
}
|
||||
}
|
||||
+135
-92
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Helper;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -17,7 +17,8 @@ use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\Component\MokoJoomCross\Administrator\Service\MokoJoomCrossServiceInterface;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Helper\CredentialHelper;
|
||||
use Joomla\Component\MokoSuiteCross\Administrator\Service\MokoSuiteCrossServiceInterface;
|
||||
|
||||
/**
|
||||
* Shared queue processor used by:
|
||||
@@ -48,7 +49,7 @@ class QueueProcessor
|
||||
|
||||
try {
|
||||
$db = Factory::getDbo();
|
||||
$componentParams = ComponentHelper::getParams('com_mokojoomcross');
|
||||
$componentParams = ComponentHelper::getParams('com_mokosuitecross');
|
||||
$maxRetry = (int) $componentParams->get('retry_max', 3);
|
||||
$retryDelay = (int) $componentParams->get('retry_delay', 300);
|
||||
$now = Factory::getDate()->toSql();
|
||||
@@ -59,8 +60,8 @@ class QueueProcessor
|
||||
// 1. Process queued posts
|
||||
$query = $db->getQuery(true)
|
||||
->select('p.*, s.service_type, s.credentials, s.params AS service_params')
|
||||
->from($db->quoteName('#__mokojoomcross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokojoomcross_services', 's')
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
|
||||
->where($db->quoteName('p.status') . ' = ' . $db->quote('queued'))
|
||||
->where('(' . $db->quoteName('p.scheduled_at') . ' IS NULL OR '
|
||||
@@ -76,8 +77,8 @@ class QueueProcessor
|
||||
// Retry 1 waits retryDelay, retry 2 waits retryDelay*2, retry 3 waits retryDelay*4, etc.
|
||||
$query = $db->getQuery(true)
|
||||
->select('p.*, s.service_type, s.credentials, s.params AS service_params')
|
||||
->from($db->quoteName('#__mokojoomcross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokojoomcross_services', 's')
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
|
||||
->where($db->quoteName('p.status') . ' = ' . $db->quote('failed'))
|
||||
->where($db->quoteName('p.retry_count') . ' < ' . $maxRetry)
|
||||
@@ -111,7 +112,7 @@ class QueueProcessor
|
||||
if ($newRetryCount >= $maxRetry) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('permanently_failed'))
|
||||
->set($db->quoteName('retry_count') . ' = ' . $newRetryCount)
|
||||
->set($db->quoteName('error_message') . ' = CONCAT(' . $db->quoteName('error_message') . ', ' . $db->quote(' [max retries exceeded]') . ')')
|
||||
@@ -129,7 +130,7 @@ class QueueProcessor
|
||||
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('retry_count') . ' = ' . $newRetryCount)
|
||||
->where($db->quoteName('id') . ' = ' . (int) $post->id)
|
||||
);
|
||||
@@ -139,14 +140,14 @@ class QueueProcessor
|
||||
// Mark as posting
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('posting'))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
->where($db->quoteName('id') . ' = ' . (int) $post->id)
|
||||
);
|
||||
$db->execute();
|
||||
|
||||
$credentials = json_decode($post->credentials ?: '{}', true) ?: [];
|
||||
$credentials = CredentialHelper::decrypt($post->credentials ?: '');
|
||||
$params = json_decode($post->service_params ?: '{}', true) ?: [];
|
||||
|
||||
// Token auto-refresh before posting
|
||||
@@ -178,8 +179,8 @@ class QueueProcessor
|
||||
|
||||
try {
|
||||
$dispatcher = Factory::getApplication()->getDispatcher();
|
||||
$beforeEvent = new \Joomla\Event\Event('onMokoJoomCrossBeforePost', [(int) $post->id, &$message, $post->service_type, &$cancel]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossBeforePost', $beforeEvent);
|
||||
$beforeEvent = new \Joomla\Event\Event('onMokoSuiteCrossBeforePost', [(int) $post->id, &$message, $post->service_type, &$cancel]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossBeforePost', $beforeEvent);
|
||||
} catch (\Throwable $e) {
|
||||
// Dispatcher may not be available
|
||||
}
|
||||
@@ -187,7 +188,7 @@ class QueueProcessor
|
||||
if ($cancel) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('cancelled'))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
->where($db->quoteName('id') . ' = ' . (int) $post->id)
|
||||
@@ -195,7 +196,7 @@ class QueueProcessor
|
||||
$db->execute();
|
||||
|
||||
self::log($db, (int) $post->id, (int) $post->service_id, 'info',
|
||||
sprintf('Post to %s cancelled by onMokoJoomCrossBeforePost event', $post->service_type));
|
||||
sprintf('Post to %s cancelled by onMokoSuiteCrossBeforePost event', $post->service_type));
|
||||
|
||||
$result['skipped']++;
|
||||
continue;
|
||||
@@ -207,7 +208,7 @@ class QueueProcessor
|
||||
if (!empty($apiResult['success'])) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('posted'))
|
||||
->set($db->quoteName('platform_post_id') . ' = ' . $db->quote($apiResult['platform_post_id'] ?? ''))
|
||||
->set($db->quoteName('platform_response') . ' = ' . $db->quote(json_encode($apiResult['response'] ?? [])))
|
||||
@@ -222,8 +223,8 @@ class QueueProcessor
|
||||
|
||||
// Lifecycle event: after successful post
|
||||
try {
|
||||
$afterEvent = new \Joomla\Event\Event('onMokoJoomCrossAfterPost', [(int) $post->id, $post->service_type, $apiResult]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossAfterPost', $afterEvent);
|
||||
$afterEvent = new \Joomla\Event\Event('onMokoSuiteCrossAfterPost', [(int) $post->id, $post->service_type, $apiResult]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossAfterPost', $afterEvent);
|
||||
} catch (\Throwable $e) {
|
||||
// Non-critical
|
||||
}
|
||||
@@ -234,7 +235,7 @@ class QueueProcessor
|
||||
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('failed'))
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(mb_substr($errorMsg, 0, 1000)))
|
||||
->set($db->quoteName('platform_response') . ' = ' . $db->quote(json_encode($apiResult['response'] ?? [])))
|
||||
@@ -248,8 +249,8 @@ class QueueProcessor
|
||||
|
||||
// Lifecycle event: post failed
|
||||
try {
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoJoomCrossPostFailed', [(int) $post->id, $post->service_type, $errorMsg]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossPostFailed', $failedEvent);
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoSuiteCrossPostFailed', [(int) $post->id, $post->service_type, $errorMsg]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossPostFailed', $failedEvent);
|
||||
} catch (\Throwable $e) {
|
||||
// Non-critical
|
||||
}
|
||||
@@ -259,7 +260,7 @@ class QueueProcessor
|
||||
} catch (\Throwable $e) {
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('failed'))
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(mb_substr($e->getMessage(), 0, 1000)))
|
||||
->set($db->quoteName('modified') . ' = ' . $db->quote(Factory::getDate()->toSql()))
|
||||
@@ -272,8 +273,8 @@ class QueueProcessor
|
||||
|
||||
// Lifecycle event: post failed (exception)
|
||||
try {
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoJoomCrossPostFailed', [(int) $post->id, $post->service_type, $e->getMessage()]);
|
||||
$dispatcher->dispatch('onMokoJoomCrossPostFailed', $failedEvent);
|
||||
$failedEvent = new \Joomla\Event\Event('onMokoSuiteCrossPostFailed', [(int) $post->id, $post->service_type, $e->getMessage()]);
|
||||
$dispatcher->dispatch('onMokoSuiteCrossPostFailed', $failedEvent);
|
||||
} catch (\Throwable $ex) {
|
||||
// Non-critical
|
||||
}
|
||||
@@ -303,7 +304,7 @@ class QueueProcessor
|
||||
{
|
||||
$result = ['queued' => 0];
|
||||
|
||||
$componentParams = ComponentHelper::getParams('com_mokojoomcross');
|
||||
$componentParams = ComponentHelper::getParams('com_mokosuitecross');
|
||||
|
||||
if (!$componentParams->get('evergreen_enabled', 1)) {
|
||||
return $result;
|
||||
@@ -320,7 +321,7 @@ class QueueProcessor
|
||||
->select('c.id, c.attribs')
|
||||
->from($db->quoteName('#__content', 'c'))
|
||||
->where($db->quoteName('c.state') . ' = 1')
|
||||
->where('JSON_EXTRACT(' . $db->quoteName('c.attribs') . ', ' . $db->quote('$.mokojoomcross_evergreen') . ') = ' . $db->quote('1'));
|
||||
->where('JSON_EXTRACT(' . $db->quoteName('c.attribs') . ', ' . $db->quote('$.mokosuitecross_evergreen') . ') = ' . $db->quote('1'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$articles = $db->loadObjectList() ?: [];
|
||||
@@ -332,7 +333,7 @@ class QueueProcessor
|
||||
// Load all published services
|
||||
$query = $db->getQuery(true)
|
||||
->select('id, service_type')
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('published') . ' = 1');
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -344,7 +345,41 @@ class QueueProcessor
|
||||
|
||||
// Import service plugins (not used for direct dispatch here, but ensures
|
||||
// they are loaded in case any lifecycle events depend on them)
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
|
||||
// Batch pre-load: latest posted_at per article+service (eliminates N*M queries)
|
||||
$articleIds = implode(',', array_map(function ($a) { return (int) $a->id; }, $articles));
|
||||
$serviceIds = implode(',', array_map(function ($s) { return (int) $s->id; }, $services));
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select(['article_id', 'service_id', 'MAX(' . $db->quoteName('posted_at') . ') AS last_posted'])
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('article_id') . ' IN (' . $articleIds . ')')
|
||||
->where($db->quoteName('service_id') . ' IN (' . $serviceIds . ')')
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote('posted'))
|
||||
->group(['article_id', 'service_id']);
|
||||
$db->setQuery($query);
|
||||
$lastPostedRows = $db->loadObjectList() ?: [];
|
||||
|
||||
$lastPostedMap = [];
|
||||
foreach ($lastPostedRows as $row) {
|
||||
$lastPostedMap[$row->article_id . ':' . $row->service_id] = $row->last_posted;
|
||||
}
|
||||
|
||||
// Batch pre-load: existing queued/posting entries
|
||||
$query = $db->getQuery(true)
|
||||
->select(['article_id', 'service_id'])
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('article_id') . ' IN (' . $articleIds . ')')
|
||||
->where($db->quoteName('service_id') . ' IN (' . $serviceIds . ')')
|
||||
->where($db->quoteName('status') . ' IN (' . $db->quote('queued') . ',' . $db->quote('posting') . ')');
|
||||
$db->setQuery($query);
|
||||
$pendingRows = $db->loadObjectList() ?: [];
|
||||
|
||||
$pendingSet = [];
|
||||
foreach ($pendingRows as $row) {
|
||||
$pendingSet[$row->article_id . ':' . $row->service_id] = true;
|
||||
}
|
||||
|
||||
foreach ($articles as $article) {
|
||||
if ($result['queued'] >= $maxPerRun) {
|
||||
@@ -352,14 +387,14 @@ class QueueProcessor
|
||||
}
|
||||
|
||||
$attribs = json_decode($article->attribs ?? '{}', true) ?: [];
|
||||
$interval = (int) ($attribs['mokojoomcross_evergreen_interval'] ?? $defaultInterval);
|
||||
$interval = (int) ($attribs['mokosuitecross_evergreen_interval'] ?? $defaultInterval);
|
||||
|
||||
if ($interval < 1) {
|
||||
$interval = $defaultInterval;
|
||||
}
|
||||
|
||||
// Per-article service filter
|
||||
$selectedServiceIds = $attribs['mokojoomcross_services'] ?? null;
|
||||
$selectedServiceIds = $attribs['mokosuitecross_services'] ?? null;
|
||||
|
||||
if (is_array($selectedServiceIds) && !empty($selectedServiceIds)) {
|
||||
$selectedServiceIds = array_map('intval', $selectedServiceIds);
|
||||
@@ -380,18 +415,10 @@ class QueueProcessor
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check last successful post for this article+service
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('posted_at'))
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->where($db->quoteName('article_id') . ' = ' . (int) $article->id)
|
||||
->where($db->quoteName('service_id') . ' = ' . (int) $service->id)
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote('posted'))
|
||||
->order($db->quoteName('posted_at') . ' DESC')
|
||||
->setLimit(1);
|
||||
$key = $article->id . ':' . $service->id;
|
||||
|
||||
$db->setQuery($query);
|
||||
$lastPosted = $db->loadResult();
|
||||
// Check last successful post from batch-loaded map
|
||||
$lastPosted = $lastPostedMap[$key] ?? null;
|
||||
|
||||
if (empty($lastPosted)) {
|
||||
// Never posted — skip, the initial cross-post will handle it
|
||||
@@ -399,25 +426,14 @@ class QueueProcessor
|
||||
}
|
||||
|
||||
// Check if interval has elapsed
|
||||
$lastDate = Factory::getDate($lastPosted);
|
||||
$dueDate = Factory::getDate($lastPosted . ' + ' . $interval . ' days');
|
||||
$dueDate = Factory::getDate($lastPosted . ' + ' . $interval . ' days');
|
||||
|
||||
if ($dueDate->toUnix() > Factory::getDate()->toUnix()) {
|
||||
// Not due yet
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip if there's already a queued/posting entry
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->where($db->quoteName('article_id') . ' = ' . (int) $article->id)
|
||||
->where($db->quoteName('service_id') . ' = ' . (int) $service->id)
|
||||
->where($db->quoteName('status') . ' IN (' . $db->quote('queued') . ',' . $db->quote('posting') . ')');
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
if ((int) $db->loadResult() > 0) {
|
||||
if (isset($pendingSet[$key])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -453,7 +469,7 @@ class QueueProcessor
|
||||
'modified' => $now,
|
||||
];
|
||||
|
||||
$db->insertObject('#__mokojoomcross_posts', $post);
|
||||
$db->insertObject('#__mokosuitecross_posts', $post);
|
||||
|
||||
self::log($db, $db->insertid(), (int) $service->id, 'info',
|
||||
sprintf('Evergreen re-share queued for article %d to %s (interval: %d days)',
|
||||
@@ -579,7 +595,7 @@ class QueueProcessor
|
||||
$ids = implode(',', array_map('intval', $postIds));
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('queued'))
|
||||
->set($db->quoteName('retry_count') . ' = 0')
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(''))
|
||||
@@ -611,7 +627,7 @@ class QueueProcessor
|
||||
$now = Factory::getDate()->toSql();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__mokojoomcross_posts'))
|
||||
->update($db->quoteName('#__mokosuitecross_posts'))
|
||||
->set($db->quoteName('status') . ' = ' . $db->quote('queued'))
|
||||
->set($db->quoteName('retry_count') . ' = 0')
|
||||
->set($db->quoteName('error_message') . ' = ' . $db->quote(''))
|
||||
@@ -639,29 +655,29 @@ class QueueProcessor
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
$componentParams = ComponentHelper::getParams('com_mokojoomcross');
|
||||
$componentParams = ComponentHelper::getParams('com_mokosuitecross');
|
||||
$maxRetry = (int) $componentParams->get('retry_max', 3);
|
||||
$retryDelay = (int) $componentParams->get('retry_delay', 300);
|
||||
$retryAfter = Factory::getDate('now - ' . $retryDelay . ' seconds')->toSql();
|
||||
$now = Factory::getDate()->toSql();
|
||||
$now = Factory::getDate()->toSql();
|
||||
|
||||
// Queued posts ready to go
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote('queued'))
|
||||
->where('(' . $db->quoteName('scheduled_at') . ' IS NULL OR '
|
||||
. $db->quoteName('scheduled_at') . ' <= ' . $db->quote($now) . ')');
|
||||
$db->setQuery($query);
|
||||
$queued = (int) $db->loadResult();
|
||||
|
||||
// Failed posts eligible for retry
|
||||
// Failed posts eligible for retry (exponential backoff matching processQueue)
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote('failed'))
|
||||
->where($db->quoteName('retry_count') . ' < ' . $maxRetry)
|
||||
->where($db->quoteName('modified') . ' <= ' . $db->quote($retryAfter));
|
||||
->where($db->quoteName('modified') . ' <= DATE_SUB(NOW(), INTERVAL ('
|
||||
. (int) $retryDelay . ' * POW(2, ' . $db->quoteName('retry_count') . ')) SECOND)');
|
||||
$db->setQuery($query);
|
||||
$retryable = (int) $db->loadResult();
|
||||
|
||||
@@ -669,23 +685,23 @@ class QueueProcessor
|
||||
}
|
||||
|
||||
/**
|
||||
* Import mokojoomcross plugins and build a type → plugin instance map.
|
||||
* Import mokosuitecross plugins and build a type → plugin instance map.
|
||||
*
|
||||
* @return array<string, MokoJoomCrossServiceInterface>
|
||||
* @return array<string, MokoSuiteCrossServiceInterface>
|
||||
*/
|
||||
private static function getServicePluginMap(): array
|
||||
{
|
||||
PluginHelper::importPlugin('mokojoomcross');
|
||||
PluginHelper::importPlugin('mokosuitecross');
|
||||
|
||||
// In Joomla 5+ with SubscriberInterface, plugins receive the Event object
|
||||
// as their first argument. When they do $services[] = $this, they append to
|
||||
// the Event via ArrayAccess at numeric indices starting at 1.
|
||||
$servicePlugins = [];
|
||||
$event = new \Joomla\Event\Event('onMokoJoomCrossGetServices', [$servicePlugins]);
|
||||
$event = new \Joomla\Event\Event('onMokoSuiteCrossGetServices', [$servicePlugins]);
|
||||
|
||||
try {
|
||||
Factory::getApplication()->getDispatcher()->dispatch(
|
||||
'onMokoJoomCrossGetServices',
|
||||
'onMokoSuiteCrossGetServices',
|
||||
$event
|
||||
);
|
||||
} catch (\Throwable $e) {
|
||||
@@ -703,7 +719,7 @@ class QueueProcessor
|
||||
$map = [];
|
||||
|
||||
foreach ($servicePlugins as $plugin) {
|
||||
if ($plugin instanceof MokoJoomCrossServiceInterface) {
|
||||
if ($plugin instanceof MokoSuiteCrossServiceInterface) {
|
||||
$map[$plugin->getServiceType()] = $plugin;
|
||||
}
|
||||
}
|
||||
@@ -725,7 +741,7 @@ class QueueProcessor
|
||||
$cutoff = Factory::getDate('now - ' . $retentionDays . ' days')->toSql();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->delete($db->quoteName('#__mokojoomcross_logs'))
|
||||
->delete($db->quoteName('#__mokosuitecross_logs'))
|
||||
->where($db->quoteName('created') . ' < ' . $db->quote($cutoff));
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -746,13 +762,13 @@ class QueueProcessor
|
||||
$serverType = $db->getServerType();
|
||||
|
||||
if ($serverType === 'mysql' || $serverType === 'mariadb') {
|
||||
$db->setQuery("SELECT GET_LOCK('mokojoomcross_queue', 0)");
|
||||
$db->setQuery("SELECT GET_LOCK('mokosuitecross_queue', 0)");
|
||||
|
||||
return (int) $db->loadResult() === 1;
|
||||
}
|
||||
|
||||
if ($serverType === 'postgresql') {
|
||||
$db->setQuery("SELECT pg_try_advisory_lock(hashtext('mokojoomcross_queue'))");
|
||||
$db->setQuery("SELECT pg_try_advisory_lock(hashtext('mokosuitecross_queue'))");
|
||||
|
||||
return (bool) $db->loadResult();
|
||||
}
|
||||
@@ -774,14 +790,14 @@ class QueueProcessor
|
||||
$serverType = $db->getServerType();
|
||||
|
||||
if ($serverType === 'mysql' || $serverType === 'mariadb') {
|
||||
$db->setQuery("SELECT RELEASE_LOCK('mokojoomcross_queue')");
|
||||
$db->setQuery("SELECT RELEASE_LOCK('mokosuitecross_queue')");
|
||||
$db->execute();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($serverType === 'postgresql') {
|
||||
$db->setQuery("SELECT pg_advisory_unlock(hashtext('mokojoomcross_queue'))");
|
||||
$db->setQuery("SELECT pg_advisory_unlock(hashtext('mokosuitecross_queue'))");
|
||||
$db->execute();
|
||||
|
||||
return;
|
||||
@@ -796,31 +812,58 @@ class QueueProcessor
|
||||
/**
|
||||
* Timestamp-based lock fallback for databases without advisory locks.
|
||||
*
|
||||
* Uses the component params to store a lock timestamp. Considers the lock
|
||||
* stale after 120 seconds to prevent deadlocks from crashed processes.
|
||||
* Uses an atomic UPDATE with a WHERE clause to prevent TOCTOU race
|
||||
* conditions. The lock is considered stale after 120 seconds.
|
||||
*/
|
||||
private static function acquireTimestampLock($db): bool
|
||||
{
|
||||
$params = ComponentHelper::getParams('com_mokojoomcross');
|
||||
$lockTime = (int) $params->get('queue_lock_time', 0);
|
||||
$now = time();
|
||||
$staleThreshold = $now - 120;
|
||||
|
||||
if ($lockTime > 0 && ($now - $lockTime) < 120) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Atomic: only succeeds if lock is absent (0) or stale
|
||||
$params = ComponentHelper::getParams('com_mokosuitecross');
|
||||
$oldParams = $params->toString();
|
||||
$params->set('queue_lock_time', $now);
|
||||
$newParams = $params->toString();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote($params->toString()))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokojoomcross'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'));
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote($newParams))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
|
||||
->where('(' . $db->quoteName('params') . ' NOT LIKE ' . $db->quote('%"queue_lock_time"%')
|
||||
. ' OR ' . $db->quoteName('params') . ' LIKE ' . $db->quote('%"queue_lock_time":0%')
|
||||
. ' OR ' . $db->quoteName('params') . ' LIKE ' . $db->quote('%"queue_lock_time":"0"%')
|
||||
. ')');
|
||||
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
|
||||
return true;
|
||||
if ($db->getAffectedRows() > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the existing lock is stale
|
||||
$params = ComponentHelper::getParams('com_mokosuitecross');
|
||||
$lockTime = (int) $params->get('queue_lock_time', 0);
|
||||
|
||||
if ($lockTime > 0 && $lockTime <= $staleThreshold) {
|
||||
// Force acquire stale lock
|
||||
$params->set('queue_lock_time', $now);
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote($params->toString()))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -828,13 +871,13 @@ class QueueProcessor
|
||||
*/
|
||||
private static function releaseTimestampLock($db): void
|
||||
{
|
||||
$params = ComponentHelper::getParams('com_mokojoomcross');
|
||||
$params = ComponentHelper::getParams('com_mokosuitecross');
|
||||
$params->set('queue_lock_time', 0);
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote($params->toString()))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokojoomcross'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'));
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -855,6 +898,6 @@ class QueueProcessor
|
||||
'created' => Factory::getDate()->toSql(),
|
||||
];
|
||||
|
||||
$db->insertObject('#__mokojoomcross_logs', $log);
|
||||
$db->insertObject('#__mokosuitecross_logs', $log);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Helper;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Helper;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
|
||||
class DashboardModel extends BaseDatabaseModel
|
||||
{
|
||||
/**
|
||||
* Get summary statistics for the dashboard.
|
||||
*
|
||||
* @return object Stats object with counts
|
||||
*/
|
||||
public function getStats(): object
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
$stats = new \stdClass();
|
||||
|
||||
// Active services count
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('published') . ' = 1');
|
||||
$db->setQuery($query);
|
||||
$stats->active_services = (int) $db->loadResult();
|
||||
|
||||
// Posts by status
|
||||
foreach (['queued', 'posted', 'failed'] as $status) {
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote($status));
|
||||
$db->setQuery($query);
|
||||
$stats->{$status . '_count'} = (int) $db->loadResult();
|
||||
}
|
||||
|
||||
return $stats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Perfect Publisher Pro migration is available.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isMigrationAvailable(): bool
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuitecross'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$params = json_decode($db->loadResult() ?: '{}', true);
|
||||
|
||||
return !empty($params['migration_available']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get recent activity log entries.
|
||||
*
|
||||
* @param int $limit Number of entries to return
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRecentActivity(int $limit = 10): array
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select('l.*, s.title AS service_title, s.service_type')
|
||||
->from($db->quoteName('#__mokosuitecross_logs', 'l'))
|
||||
->join('LEFT', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('l.service_id'))
|
||||
->order($db->quoteName('l.created') . ' DESC');
|
||||
|
||||
$db->setQuery($query, 0, $limit);
|
||||
|
||||
return $db->loadObjectList() ?: [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get posts-per-service breakdown for the analytics chart.
|
||||
*
|
||||
* @param string|null $since Only count posts created on or after this datetime
|
||||
*
|
||||
* @return array [['service_type' => '...', 'posted' => N, 'failed' => N, 'queued' => N], ...]
|
||||
*/
|
||||
public function getServiceBreakdown(?string $since = null): array
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select([
|
||||
$db->quoteName('s.id', 'service_id'),
|
||||
$db->quoteName('s.service_type'),
|
||||
$db->quoteName('s.title', 'service_title'),
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('posted') . ' THEN 1 ELSE 0 END) AS posted',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('failed') . ' THEN 1 ELSE 0 END) AS failed',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('queued') . ' THEN 1 ELSE 0 END) AS queued',
|
||||
'COUNT(*) AS total',
|
||||
])
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('p.service_id'))
|
||||
->group($db->quoteName(['s.id', 's.service_type', 's.title']))
|
||||
->order('total DESC');
|
||||
|
||||
if ($since !== null) {
|
||||
$query->where($db->quoteName('p.created') . ' >= ' . $db->quote($since));
|
||||
}
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
return $db->loadAssocList() ?: [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get posts-per-day for the last N days (for trend chart).
|
||||
*
|
||||
* @param int $days Number of days to look back
|
||||
*
|
||||
* @return array [['day' => '2026-05-28', 'posted' => N, 'failed' => N], ...]
|
||||
*/
|
||||
public function getDailyTrend(int $days = 14): array
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
$cutoff = Factory::getDate('now - ' . $days . ' days')->format('Y-m-d');
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select([
|
||||
'DATE(' . $db->quoteName('created') . ') AS day',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('status') . ' = ' . $db->quote('posted') . ' THEN 1 ELSE 0 END) AS posted',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('status') . ' = ' . $db->quote('failed') . ' THEN 1 ELSE 0 END) AS failed',
|
||||
'COUNT(*) AS total',
|
||||
])
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where('DATE(' . $db->quoteName('created') . ') >= ' . $db->quote($cutoff))
|
||||
->group('DATE(' . $db->quoteName('created') . ')')
|
||||
->order('day ASC');
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
return $db->loadAssocList() ?: [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get most cross-posted articles.
|
||||
*
|
||||
* @param int $limit Number of articles
|
||||
* @param string|null $since Only count posts created on or after this datetime
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTopArticles(int $limit = 5, ?string $since = null): array
|
||||
{
|
||||
$db = $this->getDatabase();
|
||||
|
||||
$query = $db->getQuery(true)
|
||||
->select([
|
||||
$db->quoteName('c.id'),
|
||||
$db->quoteName('c.title'),
|
||||
'COUNT(*) AS post_count',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('posted') . ' THEN 1 ELSE 0 END) AS success_count',
|
||||
])
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__content', 'c')
|
||||
. ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('p.article_id'))
|
||||
->group($db->quoteName(['c.id', 'c.title']))
|
||||
->order('post_count DESC');
|
||||
|
||||
if ($since !== null) {
|
||||
$query->where($db->quoteName('p.created') . ' >= ' . $db->quote($since));
|
||||
}
|
||||
|
||||
$db->setQuery($query, 0, $limit);
|
||||
|
||||
return $db->loadAssocList() ?: [];
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -38,8 +38,8 @@ class LogsModel extends ListModel
|
||||
|
||||
$query->select('a.*')
|
||||
->select($db->quoteName('s.title', 'service_title'))
|
||||
->from($db->quoteName('#__mokojoomcross_logs', 'a'))
|
||||
->join('LEFT', $db->quoteName('#__mokojoomcross_services', 's')
|
||||
->from($db->quoteName('#__mokosuitecross_logs', 'a'))
|
||||
->join('LEFT', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('a.service_id'));
|
||||
|
||||
$level = $this->getState('filter.level');
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -21,7 +21,7 @@ class PostModel extends AdminModel
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
$form = $this->loadForm(
|
||||
'com_mokojoomcross.post',
|
||||
'com_mokosuitecross.post',
|
||||
'post',
|
||||
['control' => 'jform', 'load_data' => $loadData]
|
||||
);
|
||||
+5
-5
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -52,10 +52,10 @@ class PostsModel extends ListModel
|
||||
->select($db->quoteName('c.title', 'article_title'))
|
||||
->select($db->quoteName('s.title', 'service_title'))
|
||||
->select($db->quoteName('s.service_type'))
|
||||
->from($db->quoteName('#__mokojoomcross_posts', 'a'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'a'))
|
||||
->join('LEFT', $db->quoteName('#__content', 'c')
|
||||
. ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('a.article_id'))
|
||||
->join('LEFT', $db->quoteName('#__mokojoomcross_services', 's')
|
||||
->join('LEFT', $db->quoteName('#__mokosuitecross_services', 's')
|
||||
. ' ON ' . $db->quoteName('s.id') . ' = ' . $db->quoteName('a.service_id'));
|
||||
|
||||
// Filter by status
|
||||
+9
-7
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -30,7 +30,7 @@ class ServiceModel extends AdminModel
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
$form = $this->loadForm(
|
||||
'com_mokojoomcross.service',
|
||||
'com_mokosuitecross.service',
|
||||
'service',
|
||||
['control' => 'jform', 'load_data' => $loadData]
|
||||
);
|
||||
@@ -55,7 +55,7 @@ class ServiceModel extends AdminModel
|
||||
$data = $this->getItem();
|
||||
|
||||
if ($data && !empty($data->credentials)) {
|
||||
$credentials = json_decode($data->credentials, true) ?: [];
|
||||
$credentials = \Joomla\Component\MokoSuiteCross\Administrator\Helper\CredentialHelper::decrypt($data->credentials);
|
||||
$serviceType = $data->service_type ?? '';
|
||||
|
||||
foreach ($credentials as $key => $value) {
|
||||
@@ -106,8 +106,10 @@ class ServiceModel extends AdminModel
|
||||
}
|
||||
}
|
||||
|
||||
// Store the credentials JSON
|
||||
$data['credentials'] = !empty($credentials) ? json_encode($credentials) : '{}';
|
||||
// Store credentials encrypted
|
||||
$data['credentials'] = !empty($credentials)
|
||||
? \Joomla\Component\MokoSuiteCross\Administrator\Helper\CredentialHelper::encrypt($credentials)
|
||||
: '{}';
|
||||
|
||||
// Remove individual cred_* fields so they don't cause column-not-found errors
|
||||
foreach (array_keys($data) as $key) {
|
||||
+8
-8
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -51,7 +51,7 @@ class ServiceStatsModel extends BaseDatabaseModel
|
||||
$db = $this->getDatabase();
|
||||
$query = $db->getQuery(true)
|
||||
->select('*')
|
||||
->from($db->quoteName('#__mokojoomcross_services'))
|
||||
->from($db->quoteName('#__mokosuitecross_services'))
|
||||
->where($db->quoteName('id') . ' = ' . (int) $id);
|
||||
|
||||
$db->setQuery($query);
|
||||
@@ -75,7 +75,7 @@ class ServiceStatsModel extends BaseDatabaseModel
|
||||
foreach (['queued', 'posted', 'failed'] as $status) {
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('service_id') . ' = ' . (int) $serviceId)
|
||||
->where($db->quoteName('status') . ' = ' . $db->quote($status));
|
||||
$db->setQuery($query);
|
||||
@@ -108,7 +108,7 @@ class ServiceStatsModel extends BaseDatabaseModel
|
||||
'SUM(CASE WHEN ' . $db->quoteName('status') . ' = ' . $db->quote('failed') . ' THEN 1 ELSE 0 END) AS failed',
|
||||
'COUNT(*) AS total',
|
||||
])
|
||||
->from($db->quoteName('#__mokojoomcross_posts'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts'))
|
||||
->where($db->quoteName('service_id') . ' = ' . (int) $serviceId)
|
||||
->where('DATE(' . $db->quoteName('created') . ') >= ' . $db->quote($cutoff))
|
||||
->group('DATE(' . $db->quoteName('created') . ')')
|
||||
@@ -141,7 +141,7 @@ class ServiceStatsModel extends BaseDatabaseModel
|
||||
$db->quoteName('p.retry_count'),
|
||||
$db->quoteName('c.title', 'article_title'),
|
||||
])
|
||||
->from($db->quoteName('#__mokojoomcross_posts', 'p'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('LEFT', $db->quoteName('#__content', 'c')
|
||||
. ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('p.article_id'))
|
||||
->where($db->quoteName('p.service_id') . ' = ' . (int) $serviceId)
|
||||
@@ -171,7 +171,7 @@ class ServiceStatsModel extends BaseDatabaseModel
|
||||
'COUNT(*) AS post_count',
|
||||
'SUM(CASE WHEN ' . $db->quoteName('p.status') . ' = ' . $db->quote('posted') . ' THEN 1 ELSE 0 END) AS success_count',
|
||||
])
|
||||
->from($db->quoteName('#__mokojoomcross_posts', 'p'))
|
||||
->from($db->quoteName('#__mokosuitecross_posts', 'p'))
|
||||
->join('INNER', $db->quoteName('#__content', 'c')
|
||||
. ' ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('p.article_id'))
|
||||
->where($db->quoteName('p.service_id') . ' = ' . (int) $serviceId)
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -48,7 +48,7 @@ class ServicesModel extends ListModel
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query->select('a.*')
|
||||
->from($db->quoteName('#__mokojoomcross_services', 'a'));
|
||||
->from($db->quoteName('#__mokosuitecross_services', 'a'));
|
||||
|
||||
// Filter by published state
|
||||
$published = $this->getState('filter.published');
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -20,7 +20,7 @@ class TemplateModel extends AdminModel
|
||||
public function getForm($data = [], $loadData = true)
|
||||
{
|
||||
$form = $this->loadForm(
|
||||
'com_mokojoomcross.template',
|
||||
'com_mokosuitecross.template',
|
||||
'template',
|
||||
['control' => 'jform', 'load_data' => $loadData]
|
||||
);
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Model;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Model;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -38,7 +38,7 @@ class TemplatesModel extends ListModel
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
$query->select('a.*')
|
||||
->from($db->quoteName('#__mokojoomcross_templates', 'a'));
|
||||
->from($db->quoteName('#__mokosuitecross_templates', 'a'));
|
||||
|
||||
$published = $this->getState('filter.published');
|
||||
|
||||
+6
-6
@@ -1,26 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Service;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Service;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Interface that all MokoJoomCross service plugins must implement.
|
||||
* Interface that all MokoSuiteCross service plugins must implement.
|
||||
*
|
||||
* Service plugins in the `mokojoomcross` plugin group register themselves
|
||||
* Service plugins in the `mokosuitecross` plugin group register themselves
|
||||
* by implementing this interface. The system plugin dispatches cross-post
|
||||
* requests to all enabled service plugins via this contract.
|
||||
*/
|
||||
interface MokoJoomCrossServiceInterface
|
||||
interface MokoSuiteCrossServiceInterface
|
||||
{
|
||||
/**
|
||||
* Get the unique service type identifier.
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Table;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Table;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -20,6 +20,6 @@ class PostTable extends Table
|
||||
{
|
||||
public function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__mokojoomcross_posts', 'id', $db);
|
||||
parent::__construct('#__mokosuitecross_posts', 'id', $db);
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Table;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Table;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -23,7 +23,7 @@ class ServiceTable extends Table
|
||||
{
|
||||
public function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__mokojoomcross_services', 'id', $db);
|
||||
parent::__construct('#__mokosuitecross_services', 'id', $db);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,14 +38,14 @@ class ServiceTable extends Table
|
||||
{
|
||||
// Title is required
|
||||
if (empty($this->title)) {
|
||||
$this->setError(Text::_('COM_MOKOJOOMCROSS_ERROR_TITLE_REQUIRED'));
|
||||
$this->setError(Text::_('COM_MOKOSUITECROSS_ERROR_TITLE_REQUIRED'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Service type is required
|
||||
if (empty($this->service_type)) {
|
||||
$this->setError(Text::_('COM_MOKOJOOMCROSS_ERROR_SERVICE_TYPE_REQUIRED'));
|
||||
$this->setError(Text::_('COM_MOKOSUITECROSS_ERROR_SERVICE_TYPE_REQUIRED'));
|
||||
|
||||
return false;
|
||||
}
|
||||
+4
-4
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package MokoJoomCross
|
||||
* @subpackage com_mokojoomcross
|
||||
* @package MokoSuiteCross
|
||||
* @subpackage com_mokosuitecross
|
||||
* @author Moko Consulting <hello@mokoconsulting.tech>
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace Joomla\Component\MokoJoomCross\Administrator\Table;
|
||||
namespace Joomla\Component\MokoSuiteCross\Administrator\Table;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
@@ -20,6 +20,6 @@ class TemplateTable extends Table
|
||||
{
|
||||
public function __construct(DatabaseDriver $db)
|
||||
{
|
||||
parent::__construct('#__mokojoomcross_templates', 'id', $db);
|
||||
parent::__construct('#__mokosuitecross_templates', 'id', $db);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user