Giter Site home page Giter Site logo

sonata-phpcr-admin-integration-bundle's Introduction

This repository is no longer maintained

Due to lack of interest, we had to decide to discontinue this repository. The CMF project focusses on the Routing component and RoutingBundle, which are still in active use by other projects.

This repository will no longer be upgraded and marked as abandoned, but will be kept available for legacy projects or if somebody wants to experiment with the CMF.

You can contact us in the #symfony_cmf channel of the Symfony devs slack.

Symfony Content Management Framework

Build Status Latest Stable Version Total Downloads

This bundle is part of the Symfony Content Management Framework (CMF) and licensed under the MIT License.

Note the main purpose of this repository is to offer a composer package that ties together various packages that will be used in most CMF projects. The bulk of the development is done in other repositories on the https://github.com/symfony-cmf organization.

The Symfony CMF project makes it easier for developers to add CMS functionality to applications built with the Symfony PHP framework. Key development principles for the provided set of bundles are scalability, usability, documentation and testing.

Requirements

Documentation

For the install guide and reference, see:

Contributing

Pull requests are welcome. Please see our CONTRIBUTING guide.

Thanks to everyone who has contributed already.

sonata-phpcr-admin-integration-bundle's People

Contributors

dbu avatar eiannone avatar electricmaxxx avatar emmanuelvella avatar enekochan avatar glukose avatar heristop avatar jrmyio avatar petk avatar raul3k avatar wouterj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sonata-phpcr-admin-integration-bundle's Issues

impossible to edit menu item in another locale

Hello,

I noticed an issue while trying to edit a menu item (projects-iitem), and confirmed it also happens on the online demo install of the sandbox.

It has something to do with the current locale as the problem occured when using "fr" locale, but not when using "en".

http://i.imgur.com/F0b07RL.png

http://i.imgur.com/bfUAOGm.png

Unfortunately, I could not reproduce it locally on my machine as my cmf install has now an issue with the french locale...

Regards,
Mikael

Make Admin extensions available without enabling each admin

I would like to challange the current "enabling strategy". Currently we enable each admin domain (core, content, ...) by configuration. Doing so its admin services are enabled/visible and its extensions. As the admins are for example purpose only, but the extensions are really helpful for custom admins, i would like to suggest to enable all extensions by default.

Use tab features

Just a reminder issue to add tab feature as soon as all admins have been moved to this bundle.

admin breadcrumbs

for the menu admins, we have a breadcrumb functionality that shows the tree of the breadcrumbs in the navigation. this would make sense for other types of documents too. as phpcr is always a tree, we could always show parents. maybe as an admin extension or trait?

an open question is where to stop, if we should allow configuring a list of classes/interfaces that we want in the breadcrumb and stop when we encounter something else. and/or a maximum number of parents to show.

Improve admin UX by removing options they don't care about

moved from symfony-cmf/routing-bundle#285

While doing the tab/group improvements, my eye's catched some options which I don't believe are usefull for the admin (at least not in the current way). I even believe most of them never will be usefull. First of all, words I don't think the admin understands: Controller, arguments, route.

If you then look closer at the options, the Variable pattern doesn't make any sense for the admin. What will change if the admin would put something in that text field? What's then passed to the "controller" (whatever that might be) if the controller defined those "arguments"?
What can the admin change with this? I think nothing.

The three checkboxes are about things I believe the admin understands (except that we should change "route" to "path" or "url" imo).
But then, if an admin checks format pattern, what is going to be changed? Does it mean the URL has to end with .html? If we want that, it should probably be a global option (it isn't very nice to edit every route in a website to enable/disable this).
The trailing slash is something that should be handled by the router itself imo. It's something the program has to care about, not the admin.

The Compiler class setting is the most cryptic of them all. Even I don't really know what it does. And if I know it, it would still not be usefull as it's just a plain text field. How do I know which compiler classes are available? I think this is an option that should only be provided to the developer.

At last, there are Controller and Template defaults. The first one belongs to the same group as the Compiler class imo. The Template class can be very usefull, it would allow the admin to change the theme for a page. However, we don't have anything about theming in our admin (we should maybe create a CmfThemingBundle). In the current way, there is no way to know what you can input in this field and what the page is going to look like in that case.

These are my thoughts about the routing admin, I would love to discuss this and see which options we can remove and what we can improve (e.g. adding a global settings page, a CmfThemingBundle, etc.)

Remove deprecations

Currently (when merging core-bundle integration) we have 1272 deprecation warnings. This should be decreased.

Align form_group parameters

started with seo, routing and core-bundle we have a form_group parameter per bundle, I think we forgot it in block-bundle (and others?) There we have to create more then one.

Add missing translation ids

(for all defined languages)

Dashboard:
auswahl_066

List Content:
auswahl_067

List SimpleBlock
auswahl_068

menu node create:
auswahl_069

route create:
auswahl_070

content create:
auswahl_071

PHP > 5.6

This means that new packages can use:

Use of ::class
New array syntax.
Current code cannot be updated (as it causes many merge conflicts). These packages will be updated completely to PHP 5.5 as soon as CMF 1.x support is dropped (which is planned for May 2018).

Align form_group/form_tab configuration

For block, menu and core we find the configurations for form_group and form_tab under an extensions node. For seo it is on the base, routing has nothing.
We should align the configuration here from my POV

SK translation has duplicated ids

filter.label_title and filter.label_name are defined two times and lead to an exception like:

 [Symfony\Component\Translation\Exception\InvalidResourceException]                                                                                                              
  Invalid resource provided: "1.2"; Errors: [ERROR 1877] Element '{urn:oasis:names:tc:xliff:document:1.2}trans-unit': Duplicate key-sequence ['filter.label_title'] in key ident  
  ity-constraint '{urn:oasis:names:tc:xliff:document:1.2}K_unit_id'. (in /home/maximilian/OpenSource/PRB/New/ - line 234, column 0)                                               
  [ERROR 1877] Element '{urn:oasis:names:tc:xliff:document:1.2}trans-unit': Duplicate key-sequence ['filter.label_name'] in key identity-constraint '{urn:oasis:names:tc:xliff:d  
  ocument:1.2}K_unit_id'. (in /home/maximilian/OpenSource/PRB/New/ - line 238, column 0)

