widget.php 745 B

12345678910111213141516171819202122232425262728
  1. <div class="widget-rocketchat">
  2. <?php
  3. global $myUser,$conf;
  4. try{
  5. $chan = empty( $widget->data('chan')) ? '': $widget->data('chan');
  6. if(empty($conf->get('rocketchat_host'))) throw new Exception("Le serveur chat n'est pas configuré, merci de contacter un administrateur");
  7. if(empty($chan)) throw new Exception('Aucun chan spécifié</h2><p>Veuillez configurer ce widget</p>');
  8. $url = $conf->get('rocketchat_host');
  9. $url .= $chan.'?layout=embedded';
  10. $chan = urldecode($widget->data('chan'));
  11. ?>
  12. <iframe class="frame-view" src="<?php echo $url; ?>"></iframe>
  13. <?php
  14. }catch(Exception $e){
  15. ?>
  16. <div class="text-center pt-3"><h2 class="text-muted"><i class="fab fa-rocketchat"></i> <?php echo $e->getMessage(); ?></div>
  17. <?php
  18. }
  19. ?></div>