|
@@ 412-441 (lines=30) @@
|
| 409 |
|
* |
| 410 |
|
* @return array |
| 411 |
|
*/ |
| 412 |
|
function bigbluebuttonbn_broker_recording_action_unpublish($params, $recordings) { |
| 413 |
|
global $DB; |
| 414 |
|
if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
| 415 |
|
// Execute unpublish or protect on imported recording link. |
| 416 |
|
return array( |
| 417 |
|
'status' => bigbluebuttonbn_publish_recording_imported( |
| 418 |
|
$recordings[$params['id']]['imported'], |
| 419 |
|
false |
| 420 |
|
) |
| 421 |
|
); |
| 422 |
|
} |
| 423 |
|
// As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
| 424 |
|
// First: Unpublish imported links associated to the recording. |
| 425 |
|
$importedall = bigbluebuttonbn_get_recording_imported_instances($params['id']); |
| 426 |
|
foreach ($importedall as $key => $record) { |
| 427 |
|
$meta = json_decode($record->meta, true); |
| 428 |
|
// Prepare data for the update. |
| 429 |
|
$meta['recording']['published'] = 'false'; |
| 430 |
|
$importedall[$key]->meta = json_encode($meta); |
| 431 |
|
// Proceed with the update. |
| 432 |
|
$DB->update_record('bigbluebuttonbn_logs', $importedall[$key]); |
| 433 |
|
} |
| 434 |
|
// Second: Execute the actual unpublish. |
| 435 |
|
return array( |
| 436 |
|
'status' => bigbluebuttonbn_publish_recordings( |
| 437 |
|
$params['id'], |
| 438 |
|
'false' |
| 439 |
|
) |
| 440 |
|
); |
| 441 |
|
} |
| 442 |
|
|
| 443 |
|
/** |
| 444 |
|
* Helper for performing protect on recordings. |
|
@@ 451-480 (lines=30) @@
|
| 448 |
|
* |
| 449 |
|
* @return array |
| 450 |
|
*/ |
| 451 |
|
function bigbluebuttonbn_broker_recording_action_protect($params, $recordings) { |
| 452 |
|
global $DB; |
| 453 |
|
if (bigbluebuttonbn_broker_recording_is_imported($recordings, $params['id'])) { |
| 454 |
|
// Execute unpublish or protect on imported recording link. |
| 455 |
|
return array( |
| 456 |
|
'status' => bigbluebuttonbn_protect_recording_imported( |
| 457 |
|
$recordings[$params['id']]['imported'], |
| 458 |
|
true |
| 459 |
|
) |
| 460 |
|
); |
| 461 |
|
} |
| 462 |
|
// As the recordingid was not identified as imported recording link, execute protect on a real recording. |
| 463 |
|
// First: Protect imported links associated to the recording. |
| 464 |
|
$importedall = bigbluebuttonbn_get_recording_imported_instances($params['id']); |
| 465 |
|
foreach ($importedall as $key => $record) { |
| 466 |
|
$meta = json_decode($record->meta, true); |
| 467 |
|
// Prepare data for the update. |
| 468 |
|
$meta['recording']['protected'] = 'true'; |
| 469 |
|
$importedall[$key]->meta = json_encode($meta); |
| 470 |
|
// Proceed with the update. |
| 471 |
|
$DB->update_record('bigbluebuttonbn_logs', $importedall[$key]); |
| 472 |
|
} |
| 473 |
|
// Second: Execute the actual protect. |
| 474 |
|
return array( |
| 475 |
|
'status' => bigbluebuttonbn_update_recordings( |
| 476 |
|
$params['id'], |
| 477 |
|
array('protect' => 'true') |
| 478 |
|
) |
| 479 |
|
); |
| 480 |
|
} |
| 481 |
|
|
| 482 |
|
/** |
| 483 |
|
* Helper for performing delete on recordings. |