<%
   selected_section = controller.class::SECTION if defined?(controller.class::SECTION)
   if selected_section==Navigation::SECTION_RESOURCE && !@project && !@resource
     selected_section = Navigation::SECTION_HOME
   end
%>

<script>
  window.navbarOptions.set({
    space: 'settings',
    settingsPages: [
      <% pages = controller.java_facade.getPages(Navigation::SECTION_CONFIGURATION.key, nil, nil, nil, nil)
         pages.each_with_index do |page, index|
         page_url = (page.isController() ? page.getId() : "/plugins/configuration/#{page.getId()}")
      %>
      {
        url: '<%= page_url -%>',
        name: '<%= escape_javascript message(page.getId() + '.page', :default => page.getTitle()) %>'
      }<% if index < pages.size - 1 -%>, <% end %>
      <% end %>
    ],
    settingsProvisioning: <%= has_role?("provisioning") -%>,
    settingsUpdateCenter: <%= controller.java_facade.getSettings().getBoolean('sonar.updatecenter.activate') -%>
  });
</script>
