'fieldset', '#title' => t('Boost cache type settings'), ); foreach ($types as $title => $content_types) { $form['cache_types'][$title] = array( '#type' => 'fieldset', '#title' => t('@title settings', array('@title' => $title)), '#collapsible' => TRUE, ); $collapsed = TRUE; foreach ($content_types as $type => $values) { $form['cache_types'][$title][$type] = array( '#type' => 'fieldset', '#title' => t('@type settings', array('@type' => $type)), '#description' => t('Cache @description of type @type', array( '@description' => $values['description'], '@type' => $type, ) ), ); // This content type enabled? $form['cache_types'][$title][$type]['boost_enabled_' . $type] = array( '#type' => 'checkbox', '#title' => t('Cache Enabled'), '#default_value' => $values['enabled'], ); // Content type extension $form['cache_types'][$title][$type]['boost_extension_' . $type] = array( '#type' => 'textfield', '#title' => t('Filename Extension', array( '@title' => $title, '@description' => $values['description'], '@type' => $type, ) ), '#default_value' => $values['extension'], ); // Maximum cache lifetime $form['cache_types'][$title][$type]['boost_lifetime_max_' . $type] = array( '#type' => 'select', '#options' => $period, '#title' => t('@type - Maximum Cache Lifetime', array( '@title' => $title, '@description' => $values['description'], '@type' => $type, ) ), '#default_value' => $values['lifetime_max'], ); // Minimum cache lifetime $form['cache_types'][$title][$type]['boost_lifetime_min_' . $type] = array( '#type' => 'select', '#options' => $period, '#title' => t('@type - Minimum Cache Lifetime', array( '@title' => $title, '@description' => $values['description'], '@type' => $type, ) ), '#default_value' => $values['lifetime_min'], ); if ($values['enabled']) { $collapsed = !$values['enabled']; } } $form['cache_types'][$title]['#collapsed'] = $collapsed; } $form['cacheability'] = array( '#type' => 'fieldset', '#title' => t('Boost cacheability settings'), ); // See http://api.drupal.org/api/function/block_admin_configure/7 $access = user_access('use PHP for settings'); $options = array( BLOCK_VISIBILITY_NOTLISTED => t('All pages except those listed'), BLOCK_VISIBILITY_LISTED => t('Only the listed pages'), ); $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '')); if (module_exists('php') && $access) { $options += array(BLOCK_VISIBILITY_PHP => t('Pages on which this PHP code returns TRUE (experts only)')); $title = t('Pages or PHP code'); $description .= ' ' . t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', array('%php' => '')); } else { $title = t('Pages'); } $form['cacheability']['boost_cacheability_option'] = array( '#type' => 'radios', '#title' => t('Cache specific pages'), '#options' => $options, '#default_value' => variable_get('boost_cacheability_option', BLOCK_VISIBILITY_NOTLISTED), ); $form['cacheability']['boost_cacheability_pages'] = array( '#type' => 'textarea', '#title' => '' . $title . '', '#default_value' => variable_get('boost_cacheability_pages', BOOST_CACHEABILITY_PAGES), '#description' => $description, ); return system_settings_form($form); }