public function checkBoxList($model, $attribute) { if ($model !== null) { return CHtml::activeCheckBoxList($model, $attribute, $this->all); } else return CHtml::checkBoxList($attribute, '', $this->all); }
?> </b> <?php echo $form->dropDownList($model, 'id_tipo_bus', CHtml::listData(Stipobus::model()->findAll(), 'id_tipo_bus', 'desc_tipo_bus'), array('empty' => '-- Seleccionar --')); ?> <?php echo $form->textFieldRow($model, 'carga_maxima', array('style' => 'width:100px')); ?> <?php echo $form->fileFieldRow($model, 'imagen', array('class' => 'span5', 'maxlength' => 500)); ?> <?php echo $form->textAreaRow($model, 'observaciones', array('rows' => 4, 'cols' => 35, 'class' => 'span4')); ?> <b><?php echo $form->labelEx($model, 'configuracion'); ?> </b> <?php echo CHtml::activeCheckBoxList($model, 'configuracion', CHtml::listData(scodobjventasextras::model()->findAll(), 'id_cod_obj_venta_extra', 'name')); ?> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Almacenar' : 'Actualizar')); ?> </div> <?php $this->endWidget();
echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 100)); ?> <?php echo $form->error($model, 'email'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, '_selected_roles'); ?> <?php echo CHtml::activeCheckBoxList($model, '_selected_roles', CHtml::listData($model->getActiveRoles(), 'id', 'name'), array('style' => 'float: left; margin-right: 5px; margin-top: 0px;')); ?> <?php echo $form->error($model, '_selected_roles'); ?> </div> <div class="row" > <?php echo CHtml::encode($model->getAttributeLabel('active')); ?> <?php echo $form->checkbox($model, 'active'); ?> <?php
public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array()) { self::getJValidateInstance()->activeCheckBoxList($model, $attribute, $data, $htmlOptions); return parent::activeCheckBoxList($model, $attribute, $data, $htmlOptions); }
echo CHtml::activeCheckBoxList($propertyAmenities, 'houseAmenities', CHtml::listData(CategoryAmenities::model()->findAll('amenity_type=:amenityType', array(':amenityType' => '0')), 'id', 'amenity')); ?> </div> </li> <li class="error_message"><?php echo CHtml::error($propertyAmenities, 'houseAmenities'); ?> </li> </ul> <ul> <li><span><label for="Property_description" class="required">External Amenities <span class="required"></span></label></span> <?php //echo CHtml::activeDropdownList($propertyAmenities,'amenity_id[]',CHtml::listData(CategoryAmenities::model()->findAll(),'id','amenity'),array('size'=>'5','multiple'=>'multiple','id'=>'amenities-multi')) ?> <div class="multi_checkbox avg"><?php echo CHtml::activeCheckBoxList($propertyAmenities, 'externalAmenities', CHtml::listData(CategoryAmenities::model()->findAll('amenity_type=:amenityType', array(':amenityType' => '1')), 'id', 'amenity')); ?> </div> </li> <li class="error_message"><?php echo CHtml::error($propertyAmenities, 'externalAmenities'); ?> </li> </ul> </fieldset> <?php break; } ?>
echo CHtml::activeDropDownList($modelProperty, 'transaction_type_id', CHtml::listData(PropertyTransactionTypes::model()->findAll(), 'id', 'transaction_type'), array('class' => 'select_box', 'empty' => 'All')); ?> </td> </tr> <tr> <td><label>Age Of Construction</label><br /> <?php echo CHtml::activeDropDownList($modelProperty, 'age_of_construction', CHtml::listData(PropertyAgeOfConstruction::model()->findAll(), 'id', 'age'), array('empty' => 'All', 'class' => 'select_box')); ?> </td> </tr> <tr> <td><label>Type of Ownership</label> <?php echo CHtml::activeDropDownList($modelProperty, 'ownership_type_id', CHtml::listData(CategoryOwnershipTypes::model()->findAll(), 'id', 'ownership_type'), array('empty' => 'All', 'class' => 'select_box')); ?> </td> </tr> <tr> <td><label>Amenities</label><br /> <div class="multi_checkbox med"><?php //$amenities = isset($_POST['amenity_id'])? $_POST['amenity_id'] : null; echo CHtml::activeCheckBoxList($propertyAmenities, 'amenity_id', CHtml::listData(CategoryAmenities::model()->findAll(), 'id', 'amenity'), array('size' => '5', 'multiple' => 'multiple', 'id' => 'amenities-multi')); //echo CHtml::checkBoxList('amenity_id',$amenities,CHtml::listData(CategoryAmenities::model()->findAll(),'id','amenity'),array('size'=>'5','multiple'=>'multiple','id'=>'amenities-multi')); ?> </div> </td> </tr> </table> <?php break; }
</br></br><h3>Вид</h3> <?php echo CHtml::activeDropDownList($form, 'inkind', $inkind); ?> </br></br><h3>Цена (у.е.)</h3> <p>min:<?php echo CHtml::activeNumberField($form, 'min'); ?> </p> <p>max:<?php echo CHtml::activeNumberField($form, 'max'); ?> </p> </br><h3>Производитель</h3> <?php echo CHtml::activeCheckBoxList($form, 'producer', $producer); ?> </p> <?php echo CHtml::SubmitButton('Поиск'); ?> </div> <?php echo CHtml::endForm(); ?> </div> <div id="SelectFooter"></div> </div>
//// 'panel 3'=>$this->renderPartial('list',null,true), // ), // // additional javascript options for the accordion plugin // 'options'=>array( // 'animated'=>'bounceslide', // ), //)); ?> <h3>Suche einschränken: </h3> <div class="adv_row"> <?php echo CHtml::activeDropDownList($search, 'wortart', CHtml::listData(wortarten::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('prompt' => 'alle Wortarten')); ?> </div> <div class="adv_row"> <?php echo CHtml::activeDropDownList($search, 'kategorie', CHtml::listData(kategorien::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('prompt' => 'alle Kategorien')); ?> </div> <!-- activeCheckBox: <?php echo CHtml::activeCheckBox($search, 'wortart', array('value' => 'Substantiv')); ?> <br /><br /> <?php echo CHtml::activeCheckBoxList($search, 'wortart', CHtml::listData(wortarten::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('template' => '{input}{label}', 'separator' => '<br />', 'checkAll' => 'alle Wortarten')); ?> -->
<div class="privilege_main"> <?php foreach ($privileges as $i => $privilege) { ?> <div class="privilege_wide"> <h3 class="title"><?php echo $privilege['label']; ?> </h3> <div class="selectbox" style="margin-bottom:5px;"> <a href="#" class="selected-all">全选</a> / <a href="#" class="inverse">反选</a> </div> <div class="optionbox"> <?php echo CHtml::activeCheckBoxList($form, 'privileges', CHtml::listData($privilege['items'], 'privilege', 'label'), array('id' => false, 'class' => 'privileges')); ?> </div> </div> <?php } ?> </div> </div> <?php echo Helper::fieldTips('权限修改后管理员需要重新登录系统方可生效'); ?> </td> </tr> </table>
<div style="margin-top: -20px"> <?php $current_url = $this->createUrl('site/msghistory'); ?> <table class="formtable left" style="margin-right: 20px;"> <tr> <th><?php echo CHtml::activeLabel($form, 'type'); ?> </th> </tr> <tr> <td> <?php echo CHtml::activeCheckBoxList($form, 'types', $form->getTypes()); ?> <?php echo CHtml::error($form, 'types'); ?> </td> </tr> </table> <table class="formtable left middlecolumns" id="filterparams" > <tr> <th><?php echo CHtml::activeLabel($form, 'date_from'); ?> </th>
?> <div class="controls"> <?php echo CHtml::activeTextField($signupForm, 'email', array('class' => 'input-xlarge', 'data-required' => 'ture', 'data-type' => 'email')); echo CHtml::tag('span', array('class' => 'help-inline'), $signupForm->getError('email')); ?> </div> </div> <div class="well well-smallest"> <strong> <?php echo Yii::t('SignUpForm', 'Product list'); ?> </strong> </div> <div class="row-fluid row-product-list"> <?php echo CHtml::activeCheckBoxList($signupForm, 'products', $productOpts, array('separator' => '', 'template' => '<div class="checkbox inline span4">{input}{label}</div>')); ?> </div> <div class="row-fluid"> <?php echo CHtml::submitButton(Yii::t('SignUpForm', 'Signup'), array('class' => 'btn btn-primary')); ?> </div> <?php echo CHtml::endForm(); ?> </div> </body> </html>
</div> <b><?php echo $form->labelEx($model, 'nombre_tabla'); ?> </b> <?php echo $form->dropDownList($model, 'nombre_tabla', Yii::app()->db->schema->getTableNames(), array('empty' => '-- Seleccionar --')); ?> <div id="campos_det_div"> <b><?php echo $form->labelEx($model, 'campos_det'); ?> </b> <?php echo CHtml::activeCheckBoxList($model, 'campos_det', array()); ?> </div> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Almacenar' : 'Actualizar')); ?> </div> <?php $this->endWidget(); ?> <script type="text/javascript"> $(document).ready(function() {
/** * The same as CHtml::checkBoxList, but with js handlers to limit the number * of choices in the list * * @param [type] $model [description] * @param [type] $attribute [description] * @param [type] $data [description] * @param array $htmlOptions [description] * @param integer $maxLimit * @return string checkBoxList */ public static function checkBoxListLimited($model, $attribute, $data, $htmlOptions = array(), $maxLimit) { if (isset($maxLimit) && $maxLimit > 0) { // javascript function that performs validation of number of checkboxes clicked in a list. When number of checkboxes clicked reaches maxLimit it grays out non-clicked checkboxes. Otherwise it makes available all checkboxes in a list. $js = <<<EOD function checkboxClickedLimit(maxLimit){ var checkboxes = arguments[1].parentNode.parentNode.getElementsByTagName("input"); // Get number of checked checkboxes var checkedCounter = 0; for (var i = 0; i < checkboxes.length; i++) { if (checkboxes[i].checked) checkedCounter++; } // If limit of checked succeeded mark all other checkboxes as read only, otherwise make all checkboxes updateable if (checkedCounter >= maxLimit) { for (var i = 0; i < checkboxes.length; i++) { if (!checkboxes[i].checked) { checkboxes[i].disabled = true; checkboxes[i].parentNode.className = "checkbox-disabled"; } } } else { for (var i = 0; i < checkboxes.length; i++) { checkboxes[i].disabled = false; checkboxes[i].parentNode.className = "checkbox-enabled"; } } } EOD; $css = <<<EOD .checkbox-disabled { color: gray; } .checkbox-enabled { color: #312a1e; } EOD; $cs = Yii::app()->getClientScript(); $cs->registerCss('checkboxAppearance', $css); $cs->registerScript('checkboxClickedLimit', $js, CClientScript::POS_END); // add event to all of the checkboxes in a list $htmlOptions['onchange'] = 'javascript:checkboxClickedLimit(' . $maxLimit . ', this);'; return CHtml::activeCheckBoxList($model, $attribute, $data, $htmlOptions); } }
<tr> <th><?php echo CHtml::activeLabelEx($category, 'brand_id'); ?> </th> <td> <div class="privilege_main"> <div class="privilege_wide"> <div class="selectbox" style="margin-bottom:5px;"> <a href="#" class="selected-all">全选</a> / <a href="#" class="inverse">反选</a> </div> <div class="optionbox"> <?php echo CHtml::activeCheckBoxList($category, 'brand_id', $brandOptions, array('class' => 'privileges')); ?> </div> </div> </div> <!-- <select name="ProductCategory[brand_id]" id="brand_id"> <option value="0">请选择</option> <?php foreach ($brandOptions as $key => $value) { ?> <option value="<?php echo $key; ?> " <?php if (!empty($category) && $category->brand_id == $key) {
CHtml::listData(Pais::model()->findAll(), 'idpais', 'descpais'), array('prompt'=>'Select', 'class'=>'form-control input-sm') ); ?> </div> </div> </fieldset> <br/> <fieldset> <legend>Campo de la mecánica de interés (Puede seleccionar más de uno)</legend> <div class="row"> <div class="col-md-4"> <?php echo CHtml::activeCheckBoxList($model,'campoint', array( '1'=>'Diseño mecánico', '2'=>'Educación en ingeniería mecánica', '3'=>'Manufactura y materiales', '4'=>'Mecanica teórica', '5'=>'Otras', '6'=>'Termofluidos')); ?> </div> </div> <div class="row"> <div class="col-md-8"> <?php echo CHtml::activeLabel($model,'areaespe'); ?> <?php echo CHtml::activeTextField($model,'areaespe', array('class'=>'form-control input-sm')) ?> </div> </div> </fieldset> <br/> <fieldset>
echo $station['color']; ?> ; width:5px; height:5px; float:left; margin-left:2px; "></div> <?php } } ?> </li> <?php /* if (!in_array($group_key,['TemperatureWater', 'TemperatureSoil'])): ?> <li class="head"><?php echo $group['name'] ?></li> <?php endif;*/ ?> <?php echo CHtml::activeCheckBoxList($form, 'sensor_feature_code[' . $group_key . ']', $group['sensor_features'], array('separator' => '', 'template' => '<li>{input} {label}</li>', 'container' => '', 'checkAll' => count($group['sensor_features']) > 1 ? 'Select All' : null)); ?> </ul> </li> <?php } ?> <li id="station-feature-attention" class="hide">Please select station(s) first</li> </ul> </div> </div> </td> <td> <div class="select-list"> <?php echo CHtml::button(It::t('site_label', 'do_select'), array('id' => 'accumulation_select', 'style' => 'width: 100px; display: none;'));
public function actionAjaxJobTitles() { if (isset($_POST['jobCat'])) { $titles = CHtml::listData(JobTitle::getTitlesByCategory($_POST['jobCat'], Yii::app()->user->id), 'job_title_id', 'job_title_name'); if (empty($titles)) { echo CHtml::tag('label', array('class' => 'checkbox'), Yii::t('model', 'postResumeForm.jobTitles_empty'), true); } else { $model = new PostResumeForm(); echo CHtml::activeCheckBoxList($model, 'jobTitles', $titles, array('container' => '', 'separator' => '', 'template' => '<label class="checkbox">{input} {label}</label>')); } } }
if (is_array($activeVariants) && key_exists($attribute->name, $activeVariants) && is_array($activeVariants[$attribute->name])) { $variantsList = array_intersect_key($variantsList, array_flip($activeVariants[$attribute->name])); } if (empty($variantsList)) { continue; } ?> <div class="filter_block_title"> <?php echo $attribute->label; ?> </div> <div class="filter_param_block"> <div class="checkbox_block"> <?php echo CHtml::activeCheckBoxList($model, $attribute->name, $variantsList, array()); ?> </div> </div> <?php } else { ?> <?php $this->renderPartial('_slider_param', array('form' => $form, 'model' => $model, 'attributeName' => $attribute->name, 'attributeLabel' => $attribute->label, 'bounds' => $bounds)); ?> <?php } ?>
<table class="formtable left" style="margin-right: 10px;"> <tr> <th> <input type="checkbox" id="check_all_stations" onclick="$('div.checkboxes_list.stid input').attr('checked', ($(this).attr('checked') == 'checked' ? true : false));"> <?php echo CHtml::activeLabel($form, 'station_id'); ?> </th> </tr> <tr> <td> <div class="checkboxes_list stid"> <?php echo CHtml::activeCheckBoxList($form, 'station_id', $form->all_stations); ?> </div> </td> </tr> </table> <table class="formtable left middlecolumns" id="filterparams" > <tr> <th><?php echo CHtml::activeLabel($form, 'date_from'); ?> </th> <td> <?php echo CHtml::activeTextField($form, 'date_from', array('class' => 'date-pick input-calendar'));
/** * Renders a checkbox list for a model attribute. * This method is a wrapper of {@link CHtml::activeCheckBoxList}. * Please check {@link CHtml::activeCheckBoxList} for detailed information * about the parameters for this method. * @param CModel $model the data model * @param string $attribute the attribute * @param array $data value-label pairs used to generate the check box list. * @param array $htmlOptions addtional HTML options. * @return string the generated check box list */ public function checkBoxList($model, $attribute, $data, $htmlOptions = array()) { return CHtml::activeCheckBoxList($model, $attribute, $data, $htmlOptions); }
<?php if ($list) { $city_id = ""; echo CHtml::activeCheckBoxList('city_id', $city_id, $list); }