Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. function paywall_form_alter(&$form, $form_state, $form_id) {
  2.     // Normally a switch is used because you may want to alter more than
  3.     // one form and it is easy to add a new case for each form.
  4.     dpm($form);
  5.     dpm($form_id);
  6.     switch ($form_id) {
  7.       // This is our form ID.
  8.       case 'story_node_form':
  9.         dpm('altering form');
  10.         // Our kickin' mods go here.
  11.         $form['paywall'] = array(
  12.             '#type' => 'fieldset',
  13.             '#title' => 'Paywall',
  14.                 );
  15.           $form['paywall']['paywall_enabled'] = array(
  16.             '#type' => 'checkbox',
  17.             '#default_value' => '',
  18.             '#title' => 'Paywall Enabled On This Node'
  19.             );
  20.         break;
  21.     }
  22.   }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement