You are here

function media_browser_plus_media_settings in Media Browser Plus 7

Same name and namespace in other branches
  1. 7.3 includes/media_browser_plus.admin.inc \media_browser_plus_media_settings()
  2. 7.2 media_browser_plus.module \media_browser_plus_media_settings()

Creates the media browser plus settings form.

_state

Parameters

$form:

1 string reference to 'media_browser_plus_media_settings'
media_browser_plus_menu in ./media_browser_plus.module
Implements hook_menu().

File

./media_browser_plus.module, line 1522
Adds fields to the media browser forms for better UX

Code

function media_browser_plus_media_settings($form, &$form_state = array()) {
  $form = array(
    'media_per_page' => array(
      '#type' => 'textfield',
      '#title' => 'Media Items per page',
      '#description' => t('Insert a number higher than one for the amount of media items displayed per page.'),
      '#default_value' => variable_get('media_media_per_page'),
      '#maxlength' => 4,
      '#required' => TRUE,
    ),
    'grid_window_height' => array(
      '#type' => 'textfield',
      '#title' => 'Grind Window Height',
      '#default_value' => variable_get('media_grid_window_height'),
      '#description' => t('Set a maximum height of pixels for the media grid view.'),
      '#maxlength' => 4,
      '#required' => TRUE,
    ),
    'page_items_per_page' => array(
      '#type' => 'textfield',
      '#title' => 'Page Items per page',
      '#default_value' => variable_get('media_page_items_per_page'),
      '#description' => t('Set how many page items you want in the paging navigation of each page.'),
      '#maxlength' => 4,
      '#required' => TRUE,
    ),
    'max_filesize' => array(
      '#type' => 'textfield',
      '#title' => 'Upload Maximum Filesize',
      '#default_value' => media_variable_get('max_filesize'),
      '#description' => t('Standard unit is MB and therefore can be left out. Otherwise use "NUMBER UNIT"'),
      '#maxlength' => 20,
      '#required' => TRUE,
    ),
    'root_folder' => array(
      '#type' => 'textfield',
      '#title' => 'Media Root folder',
      '#default_value' => variable_get('media_root_folder', 'media'),
      '#description' => t('The root folder of uploaded images.Dont use start or end slashes. eg "media/images"'),
      '#required' => TRUE,
    ),
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save Changes'),
  );
  return $form;
}