checkBoxList() public static method

Generates a check box list.
public static checkBoxList ( string $name, mixed $select, array $data, array $htmlOptions = [] ) : string
$name string name of the check box list.
$select mixed selection of the check boxes.
$data array $data value-label pairs used to generate the check box list.
$htmlOptions array additional HTML attributes.
return string the generated list.
Ejemplo n.º 1
0
			<?php 
echo TbHtml::checkBoxList('checkGames', '', array('6.1, 6.2, 6.3, 6.4' => CHtml::encode('Does your app is a game?')));
?>
		<p><?php 
echo TbHtml::b('Contracts and Extensions');
?>
</p>
                        <?php 
echo TbHtml::checkBoxList('checkContracts', '', array('7.1, 7.2' => CHtml::encode('Does your app is a share source?')));
?>
		<p><?php 
echo TbHtml::b('Audio and Video');
?>
</p>
			<?php 
echo TbHtml::checkBoxList('checkAudioAndVideo', '', array('9.1, 9.2' => CHtml::encode('Does your app is a music app?'), '9.3' => CHtml::encode('Does your app use voice call?'), '9.4' => CHtml::encode('Does your app have sounds?')));
?>
                
	</div>

 <?php 
echo TbHtml::button('Back', array('onclick' => 'js:document.location.href="/mtcontrool/runs/create"', 'color' => TbHtml::BUTTON_COLOR_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_LARGE));
?>
	 <?php 
echo TbHtml::link('Submit', array('runs/saveWPQuest', 'id' => $idRuns), array('class' => 'btn btn-success btn-large'));
?>
 

 <?php 
