You are here

function hook_node_limit_element in Node Limit 8

Same name and namespace in other branches
  1. 7 node_limit.api.php \hook_node_limit_element()

Return submodules' form elements.

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.

Parameters

int $lid: The node limit id.

Return value

array 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.

5 functions implement hook_node_limit_element()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

node_limit_interval_node_limit_element in old/node_limit_interval/node_limit_interval.module
Implements hook_node_limit_element().
node_limit_role_node_limit_element in old/node_limit_role/node_limit_role.module
Implements hook_node_limit_element().
node_limit_type_node_limit_element in old/node_limit_type/node_limit_type.module
Implements hook_node_limit_element().
node_limit_userofrole_node_limit_element in old/node_limit_userofrole/node_limit_userofrole.module
Implements hook_node_limit_element().
node_limit_user_node_limit_element in old/node_limit_user/node_limit_user.module
Implements hook_node_limit_element().
1 invocation of hook_node_limit_element()
node_limit_limit_form in old/node_limit.module
Implements hook_form().

File

old/node_limit.api.php, line 72
Node_limit api reference.

Code

function hook_node_limit_element($lid = 0) {
  $limit = submodule_node_limit_load($lid);
  $name = !empty($limit['submodule']['name']) ? $limit['submodule']['name'] : '';
  return array(
    'submodule' => array(
      '#type' => 'textfield',
      '#title' => t('User'),
      '#autocomplete_path' => 'user/autocomplete',
      '#default_value' => $name,
    ),
  );
}