|
.pmk-RadioButton { }
.pmk-RadioButton-disabled { color: #888; }
|
<?php include_once 'phpmoko/ui/HTML.php'; include_once 'phpmoko/ui/Form/RadioButton.php'; include_once 'phpmoko/ui/VerticalPanel.php';
class ModuleDemo implements WebModule {
function getWidget() { $vPanel = new VerticalPanel();
$vPanel->add(new HTML('<b>Select your favorite color:</b>'));
// Add some radio buttons to a group called 'color' $colors = array('blue', 'red', 'yellow', 'green'); for ($i = 0; $i < sizeof($colors); $i++) { $color = $colors[$i]; $radioButton = new RadioButton('color', $color); $radioButton->setId('cwRadioButton-color-' . $color); if ($i == 2) $radioButton->setEnabled(false);
$vPanel->add($radioButton); }
// Add a new header to select your favorite sport $vPanel->add(new HTML('<br><b>Select your favorite sport:</b>'));
// Add some radio buttons to a group called 'sport' $sports = array('Baseball', 'Basketball', 'Football', 'Hockey', 'Soccer', 'Water Polo'); for ($i = 0; $i < sizeof($sports); $i++) { $sport = $sports[$i]; $radioButton = new RadioButton('sport', $sport); $radioButton->setId('cwRadioButton-sport-' . str_replace(' ', '', $sport)); $radioButton->setValue($i); if ($i == 2) $radioButton->setChecked(true);
$vPanel->add($radioButton); }
return $vPanel; } } ?>
|
|