function node_limit_userofrole_node_limit_save in Node Limit 7
Same name and namespace in other branches
- 8 old/node_limit_userofrole/node_limit_userofrole.module \node_limit_userofrole_node_limit_save()
Implements hook_node_limit_save().
File
- node_limit_userofrole/
node_limit_userofrole.module, line 98 - Module to restrict the number of nodes by role.
Code
function node_limit_userofrole_node_limit_save($lid, $applies, $element) {
if ($applies) {
// In the clone context, $element is an array containing
// the rid and the role name
if (is_array($element)) {
$element = $element['rid'];
}
db_insert('node_limit_userofrole')
->fields(array(
'lid' => $lid,
'rid' => $element,
))
->execute();
}
}