<?php /*
    Autor: Giovanni López O.
    @gmlo_89
*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title><?php echo Config::get('core.app_name'); ?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <base href="<?php echo url(''); ?>">

        <?php /* Cargamos los css necesarios. */ ?>
        
        
        <?php /* Carga lo que ocupe algún modulo en el head */ ?>
        <?php echo $__env->yieldContent('head'); ?>

        <?php echo HTML::script('backend/vendor/tinymce/tinymce.min.js');; ?>

        <?php /* Estilos para fancybox */ ?>
        <?php echo HTML::style('backend/vendor/fancybox/source/jquery.fancybox.css');; ?>

        <?php /* Estilos para datatables */ ?>
        <?php echo HTML::style('backend/css/datatables.css');; ?>

        <?php /* Styles for bootstrap-switch */ ?>
        <?php echo HTML::style('backend/vendor/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css');; ?>

        <?php /* Styles for data-pickers */ ?>
        <?php echo HTML::style('backend/vendor/bootstrap-datepicker/css/datepicker3.css');; ?>

        <?php /* Estilos del Dashboard */ ?>
        <?php if(App::environment('local')): ?>
            <link rel="stylesheet/less" type="text/css" href="<?php echo asset('backend/less/dashboard.less'); ?>" />
        <?php else: ?>
            <?php echo HTML::style('backend/css/dashboard.min.css'); ?>
        <?php endif; ?>


        <?php /* Estilos para extender */ ?>
        <?php echo HTML::style('backend/css/ext.css');; ?>

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-4 col-md-2 sidebar">
                    <?php /* Menú lateral */ ?>
                    <?php /* <?php echo $__env->make('dashboard::menu-lateral', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?> */ ?>
                    <?php echo HTML::link('admin', Config::get('core.app_name'), array('class' => 'brand'));; ?>
                    <?php echo Dashboard::renderMenuLeft(); ?>
                </div>
                <div class="col-sm-8 col-sm-offset-4 col-md-10 col-md-offset-2 main-container">
                    <?php /* Incluimos la vista del menú superior */ ?>
                    <?php echo $__env->make('dashboard::menu-top', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                    <?php /* Contenido del modulo actual. */ ?>
                    <?php echo $__env->yieldContent('content'); ?>
                </div>
            </div>
        </div>

        



        <?php /* JS que se necesitaran a lo largo de la aplicación. */ ?>

        <?php /* Variables JavaScript que se nesesitaran a lo largo de nuestra aplicación. */ ?>
        <?php echo JavaScript::renderVars(); ?>


        <script src="https://code.jquery.com/jquery.js"></script>
        <script>window.jQuery || document.write('<script src="<?php echo asset("backend/vendor/jquery/dist/jquery.js"); ?>"><\/script>')</script>
        
        <?php if(App::environment('local')): ?>
            <!-- set options before less.js script -->
            <script>
              less = {
                env: "development",
                async: false,
                fileAsync: false,
                poll: 1000,
                functions: {},
                dumpLineNumbers: "comments",
                relativeUrls: false,
                rootpath: ""
              };
            </script>
            <?php echo HTML::script('backend/vendor/less/dist/less-1.7.0.min.js');; ?>
        <?php endif; ?>
        
        <?php echo HTML::script('backend/js/bootstrap.min.js');; ?>
        <?php echo HTML::script('backend/js/jquery.validate.js');; ?>

        <?php echo JavaScript::makeVar('label_find_file', trans('dashboard::label.find_file')); ?>
        
        <?php /* Plugin para cambiar el estilo de todos los input con type="file" */ ?>
        <?php echo HTML::script('backend/vendor/bootstrap-filestyle/src/bootstrap-filestyle.js');; ?>
        <script type="text/javascript">
            // Indicamos que todos los input[type="file"] van a tener un diseño especial
            $(":file").filestyle({buttonText: inncore.label_find_file});
        </script>

        <?php /* Script para bootstrap-switch */ ?>
        <?php echo HTML::script('backend/vendor/bootstrap-switch/dist/js/bootstrap-switch.min.js');; ?>
        <script type="text/javascript">
            $("[data-toggle='checkbox']").bootstrapSwitch();
        </script>

        <?php /* Script for bootstrap-datapickers */ ?>
        <?php echo HTML::script('backend/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js');; ?>



        <?php /* Script for fancybox */ ?>
        <?php echo HTML::script('backend/vendor/fancybox/source/jquery.fancybox.js');; ?>

        <?php /* Script que ayuda para crear cuadros de dialogo de bootstrap */ ?>
        <?php echo HTML::script('backend/vendor/bootbox/bootbox.js');; ?>
        <script type="text/javascript">
            // Definimos los valores default para bootbox
            bootbox.setDefaults({
                /**
                * @optional String
                * @default: en
                * which locale settings to use to translate the three
                * standard button labels: OK, CONFIRM, CANCEL
                */
                locale: "es",
                /**
                * @optional Boolean
                * @default: true
                * whether the dialog should be shown immediately
                */
                show: true,
                /**
                * @optional Boolean
                * @default: true
                * whether the dialog should be have a backdrop or not
                */
                backdrop: true,
                /**
                * @optional Boolean
                * @default: true
                * show a close button
                */
                closeButton: true,
                /**
                * @optional Boolean
                * @default: true
                * animate the dialog in and out (not supported in < IE 10)
                */
                animate: true,
                /**
                * @optional String
                * @default: null
                * an additional class to apply to the dialog wrapper
                */
                className: "my-modal"
            });
        </script>

        <?php /* JS propio para cuando ocupe algunas funciones. */ ?>
        <?php echo HTML::script('backend/js/scripts.js');; ?>

        <?php echo HTML::script('backend/js/jquery.dataTables.js');; ?>
        <?php echo HTML::script('backend/js/datatables.js');; ?>

        <?php /* Para poner algunas instrucciones JS necesarias */ ?>
        <script type="text/javascript">
            // Habilitamos la propiedad para que los elementos con la clase .fancybox usen tal script
            $(".fancybox").fancybox();


            // Todos los textarea con la clase .editor-html van a usar tinymce
            tinymce.init({
                selector: "textarea.editor-html",
                file_browser_callback : elFinderBrowser,
                theme: "modern",
                height: 600,
                plugins: [
                     "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
                     "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
                     "save table contextmenu directionality emoticons template paste textcolor"
               ],
              // content_css: "css/content.css",
               toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | formatselect | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons", 
               style_formats: [
                    {title: 'Bold text', inline: 'b'},
                    {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
                    {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
                    {title: 'Example 1', inline: 'span', classes: 'example1'},
                    {title: 'Example 2', inline: 'span', classes: 'example2'},
                    {title: 'Table styles'},
                    {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
                ]

             });
            function elFinderBrowser (field_name, url, type, win) {
              tinymce.activeEditor.windowManager.open({
                file: '/elfinder/tinymce',// use an absolute path!
                title: 'elFinder 2.0',
                width: 900,
                height: 450,
                resizable: 'yes'
              }, {
                setUrl: function (url) {
                  win.document.getElementById(field_name).value = url;
                }
              });
              return false;
            }
        </script>

        <?php /* Carga los JS que ocupe cada modulo. */ ?>
        <?php echo $__env->yieldContent('scripts'); ?>

    </body>
</html>