[dev] The sidebar resources as viewed from JS

Ralf Lang lang at b1-systems.de
Tue Dec 15 11:00:35 UTC 2015


Hi,

I am currently examining the sidebar resources handling.

In a plain horde application (from skeleton), one would add sidebar
resources via $app_Application->sidebar derived from Horde_Core_Application.

This would generate pretty bare "radio" or "checkbox" resources - they
have no identifying id, class or other element and the radios would not
have any relation besides living on the same container. For a
traditional static render-and-forget app, this works well but for
dynamic, it seems not ideal.

In kronolith/dynamic, resources are added via js and generate a slightly
different html code for the resources (checkboxes only).
They store the actual context  of the checkbox via prototypeJS' store()
method.

In Hermes/dynamic,

the sidebar() method is ignored and a separate Hermes_View_Sidebar /
sidebar.html.php is rendered which actually has IDs to refer to.

-------

I am currently trying to use a group of "radio" entries to switch some
application content without actually reloading the site.

First thing obviously is to identify the clicked entry, find all radios
which logically belong together to this group, disable the currently
active radio and enable the clicked radio - and then do whatever it is
supposed to achieve.

Which solution would be acceptable for re-use in other horde apps (i.e.
turba)?

1) Amend the sidebar() generated code with optional class for logically
grouping radio items and optional id to make use of them in javascript code

2) Generate dynamic-view resources in javascript code, including
class/id needed for handling

3) The hermes way

Is there any plan to refactor that in H6 or horde 5.next?

Regards,

Ralf

-- 
Ralf Lang
Linux Consultant / Developer
Tel.: +49-170-6381563
Mail: lang at b1-systems.de
B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.horde.org/archives/dev/attachments/20151215/ca666a50/attachment.bin>


More information about the dev mailing list