You are here

function image_gallery_admin_settings in Image 5.2

Same name and namespace in other branches
  1. 5 contrib/image_gallery/image_gallery.module \image_gallery_admin_settings()
  2. 6 contrib/image_gallery/image_gallery.admin.inc \image_gallery_admin_settings()
  3. 7 contrib/image_gallery/image_gallery.admin.inc \image_gallery_admin_settings()
1 string reference to 'image_gallery_admin_settings'
image_gallery_menu in contrib/image_gallery/image_gallery.module

File

contrib/image_gallery/image_gallery.module, line 93

Code

function image_gallery_admin_settings() {
  _image_check_settings();
  if (image_gallery_is_using_views()) {
    $form['info'] = array(
      '#type' => 'item',
      '#title' => t('Image galleries are being provided by the Views module'),
    );
    if (module_exists('views_ui')) {
      $form['info']['#value'] = t('To change the way galleries are displayed, override the default image_gallery view on the <a href="!views-link">Views administration page</a>.', array(
        '!views-link' => url('admin/build/views'),
      ));
    }
    else {
      $form['info']['#value'] = t('To change the way galleries are displayed, enable the <strong>Views UI</strong> module on the <a href="!modules-link">Modules administration page</a>, then override the default image_gallery view.', array(
        '!modules-link' => url('admin/build/modules', NULL, 'edit-status-views-ui'),
      ));
    }
    return $form;
  }
  $form['gallery'] = array(
    '#type' => 'fieldset',
    '#title' => t('Gallery settings'),
  );
  $form['gallery']['image_images_per_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Images per page'),
    '#default_value' => variable_get('image_images_per_page', 6),
    '#size' => 3,
    '#description' => t('Sets the number of images to be displayed in a gallery page.'),
  );
  $form['gallery']['image_gallery_node_info'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display node info'),
    '#default_value' => variable_get('image_gallery_node_info', 0),
    '#description' => t("Checking this will display the \"Posted by\" node information on the gallery pages."),
  );
  $form['gallery']['image_gallery_sort_order'] = array(
    '#type' => 'radios',
    '#title' => t('Image display sort order'),
    '#default_value' => variable_get('image_gallery_sort_order', IMAGE_GALLERY_SORT_CREATE_DESC),
    '#options' => array(
      IMAGE_GALLERY_SORT_CREATE_DESC => t('Create date, newest first'),
      IMAGE_GALLERY_SORT_CREATE_ASC => t('Create date, oldest first'),
      IMAGE_GALLERY_SORT_FILENAME => t('File name'),
      IMAGE_GALLERY_SORT_TITLE => t('Image title'),
    ),
  );
  return system_settings_form($form);
}