You are here

function exif_admin_settings_form in Exif 5

Same name and namespace in other branches
  1. 6 exif.admin.inc \exif_admin_settings_form()
  2. 7 exif.admin.inc \exif_admin_settings_form()

Administration page callback.

1 string reference to 'exif_admin_settings_form'
exif_menu in ./exif.module
Implementation of hook_menu().

File

./exif.module, line 69

Code

function exif_admin_settings_form() {
  _exif_bootstrap();
  $tags = exif_load_settings();
  foreach ($tags as $tag) {
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['type'] = array(
      '#type' => 'markup',
      '#value' => PelIfd::getTypeName($tag->ifd),
    );
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['ifd'] = array(
      '#type' => 'hidden',
      '#value' => $tag->ifd,
    );
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['tag'] = array(
      '#type' => 'hidden',
      '#value' => $tag->tag,
    );
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['status'] = array(
      '#type' => 'checkbox',
      '#title' => utf8_encode(PelTag::getTitle($tag->ifd, $tag->tag)),
      '#default_value' => $tag->status,
    );
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['weight'] = array(
      '#type' => 'weight',
      '#delta' => 10,
      '#default_value' => $tag->weight,
    );
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['#tree'] = TRUE;
    $form['tags']["{$tag->ifd}_{$tag->tag}"]['#weight'] = $tag->weight;
  }
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  $form['buttons']['reset'] = array(
    '#type' => 'submit',
    '#value' => t('Reset to defaults'),
  );
  return $form;
}