I'm thinking of using the Flexinode module on 4.6.3 to allow certain users to upload images. I want to include a Flexinode checkbox field that moderators can mark to promote the image to "featured" status.
I don't want users without the moderator role to have access to that checkbox during input, though. Is there any way to hide this box by role?
Clarification: I already know how to hide the output using CSS and php. I just need to hide the checkbox from unauthorized users during input.
Here's what I've already tried:
In my page.tpl.php file:
global $user;
$role = $user->roles;
if ((is_array($role)) && (!in_array("moderator",$role))) { ? >
<link rel="stylesheet" type="text/css" href="misc/admin_hide.css">
< ?php }
And in admin_hide.css:
#edit-flexinode_13 {
display: none !important;
}
This works great, except that it only hides the checkbox itself. The label for the checkbox, though, remains visible, which could be confusing for some users. There's no way (that I've found) to target the label using CSS, since it shares the same class (div.form-item label.option) as the other checkboxes on the input page -- there is no specific marker for this particular label.
Can anyone help me out with this?
(I'm aware of FlexiMAX but it looks as if that focuses on output, not input, of Flexinode types. Am I wrong in this assumption?)