You are here

function imageblock_form_alter in Image Block 7

Same name and namespace in other branches
  1. 6 imageblock.module \imageblock_form_alter()

Implements hook_form_alter().

File

./imageblock.module, line 179
imageblock.module Primarily Drupal hooks.

Code

function imageblock_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'block_admin_configure') {
    if ($form['module']['#value'] == 'imageblock') {
      $form['#attributes']['enctype'] = 'multipart/form-data';
      $form['#validate'][] = 'imageblock_configure_form_validate';
    }
  }
  elseif ($form_id == 'block_admin_display_form') {
    foreach ($form['blocks'] as $key => $element) {
      if ($element['module']['#value'] == 'imageblock') {
        $form['blocks'][$key]['delete'] = array(
          '#type' => 'link',
          '#title' => t('delete'),
          '#href' => 'admin/structure/block/manage/imageblock/' . $element['delta']['#value'] . '/delete',
        );
      }
    }
  }
}