Updating external functions
This commit is contained in:
parent
0bc809ba07
commit
4f342659d4
@ -50,7 +50,7 @@ if (boolval($deleteid)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Retrieving a list of services */
|
/* Retrieving a list of services */
|
||||||
$callbacks = local_webhooks_list_records();
|
$callbacks = local_webhooks_get_list_records();
|
||||||
|
|
||||||
/* Upload settings as a file */
|
/* Upload settings as a file */
|
||||||
if (boolval($backupservices)) {
|
if (boolval($backupservices)) {
|
||||||
|
39
lib.php
39
lib.php
@ -24,6 +24,27 @@
|
|||||||
|
|
||||||
defined("MOODLE_INTERNAL") || die();
|
defined("MOODLE_INTERNAL") || die();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getting a list of all services.
|
||||||
|
*
|
||||||
|
* @param number $limitfrom
|
||||||
|
* @param number $limitnum
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function local_webhooks_get_list_records($limitfrom = 0, $limitnum = 0) {
|
||||||
|
global $DB;
|
||||||
|
|
||||||
|
$listservices = $DB->get_records("local_webhooks_service", null, "id", "*", $limitfrom, $limitnum);
|
||||||
|
|
||||||
|
foreach ($listservices as $servicerecord) {
|
||||||
|
if (!empty($servicerecord->events)) {
|
||||||
|
$servicerecord->events = local_webhooks_unarchive_data($servicerecord->events);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $listservices;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getting information about the service.
|
* Getting information about the service.
|
||||||
*
|
*
|
||||||
@ -43,24 +64,12 @@ function local_webhooks_get_record($serviceid = 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getting a list of all services.
|
* Clear the database table.
|
||||||
*
|
|
||||||
* @param number $limitfrom
|
|
||||||
* @param number $limitnum
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
function local_webhooks_list_records($limitfrom = 0, $limitnum = 0) {
|
function local_webhooks_remove_list_records() {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
$listservices = $DB->get_records("local_webhooks_service", null, "id", "*", $limitfrom, $limitnum);
|
$DB->delete_records("local_webhooks_service", null);
|
||||||
|
|
||||||
foreach ($listservices as $servicerecord) {
|
|
||||||
if (!empty($servicerecord->events)) {
|
|
||||||
$servicerecord->events = local_webhooks_unarchive_data($servicerecord->events);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $listservices;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user