mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	move spacename to CLChillMain to ChillMain
This commit is contained in:
		| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle; | ||||
|  | ||||
| use Symfony\Component\HttpKernel\Bundle\Bundle; | ||||
|  | ||||
| class CLChillMainBundle extends Bundle | ||||
| { | ||||
| } | ||||
							
								
								
									
										9
									
								
								ChillMainBundle.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								ChillMainBundle.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Chill\MainBundle; | ||||
|  | ||||
| use Symfony\Component\HttpKernel\Bundle\Bundle; | ||||
|  | ||||
| class ChillMainBundle extends Bundle | ||||
| { | ||||
| } | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Controller; | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||||
|  | ||||
| @@ -16,7 +16,7 @@ class AdminController extends Controller { | ||||
|             $page_title = 'views.Main.admin.index.page_title') { | ||||
|          | ||||
|          | ||||
|         return $this->render('CLChillMainBundle:Admin:index.html.twig', array( | ||||
|         return $this->render('ChillMainBundle:Admin:index.html.twig', array( | ||||
|             'menu_composer' => $this->get('cl_chill_main_menu_composer'), | ||||
|             'menu' => $menu, | ||||
|             'header_title' => $header_title, | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Controller; | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||||
|  | ||||
| @@ -24,6 +24,6 @@ class DefaultController extends Controller | ||||
|         } | ||||
|          | ||||
|          | ||||
|         return $this->render('CLChillMainBundle::layout.html.twig'); | ||||
|         return $this->render('ChillMainBundle::layout.html.twig'); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Controller; | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\DataFixtures\ORM; | ||||
| namespace Chill\MainBundle\DataFixtures\ORM; | ||||
|  | ||||
| use Doctrine\Common\DataFixtures\AbstractFixture; | ||||
| use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||||
| use Doctrine\Common\Persistence\ObjectManager; | ||||
| use CL\Chill\MainBundle\Entity\Agent; | ||||
| use Chill\MainBundle\Entity\Agent; | ||||
| use Symfony\Component\DependencyInjection\ContainerInterface; | ||||
| use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\DataFixtures\ORM; | ||||
| namespace Chill\MainBundle\DataFixtures\ORM; | ||||
|  | ||||
| use Doctrine\Common\DataFixtures\AbstractFixture; | ||||
| use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||||
| @@ -23,7 +23,7 @@ class LoadCountries extends AbstractFixture { | ||||
|         echo "loading countries... \n"; | ||||
|          | ||||
|         foreach ($this->countries as $code => $name) { | ||||
|             $country = new \CL\Chill\MainBundle\Entity\Country(); | ||||
|             $country = new \Chill\MainBundle\Entity\Country(); | ||||
|             $country->setLabel(ucwords($name)); | ||||
|             $manager->persist($country); | ||||
|         } | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
| 
 | ||||
| namespace CL\Chill\MainBundle\DependencyInjection; | ||||
| namespace Chill\MainBundle\DependencyInjection; | ||||
| 
 | ||||
| use Symfony\Component\DependencyInjection\ContainerBuilder; | ||||
| use Symfony\Component\Config\FileLocator; | ||||
| @@ -13,7 +13,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; | ||||
|  * | ||||
|  * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} | ||||
|  */ | ||||
| class CLChillMainExtension extends Extension implements PrependExtensionInterface | ||||
| class ChillMainExtension extends Extension implements PrependExtensionInterface | ||||
| { | ||||
|     /** | ||||
|      * {@inheritDoc} | ||||
| @@ -33,15 +33,15 @@ class CLChillMainExtension extends Extension implements PrependExtensionInterfac | ||||
|     public function prepend(ContainerBuilder $container)  | ||||
|     { | ||||
|         $bundles = $container->getParameter('kernel.bundles'); | ||||
|         //add CLChillMain to assetic-enabled bundles
 | ||||
|         //add ChillMain to assetic-enabled bundles
 | ||||
|         if (!isset($bundles['AsseticBundle'])) { | ||||
|             throw new MissingBundleException('AsseticBundle'); | ||||
|         } | ||||
| 
 | ||||
|         $asseticConfig = $container->getExtensionConfig('assetic'); | ||||
|         $asseticConfig['bundles'][] = 'CLChillMainBundle'; | ||||
|         $asseticConfig['bundles'][] = 'ChillMainBundle'; | ||||
|         $container->prependExtensionConfig('assetic',  | ||||
|                 array('bundles' => array('CLChillMainBundle'))); | ||||
|                 array('bundles' => array('ChillMainBundle'))); | ||||
|          | ||||
|         //add installation_name to globals
 | ||||
|         $chillMainConfig = $container->getExtensionConfig($this->getAlias()); | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\DependencyInjection; | ||||
| namespace Chill\MainBundle\DependencyInjection; | ||||
|  | ||||
| use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||||
| use Symfony\Component\Config\Definition\ConfigurationInterface; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\DependencyInjection; | ||||
| namespace Chill\MainBundle\DependencyInjection; | ||||
|  | ||||
| use Exception; | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Entity; | ||||
| namespace Chill\MainBundle\Entity; | ||||
|  | ||||
|  | ||||
| use Doctrine\ORM\Mapping as ORM; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Entity; | ||||
| namespace Chill\MainBundle\Entity; | ||||
|  | ||||
| use Doctrine\ORM\Mapping as ORM; | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| CL\Chill\MainBundle\Entity\Agent: | ||||
| Chill\MainBundle\Entity\Agent: | ||||
|     type: entity | ||||
|     table: agents | ||||
|     id: | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| CL\Chill\MainBundle\Entity\Country: | ||||
| Chill\MainBundle\Entity\Country: | ||||
|     type: entity | ||||
|     table: null | ||||
|     fields: | ||||
|   | ||||
| @@ -12,35 +12,13 @@ root: | ||||
|  | ||||
| cl_chill_main_homepage: | ||||
|     pattern:  /hello | ||||
|     defaults: { _controller: CLChillMainBundle:Default:index } | ||||
|     defaults: { _controller: ChillMainBundle:Default:index } | ||||
|      | ||||
| chill_main_admin_central: | ||||
|     pattern: /admin | ||||
|     defaults: { _controller: CLChillMainBundle:Admin:index } | ||||
|     defaults: { _controller: ChillMainBundle:Admin:index } | ||||
|     options: | ||||
|         menus: | ||||
|             main: | ||||
|                 order: 20 | ||||
|                 label: homepage | ||||
|      | ||||
|      | ||||
| chill_main_dummy_0: | ||||
|     pattern: /dummy | ||||
|     defaults: { _controller: CLChillMainBundle:Default:index } | ||||
|     options: | ||||
|         menus: | ||||
|             dummy0: | ||||
|                 order: 50 | ||||
|                 label: 'test dummy 0' | ||||
|             dummy1: | ||||
|                 order: 50 | ||||
|                 label: test dummy 1 | ||||
|  | ||||
| chill_main_dummy_1: | ||||
|     pattern: /dummy1 | ||||
|     defaults: { _controller: CLChillMainBundle:Default:index } | ||||
|     options: | ||||
|         menus: | ||||
|             dummy0: | ||||
|                 order: 51 | ||||
|                 label: 'test dummy 1' | ||||
|   | ||||
| @@ -1,15 +1,15 @@ | ||||
| parameters: | ||||
| #    cl_chill_main.example.class: CL\Chill\MainBundle\Example | ||||
| #    cl_chill_main.example.class: Chill\MainBundle\Example | ||||
|  | ||||
| services: | ||||
|     chill.main.menu_composer: | ||||
|         class: CL\Chill\MainBundle\Routing\MenuComposer | ||||
|         class: Chill\MainBundle\Routing\MenuComposer | ||||
|         #must be set in function to avoid circular reference with chill.main.twig.chill_menu | ||||
|         calls: | ||||
|             -  [setContainer, ["@service_container"]] | ||||
|              | ||||
|     chill.main.twig.chill_menu: | ||||
|         class: CL\Chill\MainBundle\Routing\MenuTwig | ||||
|         class: Chill\MainBundle\Routing\MenuTwig | ||||
|         arguments: | ||||
|             - "@chill.main.menu_composer" | ||||
|         calls: | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| {% extends "CLChillMainBundle::layout.html.twig" %} | ||||
| {% extends "ChillMainBundle::layout.html.twig" %} | ||||
|  | ||||
| {% block title%}{{ header_title|trans }}{% endblock %} | ||||
|  | ||||
|  | ||||
| {% block css %} | ||||
|     {% stylesheets  output="css/all.css" filter="cssrewrite" | ||||
|           "bundles/clchillmain/css/admin.css" | ||||
|           "bundles/Chillmain/css/admin.css" | ||||
|     %}  | ||||
|     <link rel="stylesheet" href="{{ asset_url }}"/> | ||||
|     {% endstylesheets %} | ||||
|   | ||||
| @@ -5,21 +5,21 @@ | ||||
|     <title>{{ installation.name }}{% block title %}{% endblock %}</title> | ||||
|      | ||||
|     {% stylesheets  output="css/all.css" filter="cssrewrite" | ||||
|           "bundles/clchillmain/css/gumby.css" | ||||
|           "bundles/clchillmain/css/chillmain.css" | ||||
|           "bundles/clchillmain/js/lib_jquery_ui_pickadate/jquery-ui-1.10.3.pickadate.css" %} | ||||
|           "bundles/Chillmain/css/gumby.css" | ||||
|           "bundles/Chillmain/css/chillmain.css" | ||||
|           "bundles/Chillmain/js/lib_jquery_ui_pickadate/jquery-ui-1.10.3.pickadate.css" %} | ||||
|     <link rel="stylesheet" href="{{ asset_url }}"/> | ||||
|     {% endstylesheets %} | ||||
|      | ||||
|     {% block css%}<!-- nothing added to css -->{% endblock %} | ||||
|  | ||||
|     {% javascripts output="js/libs.js" | ||||
|         "bundles/clchillmain/js/modernizr-2.6.2.min.js" | ||||
|         "bundles/clchillmain/js/jquery-2.0.2.min.js" | ||||
|         "bundles/clchillmain/js/gumby.js" | ||||
|         "bundles/clchillmain/js/gumby.init.js"  | ||||
|         "bundles/clchillmain/js/ui/*.js" | ||||
|         "bundles/clchillmain/js/lib_jquery_ui_pickadate/jquery-ui-1.10.3.pickadate.js" %} | ||||
|         "bundles/Chillmain/js/modernizr-2.6.2.min.js" | ||||
|         "bundles/Chillmain/js/jquery-2.0.2.min.js" | ||||
|         "bundles/Chillmain/js/gumby.js" | ||||
|         "bundles/Chillmain/js/gumby.init.js"  | ||||
|         "bundles/Chillmain/js/ui/*.js" | ||||
|         "bundles/Chillmain/js/lib_jquery_ui_pickadate/jquery-ui-1.10.3.pickadate.js" %} | ||||
|     <script src="{{ asset_url }}" type="text/javascript"></script> | ||||
|     {% endjavascripts %}     | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Routing; | ||||
| namespace Chill\MainBundle\Routing; | ||||
|  | ||||
| use Symfony\Component\Routing\RouterInterface; | ||||
| use Symfony\Component\Routing\RouteCollection; | ||||
|   | ||||
| @@ -19,9 +19,9 @@ | ||||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Routing; | ||||
| namespace Chill\MainBundle\Routing; | ||||
|  | ||||
| use CL\Chill\MainBundle\Routing\MenuComposer; | ||||
| use Chill\MainBundle\Routing\MenuComposer; | ||||
| use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||||
| use Symfony\Component\DependencyInjection\ContainerInterface; | ||||
|  | ||||
| @@ -51,7 +51,7 @@ class MenuTwig extends \Twig_Extension implements ContainerAwareInterface | ||||
|      * @var mixed[]  | ||||
|      */ | ||||
|     private $defaultParams = array( | ||||
|         'layout' => 'CLChillMainBundle:Menu:defaultMenu.html.twig', | ||||
|         'layout' => 'ChillMainBundle:Menu:defaultMenu.html.twig', | ||||
|         'args' => array(), | ||||
|         'activeRouteKey' => null | ||||
|     ); | ||||
| @@ -73,7 +73,7 @@ class MenuTwig extends \Twig_Extension implements ContainerAwareInterface | ||||
|      *  | ||||
|      * Expected params :  | ||||
|      * - args: the arguments to build the path (i.e: if pattern is /something/{bar}, args must contain {'bar': 'foo'} | ||||
|      * - layout: the layout. Absolute path needed (i.e.: CLChillXyzBundle:section:foo.html.twig) | ||||
|      * - layout: the layout. Absolute path needed (i.e.: ChillXyzBundle:section:foo.html.twig) | ||||
|      * - activeRouteKey : the key active, will render the menu differently. | ||||
|      *  | ||||
|      * see https://redmine.champs-libres.coop/issues/179 for more informations | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Tests\Controller; | ||||
| namespace Chill\MainBundle\Tests\Controller; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ class AppKernel extends Kernel | ||||
|     {    | ||||
|         return array( | ||||
|             new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | ||||
|             new \CL\Chill\MainBundle\CLChillMainBundle(), | ||||
|             new Chill\MainBundle\ChillMainBundle(), | ||||
|             new Symfony\Bundle\SecurityBundle\SecurityBundle(), | ||||
|             new Symfony\Bundle\TwigBundle\TwigBundle(), | ||||
|             new \Symfony\Bundle\AsseticBundle\AsseticBundle(), | ||||
|   | ||||
| @@ -1,9 +1,9 @@ | ||||
| hello_bundle:                                                                                                                                                                                                     | ||||
|     resource: "@CLChillMainBundle/Resources/config/routing.yml" | ||||
|     resource: "@ChillMainBundle/Resources/config/routing.yml" | ||||
|      | ||||
| chill_main_dummy_0: | ||||
|     pattern: /dummy | ||||
|     defaults: { _controller: CLChillMainBundle:Default:index } | ||||
|     defaults: { _controller: ChillMainBundle:Default:index } | ||||
|     options: | ||||
|         menus: | ||||
|             dummy0: | ||||
| @@ -16,7 +16,7 @@ chill_main_dummy_0: | ||||
|  | ||||
| chill_main_dummy_1: | ||||
|     pattern: /dummy1 | ||||
|     defaults: { _controller: CLChillMainBundle:Default:index } | ||||
|     defaults: { _controller: ChillMainBundle:Default:index } | ||||
|     options: | ||||
|         menus: | ||||
|             dummy0: | ||||
| @@ -26,7 +26,7 @@ chill_main_dummy_1: | ||||
|                  | ||||
| chill_main_dummy_2: | ||||
|     pattern: /dummy2/{param} | ||||
|     defaults: {_controller: CLChillMainBundle:Default:index } | ||||
|     defaults: {_controller: ChillMainBundle:Default:index } | ||||
|     options: | ||||
|         menus: | ||||
|             dummy0: | ||||
|   | ||||
| @@ -18,7 +18,7 @@ | ||||
|  * along with this program.  If not, see <http://www.gnu.org/licenses/>. | ||||
|  */ | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Tests\Services; | ||||
| namespace Chill\MainBundle\Tests\Services; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| use Symfony\Component\DomCrawler\Crawler; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| <?php | ||||
|  | ||||
| namespace CL\Chill\MainBundle\Tests\Services; | ||||
| namespace Chill\MainBundle\Tests\Services; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| use Symfony\Component\Routing\RouteCollection; | ||||
| @@ -21,7 +21,7 @@ class MenuComposerTest extends KernelTestCase | ||||
|      | ||||
|     /** | ||||
|      * | ||||
|      * @var \CL\Chill\MainBundle\DependencyInjection\Services\MenuComposer; | ||||
|      * @var \Chill\MainBundle\DependencyInjection\Services\MenuComposer; | ||||
|      */ | ||||
|     private $menuComposer; | ||||
|      | ||||
| @@ -33,7 +33,7 @@ class MenuComposerTest extends KernelTestCase | ||||
|     } | ||||
|      | ||||
|     /** | ||||
|      * @covers \CL\Chill\MainBundle\Routing\MenuComposer | ||||
|      * @covers \Chill\MainBundle\Routing\MenuComposer | ||||
|      */ | ||||
|     public function testMenuComposer() | ||||
|     { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|     "keywords" : ["chill", "social work"], | ||||
|     "homepage" : "https://github.com/Chill-project/Main", | ||||
|     "autoload": { | ||||
|         "psr-4": { "CL\\Chill\\MainBundle\\": "" } | ||||
|         "psr-4": { "Chill\\MainBundle\\": "" } | ||||
|     }, | ||||
|     "authors" : [ | ||||
|         { | ||||
|   | ||||
| @@ -1,38 +0,0 @@ | ||||
| On utilise les options de routing pour créer des entrées.  | ||||
|  | ||||
| ```yaml | ||||
| chill_appointment_admin: | ||||
|      pattern: /admin | ||||
|      defaults: { _controller: CLChillAppointmentBundle:Admin:index } | ||||
|      options: | ||||
|          menu: admin | ||||
|          label: menu.Appointment.index.title | ||||
|          helper: menu.Appointment.index.helper | ||||
|          order: 200 | ||||
| ``` | ||||
|  | ||||
| Attention à ne pas utiliser deux fois le même `order`, sinon l'entrée est supprimée... | ||||
|  | ||||
| Et puis, il "suffit" de créer la fonction correspondante dans un controller. | ||||
|  | ||||
| On peut se contenter d'un "forward" vers la fonction index du controller admin dans le bundle main ('CLChillMainBundle:Controller:index') : | ||||
|  | ||||
| ```php | ||||
|     public function indexAction() { | ||||
|          return $this->forward('CLChillMainBundle:Admin:index', | ||||
|                  array( | ||||
|                      'menu' => 'admin_appointment', | ||||
|                      'page_title' => 'menu.appointment.admin.index', | ||||
|                      'header_title' => 'menu.appointment.header_index' | ||||
|                      ) | ||||
|                  ); | ||||
|      } | ||||
| ``` | ||||
|  | ||||
| qui ira chercher à son tour toutes les entrées ont comme option le menu correspondant. Exemple pour admin_appointment: | ||||
|  | ||||
| ```yaml | ||||
| options: | ||||
|         menu: admin_appointment | ||||
|         #(...)   | ||||
| ``` | ||||
		Reference in New Issue
	
	Block a user