Merge branch 'maint/7.0'
[ninja.git] / application / views / template_notifications.php
blob4f238e979f1a2adaf6d8413c0849b595f99b9468
2 <div class="jq-notify-zone"></div>
4 <?php
6 /* Check to see if there are any global notifications to display */
8 $notifications = array();
10 $note_config = Ninja_setting_Model::fetch_page_setting( "notifications", "notifications_facility" );
11 if ( $note_config ) {
12 $note_config = $note_config->setting;
13 } else {
14 $note_config = "{}";
17 echo "<script type=\"text/javascript\">" .
18 "$.notify.sessionid = '" . sha1( session_id() ) . "';" .
19 "$.notify.configured = " . $note_config . ";" .
20 "</script>";
22 if ( isset( $global_notifications ) && is_array( $global_notifications ) && count( $global_notifications ) >= 1 ) {
24 foreach ( $global_notifications as $note )
25 $notifications[] = $note[0];
27 if ( count( $notifications ) > 1 ) {
28 $last = array_pop( $notifications );
29 $message = implode( ", ", $notifications ) . " and " . $last;
30 } else {
31 $message = implode( ", ", $notifications );
34 $message .= ". You can enter the process information page to enable/disable process settings.";
38 /* Render PHP added notifications if logged in! */
40 if ( Auth::instance()->logged_in() )
41 notify::render();