<?php
class BootstrapNotifications extends CodonModule 
{
    /**
     * Activity::index()
     * 
     * @return void
     */
    public function index() {
        
        $this->render('Notify/index.php');
    }
    
    public function Notify($heading, $message, $delay, $color) {
    	
    	
    	if($delay == '') {
    		$delay = 11000;
    	}
    	
    	if($color == '') {
    		$color = 'info';
    	}
    	
    	if($message == '') {
    		return;
    	} else {
    	?>
    	
    	
    	
	<script>
    $(function() {
    setTimeout(function() {
    $.bootstrapGrowl("<h4><strong><?php echo $heading; ?> </strong> </h4> <?php echo $message; ?> ", {
    ele: 'body', // which element to append to
    type: '<?php echo $color; ?>', // (null, 'info', 'danger', 'success')
    offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
    align: 'right', // ('left', 'right', or 'center')
    width: 250, // (integer, or 'auto')
    delay: <?php echo $delay; ?>, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
    allow_dismiss: true, // If true then will display a cross to close the popup.
    stackup_spacing: 10 // spacing between consecutively stacked growls.
    });
    }, 200);
    });      
	</script>

<?php 
    	}
    	 
    	
    	
    }
    
}
?>