You are here

function flipping_book_management_form in Flipping Book 7

Flipping Book Management form.

1 string reference to 'flipping_book_management_form'
flipping_book_menu in ./flipping_book.module
Implements hook_menu().

File

includes/flipping_book.pages.inc, line 11
Flipping Book Pages.

Code

function flipping_book_management_form($form, &$form_state) {
  $form['#attached'] = array(
    'css' => array(
      drupal_get_path('module', 'flipping_book') . '/css/flipping_book.css',
    ),
  );
  $max_upload_size = ini_get('upload_max_filesize');
  $form['filters']['fb'] = array(
    '#tree' => TRUE,
    '#theme' => 'table',
    '#header' => array(
      t('Title'),
      t('File'),
      t('Import'),
    ),
    '#rows' => array(),
  );
  $title = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#required' => TRUE,
  );
  $file = array(
    '#type' => 'file',
    '#title' => t('Flipping Book'),
    '#description' => t('Allowed extension: zip. Files must be less than @max_upload_size', array(
      '@max_upload_size' => $max_upload_size,
    )),
  );
  $submit = array(
    '#type' => 'submit',
    '#value' => t('Import'),
  );
  $form['filters']['fb'][] = array(
    'title' => &$title,
    'file' => &$file,
    'submit' => &$submit,
  );
  $form['filters']['fb']['#rows'][] = array(
    array(
      'data' => &$title,
    ),
    array(
      'data' => &$file,
    ),
    array(
      'data' => &$submit,
    ),
  );
  unset($title);
  unset($file);
  unset($submit);
  $form['#suffix'] = views_embed_view('flipping_books', 'block_1');
  return $form;
}