An open API service indexing awesome lists of open source software.

https://github.com/dgac/mattermostmodule

Mattermost Module for Zend Framework and Bootstrap
https://github.com/dgac/mattermostmodule

bootstrap chatclient chatroom laminas laminas-module laminas-mvc mattermost php zend-framework zend-module

Last synced: 2 months ago
JSON representation

Mattermost Module for Zend Framework and Bootstrap

Awesome Lists containing this project

README

        

# 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](https://raw.githubusercontent.com/DGAC/MattermostModule/master/mattermostmodule.png)

## 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 :

```php
echo $this->headLink()
->appendStylesheet($this->basePath() . '//bootstrap.min.css')
->appendStylesheet($this->basePath() . '/assets/css/font-awesome.all.min.css')
->appendStylesheet($this->basePath() . '/assets/css/mattermostchat.css');

```

* Add javascript dependencies (see bower.json)

- JQuery
- JQuery-UI
- Bootstrap 3
- Moment.js : http://momentjs.com/
- List.js : http://listjs.com/
- Marked : https://github.com/chjj/marked
- JS Cookie : https://github.com/js-cookie/js-cookie

Example :

```php
echo $this->headScript()
->appendFile($this->basePath() . '//jquery.min.js')
->appendFile($this->basePath() . '//jquery-ui.min.js')
->appendFile($this->basePath() . '//bootstrap.min.js')
->appendFile($this->basePath() . '//moment.min.js')
->appendFile($this->basePath() . '//list.min.js')
->appendFile($this->basePath() . '//marked.min.js')
->appendFile($this->basePath() . '//js-cookie.js')
->appendFile($this->basePath() . '/assets/js/mattermostchat.js');
```

* Use view helper :
```html


mattermost();?>

```

* And finally configure the Jquery UI Widget :
```javascript
$('.chat-container').mattermost({
baseUrl: 'basePath(); ?>',
userName: 'mattermost['login'];?>',
teamName: 'mattermost['team_id'];?>',
channelId: 'mattermost['defaultchannelid'];?>',
token: 'mattermost['token'];?>',
serverUrl: 'mattermost['server_url'];?>'
});
```