You are here

function andromeda_slideshow_manage_form in Andromeda Slideshow 7

Same name and namespace in other branches
  1. 7.2 includes/andromeda_slideshow.forms.inc \andromeda_slideshow_manage_form()

Manage images for a slideshow form

1 string reference to 'andromeda_slideshow_manage_form'
andromeda_slideshow_menu in ./andromeda_slideshow.module
Implements hook_menu().

File

includes/andromeda_slideshow.forms.inc, line 177
Form definitions for andromeda slideshow module

Code

function andromeda_slideshow_manage_form($form, &$form_state, $slideshow) {
  $form = array();
  $images = andromeda_slideshow_load_slideshow_images($slideshow->sid);
  $form['images'] = array(
    '#theme' => 'andromeda_slideshow_manage_form_table',
    '#slideshow' => isset($slideshow) ? $slideshow : andromeda_slideshow_new_slideshow(),
    '#tree' => TRUE,
  );
  foreach ($images as $siid => $image) {
    $form['images'][$siid]['#image'] = $image;
    $form['images'][$siid]['position'] = array(
      '#type' => 'weight',
      '#default_value' => $image->position,
      '#attributes' => array(
        'class' => array(
          'col-weight',
        ),
      ),
    );
  }
  $form['actions'] = array();
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['actions']['cancel'] = array(
    '#markup' => l(t('Cancel'), 'admin/structure/slideshows'),
  );
  return $form;
}