Drupal 常用模块安装

#!/bin/bash
 
enable_modules=('admin_menu' 'module_filter' 'token' 'ctools' 'pathauto' 'ds' 'devel' 'views' 'context')
disable_modules=('firephp' 'overlay' 'toolbar' 'color' 'dashboard')
 
for dmodule in ${disable_modules[@]}; do
    sudo drush pm-disable $dmodule -y
done
 
for emodule in ${enable_modules[@]}; do
   sudo drush dl $emodule -y
done;
 
for emodule in ${enable_modules[@]}; do
   sudo drush pm-enable $emodule -y
done;

对表单的某些元素用Div包起来



/**
此处操作的Formid是 webform_client_form_14.用到hook_form_alter
在表单元素key为number_of_adults12_years前面加一个Div开头
在表单元素key为city后面加一个结束Di
*/

/***
* Implementation of hook_form_alter(&$form, &$form_state)
*/
function centurytours_form_alter(&$form, &$form_state, $form_id)
{
    
    /**
     * Add div
     */
    if($form_id == 'webform_client_form_14')
    {
        foreach($form['submitted'] as $key=>$web_form)
        {
          if($key === 'number_of_adults12_years')
          {
              $form['submitted'][$key]['#prefix'] = '<div class="demo" id="demo">';
          }
          
          if($key === 'city')
          {
              $form['submitted'][$key]['#suffix'] = '</div>';
          }
          
        }
    }
}