In the DnD library, the list of links under each atom should be customisable e.g. to hide (discourage) the Delete action, or to add the Translate link (with Entity Translation). New links can be open in a modal (like "edit" or "delete") or in an external window (like "view").

Proposition: an alter hook after scald_atom_user_build_action_links(). This is one-liner patch. Or if we can to clean up scald_atom_user_build_action_links() where there are hard-coded logic for view/edit/delete action then it would be longer.

Comments

jcisio’s picture

Title: Allow to customize links in the DnD library » Allow to customize links in the DnD library and add support for "Translate" link

Update the title. Another hybrid solution is an UI to disable some links and an alter hook that allow to change $links array (after the array is built).

nagy.balint’s picture

So the plan would be to have an alter hook that can change the links array and to have a few checkboxes for "Enabled library actions" or something similar to control which built in links are visible?
Also the translate link would be built in, just would be checked whether you have entity translation or not? (Though for ET we will also need to finish #2211409: Integration with ET and Title module)

An alternative could be to have a hook system where scald implements the current built in methods by implementing the hook itself, and other can also make an implementation to define other links. However then we would still need to implement a UI, which would actually work with contrib implemented links as well though.

nagy.balint’s picture

Status: Active » Needs review
StatusFileSize
new788 bytes

Here is the one liner patch, and the api file change of course.

Maybe this could be committed as its a very small change.

And then the translate link can be added afterwards, and the UI.

  • nagy.balint committed a0aea4a on 7.x-1.x
    Issue #2509948 by nagy.balint: Allow to customize links in the DnD...
nagy.balint’s picture

Status: Needs review » Needs work

Committed the hook, as then at least modifying the links is already possible.

Setting it to needs work, to work on the followups (UI and translate link likely)

  • jcisio committed 3b9298e on 7.x-1.x
    Issue #2509948 by nagy.balint, jcisio: Allow to customize links in the...
jcisio’s picture

Status: Needs work » Active

A context $atom was missing in the alter hook. While it can be deduced from $links['view']['href'] but I'm adding it btw.

Back to active because there is no patch yet for the next part.