{"action":"created","issue":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/3132","labels_url":"https://api.github.com/repos/concrete5/concrete5/issues/3132/labels{/name}","comments_url":"https://api.github.com/repos/concrete5/concrete5/issues/3132/comments","events_url":"https://api.github.com/repos/concrete5/concrete5/issues/3132/events","html_url":"https://github.com/concrete5/concrete5/issues/3132","id":117660417,"number":3132,"title":"Editors should be installable and pickable","user":{"login":"joe-meyer","id":1292766,"avatar_url":"https://avatars.githubusercontent.com/u/1292766?v=3","gravatar_id":"","url":"https://api.github.com/users/joe-meyer","html_url":"https://github.com/joe-meyer","followers_url":"https://api.github.com/users/joe-meyer/followers","following_url":"https://api.github.com/users/joe-meyer/following{/other_user}","gists_url":"https://api.github.com/users/joe-meyer/gists{/gist_id}","starred_url":"https://api.github.com/users/joe-meyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joe-meyer/subscriptions","organizations_url":"https://api.github.com/users/joe-meyer/orgs","repos_url":"https://api.github.com/users/joe-meyer/repos","events_url":"https://api.github.com/users/joe-meyer/events{/privacy}","received_events_url":"https://api.github.com/users/joe-meyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-18T19:21:49Z","updated_at":"2015-11-19T17:52:40Z","closed_at":null,"body":"With our work on the CKEditor integration, we've found that in order to make the editor truely swapable we're probably going to need some way to install and autoload these editors ahead of the on_start bindings. Up to this point we've just been clobbering the `editor` service binding, but this is problematic because that doesn't happen until the package's `on_start` runs. If there is another package ahead of the editor package that is trying to add an editor plugin, the change gets lost because it's going against the redactor plugin manager instead. I'm thinking that it might make sense to have a kind of EditorManager that loads up all the installed editors and then to register plugins one would do something like\r\n\r\n`Core::make('editor/manager')->getEditor('redactor')->getPluginManager()->register($plugin)` \r\n\r\nWe could then have the Core::make('editor') just call up `Core::make('editor/manager')->getEditor('redactor')` and deprecate that service for backwards compatibility (this makes the assumption that up till now people are only using that to register redactor plugins).\r\n\r\nAdditionally, I think this will mean that we'd need to have some reliable pathing to autoload the editors (like we do for authentication types). Since we'll need to be able to load up the editor and attach its plugin manager, prior to any plugins actually being registered.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/concrete5/concrete5/issues/comments/158135573","html_url":"https://github.com/concrete5/concrete5/issues/3132#issuecomment-158135573","issue_url":"https://api.github.com/repos/concrete5/concrete5/issues/3132","id":158135573,"user":{"login":"joe-meyer","id":1292766,"avatar_url":"https://avatars.githubusercontent.com/u/1292766?v=3","gravatar_id":"","url":"https://api.github.com/users/joe-meyer","html_url":"https://github.com/joe-meyer","followers_url":"https://api.github.com/users/joe-meyer/followers","following_url":"https://api.github.com/users/joe-meyer/following{/other_user}","gists_url":"https://api.github.com/users/joe-meyer/gists{/gist_id}","starred_url":"https://api.github.com/users/joe-meyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joe-meyer/subscriptions","organizations_url":"https://api.github.com/users/joe-meyer/orgs","repos_url":"https://api.github.com/users/joe-meyer/repos","events_url":"https://api.github.com/users/joe-meyer/events{/privacy}","received_events_url":"https://api.github.com/users/joe-meyer/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T17:52:39Z","updated_at":"2015-11-19T17:52:39Z","body":"I think some kind of editor hook for `on_editor_data_load` and `on_editor_data_save` like we discussed in irc might accomplish this. That way editors don't have to render things like links/pictures in the same way, but they can certainly save them the same and leave it up to the editor to determine how those get rendered. This way if an editor plugin needs say certain data attributes on pictures or something it could be accomplished and it makes it so that if a different editor doesn't require those things it can just throw them out. This might need some further thought though, up till now I've been able to accomplish the link abstractions stuff in CKEditor with no problem without these."}}