Schema file

Just a reminder. When we have a clear configuration, we have to put it into the bundles schema file.

Extracting admin classes from bundles

The goal of this issue is to track the work-in-progress in extracting the admin classes from each bundle to provide a separated sonata admin integration of the cmf bundles.

Work has started in symfony-cmf/content-bundle#150 as a proof of concept.

Extracting an Admin class

  • Extract FormTypes.
  • Move Admin classes inside this bundle.
  • Update the sandbox.

Extracting an AdminExtension class

  • Extract FormExtensions
  • Move AdminExtension class inside this bundle.

Progress

Bundle Class Status Link
content-bundle Admin\StaticContentAdmin Merged symfony-cmf/content-bundle#150
routing-bundle Admin\RouteAdmin Todo
routing-bundle Admin\RedirectRouteAdmin Todo
block-bundle Admin\Imagine\ImagineBlockAdmin Todo
block-bundle Admin\Imagine\SlideshowBlockAdmin Todo
block-bundle Admin\ReferenceBlockAdmin Todo
block-bundle Admin\StringBlockAdmin Todo
block-bundle Admin\MenuBlockAdmin Todo
block-bundle Admin\ActionBlockAdmin Todo
block-bundle Admin\ContainerBlockAdmin Todo
block-bundle Admin\SimpleBlockAdmin Todo
menu-bundle Admin\MenuNodeAdmin Todo
menu-bundle Admin\MenuAdmin Todo
seo-bundle Admin\Extension\SeoContentAdminExtension Todo
core-bundle Admin\Extension\ChildExtension Todo
core-bundle Admin\Extension\PublishableExtension In progress symfony-cmf/core-bundle#207
core-bundle Admin\Extension\PublishTimePeriodExtension In progress symfony-cmf/core-bundle#207
routing-bundle Admin\Extension\RouteReferrersExtension Todo
routing-bundle Admin\Extension\FrontendLinkExtension Todo
block-bundle Admin\Extension\BlockCacheExtension Todo
menu-bundle Admin\Extension\MenuNodeReferrersExtension Todo
menu-bundle Admin\Extension\MenuOptionsExtension Todo

Regressions

Add missing translations

