<?php
$dontShow = array('id','moderatorType');
    $textFields = array('name','extension','pin');
    $userOrGroupDropdown = array('moderator');
    $IVRDropdown=array('announce_file');
    $checkBox = array('listen_to_music','useConfereceMemberName');

    foreach ($model->attributes as $attributeName => $value) {
    	$htmlOptions = array('data-translation-id'=>'CONFERENCE_MODEL_'.strtoupper($attributeName));
    	
        if (!in_array($attributeName,$dontShow)) {
            
            //render as text Field
            if (in_array($attributeName,$textFields)) {

                if (cfg('DP_BRANCH_PREFIX') && $attributeName == 'extension') {
                    $htmlOptions['prepend'] = cfg('DP_BRANCH_PREFIX');
                    $htmlOptions['style'] = 'width: 179px;';
                }
                echo $form->textFieldRow($model,$attributeName,$htmlOptions);
            }
            
            if (in_array($attributeName,$checkBox)) {
                echo $form->checkBoxRow($model,$attributeName, $htmlOptions);
            }
            
            if (in_array($attributeName,$IVRDropdown)) {
                $htmlOptions['data-translation-target'] = 'CONFERENCE_MODEL_ANNOUNCE_FILE_DROPDOWN_TARGET';
                echo $form->dropDownListRow($model,$attributeName,$model->getAnnounceFileListData(), $htmlOptions);
            }

            if ($attributeName == 'mohId')  {
                echo '<div id=mohId data-translation-target="CONFERENCE_MODERATOR_MODEL_MOH_ID_DROPDOWN">';
                echo $form->dropDownListRow($model,$attributeName,$model->getMohData());
                echo '</div>';
            }
            
        }
    }
    
if (PhonalisaLicenseManager::routingScriptExtensionMax() !== 0) {
    echo $form->dropDownListRow($model, 'scriptExtension', ScriptExtension::model()->listData, array(
        'data-translation-id' => 'USER_MODEL_SCRIPT_EXTENSION',
            )
    );
}
    
//CONFERENCE_MODEL_SELECT_ANNOUNCE_FILE_STANDARD
echo "<i data-translation-target='CONFERENCE_MODEL_ANNOUNCE_FILE_DROPDOWN_TARGET' data-translation-id='CONFERENCE_MODEL_SELECT_ANNOUNCE_FILE_STANDARD'></i>"

?> 
<script>
    if ($('#Conference_listen_to_music').is(':checked')) {
        $('#mohId').show();
    }else {
        $('#mohId').hide();
    }
    $('#Conference_listen_to_music').click(function(){
        $('#mohId').toggle();
    })
   
</script>