|
.pmk-CheckBox { }
.pmk-CheckBox-disabled { color: #888; }
|
<?php include_once 'phpmoko/ui/Form/CheckBox.php'; include_once 'phpmoko/ui/HTML.php'; include_once 'phpmoko/ui/VerticalPanel.php';
class ModuleDemo implements WebModule { function getWidget() { $vPanel = new VerticalPanel(); $label = new HTML('<b>Check all days that you are available:</b>'); $vPanel->add($label);
// Add a checkbox for each day of the week $daysOfWeek = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'); for ($i = 0; $i < sizeof($daysOfWeek); $i++) { $day = $daysOfWeek[$i]; $checkBox = new CheckBox($day); $checkBox->setId('cwCheckBox-'.$day);
// Disable the weekends if ($i >= 5) $checkBox->setEnabled(false);
$vPanel->add($checkBox); }
return $vPanel; } } ?>
|
|