

<?php $__env->startSection('head'); ?>
    <script type="text/javascript">
        $(function() {
            App.Binder.bindTinymce();

            $(".browse-file-manager-input").each(function() {
                var input = $(this);

                $(document).on('chooseFile-' + input.attr('id'), function(e) {
                    App.FileManager.close();
                    input.val(e.path);
                });

                input.parent().find(".file-path-browse").bind('click', function(e) {
                    e.preventDefault();

                    if(input.data('images-only') == true) {
                        var imagesOnly = true;
                    } else {
                        var imagesOnly = false;
                    }

                    console.log(imagesOnly);

                    App.FileManager.show(input.attr('id'), imagesOnly);
                });
            });

        });
    </script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <?php echo HTML::widgetBox(['name' => trans('GlobalTranslations::common.settings'), 'icon' => 'icon-gear'],[
            ]); ?>


        <div id="settings-table">
            <?php echo Former::populate($populate); ?>


            <?php echo Former::open(); ?>


                <?php foreach($configOptions as $option): ?>
                    <?php if(isset($option['type']) && $option['type'] == 'select'): ?>
                        <?php echo Former::select($namespace . '[' . $option['clean_key'] . ']')->options($option['select']); ?>

                    <?php elseif(isset($option['type']) && $option['type'] == 'textarea'): ?>
                        <?php echo Former::textarea($namespace . '[' . $option['clean_key'] . ']')->rows(6); ?>

                    <?php elseif(isset($option['type']) && $option['type'] == 'wysiwyg'): ?>
                        <?php echo Former::textarea($namespace . '[' . $option['clean_key'] . ']')->class('tinymce')->rows(6); ?>

                    <?php elseif(isset($option['type']) && ($option['type'] == 'file_manager' || $option['type'] == 'file_manager_image')): ?>
                        <?php echo Former::text($namespace . '[' . $option['clean_key'] . ']')->data_images_only($option['type'] == 'file_manager' ? 'false' : 'true')->addClass('browse-file-manager-input')->prepend('<span class="attached-button"><button class="file-path-browse">' . trans('FileManager::common.browse') . '</button></span>'); ?>

                    <?php else: ?>
                        <?php echo Former::text($namespace . '[' . $option['clean_key'] . ']'); ?>

                    <?php endif; ?>
                <?php endforeach; ?>

                <?php echo Former::actions( Former::btn_primary_submit(trans('GlobalTranslations::common.save')) ); ?>


            <?php echo Former::close(); ?>

        </div>

    <?php echo HTML::widgetBox(false); ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('Backend::layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>