Search
 
SCRIPT & CODE EXAMPLE
 

PHP

drupal 7 hook_form_alter

function hook_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) {
    $form['workflow']['upload_' . $form['type']['#value']] = array(
      '#type' => 'radios',
      '#title' => t('Attachments'),
      '#default_value' => variable_get('upload_' . $form['type']['#value'], 1),
      '#options' => array(
        t('Disabled'),
        t('Enabled'),
      ),
    );
  }
}
Comment

drupal form id alter hook

function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {

  // Modification for the form with the given form ID goes here. For example, if
  // FORM_ID is "user_register_form" this code would run only on the user
  // registration form.
  // Add a checkbox to registration form about agreeing to terms of use.
  $form['terms_of_use'] = array(
    '#type' => 'checkbox',
    '#title' => t("I agree with the website's terms and conditions."),
    '#required' => TRUE,
  );
}
Comment

PREVIOUS NEXT
Code Example
Php :: php list directories 
Php :: php short string 
Php :: html_entity_decode (PHP 4 = 4.3.0, PHP 5, PHP 7, PHP 8) html_entity_decode — Convert HTML entities to their corresponding characters 
Php :: get blog page url in wordpress 
Php :: getMessage in php 
Php :: laravel query latest 
Php :: php curl_exec get response json 
Php :: php get day number 
Php :: php array map cast to int 
Php :: how to add values to an array in laravel 
Php :: read pdf text in php 
Php :: php isset array 
Php :: ubuntu fopen failed to open stream: Permission denied 
Php :: laravel launch only one dusk test 
Php :: download file php 
Php :: order by in datatable laravel 
Php :: laravel collection reject 
Php :: wordpress loop over posts but exclude current post 
Php :: php array remove key value pair 
Php :: localhost didn’t send any data 
Php :: Add new column to table in mysql using php 
Php :: PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes") 
Php :: insert data in database using seeder in laravel 
Php :: laravel log build 
Php :: php erase element from array 
Php :: php add item to array 
Php :: convert to json php 
Php :: php array extract value 
Php :: random string in php 
Php :: delete model laravel 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =