' . __('Notification types','attention-bar'); if (isset($_REQUEST['edit'])) { echo ' ' . __('New entry','attention-bar') . '

'; } else { echo ''; } $msg = ''; if ( !empty($_POST) && check_admin_referer('nb_submit','nb_nonce') ){ if($_POST['notbar_hidden_post'] == 'Y') { if($_POST['notbar_hidden_edit'] == 'Y') { // entry has been edited, only update the existing entry nb_edit_nottype($_POST['nb_notid']); if ( function_exists('w3tc_pgcache_flush') ) { w3tc_pgcache_flush(); $msg .= __(' & W3 Total Cache Page Cache flushed'); } echo '

' . __('Updated:','attention-bar') . ' ' . $_POST['nb_notname'] . $msg . '

'; } else { nb_insert_nottype(); if ( function_exists('w3tc_pgcache_flush') ) { w3tc_pgcache_flush(); $msg .= __(' & W3 Total Cache Page Cache flushed'); } echo '

' . __('Saved:','attention-bar') . ' ' . $_POST['nb_notname'] . $msg . '

'; } } } if (isset($_REQUEST['delete'])) { nb_delete_nottype($_REQUEST['id']); if ( function_exists('w3tc_pgcache_flush') ) { w3tc_pgcache_flush(); $msg .= __(' & W3 Total Cache Page Cache flushed'); } echo '

' . __('Deleted:','attention-bar') .' ' . $_REQUEST['id'] . $msg . '

'; } global $wpdb; $table_name = $wpdb->prefix . "nb_nottypes"; $myrows = $wpdb->get_results( "SELECT * FROM " . $table_name . ' ORDER BY id' ); echo '

' . __('Entries','attention-bar') . '

'; foreach ($myrows as $myrows) { if (empty($myrows->bgcolor)) { $bgcolor = __('Not set','attention-bar'); $bgcolorpreview = ""; } else { $bgcolor = $myrows->bgcolor; $bgcolorpreview = $bgcolor; } if (empty($myrows->fontcolor)) { $fontcolor = __('Not set','attention-bar'); $fontcolorpreview = ""; } else { $fontcolor = $myrows->fontcolor; $fontcolorpreview = $fontcolor; } if (empty($myrows->icon)) { $icon = '' . __('No icon','attention-bar') . ''; } else { $icon = ''; } $deletelink = 'admin.php?page=pd_sub_nottypes&delete&id=' . $myrows->id; $editlink = 'admin.php?page=pd_sub_nottypes&edit&id=' . $myrows->id; echo ''; } echo '
ID ' . __('Icon','attention-bar') . ' ' . __('Name','attention-bar') . ' ' . __('Background color','attention-bar') . ' ' . __('Font color','attention-bar') . '
ID ' . __('Icon','attention-bar') . ' ' . __('Name','attention-bar') . ' ' . __('Background color','attention-bar') . ' ' . __('Font color','attention-bar') . '
' . $myrows->id . '' . $icon . '' . $myrows->name . '' . $bgcolor . '' . $fontcolor . '
'; $noticonvalue = ''; $notnamevalue = ''; $notbgcolorvalue = ''; $notfontcolorvalue = ''; $notsizevalue = ''; $noturlvalue = ''; $edithidden = 'N'; $idhidden = ''; // check if we are in edit mode if (isset($_REQUEST['edit'])) { $table_name = $wpdb->prefix . "nb_nottypes"; $editrow = $wpdb->get_results( "SELECT * FROM " . $table_name . ' WHERE id = ' . $_REQUEST['id'] ); foreach ($editrow as $editrow) { $noticonvalue = $editrow->icon; $noturlvalue = $editrow->url; $notnamevalue = $editrow->name; $notbgcolorvalue = $editrow->bgcolor; $edithidden = "Y"; $idhidden = $editrow->id; $notfontcolorvalue = $editrow->fontcolor; $notsizevalue = $editrow->size; } } echo '

' . __('New / edit entry','attention-bar') . '

'; wp_nonce_field('nb_submit','nb_nonce'); nb_createinput('text',array( 'id' => 'nb_noticon', 'name' => 'nb_noticon', 'label' => __('Icon path','attention-bar'), 'desc' => __('If you leave this empty, no icon will be displayed in the Attention bar','attention-bar'), 'sel' => $noticonvalue, )); echo '
'; nb_createinput('text',array( 'id' => 'nb_noturl', 'name' => 'nb_noturl', 'label' => __('URL','attention-bar'), 'desc' => __('Makes the image clickable, linking to this URL','attention-bar'), 'sel' => $noturlvalue, )); echo '
'; nb_createinput('text',array( 'id' => 'nb_notname', 'name' => 'nb_notname', 'label' => __('Notification name','attention-bar'), 'desc' => __('This text will be displayed as announcement message','attention-bar'), 'sel' => $notnamevalue, )); echo '
'; nb_createinput('smalltext',array( 'id' => 'nb_notsize', 'name' => 'nb_notsize', 'label' => __('Notification size','attention-bar'), 'sel' => $notsizevalue, )); echo '
'; nb_createinput('color',array( 'id' => 'nb_notbgcolor', 'name' => 'nb_notbgcolor', 'label' => __('Background color','attention-bar'), 'sel' => $notbgcolorvalue, )); echo '
'; nb_createinput('color',array( 'id' => 'nb_notfontcolor', 'name' => 'nb_notfontcolor', 'label' => __('Font color','attention-bar'), 'sel' => $notfontcolorvalue, )); echo '

'; echo nb_get_info_box(); } ?>