Skip to content

Commit

Permalink
Fix empty slides call
Browse files Browse the repository at this point in the history
  • Loading branch information
sanduhrs committed Aug 5, 2020
1 parent edb840d commit 35934ae
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/BigBlueButton/Member/Meeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -1611,29 +1611,31 @@ public function create()
$parameters["meta_$key"] = $value;
}

$xml = new \DOMDocument(self::XML_VERSION, self::XML_ENCODING);
$modules = $xml->createElement("modules");
$module = $xml->createElement("module");
$module->setAttribute('name', 'presentation');
$modules->appendChild($module);
foreach ($this->getSlides() as $slide) {
if ($slide->isEmbedded()) {
if ($slide->getBase64() === '') {
$slide->setBase64(base64_encode(file_get_contents($slide->getUri())));
if ($this->getSlides()) {
$xml = new \DOMDocument(self::XML_VERSION, self::XML_ENCODING);
$modules = $xml->createElement("modules");
$module = $xml->createElement("module");
$module->setAttribute('name', 'presentation');
$modules->appendChild($module);
foreach ($this->getSlides() as $slide) {
if ($slide->isEmbedded()) {
if ($slide->getBase64() === '') {
$slide->setBase64(base64_encode(file_get_contents($slide->getUri())));
}
$document = $xml->createElement("document", $slide->getBase64());
$document->setAttribute('name', $slide->getName());
$module->appendChild($document);
} else {
$document = $xml->createElement("document", $slide->getBase64());
$document->setAttribute('url', $slide->getUri());
$document->setAttribute('filename', $slide->getName());
$module->appendChild($document);
}
$document = $xml->createElement("document", $slide->getBase64());
$document->setAttribute('name', $slide->getName());
$module->appendChild($document);
} else {
$document = $xml->createElement("document", $slide->getBase64());
$document->setAttribute('url', $slide->getUri());
$document->setAttribute('filename', $slide->getName());
$module->appendChild($document);
}
$xml->appendChild($modules);
$body = $xml->saveXML($xml->documentElement);
$parameters['body'] = $body;
}
$xml->appendChild($modules);
$body = $xml->saveXML($xml->documentElement);
$parameters['body'] = $body;

$response = $this->client->post('create', $parameters);
$this->meetingID = $response->meetingID;
Expand Down

0 comments on commit 35934ae

Please sign in to comment.