You are here

README.txt in Node Limit 6

Same filename and directory in other branches
  1. 7 README.txt
node_limit Module

This module allows administrators to limit the number of nodes that users may create.  This limitation may be done on a per-role or per-user basis.

INSTALLATION:

- Put the module in your drupal modules directory and enable it in admin/build/module.
- Only users with the "administer node limits" permissions will be able to edit node limits.
- The administration page is at admin/user/node_limit

DETAILS:

- Node limits do not apply to user 1.
- If a user belongs to roles A and B, which have limits of 3 and 4 (respectively), the user will have a node limit of 4.
- Individual user node limits override role node limits

FUTURE PLANS:

- Allow for time-based node limits (a limit for a certain time period, or a limit that expires on a certain date or after a certain interval)
- Integration with other modules that segregate content, such as Organic Groups

HOOKS FOR SUBMODULES:
- hook_node_limit_element($lid = 0):
  return an array with a single key-value pair.  The key must be the name of the submodule, and the value is an element in form api.
  see node_limit_user for an implementation.
  You may set the value '#custom_render' => true if your element requires a custom rendering
  The $lid parameter is given if the user is editing (as opposed to adding) a node limit.  The implementor should fill in a #default_value for the element
  
- hook_node_limit_render_element(&$element):
  called if the element returned from hook_node_limit_element has '#custom_render' => true
  should return a string of rendered html
  
- hook_node_limit_element_validate($element):
  called when the user attempts to add or edit a Node Limit.  The implementor of the hook has the opportunity to validate the value the user entered.
  
- hook_node_limit_element_submit($lid, $applies, $element):
  called when the user adds or edits a Node Limit (and has passed validation).  The implementor of the hook has the opportunity to save the user-entered value based on the passed Node Limit id.  $applies == true iff the limit uses this limitation.  Otherwise the submodule should delete the limitation from its table.
  
- hook_node_limit_load($lid):
  Called when node_limit loads a limit from the database.  The implementor should return an array with a single key-value pair.  The key must be the name of the submodule, and the value is an array containing 
  

File

README.txt
View source
  1. node_limit Module
  2. This module allows administrators to limit the number of nodes that users may create. This limitation may be done on a per-role or per-user basis.
  3. INSTALLATION:
  4. - Put the module in your drupal modules directory and enable it in admin/build/module.
  5. - Only users with the "administer node limits" permissions will be able to edit node limits.
  6. - The administration page is at admin/user/node_limit
  7. DETAILS:
  8. - Node limits do not apply to user 1.
  9. - If a user belongs to roles A and B, which have limits of 3 and 4 (respectively), the user will have a node limit of 4.
  10. - Individual user node limits override role node limits
  11. FUTURE PLANS:
  12. - Allow for time-based node limits (a limit for a certain time period, or a limit that expires on a certain date or after a certain interval)
  13. - Integration with other modules that segregate content, such as Organic Groups
  14. HOOKS FOR SUBMODULES:
  15. - hook_node_limit_element($lid = 0):
  16. return an array with a single key-value pair. The key must be the name of the submodule, and the value is an element in form api.
  17. see node_limit_user for an implementation.
  18. You may set the value '#custom_render' => true if your element requires a custom rendering
  19. The $lid parameter is given if the user is editing (as opposed to adding) a node limit. The implementor should fill in a #default_value for the element
  20. - hook_node_limit_render_element(&$element):
  21. called if the element returned from hook_node_limit_element has '#custom_render' => true
  22. should return a string of rendered html
  23. - hook_node_limit_element_validate($element):
  24. called when the user attempts to add or edit a Node Limit. The implementor of the hook has the opportunity to validate the value the user entered.
  25. - hook_node_limit_element_submit($lid, $applies, $element):
  26. called when the user adds or edits a Node Limit (and has passed validation). The implementor of the hook has the opportunity to save the user-entered value based on the passed Node Limit id. $applies == true iff the limit uses this limitation. Otherwise the submodule should delete the limitation from its table.
  27. - hook_node_limit_load($lid):
  28. Called when node_limit loads a limit from the database. The implementor should return an array with a single key-value pair. The key must be the name of the submodule, and the value is an array containing