Exemple #1
0
function gabcast_show($xtn, $type, $iam)
{
    //get settings if editing
    if (!empty($xtn)) {
        $thisxtn = gabcast_get($xtn);
        if (!is_array($thisxtn)) {
            echo _("Error: cannot retreive Gabcast info for this extension");
            return;
        }
        $player = gabcast_player($thisxtn[1]);
        $action = 'edit';
        ?>
		
		<form method="POST" action="{$_SERVER['PHP_SELF']}?type={$type}&display={$iam}">
		<input type="hidden" name="action" value="delete">
		<input type="hidden" name="ext" value="{$thisxtn[0]}">
		<input type="submit" value="<?php 
        echo _('Delete settings');
        ?>
"></form>
<?php 
    }
    $usage_list = framework_display_destination_usage(gabcast_getdest($xtn));
    if (!empty($usage_list)) {
        ?>
			<a href="#" class="info"><?php 
        echo $usage_list['text'];
        ?>
:<span><?php 
        echo $usage_list['tooltip'];
        ?>
</span></a>
		<?php 
    }
    echo "<hr>";
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
        $thisxtn['ext'] = $_REQUEST['ext'];
        $thisxtn[0] = $_REQUEST['ext'];
        $player = "";
        $action = 'add';
        echo "<div style=margin-bottom:10px;>";
        echo _("You <u>must</u> have a Gabcast account & channel to use this feature. Visit");
        echo "&nbsp;<a href=\"http://www.gabcast.com\" target=\"_blank\">www.gabcast.com</a>&nbsp;";
        echo _("to sign up. <u>It's a free service</u>!");
        echo "</div>";
    }
    echo "<form method=\"POST\" action=\"{$_SERVER['PHP_SELF']}?type={$type}&display={$iam}&action={$action}\">";
    echo "<input type=\"hidden\" name=\"action\" value=\"{$action}\"><div>";
    echo _("Gabcast Channel Number:");
    echo "<input size=\"10\" type=\"text\" name=\"channbr\" value=\"{$thisxtn[1]}\"></div><dic>";
    echo _("Gabcast Channel Password:"******"<input size=\"10\" type=\"text\" name=\"pin\" value=\"{$thisxtn[2]}\"></div><div>";
    echo _("Link to Extension/User Number:");
    echo "<input size=\"10\" type=\"text\" name=\"ext\" value=\"{$thisxtn[0]}\"></div><div>";
    echo "<input type=\"submit\"></div><div style=\"margin-top:20px;\">";
    echo "{$player}";
    echo "</div></form>";
}
Exemple #2
0
function gabcast_add($xtn, $channbr, $pin)
{
    // fail if this exten already exists in DB
    if (is_array(gabcast_get($xtn))) {
        echo "<div class=error>An error occured when writing to database</div>";
        return;
    }
    sql("INSERT INTO gabcast (ext, channbr, pin) values ('{$xtn}','{$channbr}','{$pin}')");
}