Changeset 4396

Show
Ignore:
Timestamp:
07/13/07 22:05:28 (6 years ago)
Author:
gregmac
Message:

Add support for deleting notifications

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3/dashboard/dashboard.css

    r4360 r4396  
    9393    padding-left:2px; 
    9494} 
    95 #syslog ul li .notify_ignore_btn
     95#syslog ul li .notification_buttons
    9696    position:absolute; 
    9797  right:0; 
    9898  top:0; 
     99} 
     100#syslog ul li .notification_buttons a { 
     101  cursor:pointer; 
    99102} 
    100103#syslog ul li.notify_critical { 
  • modules/branches/2.3/dashboard/page.index.php

    r4376 r4396  
    345345       
    346346      $out .= '<h4 class="syslog_text"><span>'.$item['display_text'].'</span>'; 
     347      $out .= '<div class="notification_buttons">'; 
     348      if (isset($item['candelete']) && $item['candelete']) { 
     349        $out .= '<a class="notify_ignore_btn" title="'._('Delete this').'" '. 
     350                'onclick="delete_notification(\''.$domid.'\', \''.$item['module'].'\', \''.$item['id'].'\');">'. 
     351                '<img src="images/cancel.png" width="16" height="16" border="0" alt="'._('Delete this').'" /></a>'; 
     352      } 
    347353      if (!$item['reset']) { 
    348354        $out .= '<a class="notify_ignore_btn" title="'._('Ignore this').'" '. 
     
    350356                '<img src="'.dirname($_SERVER['PHP_SELF']).'/images/notify_delete.png" width="16" height="16" border="0" alt="'._('Ignore this').'" /></a>'; 
    351357      } 
     358      $out .= '</div>'; 
    352359      $out .= '</h4>'; 
    353360       
     
    387394  if (isset($_REQUEST['module']) && $_REQUEST['id']) { 
    388395    $notify->reset($_REQUEST['module'], $_REQUEST['id']); 
     396  } 
     397} 
     398function do_syslog_delete() {  
     399  global $db; 
     400  $notify =& notifications::create($db); 
     401   
     402  if (isset($_REQUEST['module']) && $_REQUEST['id']) { 
     403  var_dump($_REQUEST); 
     404    $notify->safe_delete($_REQUEST['module'], $_REQUEST['id']); 
    389405  } 
    390406} 
     
    489505    $.post('config.php', {display:'<?php echo $module_page; ?>', quietmode:1, info:'syslog_ack', module:module, id:id}); 
    490506  } 
     507  function delete_notification(domid, module, id) { 
     508    $('#'+domid).fadeOut('slow'); 
     509    $.post('config.php', {display:'<?php echo $module_page; ?>', quietmode:1, info:'syslog_delete', module:module, id:id}); 
     510  } 
    491511  </script> 
    492512 
     
    557577      do_syslog_ack(); 
    558578    break; 
    559      
     579    case 'syslog_delete': 
     580      do_syslog_delete(); 
     581    break; 
    560582     
    561583    case 'info':