<?php if(isset($language)): ?>
<div class="form-group form-language-group form-language-<?php echo $language; ?><?php echo $language == $defaultLang ? ' default-lang' : ''; ?><?php echo (isset($errors) && $errors->has($errorKey) ? ' has-error' : ''); ?><?php echo $parentHidden ? ' parent-hidden' : ''; ?>" style="<?php echo !empty($hide) ? 'display:none' : ''; ?>"> 
<?php else: ?>
<div class="form-group<?php echo (isset($errors) && $errors->has($errorKey) ? ' has-error' : ''); ?><?php echo $parentHidden ? ' parent-hidden' : ''; ?>" style="<?php echo !empty($hide) ? 'display:none' : ''; ?>">
<?php endif; ?>
    <label class="checkbox-inline">
        <?php echo Form::checkbox($name, 1, $value == 1, array(
            'id' => $id, 
            'class' => (isset($language) && $language == $defaultLang ? 'default-lang' : null),
            'data-toggle' => (isset($errors) && $errors->has($errorKey) ? 'tooltip': null),
            'title' => (isset($errors) && $errors->has($errorKey) ? $errors->first($errorKey): null),
            'disabled' => $enabled ? null : 'disabled')); ?>

        <b><?php echo ucfirst($label); ?></b>
    </label>
    <?php if(!empty($info)): ?>
        <span id="helpBlock" class="help-block"><?php echo $info; ?></span>
    <?php endif; ?>
</div>

<script>
    $(function(){
        var genericField<?php echo $id; ?> = new Eae.View.BackendGenericField({
            el: $("#<?php echo $id; ?>"),
            type: "checkbox",
            parent:  <?php echo empty($parent) ? 'false': json_encode($parent); ?>,
            <?php if(isset($language)): ?>
                language: '<?php echo $language; ?>'
            <?php endif; ?>
        });    
    });
</script>   