first commit

This commit is contained in:
2025-07-18 16:20:14 +07:00
commit 98af45c018
16382 changed files with 3148096 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
name: api_webhooks
title: API Webhooks
author: Montala Limited
version: 1.0
desc: Adds support for configurable action buttons that call remote scripts..
icon: fa fa-plug
icon-colour: #669944
category: Integrations
info_url: https://www.resourcespace.com/knowledge-base/plugins/api-webhooks

View File

@@ -0,0 +1,17 @@
<?php
// Copy to config.php in this folder, or the main ResourceSpace config.php file.
$api_webhooks_urls = [
[
"location" => "edit",
"buttontext" => "Fetch object data from CMS",
"url" => "https://www.resourcespace.com/some_script.abc?resource_id="
]
,
[
"location" => "edit",
"buttontext" => "Push image to CMS",
"url" => "https://www.resourcespace.com/another_script.abc?resource_id="
]
];

View File

@@ -0,0 +1,4 @@
.APIWebhooksEditButton
{
float:right;margin: 0 10px 0 10px !important;
}

View File

@@ -0,0 +1,89 @@
<?php
function HookApi_webhooksEditExtra_edit_buttons()
{
// Add configured buttons as appropriate.
global $api_webhooks_urls,$multiple;
if (!isset($api_webhooks_urls)) {
return false;
}
if ($multiple) {
return false;
} // Not for batch edit
?>
<input type="hidden" name="api_webhooks_submitted_button" id="api_webhooks_submitted_button" value="" />
<?php
$counter = 0;
foreach ($api_webhooks_urls as $url) {
?>
<input name="save"
class="editsave APIWebhooksEditButton"
type="submit"
value="&nbsp;&nbsp;&#8634;&nbsp;<?php echo escape(i18n_get_translated($url["buttontext"])); ?>&nbsp;&nbsp;"
onclick="document.getElementById('api_webhooks_submitted_button').value=<?php echo $counter ?>;"
/>
<?php
$counter++;
}
}
function HookApi_webhooksEditRedirectaftersave()
{
// Process the saved form and access the remote script.
global $api_webhooks_urls,$ref;
if (!isset($api_webhooks_urls)) {
return false;
}
// Fetch appropriate button
$button_index = getval("api_webhooks_submitted_button", "");
if ($button_index === "") {
return false;
} // No button pressed? Redirect to view page as normal.
$button = $api_webhooks_urls[$button_index];
// Perform API call.
$url = $button["url"] . $ref;
$options = array
(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'ignore_errors' => true
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
global $api_webhooks_urls;
// Handle any errors.
if (strpos($http_response_header[0], "200 OK") === false) {
?>
<script>alert('Error - POST to <?php echo escape($url) ?> returned <?php echo escape($http_response_header[0]) ?>');</script>
<?php
}
// Clear posted values so user's changes don't overwrite the data coming back in.
$_POST = array();
return true;
}
function HookApi_webhooksEditUploadreviewabortnext()
{
global $api_webhooks_urls;
if (!isset($api_webhooks_urls)) {
return false;
}
// Don't move to the next resource when an API button has been pressed.
$button_index = getval("api_webhooks_submitted_button", "");
if ($button_index !== "") {
return true;
}
}
function HookApi_webhooksEditRedirectaftersavetemplate()
{
return HookApi_webhooksEditRedirectaftersave();
}

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'ويب هوكس API';
$lang["plugin-api_webhooks-desc"] = 'يضيف دعمًا لأزرار الإجراءات القابلة للتكوين التي تستدعي البرامج النصية البعيدة.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Afegeix suport per a botons d\'acció configurables que criden scripts remots.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooky';
$lang["plugin-api_webhooks-desc"] = 'Přidává podporu pro konfigurovatelná akční tlačítka, která volají vzdálené skripty.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Tilføjer support til konfigurerbare handlingsknapper, der kalder eksterne scripts.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API-Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Fügt Unterstützung für konfigurierbare Aktionsschaltflächen hinzu, die entfernte Skripte aufrufen.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Προσθέτει υποστήριξη για διαμορφώσιμα κουμπιά ενεργειών που καλούν απομακρυσμένα σενάρια.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Webhooks de API';
$lang["plugin-api_webhooks-desc"] = 'Agrega soporte para botones de acción configurables que llaman a scripts remotos.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Webhooks de API';
$lang["plugin-api_webhooks-desc"] = 'Añade soporte para botones de acción configurables que llaman a scripts remotos.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API-verkkokoukut';
$lang["plugin-api_webhooks-desc"] = 'Lisää tuen konfiguroitaville toimintopainikkeille, jotka kutsuvat etäskriptejä.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Ajoute la prise en charge des boutons d\'action configurables qui appellent des scripts distants.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'एपीआई वेबहुक्स';
$lang["plugin-api_webhooks-desc"] = 'रिमोट स्क्रिप्ट्स को कॉल करने वाले कॉन्फ़िगर करने योग्य एक्शन बटन के लिए समर्थन जोड़ता है।';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhookovi';
$lang["plugin-api_webhooks-desc"] = 'Dodaje podršku za konfigurabilne akcijske gumbe koji pozivaju udaljene skripte.';

View File

@@ -0,0 +1,2 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Menambahkan dukungan untuk tombol tindakan yang dapat dikonfigurasi yang memanggil skrip jarak jauh.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Webhook API';
$lang["plugin-api_webhooks-desc"] = 'Aggiunge il supporto per pulsanti di azione configurabili che richiamano script remoti.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'APIウェブフック';
$lang["plugin-api_webhooks-desc"] = 'リモートスクリプトを呼び出すための設定可能なアクションボタンのサポートを追加します。';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API 웹훅';
$lang["plugin-api_webhooks-desc"] = '원격 스크립트를 호출하는 구성 가능한 작업 버튼 지원 추가.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Voegt ondersteuning toe voor configureerbare actiekoppen die externe scripts aanroepen.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Legger til støtte for konfigurerbare handlingsknapper som kaller eksterne skript.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Interfejs API Webhooki';
$lang["plugin-api_webhooks-desc"] = 'Dodaje wsparcie dla konfigurowalnych przycisków akcji, które wywołują zdalne skrypty.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Webhooks da API';
$lang["plugin-api_webhooks-desc"] = 'Adiciona suporte para botões de ação configuráveis que chamam scripts remotos.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Webhooks da API';
$lang["plugin-api_webhooks-desc"] = 'Adiciona suporte para botões de ação configuráveis que chamam scripts remotos.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'Webhook-uri API';
$lang["plugin-api_webhooks-desc"] = 'Adaugă suport pentru butoane de acțiune configurabile care apelează scripturi la distanță.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Вебхуки';
$lang["plugin-api_webhooks-desc"] = 'Добавляет поддержку настраиваемых кнопок действий, которые вызывают удаленные скрипты.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooki';
$lang["plugin-api_webhooks-desc"] = 'Dodaja podporo za nastavljive akcijske gumbe, ki kličejo oddaljene skripte.';

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = 'Lägger till stöd för konfigurerbara åtgärdsknappar som anropar fjärrskript.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhook\'ları';
$lang["plugin-api_webhooks-desc"] = 'Uzaktan komut dosyalarını çağıran yapılandırılabilir eylem düğmeleri için destek ekler.';

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1 @@
<?php

View File

@@ -0,0 +1,2 @@
<?php

View File

@@ -0,0 +1,4 @@
<?php
$lang["plugin-api_webhooks-title"] = 'API Webhooks';
$lang["plugin-api_webhooks-desc"] = '添加对可配置操作按钮的支持,这些按钮调用远程脚本。';