Now we centralized all translations of the CMF in this bundle, we have a clear view of what's missing. These are marked with TODO: comments in the Xliff file. We're missing some messages in the following languages:

  • Czech
  • French (#68)
  • German (#60)
  • Italian (#57)
  • Polish
  • Slovak
  • Slovene (#58)
  • Spanish (#63)
  • Portuguese (Brazilian) (#80)

/cc @pulzarraider, @eiannone, @peterkokot, @cordoval, @emgiezet You guys did an amazing job translating the CMF into the languages! Do you maybe have some time left to translate the missing messages?

Admin/Document class parameters

While integration of block-bundle i simply reused the way of injecting admin and document classes due to configuration. I don't know if we really need that, cause the other bundles do not have that? And i did a mistake as i grouped them all under admin_classes and had no default [] in the configuration. This has to be fixed anyway.

publication extensions: have a special column for aggregated publication info

Group all info of the 3 publication admin extensions in one column: Published, XYZ until XZY | Published, XYZ | Published, until XZY. Use a color code to reflect the current state.

This should be an optional feature, some might prefer to have separate columns for ordering and filtering.

That would probably work like this: https://github.com/symfony-cmf/CoreBundle/blob/master/Admin/Extension/TranslatableExtension.php#L50

Suggestion from https://blog.liip.ch/archive/2014/12/11/improving-the-user-experience-of-the-symfony-cmf-backend.html : We could use an icon for the column heading of publishable to save some space.

treebrowser issue

Hello,

I wrote about my issue here.

To sum up, the does not render completely, shows an error for a specific node which loads its content via a specific query which ends with this error message :

No resource found at path "/menu/main/services-item" for repository "default"
No PHPCR-ODM document could be found at "/menu/main/services-item"

https://snag.gy/ebP4YI.jpg
https://snag.gy/szoBnm.jpg

It could very well be due to my configuration, as it's one of my first attempts at setting up the cmf and I still don't understand well what I'm doing :)

Regards
Mikael

[1.1] Improve Menu Admin

The menu admin can be improved quite a lot:

  • Remove the menu node admin from the sidebar list. It doesn't make sense to list all menu items
  • Improve view of menu items when editing a menu. Make it reorderable, etc.
  • Add ability to create/edit menu items in the menu admin (embedded the menu node admin)

Generic Compiler Pass to replace admin class or document class

I currently had an idea how to replace the editable admin/document class configuration in a nice way.
On my sandbox PR (symfony-cmf/cmf-sandbox#332) i created a very specific compiler pass to replace the document class for the StaticContentAdmin, what about a configuration here like:

admin_classes:
    cmf_sonata_admin_integration.content.admin: My\Special\Admin\Class
    ....
document_classes:
   cmf_sonata_admin_integration.content.admin: AppBundle\Document\DemoSeoContent
   ....

We could then create a more generic compiler pass to replace the class or the 2. argument of a service (key) with the given value.

Move translation catalogues to this bundle

Currently, all translation catalogues still live in the core bundles. They should be moved to this bundle.

We may have to split it in some catalogues, to avoid conflicts.

Using locales with a dash instead of an underscore

In my app there I have 3 locales
en, nl-nl and nl-be.

I defined the odm locales as:

doctrine_phpcr:
    odm:
        locales:
            en: [nl-nl, nl-be]
            nl-nl : [nl-be, en]
            nl-be : [nl-nl, en]

However, this dashes used in this configuration seem to be overwritten by PHPCR to underscore.

As soon as I go to the Admin Bundle
admin/cmf/block/simpleblock/cms/blocks/test/edit?tl=nl-nl

I will hit an error `There is no language fallback for language 'nl-nl'.

Is this a problem of the PHPCR-admin-integration that it has to also overwrite dashes with underscores or shouldn't this be happening in the first place?

Is there any solution to tackle this problem without having locales to be using underscores?

How to deal with persistence layers

How should we handle PHPCR ODM/ORM, etc. things in this bundle?

1) Global config

cmf_sonata_admin_integration:
    persistence:
        phpcr: ~
    bundles:
        seo: ~
        routing: ~

The problem here is that some options of the admin factories are persistence layer dependent (e.g. basepath in routing).

2) Per admin config

cmf_sonata_admin_integration:
    bundles:
        seo:
            persistence:
                phpcr: ~
        routing:
            persistence:
                phpcr:
                    basepath: /cms/routing

This might be combined with a global enable option, to avoid lots of duplication.
The problem here is that each admin factory has to add these options to its config tree. We can't guarantee that the option exists.

3) Other options?

There probably are some other ideas?


Btw, this also means we have to make the PHPCR ODM Sonata admin bundle optional, so people can install only the SonataDoctrineOrmAdminBundle.

Exception when no configuration is set

When just enabling the bundle in AppKernel without any configuration, an exception occurs:


PHP Notice:  Undefined index: bundles in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php on line 57
PHP Stack trace:
1. {main}() web/app.php:0
2. Symfony\\Component\\HttpKernel\\Kernel->handle() web/app.php:29
3. Symfony\\Component\\HttpKernel\\Kernel->boot() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:165
4. Symfony\\Component\\HttpKernel\\Kernel->initializeContainer() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:116
5. Symfony\\Component\\DependencyInjection\\ContainerBuilder->compile() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:484
6. Symfony\\Component\\DependencyInjection\\Compiler\\Compiler->compile() vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:565
7. Symfony\\Component\\HttpKernel\\DependencyInjection\\MergeExtensionConfigurationPass->process() vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:120
8. Symfony\\Component\\DependencyInjection\\Compiler\\MergeExtensionConfigurationPass->process() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
9. Symfony\\Cmf\\Bundle\\SonataAdminIntegrationBundle\\DependencyInjection\\CmfSonataAdminIntegrationExtension->load() vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\\Cmf\\Bundle\\SonataAdminIntegrationBundle\\DependencyInjection\\CmfSonataAdminIntegrationExtension::loadBundles() must be of the type array, null given, called in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php on line 57 and defined in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php:60\nStack trace:\n#0 vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php(57): Symfony\\Cmf\\Bundle\\SonataAdminIntegrationBundle\\DependencyInjection\\CmfSonataAdminIntegrationExtension->loadBundles(NULL, Object(Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader), Object(Symfony\\Component\\DependencyInjection\\ContainerBuilder))\n#1 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compil in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php on line 60

looks for that we forgot the default ( []) state for cmf_sonata_admin_integration.bundles.

Admin classes into an PHPCR context

As currently all admins are completely related to PHPCR I would put them into a PHPCR context then. That would mean, we have to put them into PHPCR director and namespace. The service definition files still have that seperation.

Doing so we can simply add an ORM support later by adding own ORM admins without moving the phpcr admins (BC-Break).

Make SF4 Installation possible

Currently the build of SF4 with this bundle breaks because of dependencies, which still do not support SF4 (IvoryCkeditor, ...). We should change that and make the test green.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.