<head>
{% include "@ChamiloTheme/Layout/head.html.twig" %}
</head>
{% block chamilo_wrap %}
    {% autoescape false %}
        <script>
            $(function () {
                $(".select_to_ckeditor").click(function (e) {
                    e.preventDefault();
                    if (window.opener && window.opener.CKEDITOR) {
                        window.opener.CKEDITOR.tools.callFunction(1, $(this).attr("href"));
                        window.close();
                    }
                });

                $(".not_select_to_ckeditor").click(function (e) {
                    e.preventDefault();
                });
            });
        </script>
        {% if parent_id == -1 %}
            {% if allow_course %}
                <ul class="nav nav-tabs" id="myTab" role="tablist">
                    <li class="nav-item">
                        <a id="home-tab" class="nav-link active" data-toggle="tab" href="#home" role="tab">
                            {{'Course' | trans}}
                        </a>
                    </li>
                    <li class="nav-item">
                        <a id="profile-tab" class="nav-link" data-toggle="tab" href="#profile" role="tab" >
                            {{'My files' | trans}}
                        </a>
                    </li>
                </ul>
            {% endif %}
        {% else %}
            <div id="toolbar-document" class="actions">
                <a class="btn btn-default" href = "{{ url('editor_filemanager', {'parentId' : parent_id}) }}">{{'Back' | trans}}</a>
            </div>
        {% endif %}

    {% if allow_course %}
        <div class="tab-content" id="myTabContent">
            <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
                {{ table }}
            </div>
            <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
                {% include '@ChamiloTheme/Editor/elfinder_standalone.html.twig' %}
            </div>
        </div>
    {% else %}
        {% include '@ChamiloTheme/Editor/elfinder_standalone.html.twig' %}
    {% endif %}
    {% endautoescape %}
{% endblock %}
