Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function paywall_form_alter(&$form, $form_state, $form_id) {
- // Normally a switch is used because you may want to alter more than
- // one form and it is easy to add a new case for each form.
- dpm($form);
- dpm($form_id);
- switch ($form_id) {
- // This is our form ID.
- case 'story_node_form':
- dpm('altering form');
- // Our kickin' mods go here.
- $form['paywall'] = array(
- '#type' => 'fieldset',
- '#title' => 'Paywall',
- );
- $form['paywall']['paywall_enabled'] = array(
- '#type' => 'checkbox',
- '#default_value' => '',
- '#title' => 'Paywall Enabled On This Node'
- );
- break;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement