<?php

/**
 * @file
 *
 */

function incubator_gallery_incubator_settings_menu() {
  return array(
    'title' => 'Photo galleries',
    'description' => 'Settings for photo galleries',
  );
}

function incubator_gallery_incubator_settings() {
  $form = array();
  
  $form['incubator_gallery_photos_page'] = array(
    '#type' => 'checkbox',
    '#title' => t('Create "Photos" page and feed'),
    '#default_value' => variable_get('incubator_gallery_photos_page', TRUE),
  );
  
  $form = system_settings_form($form);
  $form['#submit'][] = 'incubator_gallery_incubator_settings_submit';
  
  return $form;
}

function incubator_gallery_incubator_settings_submit() {
  cache_clear_all('ctools_export:views_view:photos', 'cache_views');
  menu_rebuild();
}
