brunospy/mattermostmodule

This package is abandoned and no longer maintained. No replacement package was suggested.

Module to use Mattermost in a Zend Framework and Bootstrap application

Installs: 310

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 8

Language:JavaScript

v0.4.1 2022-01-20 14:15 UTC

README

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'];?>'
        });