<commit_before>Cakephp/Bootstrap Notification plugin
===============================

This plugin is inspired by the Facebook notifications. It is to be used in CakePHP applications that use the Twitter Bootstrap user interface.

This is how it looks
----------------------

![Notification Screenshot][1]

The installation
----------------------

 - Checkout the code

`git clone git://github.com/beeman/cakephp-bootstrap-notifications.git Notifications`

or add as submodule:

`git submodule add git://github.com/beeman/cakephp-bootstrap-notifications.git plugins/Notifications`

 - Add the following line to app/Config/bootstrap.php to load the plugin

`CakePlugin::load('Notifications');`

 - Initialize the schema

`app/Console/cake schema create --plugin Notifications`

 - Add the resources to the default template (default.ctp)

`<?php echo $this->Html->css('/notifications/css/notifications'); ?>`

`<?php echo $this->Html->script('/notifications/js/notifications'); ?>`

 - Add elements for Notification Initialization to the default template (default.ctp)

`<?php echo $this->Element('Notifications.NotificationInit'); ?>`

 - Add the Notification Icon to the bootstrap navigation bar

`<?php echo $this->Element('Notifications.NotificationIcon'); ?>`

 - Associate Notifications to User object

```php
public $hasMany = array(
    'Notification' => array(
        'className' => 'Notifications.Notification',
        'foreignKey' => 'user_id',
    ),
);
```

Adding notifications to your system
----------------------

In this example we will give the user a notification when it logs in or when there is a login error.

Modifiy the login() method in the UsersController, enter the next rule direct below '$this->Auth->login()'

`$this->User->Notification->msg(AuthComponent::user('id'), "You logged in!");`

Now when you login you should get a notification from it.


  [1]: http://i.imgur.com/z7ZDw.png<commit_msg>Update master<commit_after>Cakephp/Bootstrap Notification plugin
===============================

This plugin is inspired by the Facebook notifications. It is to be used in CakePHP applications that use the Twitter Bootstrap user interface.

This is how it looks
----------------------

![Notification Screenshot][1]

The installation
----------------------

 - Checkout the code

`git clone git://github.com/beeman/cakephp-bootstrap-notifications.git Notifications`

or add as submodule:

`git submodule add git://github.com/beeman/cakephp-bootstrap-notifications.git plugins/Notifications`

 - Add the following line to app/Config/bootstrap.php to load the plugin

`CakePlugin::load('Notifications');`

 - Initialize the schema

`app/Console/cake schema create --plugin Notifications`

 - Add the resources to the default template (default.ctp)

`<?php echo $this->Html->css('/notifications/css/notifications'); ?>`

`<?php echo $this->Html->script('/notifications/js/notifications'); ?>`

 - Add elements for Notification Initialization to the default template (default.ctp)

`<?php echo $this->Element('Notifications.NotificationInit'); ?>`

 - Add the Notification Icon to the bootstrap navigation bar

`<?php echo $this->Element('Notifications.NotificationIcon'); ?>`

 - Associate Notifications to User object

```php
public $hasMany = array(
    'Notification' => array(
        'className' => 'Notifications.Notification',
        'foreignKey' => 'user_id',
    ),
);
```

Adding notifications to your system
----------------------

In this example we will give the user a notification when it logs in.

Modifiy the login() method in the UsersController, enter the next rule direct below '$this->Auth->login()'

`$this->User->Notification->msg(AuthComponent::user('id'), "You logged in!");`

Now when you login you should get a notification from it.


  [1]: http://i.imgur.com/z7ZDw.png
{'fraction_non_alphanumeric': 0.16217630133403085, 'fraction_numerical': 0.0015694480774261052, 'mean_word_length': 3.8962868117797695, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6357467', 'n_tokens_mistral': 1047, 'n_tokens_neox': 994, 'n_words': 355}