예제 #1
0
/** If this is ours, we return it, otherwise we return false
 *  We use just use customappsreg and not the display because it
 *  is a per-module routine
 */
function customappsreg_getdestinfo($dest)
{
    global $active_modules;
    $allDests = \FreePBX::Customappsreg()->getAllCustomDests();
    // Look for $dest in allDests. If we know about it, then return
    // the details. If we don't, return false.
    // Is it a new one?
    if (substr($dest, 0, 12) == "customdests,") {
        if (!preg_match("/customdests,dest-(\\d+),1/", $dest, $matches)) {
            throw new \Exception("Unable to validate dest {$dest}");
        }
        if (!isset($allDests[$matches[1]])) {
            return false;
        } else {
            // Found it.
            $cd = $allDests[$matches[1]];
            $tmparr = array('description' => sprintf(_("Custom Destination: %s"), $cd['description']), 'edit_url' => "config.php?display=customdests&destid=" . $cd['destid']);
            return $tmparr;
        }
    }
    foreach ($allDests as $cd) {
        if ($cd['target'] == $dest) {
            // Found it.
            $tmparr = array('description' => sprintf(_("Custom Destination: %s"), $cd['description']), 'edit_url' => "config.php?display=customdests&destid=" . $cd['destid']);
            return $tmparr;
        }
    }
    // Didn't find it.
    return false;
}
예제 #2
0
    ?>
	<span>
	<?php 
    echo _("Choose un-identified destinations on your system to add to the Custom Destination Registry. This will insert the chosen entry into the Custom Destination box above.");
    ?>
	</span>
      </a>
    </td>
    <td>
      <select onChange="insertDest();" id="insdest">
	<option value=""><?php 
    echo _("(pick destination)");
    ?>
</option>
	<?php 
    $results = \FreePBX::Customappsreg()->getUnknownDests();
    foreach ($results as $thisdest) {
        echo "<option value='{$thisdest}'>{$thisdest}</option>\n";
    }
    ?>
      </select>
    </td>
  </tr>
<?php 
}
// endif (!$usage_list)
?>

  <tr>
    <td>
      <a href="#" class="info"><?php