Example #1
0
/**
 * Displays the resolution of the code
 *
 * @param int $number
 */
function display_res($number)
{
    $table = new LSTable(1, 3, '100%', $null);
    $table->setTemplate('tpl_BLANK');
    for ($i = 1; $i <= 3; $i++) {
        $text2display = '';
        $text2display .= '<input type="radio" name="res" value="' . $i . '"';
        if ($number === $i) {
            $text2display .= ' checked="checked"';
        }
        $text2display .= ' /> ' . $i;
        $table->setText(0, $i - 1, $text2display);
    }
    return $table;
}
/**
 * Displays the rotation
 *
 * @param int $rotation
 */
function display_rotation($rotation)
{
    $availableRotation = array(0, 90, 180, 270);
    $c = count($availableRotation);
    $table = new LSTable(1, $c, '100%', $null);
    $table->setTemplate('tpl_BLANK');
    for ($i = 0; $i < $c; $i++) {
        $text2display = '';
        $text2display .= '<input type="radio" id="rotation' . $i . '" name="rotation" value="' . $availableRotation[$i] . '"';
        if ($rotation == $availableRotation[$i]) {
            $text2display .= ' checked="checked"';
        }
        $text2display .= ' /> <label for="rotation' . $i . '">' . $availableRotation[$i] . '&deg;</label>';
        $table->setText(0, $i, $text2display);
    }
    return $table;
}