Changeset 13430

Show
Ignore:
Timestamp:
02/10/12 13:28:48 (1 year ago)
Author:
p_lindheimer
Message:

fixes #5488 add required callbacks for featurecode destinations, needs testing to confirm fix

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/featurecodeadmin/functions.inc.php

    r13188 r13430  
    8080} 
    8181 
     82 
    8283function featurecodeadmin_get_config($engine) { 
    8384  global $ext;  // is this the best way to pass this? 
     
    99100    break; 
    100101  } 
     102} 
     103 
     104function featurecodeamin_getdest($exten) { 
     105  return array("ext-featurecodes,$exten,1"); 
     106} 
     107 
     108function featurecodeamin_getdestinfo($dest) { 
     109  if (substr(trim($dest),0,17) == 'ext-featurecodes,') { 
     110    $fcs = featurecodes_getAllFeaturesDetailed(); 
     111    $found = false; 
     112    foreach ($fcs as $fc) { 
     113      if ($fc['destination'] == $dest) { 
     114        $desc = $fc['description']; 
     115        $found = true; 
     116        break; 
     117      } 
     118    } 
     119    if (!$found) { 
     120      return array(); 
     121    } else { 
     122      return array( 
     123        'description' => $desc, 
     124        'edit_url' => 'config.php?display=featurecodeadmin', 
     125        ); 
     126    } 
     127  } else { 
     128    return false; 
     129  } 
     130} 
     131 
     132function featurecodes_check_destinations($dest=true) { 
     133  global $active_modules; 
     134 
     135  $fcs = featurecodeadmin_destinations(); 
     136 
     137  $destlist = array(); 
     138  if (is_array($dest) && empty($dest)) { 
     139    return $destlist; 
     140  } 
     141 
     142  $results = array(); 
     143  foreach ($fcs as $fc) { 
     144    if (in_array($fc['destination'], $destlist)) { 
     145      $results[] = $fc; 
     146    } 
     147  } 
     148 
     149  foreach ($results as $result) { 
     150    $destlist[] = array( 
     151      'dest' => $result['destination'], 
     152      'description' => $result['description'], 
     153      'edit_url' => 'config.php?display=featurecodeadmin', 
     154    ); 
     155  } 
     156  return $destlist; 
    101157} 
    102158