function userpoints_nc_revision_userpoints in User points Nodes and Comments 7
Implements hook_userpoints().
File
- userpoints_nc_revision/
userpoints_nc_revision.module, line 41 - Gives users points for creating revisions on nodes.
Code
function userpoints_nc_revision_userpoints($op, $params = array()) {
switch ($op) {
case 'setting':
$form['userpoints_nc_revision'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#title' => t('Content revisions'),
'#group' => 'settings_additional',
'#weight' => 25,
'#attached' => array(
'js' => array(
'userpoints_nc' => drupal_get_path('module', 'userpoints_nc_revision') . '/userpoints_nc_revision.js',
),
),
);
$form['userpoints_nc_revision']['userpoints_nc_revision_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enabled by default'),
'#default_value' => userpoints_nc_get_setting('revision_enabled', NULL, TRUE),
'#description' => t('If checked, all content types award !points by default for new revisions. This can be overridden for each content type on the content type edit page.', userpoints_translation()),
);
$form['userpoints_nc_revision']['userpoints_nc_revision_points'] = array(
'#type' => 'textfield',
'#title' => t('Default !points for a new revision', userpoints_translation()),
'#description' => t('Set the default number of !points to be awarded when a user adds a new revision. This can be overridden for each content type.', userpoints_translation()),
'#default_value' => userpoints_nc_get_setting('revision_points'),
'#size' => 5,
'#maxlength' => 5,
);
$form['userpoints_nc_revision']['userpoints_nc_revision_category'] = array(
'#type' => 'select',
'#title' => t('Default !points category for a new revision', userpoints_translation()),
'#description' => t('Choose the category of !points to be used by default when a user adds a new revision. This can be overridden for each content type.', userpoints_translation()),
'#options' => userpoints_get_categories(),
'#default_value' => userpoints_nc_get_setting('revision_category', NULL, userpoints_get_default_tid()),
);
$form['userpoints_nc_revision']['userpoints_nc_revision_own_nodes'] = array(
'#type' => 'checkbox',
'#default_value' => userpoints_nc_get_setting('revision_own_nodes'),
'#title' => t('Award !points for revisions by the content author', userpoints_translation()),
'#description' => t('By default, the content author is not eligible to earn !points for new revisions (only other users who submit revisions can earn !points). But if this option is checked, the content author can earn !points, too. This can be overridden for each content type.', userpoints_translation()),
);
return $form;
break;
}
}