Okay I'm just throwing some stuff I see here, it's up to you to prioritze them
.
- on a clean install there are no roles and your module says "list_fields" in the dropdown.
- When viewing a field in detailview, the fields_access_list doesn't work. I think it's best if you move the fields_access_list from your bean to the application language, that's where it belongs
- I hope you don't mind I capslocked a few words on your query to make it more readable and safer:
$query = "SELECT * from acl_roles_users LEFT JOIN acl_fields USING (role_id) WHERE acl_roles_users.deleted=0 AND acl_fields.deleted=0 AND user_id='".$current_user->id."' ORDER by category, name";
- It may be a good time to start making a roadmap for this project. I see that you want to make a list of fields in the future? ("Currently you have to type in the field name (precisely as it is in the selected module"). That sounds like a plan?
.
- The module is accessible by non-admins at the moment
- Internally your module speaks of "category". It may be best if this is called "module"
- Listview is not supported, I got it working with:
PHP Code:
$hook_array['process_record'] = Array();
$hook_array['process_record'][] = Array(1, 'acl_fields', 'modules/acl_fields/fields_logic.php','acl_fields_logic', 'limit_views');
You will need this logic hook for listviews.
and
PHP Code:
if ( (eregi('detail',$view) && $limit > 1) ||
(eregi('list',$view) && $limit > 0) ||
(eregi('index',$view) && $limit > 0) ||
(eregi('edit',$view) && $limit > 0) )
{
//print_r($bean);exit;
//unset($bean->field_name_map[$fieldname]);
unset($bean->field_defs[$fieldname]);
unset($bean->$fieldname);
$bean->field_defs[$fieldname][acl] = $limit;
//$mod_strings[$vname] = '';
}
This is not perfect, since the table header is still there, only the value is empty in ListView. I'm sure you're working on this, since the commented lines...
Bookmarks