Changeset 5253

Show
Ignore:
Timestamp:
11/18/07 23:07:33 (6 years ago)
Author:
p_lindheimer
Message:

added annoucement_check_destinations() for destination registry

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.4/announcement/functions.inc.php

    r4901 r5253  
    123123} 
    124124 
     125function announcement_check_destinations($dest=true) { 
     126  global $active_modules; 
     127 
     128  $destlist = array(); 
     129  if (is_array($dest) && empty($dest)) { 
     130    return $destlist; 
     131  } 
     132  $sql = "SELECT announcement_id, post_dest, description FROM announcement "; 
     133  if ($dest !== true) { 
     134    $sql .= "WHERE post_dest in ('".implode("','",$dest)."')"; 
     135  } 
     136  $results = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 
     137 
     138  $type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup'; 
     139 
     140  foreach ($results as $result) { 
     141    $thisdest = $result['post_dest']; 
     142    $thisid   = $result['annoucement_id']; 
     143    $destlist[] = array( 
     144      'dest' => $thisdest, 
     145      'description' => 'Annoucement: '.$result['description'], 
     146      'edit_url' => 'config.php?display=announcement&type='.$type.'&extdisplay='.urlencode($thisid), 
     147    ); 
     148  } 
     149  return $destlist; 
     150} 
     151 
    125152?>