Просмотр исходного кода

revert back to KnpMenuBundle 1.1.* (ie. revert 33a7649afa51a009a8849de46e79cc600fc5dba3)

lsmith77 12 лет назад
Родитель
Сommit
c8a1b417f2

+ 3 - 4
Admin/Admin.php

@@ -1315,10 +1315,9 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
 
         $this->loaded['side_menu'] = true;
 
-        $menu = $this->menuFactory->createItem('root')
-            ->setChildrenAttribute('class', 'nav nav-list')
-            ->setUri($this->getRequest()->getRequestUri())
-        ;
+        $menu = $this->menuFactory->createItem('root');
+        $menu->setChildrenAttribute('class', 'nav nav-list');
+        $menu->setCurrentUri($this->getRequest()->getRequestUri());
 
         $this->configureSideMenu($menu, $action, $childAdmin);
 

+ 1 - 1
Resources/doc/reference/installation.rst

@@ -9,7 +9,7 @@ Sonata dependencies that need to be installed and configured beforehand :
     - `SonataCacheBundle <http://sonata-project.org/bundles/cache>`_
     - `SonataBlockBundle <http://sonata-project.org/bundles/block>`_
     - `SonatajQueryBundle <https://github.com/sonata-project/SonatajQueryBundle>`_
-    - `KnpMenuBundle <https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md#installation>`_
+    - `KnpMenuBundle <https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md#installation>`_ (Version 1.1.*)
     - `Exporter <https://github.com/sonata-project/exporter>`_
 
 You will need to install those in their 2.1 branches (or master if they don't

+ 5 - 5
Resources/views/standard_layout.html.twig

@@ -120,11 +120,11 @@ file that was distributed with this source code.
                 <ul class="breadcrumb">
                     {% if _breadcrumb is empty %}
                         {% if action is defined %}
-                            {% for item in admin.breadcrumbs(action) %}
+                            {% for label, uri in admin.breadcrumbs(action) %}
                                 {% if not loop.last  %}
-                                    <li><a href="{{ item.uri }}">{{ item.label }}</a><span class="divider">/</span></li>
+                                    <li><a href="{{ uri }}">{{ label }}</a><span class="divider">/</span></li>
                                 {% else %}
-                                    <li class="active">{{ item.label }}</li>
+                                    <li class="active">{{ label }}</li>
                                 {% endif %}
                             {% endfor %}
                         {% endif %}
@@ -155,9 +155,9 @@ file that was distributed with this source code.
                         {% if _title is not empty %}
                             {{ _title|raw }}
                         {% elseif action is defined %}
-                            {% for item in admin.breadcrumbs(action) %}
+                            {% for label, uri in admin.breadcrumbs(action) %}
                                 {% if loop.last  %}
-                                    {{ item.label }}
+                                    {{ label }}
                                 {% endif %}
                             {% endfor %}
                         {% endif%}

+ 0 - 4
UPGRADE-2.1.md

@@ -3,10 +3,6 @@ UPGRADE FROM 2.0 to 2.1
 
 ** Work In Progress - Please do not use this code in production **
 
-### KnpMenu
-
-  * The KnpMenu dependency now used the master branch.
-
 ### Form
 
   * Due to some refactoring in the Form Component, some types definition have been changed

+ 1 - 1
composer.json

@@ -18,7 +18,7 @@
     ],
     "minimum-stability": "dev",
     "require": {
-        "knplabs/knp-menu-bundle": "dev-master",
+        "knplabs/knp-menu-bundle": "1.1.*",
         "sonata-project/jquery-bundle": "dev-master",
         "sonata-project/exporter": "dev-master",
         "sonata-project/block-bundle": "dev-master"