Changeset 5284

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

added timeconditions_getdest() and timeconditions_getdestinfo() and feedback on destination usage

Files:

Legend:

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

    r5259 r5284  
    1414  } else { 
    1515    return null; 
     16  } 
     17} 
     18 
     19function timeconditions_getdest($exten) { 
     20  return array('timeconditions,'.$exten.',1'); 
     21} 
     22 
     23function timeconditions_getdestinfo($dest) { 
     24  global $active_modules; 
     25 
     26  if (substr(trim($dest),0,15) == 'timeconditions,') { 
     27    $exten = explode(',',$dest); 
     28    $exten = $exten[1]; 
     29    $thisexten = timeconditions_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' => 'Time Conditon : '.$thisexten['displayname'], 
     35                   'edit_url' => 'config.php?display=timeconditions&itemid='.urlencode($exten), 
     36                  ); 
     37    } 
     38  } else { 
     39    return false; 
    1640  } 
    1741} 
  • modules/branches/2.4/timeconditions/page.timeconditions.php

    r3204 r5284  
    124124  <h2><?php echo ($itemid ? _("Time Condition:")." ". $itemid : _("Add Time Condition")); ?></h2> 
    125125<?php   if ($itemid){ ?> 
    126   <p><a href="<?php echo $delURL ?>"><?php echo _("Delete Time Condition")?> <?php echo $itemid; ?></a></p> 
    127 <?php   } ?> 
     126  <a href="<?php echo $delURL ?>"><?php echo _("Delete Time Condition")?> <?php echo $itemid; ?></a> 
     127<?php 
     128          $usage_list = framework_display_destination_usage(timeconditions_getdest($itemid)); 
     129          if (!empty($usage_list)) { 
     130?> 
     131            <br /><a href="#" class="info"><?php echo $usage_list['text']?>:<span><?php echo $usage_list['tooltip']?></span></a> 
     132<?php 
     133          } 
     134      }  
     135?> 
    128136  <form autocomplete="off" name="edit" action="<?php $_SERVER['PHP_SELF'] ?>" method="post" onsubmit="return edit_onsubmit();"> 
    129137  <input type="hidden" name="display" value="<?php echo $dispnum?>">