echo TbHtml::button('Cancel', array('onclick' => 'js:document.location.href="/mtcontrool"', 'color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_LARGE));
?>
		<?php 
echo TbHtml::checkBoxList('checkMultiplayer', '', array('18.1, 18.2, 18.3, 18.4' => CHtml::encode('Does your app have Multiplayer function?')));
?>
                <p><?php 
echo TbHtml::b('Display');
?>
</p>
		<?php 
echo TbHtml::checkBoxList('checkDisplay', '', array('24.7' => CHtml::encode('Does your app produce assistive text which can be displayed on the device?'), '24.11' => CHtml::encode('Does your app address reading comprehension issues?')));
?>
                <p><?php 
echo TbHtml::b('External Devices');
?>
</p>
		<?php 
echo TbHtml::checkBoxList('checkExternalDevices', '', array('26.7' => CHtml::encode('Does your app produce assistive text-to-speech in conjunction with an external audio output device?'), '26.8' => CHtml::encode('Does your app produce assistive text which can be output through an external display? ')));
?>
	</div>
 <?php 
echo TbHtml::button('Back', array('onclick' => 'js:document.location.href="/mtcontrool/runs/create"', 'color' => TbHtml::BUTTON_COLOR_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_LARGE));
?>
	 <?php 
echo TbHtml::link('Submit', array('runs/saveAndroidQuest', 'id' => $idRuns), array('class' => 'btn btn-success btn-large', 'confirm' => 'Are you sure?'));
?>
 
 
         <?php 
echo TbHtml::button('Cancel', array('onclick' => 'js:document.location.href="/mtcontrool"', 'color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_LARGE));
?>

       
Ejemplo n.º 3
0
 public function testCheckboxList()
 {
     $I = $this->codeGuy;
     $html = TbHtml::checkBoxList('checkboxList', null, array('Option 1', 'Option 2', 'Option 3'), array('separator' => '<br>', 'container' => 'div', 'containerOptions' => array('class' => 'container')));
     $container = $I->createNode($html, 'div.container');
     $I->seeNodeChildren($container, array('label.checkbox', 'br', 'label.checkbox', 'br', 'label.checkbox'));
     $label = $container->filter('label')->first();
     $I->seeNodePattern($label, '/> Option 1$/');
     $input = $label->filter('input[type=checkbox]');
     $I->seeNodeAttributes($input, array('id' => 'checkboxList_0', 'name' => 'checkboxList[]', 'value' => '0'));
     $html = TbHtml::checkBoxList('checkboxList', null, array('Option 1', 'Option 2', 'Option 3'), array('checkAll' => true));
     $span = $I->createNode($html, 'span');
     $I->seeNodeChildren($span, array('input[type=checkbox]', 'label.checkbox', 'label.checkbox', 'label.checkbox', 'label.checkbox'));
     $label = $span->filter('label')->first();
     $input = $label->filter('input');
     $I->seeNodeAttribute($input, 'name', 'checkboxList_all');
     $html = TbHtml::checkBoxList('checkboxList', null, array('Option 1', 'Option 2', 'Option 3'), array('checkAll' => true, 'checkAllLast' => true));
     $span = $I->createNode($html, 'span');
     $I->seeNodeChildren($span, array('label.checkbox', 'label.checkbox', 'label.checkbox', 'label.checkbox', 'input[type=checkbox]'));
     $label = $span->filter('label')->last();
     $input = $label->filter('input');
     $I->seeNodeAttribute($input, 'name', 'checkboxList_all');
 }
		<?php 
echo TbHtml::checkBoxList('checkMultiplayer', '', array('18.1, 18.2, 18.3, 18.4' => CHtml::encode('Does your app have Multiplayer function?')));
?>
                <p><?php 
echo TbHtml::b('Privacy and User Permissions');
?>
</p>
		<?php 
echo TbHtml::checkBoxList('checkPrivacyandUserPermissions', '', array('20.2' => CHtml::encode('Does your app use location data?'), '20.3' => CHtml::encode('Does your app use push notification?')));
?>
                 <p><?php 
echo TbHtml::b('Platform Compliance for: In App Purchase, Adversiting and Multiplayer Game Lobby');
?>
</p>
		<?php 
echo TbHtml::checkBoxList('checkPlatformCompliance', '', array('21.1' => CHtml::encode('Does your app use in-app purchase?'), '21.2' => CHtml::encode('Does your app use advertising?'), '21.3' => CHtml::encode('Does your app use the multiplayer game lobby?'), '21.4' => CHtml::encode('Does your app use subscriptions or rental mechanisms?'), '21.5' => CHtml::encode('Does your app use enable charitable donations?')));
?>
                
                 
	</div>

<?php 
echo TbHtml::button('Back', array('onclick' => 'js:document.location.href="/mtcontrool/runs/create"', 'color' => TbHtml::BUTTON_COLOR_DEFAULT, 'size' => TbHtml::BUTTON_SIZE_LARGE));
?>
	 <?php 
echo TbHtml::link('Submit', array('runs/saveIOSQuest', 'id' => $idRuns), array('class' => 'btn btn-success btn-large'));
?>
 

 <?php 
echo TbHtml::button('Cancel', array('onclick' => 'js:document.location.href="/mtcontrool"', 'color' => TbHtml::BUTTON_COLOR_DANGER, 'size' => TbHtml::BUTTON_SIZE_LARGE));
Ejemplo n.º 5
0
<div class="row-fluid">
    <?php 
if ($this->election->voter_group_restriction == Election::VGR_GROUPS_ADD) {
    ?>
    <div class="assigned-groups-sel" style="display: none;">
        <p>If you want to register as elector you should specify one or more of these groups where you will be included.</p>
        <?php 
    $groups = $this->election->localVoterGroups;
    $checkData = array();
    foreach ($groups as $group) {
        $checkData[$group->id] = $group->name;
    }
    echo TbHtml::checkBoxList('voter-groups', false, $checkData);
    ?>
    </div>
    <?php 
}
?>
    <button id="register-elector" class="btn btn-large span8 offset2">Register as Elector</button>
</div>
<script type="text/javascript">
    $(function() {
        var parent = $('#register-elector').parent();
        var onSuccess = function(model, response) {
                $('#register-elector').remove();

                if(response.status && response.status == 'exists_elector') {
                    Aes.Notifications.add(response.message, 'warning');
                } else {
                    if(response.status && response.status == 'exists') {
                        Aes.Notifications.add(response.message, 'warning');
Ejemplo n.º 6
0
 public function testUncheckValueOptionForCheckboxesAndRadioInputs()
 {
     $I = $this->codeGuy;
     $items = array(0);
     $model = new Dummy();
     $outputsWithHidden = array('checkbox' => TbHtml::checkBox('cb1', false, array('uncheckValue' => 1)), 'checkboxList' => TbHtml::checkBoxList('cb2', 0, $items, array('uncheckValue' => 1)), 'radio' => TbHtml::radioButton('rd1', false, array('uncheckValue' => 1)), 'radioList' => TbHtml::radioButtonList('rd2', 0, $items, array('uncheckValue' => 1)), 'activeCheckbox' => TbHtml::activeCheckBox($model, 'checkboxList'), 'activeCheckboxList' => TbHtml::activeCheckBoxList($model, 'checkboxList', $items), 'activeRadio' => TbHtml::activeRadioButton($model, 'radioList'), 'activeRadioList' => TbHtml::activeRadioButtonList($model, 'radioList', $items));
     foreach ($outputsWithHidden as $output) {
         $I->seeNodeChildren($I->createNode($output), array('input[type=hidden]'));
     }
     // comparing against null 'uncheckValue' option
     $noHiddenOptions = array('uncheckValue' => null);
     $outputsWithoutHidden = array('checkbox' => TbHtml::checkBox('cb1'), 'checkboxList' => TbHtml::checkBoxList('cb2', 0, $items), 'radio' => TbHtml::radioButton('rd1'), 'radioList' => TbHtml::radioButtonList('rd2', 0, $items), 'activeCheckbox' => TbHtml::activeCheckBox($model, 'checkboxList', $noHiddenOptions), 'activeCheckboxList' => TbHtml::activeCheckBoxList($model, 'checkboxList', $items, $noHiddenOptions), 'activeRadio' => TbHtml::activeRadioButton($model, 'radioList', $noHiddenOptions), 'activeRadioList' => TbHtml::activeRadioButtonList($model, 'radioList', $items, $noHiddenOptions));
     foreach ($outputsWithoutHidden as $output) {
         $I->dontSeeNodeChildren($I->createNode($output), array('input[type=hidden]'));
     }
 }