Folder editing now customizable
I am also the one to blame of the new folder editing and creating interface. Or actually blame Nemein since they needed this to be done.
Folder tools (or midcom.admin.folder) relies now on schema-based (and thus fully configurable) midcom.helper.datamanager2. It's now possible to
- Decide what fields you want to allow to edit
- Who gets to edit them
- ACL is at the moment requiring you to write it by hand, no automation yet available
- Component specific fields
- Available/excluded components list
- also configurable
Available since versions 1.2.0beta3 for MidCOM 2.8 and 1.1.5 for MidCOM 2.6.
1 Schema based
Tune yourself to create configuration for midcom.admin.folder and create the configuration snippet /sitegroup-config/midcom.admin.folder/config.
Include at least these rows:
'schemadbs_folder' => array
(
'default' => '/sitegroup-config/midcom.admin.folder/schemadb_folder',
),
and create the corresponding snippet for the schema.
2 ACLs
Knowledge is power. If you want to enable or disable some fields, you can call - for example - functions in the schema:
'default' => array
(
'description' => 'topic',
'l10n_db' => 'midcom.admin.folder',
'fields' => array
(
'name' => array
(
'title' => 'name',
'storage' => 'name',
'type' => 'text',
'widget' => 'text',
'readonly' =>
my_helper_class::member_of_group('administrators'),
),
),
),
3 Component specific fields
If you want to give extra configuration options to a specific component, give the schemadbs_folder a new key named after the component:
'schemadbs_folder' => array
(
'default' => '/sitegroup-config/midcom.admin.folder/schemadb_folder',
'midcom.admin.folder' => '/sitegroup-config/midcom.admin.folder/folder_special',
),
Naturally this requires you to write a DM2 compatible schema in the specified location.
4 Available/excluded components list
At the moment new MidCOMs are still waiting to be released. MidCOM settings wizard (midcom.admin.settings) should be released hand-in-hand. A minor change in default configuration was needed to be done in MidCOM core, but the impatient can already tweak their systems.
These may be done e.g. in <(code-init-before-midcom)> to your root page.
Set the configuration key
$GLOBALS['midcom_config_local']['component_listing_allowed'] = array
(
'net.nehmer.static',
'net.nehmer.blog',
'org.routamc.gallery',
);
if you want to show only the components described above, or
$GLOBALS['midcom_config_local']['component_listing_allowed'] = array
(
'net.nehmer.account',
'org.openpsa.calendar',
'net.nemein.calendar',
);
if you want to exclude these from the creation and editing folders' component listings.
Replace midcom_config_local by plain midcom_config if you plan to leave this for the headache of <(code-init-after-midcom)>.