Skip to content

DGAC/MattermostModule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 20, 2022
222b771 · Jan 20, 2022

History

59 Commits
Dec 4, 2019
Jan 20, 2022
Jan 20, 2022
Mar 24, 2018
Feb 5, 2018
Feb 6, 2018
Jan 25, 2018
Jan 25, 2018
Jan 20, 2022
Jan 20, 2022
Jan 20, 2022
Jan 20, 2022
May 23, 2019

Repository files navigation

Chat module for Laminas and Bootstrap 3

WIP : This module is usable but it needs more love :)

** 0.2.x version are for ZF2 ; 0.3.x and further for ZF3/Laminas **

Mandatory screenshot

screenshot

Installation

composer require dgac/mattermostmodule

Configuration

  • Add module in your application modules

  • Use mattermostmessenger.local.php.dist to add your configuration

Usage

  • Add CSS files to your view.

    • Bootstrap 3
    • Font Awesome 5

Example :

echo $this->headLink()
              ->appendStylesheet($this->basePath() . '/<path to your bootstrap>/bootstrap.min.css')
              ->appendStylesheet($this->basePath() . '/assets/css/font-awesome.all.min.css')
              ->appendStylesheet($this->basePath() . '/assets/css/mattermostchat.css');

Example :

echo $this->headScript()
    ->appendFile($this->basePath() . '/<path to your jquery>/jquery.min.js')
    ->appendFile($this->basePath() . '/<path to your jquery-ui>/jquery-ui.min.js')
    ->appendFile($this->basePath() . '/<path to your bootstrap>/bootstrap.min.js')
    ->appendFile($this->basePath() . '/<path to your momentjs>/moment.min.js')
    ->appendFile($this->basePath() . '/<path to your list.js>/list.min.js')
    ->appendFile($this->basePath() . '/<path to your marked.js>/marked.min.js')
    ->appendFile($this->basePath() . '/<path to your js-cookie>/js-cookie.js')
    ->appendFile($this->basePath() . '/assets/js/mattermostchat.js');
  • Use view helper :
<div class="chat-container">
    <?php echo $this->mattermost();?>
</div>
  • And finally configure the Jquery UI Widget :
$('.chat-container').mattermost({
            baseUrl: '<?php echo $this->basePath(); ?>',
            userName: '<?php echo $this->mattermost['login'];?>',
            teamName: '<?php echo $this->mattermost['team_id'];?>',
            channelId: '<?php echo $this->mattermost['defaultchannelid'];?>',
            token: '<?php echo $this->mattermost['token'];?>',
            serverUrl: '<?php echo $this->mattermost['server_url'];?>'
        });