{% use 'base/sidebar.html.twig' %}

{% block sidebar_buttons %}
    <div class="btn-group view pull-right" data-toggle="buttons-radio">
        <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button>
        <button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
    </div>
    <div class="btn-group visibility" data-toggle="buttons-checkbox">
        <button class="btn public active" title="Show public elements">Public</button>
        <button class="btn protected" title="Show protected elements">Protected</button>
        <button class="btn private" title="Show private elements">Private</button>
        <button class="btn inherited active" title="Show inherited elements">Inherited</button>
    </div>
{% endblock %}

{% block sidebar_entry %}
    <li class="{{ type }} {{ item.visibility }}{{ item.parent.name != node.name ? ' inherited' : '' }}">
        <a href="#{{ type }}_{{ item.name }}" title="{{ item.name }} :: {{ item.summary }}">
            <span class="description">{{ item.summary }}</span><pre>{{ item.name }}</pre>
        </a>
    </li>
{% endblock %}

{% block sidebar_content %}
    <ul class="side-nav nav nav-list">
        <li class="nav-header">
            <i class="icon-custom icon-method"></i> Methods
            <ul>
                {% set specialMethods = node.magicMethods ? node.inheritedMethods.merge(node.magicMethods) : node.inheritedMethods %}
                {% for item in node.methods.merge(specialMethods)|sort_asc %}
                    {% set type='method' %}
                    {% if item.visibility == '' or item.visibility == 'public' %}
                        {{ block('sidebar_entry') }}
                    {% endif %}
                {% endfor %}
            </ul>
        </li>
        <li class="nav-header protected">» Protected
            <ul>
                {% set specialMethods = node.magicMethods ? node.inheritedMethods.merge(node.magicMethods) : node.inheritedMethods %}
                {% for method in node.methods.merge(specialMethods)|sort_asc %}
                    {% if method.visibility == 'protected' %}
                        <li class="method {{ method.visibility }}{{ method.parent.name != node.name ? ' inherited' : '' }}">
                            <a href="#method_{{ method.name }}" title="{{ method.name }} :: {{ method.summary }}">
                                <span class="description">{{ method.summary }}</span><pre>{{ method.name }}</pre>
                            </a>
                        </li>
                    {% endif %}
                {% endfor %}
            </ul>
        </li>
        <li class="nav-header private">» Private
            <ul>
                {% set specialMethods = node.magicMethods ? node.inheritedMethods.merge(node.magicMethods) : node.inheritedMethods %}
                {% for method in node.methods.merge(specialMethods)|sort_asc %}
                    {% if method.visibility == 'private' %}
                        <li class="method {{ method.visibility }}{{ method.parent.name != node.name ? ' inherited' : '' }}">
                            <a href="#method_{{ method.name }}" title="{{ method.name }} :: {{ method.summary }}">
                                <span class="description">{{ method.summary }}</span><pre>{{ method.name }}</pre>
                            </a>
                        </li>
                    {% endif %}
                {% endfor %}
            </ul>
        </li>
        <li class="nav-header">
            <i class="icon-custom icon-constant"></i> Constants
            <ul>
                {% for constant in node.constants.merge(node.inheritedConstants)|sort_asc %}
                <li class="constant {{ constant.visibility }}">
                    <a href="#constant_{{ constant.name }}" title="{{ constant.name }} :: {{ constant.summary }}">
                        <span class="description">{{ constant.summary }}</span><pre>{{ constant.name }}</pre>
                    </a>
                </li>
                {% endfor %}
            </ul>
        </li>
    </ul>
{% endblock %}
