Beispiel #1
0
/**
* Presenta las opciones para configurar la alerta
*/
function dt_widget_alert($edit = 0)
{
    //$widget['title'] = __('Inactivity Alert','dtransport');
    //$widget['icon'] = '../images/alert.png';
    if ($edit) {
        $sw = new DTSoftware(rmc_server_var($_GET, 'id', 0));
    } else {
        $sw = new DTSoftware();
    }
    // Alerta
    $field = new RMFormYesNo('', 'alert', $edit ? $type == 'edit' ? $fields['alert']['limit'] ? 1 : 0 : ($sw->alert() ? 1 : 0) : 0);
    $enable_alert = $field->render();
    unset($field);
    ob_start();
    ?>
    <div id="tab-alert" class="widgets_forms">
    <form name="frmAlert" id="frm-alert" method="post" action="items.php">
        <div class="item">
        <div class="dt_table">
            <div class="dt_row">
                <div class="dt_cell">
                    <label for="alert"><?php 
    echo _e('Enable alerts:', 'dtransport');
    ?>
</label>
                </div>
                <div class="dt_cell">
                    <?php 
    echo $enable_alert;
    ?>
                </div>
            </div>
        </div>
        </div>
        <div class="item">
            <label for="limitalert"><?php 
    _e('Limit of days', 'dtransport');
    ?>
</label>
            <input type="text" name="limitalert" id="limitalert" value="<?php 
    echo $edit ? $sw->alert()->limit() : '';
    ?>
" class="fullwidth" />
            <span class="description"><?php 
    _e('Maximum number of days that an item can be without downloads before to send an alert to author.', 'dtransport');
    ?>
</span>
        </div>
        <div class="item">
            <label for="mode"><?php 
    _e('Alert mode', 'dtransport');
    ?>
</label><br />
            <input type="radio" name="mode" id="mode" value="0"<?php 
    echo $edit ? $sw->alert()->mode() == 0 ? ' checked="checked"' : '' : '';
    ?>
 /><?php 
    _e('Private message', 'dtransport');
    ?>
            <input type="radio" name="mode" id="mode1" value="1"<?php 
    echo $edit ? $sw->alert()->mode() == 1 ? ' checked="checked"' : '' : '';
    ?>
 /><?php 
    _e('Email message', 'dtransport');
    ?>
        </div>
    </form>
    </div>
    <?php 
    //$widget['content'] = ob_get_clean();
    $content = ob_get_clean();
    return $content;
}