Changeset 5277

Show
Ignore:
Timestamp:
11/25/07 03:01:45 (5 years ago)
Author:
p_lindheimer
Message:

add disa_getdest() and feedback on destination usage

Files:

Legend:

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

    r4901 r5277  
    1515                return null; 
    1616        } 
     17} 
     18 
     19function disa_getdest($exten) { 
     20  return array('disa,'.$exten.',1'); 
     21} 
     22 
     23function disa_getdestinfo($dest) { 
     24  global $active_modules; 
     25 
     26  if (substr(trim($dest),0,5) == 'disa,') { 
     27    $exten = explode(',',$dest); 
     28    $exten = $exten[1]; 
     29    $thisexten = disa_get($exten); 
     30    if (empty($thisexten)) { 
     31      return array(); 
     32    } else { 
     33      //$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup'; 
     34      return array('description' => 'DISA : '.$thisexten['displayname'], 
     35                   'edit_url' => 'config.php?display=disa&itemid='.urlencode($exten), 
     36                  ); 
     37    } 
     38  } else { 
     39    return false; 
     40  } 
    1741} 
    1842 
  • modules/branches/2.4/disa/page.disa.php

    r3204 r5277  
    6666  <h2><?php echo ($itemid ? "DISA: ".$thisItem["displayname"]." ($itemid)" : _("Add")." DISA"); ?></h2> 
    6767<?php   if ($itemid){ ?> 
    68   <p><a href="<?php echo $delURL ?>"><?php echo _("Delete")." DISA"?> <?php echo $thisItem["displayname"]; ?></a></p> 
     68  <a href="<?php echo $delURL ?>"><?php echo _("Delete")." DISA"?> <?php echo $thisItem["displayname"]; ?></a> 
     69 
     70<?php 
     71          $usage_list = framework_display_destination_usage(disa_getdest($itemid)); 
     72          if (!empty($usage_list)) { 
     73?> 
     74            <br /><a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a> 
     75<?php 
     76      } 
     77?> 
     78 
    6979<?php   } ?> 
    7080  <form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return edit_onsubmit();">