mirror of https://github.com/sualko/cloud_bbb
feat: add admin settings for default skip media (#176)
* feat: add admin settings for default skip media * fix: change variable names * fix: wrong variable name * fix: change checkbox label for code readabilitypull/186/head
parent
114328cf0a
commit
2b069b90c6
|
@ -12,19 +12,25 @@ use OCA\BigBlueButton\Event\RoomDeletedEvent;
|
|||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\IConfig;
|
||||
|
||||
class RoomService {
|
||||
|
||||
/** @var RoomMapper */
|
||||
private $mapper;
|
||||
|
||||
/** @var IConfig */
|
||||
private $config;
|
||||
|
||||
/** @var IEventDispatcher */
|
||||
private $eventDispatcher;
|
||||
|
||||
public function __construct(
|
||||
RoomMapper $mapper,
|
||||
IConfig $config,
|
||||
IEventDispatcher $eventDispatcher) {
|
||||
$this->mapper = $mapper;
|
||||
$this->config = $config;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -76,6 +82,8 @@ class RoomService {
|
|||
public function create(string $name, string $welcome, int $maxParticipants, bool $record, string $access, string $userId): \OCP\AppFramework\Db\Entity {
|
||||
$room = new Room();
|
||||
|
||||
$mediaCheck = $this->config->getAppValue('bbb', 'join.mediaCheck') === 'true';
|
||||
|
||||
$room->setUid(\OC::$server->getSecureRandom()->generate(16, \OCP\Security\ISecureRandom::CHAR_HUMAN_READABLE));
|
||||
$room->setName($name);
|
||||
$room->setWelcome($welcome);
|
||||
|
@ -86,7 +94,7 @@ class RoomService {
|
|||
$room->setAccess($access);
|
||||
$room->setUserId($userId);
|
||||
$room->setListenOnly(true);
|
||||
$room->setMediaCheck(true);
|
||||
$room->setMediaCheck($mediaCheck);
|
||||
$room->setCleanLayout(false);
|
||||
$room->setJoinMuted(false);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ class Admin implements ISettings {
|
|||
'app.navigation' => $this->config->getAppValue('bbb', 'app.navigation') === 'true' ? 'checked' : '',
|
||||
'join.theme' => $this->config->getAppValue('bbb', 'join.theme') === 'true' ? 'checked' : '',
|
||||
'app.shortener' => $this->config->getAppValue('bbb', 'app.shortener'),
|
||||
'join.mediaCheck' => $this->config->getAppValue('bbb', 'join.mediaCheck') === 'true' ? 'checked' : '',
|
||||
];
|
||||
|
||||
return new TemplateResponse('bbb', 'admin', $parameters);
|
||||
|
|
|
@ -29,6 +29,14 @@ script('bbb', 'restrictions');
|
|||
<label for="bbb-join-theme"><?php p($l->t('Use Nextcloud theme in BigBlueButton.')); ?></label>
|
||||
</p>
|
||||
|
||||
<h3><?php p($l->t('Default Room Settings')); ?></h3>
|
||||
<p><?php p($l->t('Below you can change some default values, which are used to create a new room.')); ?></p>
|
||||
|
||||
<p>
|
||||
<input type="checkbox" name="join.mediaCheck" id="bbb-join-mediaCheck" class="checkbox bbb-setting" value="1" <?php p($_['join.mediaCheck']); ?> />
|
||||
<label for="bbb-join-mediaCheck"><?php p($l->t('Perform media check before usage')); ?></label>
|
||||
</p>
|
||||
|
||||
<h3><?php p($l->t('Community')); ?></h3>
|
||||
<p><?php p($l->t('Are you enjoying this app? Give something back to the open source community.')); ?> <a href="https://github.com/sualko/cloud_bbb/blob/master/.github/contributing.md" target="_blank" rel="noopener noreferrer" class="button"><span class="heart"></span> <?php p($l->t('Checkout the contributor guide')); ?></a></p>
|
||||
|
||||
|
|
Loading…
Reference in New Issue