Browse Source

Update KnpMenu to use the master branch

Thomas Rabaix 13 years ago
parent
commit
33a7649afa

+ 10 - 10
Admin/Admin.php

@@ -388,13 +388,13 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     protected $extensions = array();
 
     protected $labelTranslatorStrategy;
-    
+
     /**
      * Setting to true will enable preview mode for
      * the entity and show a preview button in the
      * edit/create forms
-     * 
-     * @var boolean	
+     *
+     * @var boolean
      */
     protected $supportsPreviewMode = false;
 
@@ -1315,9 +1315,10 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
 
         $this->loaded['side_menu'] = true;
 
-        $menu = $this->menuFactory->createItem('root');
-        $menu->setChildrenAttribute('class', 'nav nav-list');
-        $menu->setCurrentUri($this->getRequest()->getRequestUri());
+        $menu = $this->menuFactory->createItem('root')
+            ->setChildrenAttribute('class', 'nav nav-list')
+            ->setUri($this->getRequest()->getRequestUri())
+        ;
 
         $this->configureSideMenu($menu, $action, $childAdmin);
 
@@ -2515,17 +2516,16 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
     {
         return $this->labelTranslatorStrategy;
     }
-    
-	/**
+
+    /**
      * Returning true will enable preview mode for
      * the target entity and show a preview button
      * when editing/creating an entity
-     * 
+     *
      * @return boolean
      */
     public function supportsPreviewMode()
     {
         return $this->supportsPreviewMode;
     }
-    
 }

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

@@ -9,10 +9,10 @@ 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>`_ (Version 1.1.*)
+    - `KnpMenuBundle <https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.md#installation>`_
     - `Exporter <https://github.com/sonata-project/exporter>`_
 
-You will need to install those in their 2.0 branches (or master if they don't
+You will need to install those in their 2.1 branches (or master if they don't
 have a similar branch). Follow also their configuration step ; you will find
 everything you need in their installation chapter.
 

+ 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 label, uri in admin.breadcrumbs(action) %}
+                            {% for item in admin.breadcrumbs(action) %}
                                 {% if not loop.last  %}
-                                    <li><a href="{{ uri }}">{{ label }}</a><span class="divider">/</span></li>
+                                    <li><a href="{{ item.uri }}">{{ item.label }}</a><span class="divider">/</span></li>
                                 {% else %}
-                                    <li class="active">{{ label }}</li>
+                                    <li class="active">{{ item.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 label, uri in admin.breadcrumbs(action) %}
+                            {% for item in admin.breadcrumbs(action) %}
                                 {% if loop.last  %}
-                                    {{ label }}
+                                    {{ item.label }}
                                 {% endif %}
                             {% endfor %}
                         {% endif%}

+ 4 - 0
UPGRADE-2.1.md

@@ -3,6 +3,10 @@ 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

@@ -21,7 +21,7 @@
         "symfony/symfony": "2.1.*",
         "symfony/framework-bundle": "2.1.*",
         "symfony/security-bundle": "2.1.*",
-        "knplabs/knp-menu-bundle": "1.1.*",
+        "knplabs/knp-menu-bundle": "dev-master",
         "sonata-project/jquery-bundle": "dev-master",
         "sonata-project/exporter": "dev-master",
         "sonata-project/block-bundle": "dev-master"