/**
  * Builds extra settings for the block edit form.
  */
 public function form($bean, $form, &$form_state)
 {
     // Here we are defining the form.
     $form = array();
     // Select objects for the vocabularies that will be used.
     $vocabulary = taxonomy_get_vocabularies();
     $select_vocabulary_array = array();
     foreach ($vocabulary as $item) {
         $select_vocabulary_array[$item->machine_name] = $item->name;
     }
     // Building the basic form for individual 'related' bean configuration.
     $form['filters'] = array('#type' => 'fieldset', '#tree' => TRUE, '#title' => t('Filters'));
     // Determine related taxonomy term vocabularies.
     $form['filters']['vocabulary'] = array('#type' => 'select', '#title' => t('Vocabulary'), '#options' => $select_vocabulary_array, '#default_value' => $bean->filters['vocabulary'], '#required' => TRUE, '#multiple' => TRUE, '#size' => 5);
     // Settings fieldset is used for configuring the 'listing' bean output.
     $form['settings'] = array('#type' => 'fieldset', '#tree' => TRUE, '#title' => t('Output'));
     // Select objects for the taxonomy term view modes that will be used.
     $term_view_modes = array();
     $entity_info = entity_get_info();
     foreach ($entity_info['taxonomy_term']['view modes'] as $key => $value) {
         $term_view_modes[$key] = $value['label'];
     }
     // User select which view mode to use for the term listing inside the bean.
     $form['settings']['term_view_mode'] = array('#type' => 'select', '#title' => t('Taxonomy Term View Mode'), '#options' => $term_view_modes, '#default_value' => $bean->settings['term_view_mode'], '#required' => TRUE, '#multiple' => FALSE);
     // User define a maximum number of terms to be shown.
     $form['settings']['records_shown'] = array('#type' => 'textfield', '#title' => t('Records shown'), '#size' => 5, '#default_value' => $bean->settings['records_shown'], '#element_validate' => array('bean_tax_setting_is_numeric'));
     $form['settings']['hide_empty'] = array('#type' => 'checkbox', '#title' => t('Do not display block if there are no results.'), '#default_value' => $bean->settings['hide_empty']);
     return $form;
 }
 /**
  * Builds extra settings for the block edit form.
  */
 public function form($bean, $form, &$form_state)
 {
     // Here we are defining the form.
     $form = array();
     // Settings fieldset is used for configuring the 'related' bean output.
     $form['settings'] = array('#type' => 'fieldset', '#tree' => TRUE, '#title' => t('Output'), '#prefix' => '<div id="output-wrapper">', '#suffix' => '</div>');
     // Instantiate entity info.
     $entity_info = entity_get_info();
     // Create a list of entity types that have view modes.
     $entity_types = array();
     foreach ($entity_info as $key => $value) {
         if (!empty($value['view modes'])) {
             $entity_types[$key] = $value['label'];
         }
     }
     // Set a cache duration for the block.
     $form['settings']['cache_duration'] = array('#type' => 'textfield', '#title' => t('Cache duration (in minutes)'), '#size' => 5, '#default_value' => $bean->settings['cache_duration'], '#required' => TRUE);
     // User select how entites are related.
     $form['settings']['related'] = array('#type' => 'select', '#title' => t('Related To'), '#options' => array('page' => 'Active Page', 'user' => 'Logged-in User'), '#default_value' => $bean->settings['related'], '#required' => TRUE, '#multiple' => FALSE);
     // Determine if auth-user caching is appropriate.
     $form['settings']['cache_auth_user'] = array('#type' => 'checkbox', '#title' => t('Cache this block for authenticated users.'), '#description' => t('Warning: This will create a cache record for every authenticated user that views this block.'), '#default_value' => $bean->settings['cache_auth_user'], '#states' => array('visible' => array(':input[name="settings[related]"]' => array('value' => 'user'))));
     // Determine if anon-user caching is appropriate.
     $form['settings']['cache_anon_user'] = array('#type' => 'checkbox', '#title' => t('Cache this block for anonymous users.'), '#description' => t('This will create a cache record for anonymous users that view this block.'), '#default_value' => $bean->settings['cache_anon_user'], '#states' => array('visible' => array(':input[name="settings[related]"]' => array('value' => 'user'))));
     // User select which entity type to use for output.
     $form['settings']['entity_type'] = array('#type' => 'select', '#title' => t('Entity Type'), '#options' => $entity_types, '#default_value' => $bean->settings['entity_type'], '#required' => TRUE, '#multiple' => FALSE, '#ajax' => array('callback' => 'bean_tax_entity_type_callback', 'wrapper' => 'output-wrapper', 'method' => 'replace'));
     // Check for an ajax update and use new entity_type setting.
     if (!isset($form_state['values']['settings']['entity_type'])) {
         $entity_type = $bean->settings['entity_type'];
     } else {
         $entity_type = $form_state['values']['settings']['entity_type'];
     }
     // User select which view mode to use for the results inside the bean.
     $form['settings']['entity_view_mode'] = array('#type' => 'select', '#title' => t('Entity View Mode'), '#options' => bean_tax_get_entity_view_modes($entity_info, $entity_type), '#default_value' => $bean->settings['entity_view_mode'], '#required' => TRUE, '#multiple' => FALSE);
     // Determine what entity bundle types to display.
     $form['settings']['bundle_types'] = array('#type' => 'select', '#title' => t('Entity Bundles'), '#options' => bean_tax_get_entity_bundles($entity_type), '#default_value' => $bean->settings['bundle_types'], '#required' => TRUE, '#multiple' => TRUE, '#size' => 5);
     $form['settings']['hide_empty'] = array('#type' => 'checkbox', '#title' => t('Do not display block if there are no results.'), '#default_value' => $bean->settings['hide_empty']);
     $form['settings']['unmatch_add'] = array('#type' => 'checkbox', '#title' => t('Append unrelated entities so there are more results.'), '#default_value' => $bean->settings['unmatch_add']);
     // Select objects for the vocabularies that will be used.
     $vocabulary = taxonomy_get_vocabularies();
     $select_vocabulary_array = array();
     foreach ($vocabulary as $item) {
         $select_vocabulary_array[$item->machine_name] = $item->name;
     }
     // Define the filters fieldset.
     $form['filters'] = array('#type' => 'fieldset', '#tree' => TRUE, '#title' => t('Filters'));
     // User define a maximum number of entities to be shown.
     $form['filters']['records_shown'] = array('#type' => 'textfield', '#title' => t('Records shown'), '#size' => 5, '#default_value' => $bean->filters['records_shown'], '#element_validate' => array('bean_tax_setting_is_numeric'));
     // User define a maximum number of entities to be shown.
     $form['filters']['offset_results'] = array('#type' => 'textfield', '#title' => t('Offset Results'), '#size' => 5, '#default_value' => $bean->filters['offset_results'], '#element_validate' => array('bean_tax_setting_is_numeric'));
     // Determine related taxonomy term vocabularies.
     $form['filters']['vocabulary'] = array('#type' => 'select', '#title' => t('Vocabularies'), '#options' => $select_vocabulary_array, '#default_value' => $bean->filters['vocabulary'], '#required' => TRUE, '#multiple' => TRUE, '#size' => 5);
     // Define a "read more" style link to be shown at the bottom of the bean.
     $form['more_link'] = array('#type' => 'fieldset', '#tree' => TRUE, '#title' => t('More link'));
     // Link text shown on the 'more link' to be defined by user.
     $form['more_link']['text'] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $bean->more_link['text']);
     // Actual URL path for the 'more link' defined by user.
     $form['more_link']['path'] = array('#type' => 'textfield', '#title' => t('Link path'), '#default_value' => $bean->more_link['path']);
     return $form;
 }
Exemple #3
0
/**
 * Expose fieldable object types.
 *
 * Inform the Field API about object types to which fields can be attached.
 * @see hook_fieldable_info_alter().
 *
 * @return
 *   An array whose keys are fieldable object type names and whose values are
 *   arrays with the following key/value pairs:
 *   - label: The human-readable name of the type.
 *   - object keys: An array describing how the Field API can extract the
 *     informations it needs from the objects of the type.
 *     - id: The name of the property that contains the primary id of the
 *       object. Every object passed to the Field API must have this property
 *       and its value must be numeric.
 *     - revision: The name of the property that contains the revision id of
 *       the object. The Field API assumes that all revision ids are unique
 *       across all objects of a type.
 *       This element can be omitted if the objects of this type are not
 *       versionable.
 *     - bundle: The name of the property that contains the bundle name for the
 *       object. The bundle name defines which set of fields are attached to
 *       the object (e.g. what nodes call "content type").
 *       This element can be omitted if this type has no bundles (all objects
 *       have the same fields).
 *   - bundle keys: An array describing how the Field API can extract the
 *     informations it needs from the bundle objects for this type (e.g
 *     $vocabulary objects for terms; not applicable for nodes).
 *     This element can be omitted if this type's bundles do not exist as
 *     standalone objects.
 *     - bundle: The name of the property that contains the name of the bundle
 *       object.
 *   - cacheable: A boolean indicating whether Field API should cache
 *     loaded fields for each object, reducing the cost of
 *     field_attach_load().
 *   - bundles: An array describing all bundles for this object type.
 *     Keys are bundles machine names, as found in the objects' 'bundle'
 *     property (defined in the 'object keys' entry above).
 *     - label: The human-readable name of the bundle.
 *     - admin: An array of informations that allow Field UI pages (currently
 *       implemented in a contributed module) to attach themselves to the
 *       existing administration pages for the bundle.
 *       - path: the path of the bundle's main administration page, as defined
 *         in hook_menu(). If the path includes a placeholder for the bundle,
 *         the 'bundle argument', 'bundle helper' and 'real path' keys below
 *         are required.
 *       - bundle argument: The position of the placeholder in 'path', if any.
 *       - real path: The actual path (no placeholder) of the bundle's main
 *         administration page. This will be used to generate links.
 *       - access callback: As in hook_menu(). 'user_access' will be assumed if
 *         no value is provided.
 *       - access arguments: As in hook_menu().
 */
function hook_fieldable_info()
{
    $return = array('taxonomy_term' => array('label' => t('Taxonomy term'), 'object keys' => array('id' => 'tid', 'bundle' => 'vocabulary_machine_name'), 'bundle keys' => array('bundle' => 'machine_name'), 'bundles' => array()));
    foreach (taxonomy_get_vocabularies() as $vocabulary) {
        $return['taxonomy_term']['bundles'][$vocabulary->machine_name] = array('label' => $vocabulary->name, 'admin' => array('path' => 'admin/structure/taxonomy/%taxonomy_vocabulary', 'real path' => 'admin/structure/taxonomy/' . $vocabulary->vid, 'bundle argument' => 3, 'access arguments' => array('administer taxonomy')));
    }
    return $return;
}
function light_print_terms($nid)
{
    $vocabularies = taxonomy_get_vocabularies();
    $output = '';
    foreach ($vocabularies as $vocabulary) {
        if ($vocabularies) {
            $terms = taxonomy_node_get_terms_by_vocabulary($nid, $vocabulary->vid);
            if ($terms) {
                $links = array();
                //$output .= '' . $vocabulary->name . ': ';
                foreach ($terms as $term) {
                    $links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => strip_tags($term->description)));
                }
                $output .= implode(', ', $links);
            }
        }
    }
    return $output;
}
Exemple #5
0
function tac_admin($form, $form_state, $rid = NULL)
{
    $vocabularyObjects = taxonomy_get_vocabularies();
    $vocabularies = array(-1 => '[Select One]');
    foreach ($vocabularyObjects as $vocabularyObject) {
        $vocabularies[$vocabularyObject->vid] = $vocabularyObject->name;
    }
    $vocabulary = variable_get('tac_vocabulary', -1);
    $form = array();
    $form[] = array('vocabulary' => array('#type' => 'select', '#options' => $vocabularies, '#title' => t('Vocabulary to use for Access Control'), '#default_value' => $vocabulary));
    if ($vocabulary > 0) {
        $query = db_select('tac_map', 'm');
        $query->fields('m');
        $data = $query->execute()->fetchAll();
        $currentValues = array();
        foreach ($data as $row) {
            $currentValues[$row->rid][$row->tid] = $row;
        }
        $user_roles = user_roles();
        $role_permissions = user_role_permissions($user_roles);
        foreach ($user_roles as $rid => $role) {
            if ($rid == DRUPAL_ANONYMOUS_RID) {
                continue;
            }
            if (isset($role_permissions[$rid]['bypass node access']) && $role_permissions[$rid]['bypass node access']) {
                continue;
            }
            $subform = array('#theme' => 'tac_term_list', '#title' => 'Permissions for role "' . $role . '"');
            foreach (taxonomy_get_tree($vocabulary) as $term) {
                $subform['term_' . $term->tid] = array('#title' => $term->name, 'list' => array('#parents' => array('edit', $rid, $term->tid, 'list'), '#type' => 'checkbox', '#default_value' => isset($currentValues[$rid][$term->tid]->grant_list) ? $currentValues[$rid][$term->tid]->grant_list : 0), 'create' => array('#parents' => array('edit', $rid, $term->tid, 'create'), '#type' => 'checkbox', '#default_value' => isset($currentValues[$rid][$term->tid]->grant_create) ? $currentValues[$rid][$term->tid]->grant_create : 0), 'update' => array('#parents' => array('edit', $rid, $term->tid, 'update'), '#type' => 'checkbox', '#default_value' => isset($currentValues[$rid][$term->tid]->grant_update) ? $currentValues[$rid][$term->tid]->grant_update : 0), 'delete' => array('#parents' => array('edit', $rid, $term->tid, 'delete'), '#type' => 'checkbox', '#default_value' => isset($currentValues[$rid][$term->tid]->grant_delete) ? $currentValues[$rid][$term->tid]->grant_delete : 0));
            }
            $form['role' . $rid] = $subform;
        }
    }
    $form[] = array('#type' => 'submit', '#value' => t('Submit'));
    return $form;
}
 /**
  * Drupal 6
  */
 protected function readDrupal6SiteProperties()
 {
     $node_types = node_get_types();
     $fields = content_fields();
     foreach ($node_types as $bundle => $entity_info) {
         $field_types = content_types($bundle);
         $instances = array();
         foreach ($field_types['fields'] as $fieldName => $fieldInfo) {
             $instance = array('entity_type' => 'node', 'bundle' => $bundle, 'field_name' => $fieldName, 'label' => $fieldInfo['widget']['label'], 'description' => $fieldInfo['widget']['description'], 'widget' => array('type' => $fieldInfo['widget']['type'], 'settings' => array()));
             $instances[$fieldName] = $this->processInstance($instance);
         }
         $this->entityTypes[] = new NodeTypeBuilder($bundle, $entity_info->name, $entity_info->description, $instances);
     }
     $vocs = taxonomy_get_vocabularies();
     foreach ($vocs as $bundle => $entity_info) {
         $this->entityTypes[] = new VocabularyBuilder($entity_info->vid, $entity_info->name, $entity_info->description);
     }
     foreach ($fields as $fieldName => $fieldInfo) {
         $this->fields[] = new FieldBuilder($fieldName, $fieldInfo['type']);
     }
     $this->parseDefinition();
 }
Exemple #7
0
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   array An array of saved settings for this theme.
 * @return
 *   array A form array.
 */
function phptemplate_settings($saved_settings)
{
    // Get the node types
    $node_types = node_get_types('names');
    // Add javascript to show/hide optional settings
    drupal_add_js(drupal_get_path('theme', 'magazeen') . '/script/theme-settings.js', 'theme');
    /**
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the template.php file.
     */
    $defaults = array('comment_title' => 'Leave a Response', 'no_comment_message' => 'It\'s quite in here! Why not leave a <a href="#respond">response</a>?', 'breadcrumb_display' => 'yes', 'breadcrumb_separator' => ' › ', 'breadcrumb_home' => 1, 'breadcrumb_trailing' => 0, 'breadcrumb_title' => 0, 'mission_statement_pages' => 'home', 'user_notverified_display' => 0, 'search_text' => 'Search', 'search_snippet' => 1, 'search_info_type' => 1, 'search_info_user' => 1, 'search_info_date' => 1, 'search_info_comment' => 1, 'search_info_upload' => 1, 'submitted_by_author_default' => 1, 'submitted_by_date_default' => 1, 'submitted_by_enable_content_type' => 0, 'taxonomy_display_default' => 'all', 'taxonomy_format_default' => 'list', 'taxonomy_enable_content_type' => 0, 'readmore_default' => t('Continue Reading'), 'readmore_title_default' => t('Read the rest of this posting.'), 'readmore_enable_content_type' => 0, 'readmore_prefix_default' => '', 'readmore_suffix_default' => '', 'comment_singular_default' => t('1 comment'), 'comment_plural_default' => t('@count comments'), 'comment_title_default' => t('Jump to the first comment of this posting.'), 'comment_prefix_default' => '', 'comment_suffix_default' => '', 'comment_new_singular_default' => t('1 new comment'), 'comment_new_plural_default' => t('@count new comments'), 'comment_new_title_default' => t('Jump to the first new comment of this posting.'), 'comment_new_prefix_default' => '', 'comment_new_suffix_default' => '', 'comment_add_default' => t('Leave a comment'), 'comment_add_title_default' => t('Leave a new comment to this page.'), 'comment_add_prefix_default' => '', 'comment_add_suffix_default' => '', 'comment_node_default' => t('Add new comment'), 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'), 'comment_node_prefix_default' => '', 'comment_node_suffix_default' => '', 'comment_enable_content_type' => 0, 'front_page_title_display' => 'title_slogan', 'page_title_display_custom' => '', 'other_page_title_display' => 'ptitle_stitle', 'other_page_title_display_custom' => '', 'configurable_separator' => ' | ', 'meta_keywords' => '', 'meta_description' => '', 'rebuild_registry' => 0, 'block_editing' => 1);
    // Make the default content-type settings the same as the default theme settings,
    // so we can tell if content-type-specific settings have been altered.
    $defaults = array_merge($defaults, theme_get_settings());
    // Set the default values for content-type-specific settings
    foreach ($node_types as $type => $name) {
        $defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
        $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
        $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
        $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
        $defaults["readmore_{$type}"] = $defaults['readmore_default'];
        $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
        $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
        $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
        $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
        $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
        $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
        $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
        $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
        $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
        $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
        $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
        $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
        $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
        $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
        $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
        $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
        $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
        $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
        $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
        $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
        $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // If content type-specifc settings are not enabled, reset the values
    if ($settings['readmore_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $settings["readmore_{$type}"] = $settings['readmore_default'];
            $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
            $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
            $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
        }
    }
    if ($settings['comment_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
            $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
            $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
            $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
            $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
            $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
            $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
            $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
            $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
            $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
            $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
            $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
            $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
            $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
            $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
            $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
            $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
            $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
        }
    }
    // Create theme settings form widgets using Forms API
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display'], '#options' => array('yes' => t('Yes'), 'admin' => t('Only in admin section'), 'no' => t('No')));
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => $settings['breadcrumb_separator'], '#size' => 5, '#maxlength' => 10, '#prefix' => '<div id="div-breadcrumb-collapse">');
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => $settings['breadcrumb_home']);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_trailing'], '#description' => t('Useful when the breadcrumb is placed just before the title.'));
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_title'], '#description' => t('Useful when the breadcrumb is not placed just before the title.'), '#suffix' => '</div>');
    // Mission Statement
    $form['tnt_container']['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Search Input Text
    $form['tnt_container']['general_settings']['search_container']['search_input'] = array('#type' => 'fieldset', '#title' => t('Search Input Text'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['search_container']['search_input']['search_text'] = array('#type' => 'textfield', '#title' => t('Search Input Text'), '#description' => t('Customize the text for the search input.'), '#size' => 60, '#default_value' => $settings['search_text']);
    // Search Result
    $form['tnt_container']['general_settings']['search_container']['search_results'] = array('#type' => 'fieldset', '#title' => t('Search Result'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    // Comment Setting
    $form['tnt_container']['general_settings']['comment_container'] = array('#type' => 'fieldset', '#title' => t('Comment setting'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Comment Title
    $form['tnt_container']['general_settings']['comment_container']['comment_title'] = array('#type' => 'textfield', '#title' => t('Comment Title'), '#description' => t('Customize the title for the comments box.'), '#size' => 60, '#default_value' => $settings['comment_title']);
    // No Comment Message
    $form['tnt_container']['general_settings']['comment_container']['no_comment_message'] = array('#type' => 'textfield', '#title' => t('No Comment Message'), '#description' => t('Display a message if there no comment. HTML is allowed.'), '#size' => 71, '#default_value' => $settings['no_comment_message']);
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
        } else {
            if ($settings['submitted_by_enable_content_type'] == 0) {
                $form['submitted_by'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('“Read more”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('“Comment”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('“Comments” link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('“New comments” link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // front page title
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
    // other pages title
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
    // SEO configurable separator
    $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results.  NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module.  These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts.  If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Theme Dev Setting
    $form['tnt_container']['theme_dev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Rebuild Registry
    $form['tnt_container']['theme_dev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')), '#default_value' => $settings['rebuild_registry']);
    // Block Editing
    $form['tnt_container']['theme_dev']['block_editing'] = array('#type' => 'checkbox', '#title' => t('Show block editing on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), '#default_value' => $settings['block_editing']);
    // Return theme settings form
    return $form;
}
Exemple #8
0
/**
 * Implementation of template_preprocess_node().
 */
function csa_base_preprocess_node(&$variables)
{
    // Add meaningfull classes to the node.
    $node_classes = array();
    $node_classes[] = 'node';
    $node_classes[] = 'node-' . $variables['node']->type;
    if (empty($variables['status'])) {
        $node_classes[] = 'node-unpublished';
    }
    $variables['node_classes'] = implode(' ', $node_classes);
    // Date & author.
    $date = t('Posted ') . format_date($variables['node']->created, 'medium');
    // Format date as small, medium, or large
    $author = theme('username', $variables['node']);
    $author_only_separator = t('Posted by ');
    $author_date_separator = t(' by ');
    $submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $variables['node']->type : 'default';
    $date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
    $author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
    $author_separator = $date_setting ? $author_date_separator : $author_only_separator;
    $date_author = $date_setting ? $date : '';
    $date_author .= $author_setting ? $author_separator . $author : '';
    $variables['submitted'] = $date_author;
    if (theme_get_setting('hide_front_page_title') && drupal_is_front_page()) {
        $variables['submitted'] = NULL;
    }
    $taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $variables['node']->type : 'default';
    $taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
    $taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
    $taxonomy_format_links = theme_get_setting('taxonomy_format_links');
    if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $variables['page'])) {
        $output = array();
        $vocabularies = taxonomy_get_vocabularies($variables['node']->type);
        foreach ($vocabularies as $vocabulary) {
            if (theme_get_setting('taxonomy_vocab_display_' . $taxonomy_content_type . '_' . $vocabulary->vid)) {
                $terms = taxonomy_node_get_terms_by_vocabulary($variables['node'], $vocabulary->vid);
                if ($terms) {
                    $links = array();
                    foreach ($terms as $term) {
                        $links[] = array('data' => l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)))), 'class' => 'vocab-term');
                    }
                    if ($taxonomy_format == 'vocab') {
                        $data = theme_get_setting('taxonomy_display_vocab_name') ? '<span class="vocab-name">' . $vocabulary->name . ':</span> ' : '';
                        $class = array('vocab');
                        $children = array();
                        if ($taxonomy_format_links) {
                            $class[] = 'links';
                            $children = $links;
                        } else {
                            $term_list = array();
                            foreach ($links as $link) {
                                $term_list[] = $link['data'];
                            }
                            $data .= implode(theme_get_setting('taxonomy_format_delimiter'), $term_list);
                        }
                        $output[] = array('data' => $data, 'class' => implode(' ', $class), 'id' => 'vocab-' . $vocabulary->vid, 'children' => $children);
                    } else {
                        $output = array_merge($links, $output);
                    }
                }
            }
        }
        $variables['terms'] = theme('item_list', $output, null, 'ul', array('class' => 'taxonomy'));
    } else {
        $variables['terms'] = '';
    }
}
Exemple #9
0
      <?php 
}
?>



      <!-- CONTENT START -->
      <div data-role="content">

      <?php 
$output = "";
$output = $output . "<!-- CONTENT CATEGORY START -->";
$output = $output . "<section class=\"content-category-ny\">";
$output = $output . "<div class=\"container\">";
$output = $output . "<div class=\"row\">";
$vocabularies = taxonomy_get_vocabularies();
if ($vocabularies) {
    foreach ($vocabularies as $vocabulary) {
        if ($vocabulary->name == "Kategori") {
            $terms = taxonomy_get_tree($vocabulary->vid, $parent = 0, $max_depth = 1, $load_entities = FALSE);
            if ($terms) {
                $output = $output . "<ul class=\"list-unstyled\">";
                foreach ($terms as $term) {
                    switch ($term->tid) {
                        case "2925":
                            //  DONT SHOW
                            break;
                        case "3013":
                            //  DONT SHOW
                            break;
                        default:
Exemple #10
0
function acquia_marina_preprocess_node(&$vars)
{
    // Build array of handy node classes
    $node_classes = array();
    $node_classes[] = $vars['zebra'];
    // Node is odd or even
    $node_classes[] = !$vars['node']->status ? 'node-unpublished' : '';
    // Node is unpublished
    $node_classes[] = $vars['sticky'] ? 'sticky' : '';
    // Node is sticky
    $node_classes[] = isset($vars['node']->teaser) ? 'teaser' : 'full-node';
    // Node is teaser or full-node
    $node_classes[] = 'node-type-' . $vars['node']->type;
    // Node is type-x, e.g., node-type-page
    $node_classes = array_filter($node_classes);
    // Remove empty elements
    $vars['node_classes'] = implode(' ', $node_classes);
    // Implode class list with spaces
    // Add node_bottom region content
    $vars['node_bottom'] = theme('blocks', 'node_bottom');
    // Node Theme Settings
    // Date & author
    if (!module_exists('submitted_by')) {
        $date = t('Posted ') . format_date($vars['node']->created, 'medium');
        // Format date as small, medium, or large
        $author = theme('username', $vars['node']);
        $author_only_separator = t('Posted by ');
        $author_date_separator = t(' by ');
        $submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $vars['node']->type : 'default';
        $date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
        $author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
        $author_separator = $date_setting ? $author_date_separator : $author_only_separator;
        $date_author = $date_setting ? $date : '';
        $date_author .= $author_setting ? $author_separator . $author : '';
        $vars['submitted'] = $date_author;
    }
    // Taxonomy
    $taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default';
    $taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
    $taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
    if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page'])) {
        $vocabularies = taxonomy_get_vocabularies($vars['node']->type);
        $output = '';
        $term_delimiter = ', ';
        foreach ($vocabularies as $vocabulary) {
            if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) {
                $terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid);
                if ($terms) {
                    $term_items = '';
                    foreach ($terms as $term) {
                        // Build vocabulary term items
                        $term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
                        $term_items .= '<li class="vocab-term">' . $term_link . $term_delimiter . '</li>';
                    }
                    if ($taxonomy_format == 'vocab') {
                        // Add vocabulary labels if separate
                        $output .= '<li class="vocab vocab-' . $vocabulary->vid . '"><span class="vocab-name">' . $vocabulary->name . ':</span> <ul class="vocab-list">';
                        $output .= substr_replace($term_items, '</li>', -(strlen($term_delimiter) + 5)) . '</ul></li>';
                    } else {
                        $output .= $term_items;
                    }
                }
            }
        }
        if ($output != '') {
            $output = $taxonomy_format == 'list' ? substr_replace($output, '</li>', -(strlen($term_delimiter) + 5)) : $output;
            $output = '<ul class="taxonomy">' . $output . '</ul>';
        }
        $vars['terms'] = $output;
    } else {
        $vars['terms'] = '';
    }
    // Node Links
    if (isset($vars['node']->links['node_read_more'])) {
        $node_content_type = theme_get_setting('readmore_enable_content_type') == 1 ? $vars['node']->type : 'default';
        $vars['node']->links['node_read_more'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('readmore_prefix_' . $node_content_type), theme_get_setting('readmore_suffix_' . $node_content_type), t(theme_get_setting('readmore_' . $node_content_type)), 'node/' . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('readmore_title_' . $node_content_type))), 'query' => NULL, 'fragment' => NULL, 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'readmore-item'), 'html' => TRUE);
    }
    if (isset($vars['node']->links['comment_add'])) {
        $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default';
        if ($vars['teaser']) {
            $vars['node']->links['comment_add'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_add_prefix_' . $node_content_type), theme_get_setting('comment_add_suffix_' . $node_content_type), t(theme_get_setting('comment_add_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_add_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-add-item'), 'html' => TRUE);
        } else {
            $vars['node']->links['comment_add'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_node_prefix_' . $node_content_type), theme_get_setting('comment_node_suffix_' . $node_content_type), t(theme_get_setting('comment_node_' . $node_content_type)), "comment/reply/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_node_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comment-form', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-node-item'), 'html' => TRUE);
        }
    }
    if (isset($vars['node']->links['comment_new_comments'])) {
        $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default';
        $vars['node']->links['comment_new_comments'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_new_prefix_' . $node_content_type), theme_get_setting('comment_new_suffix_' . $node_content_type), format_plural(comment_num_new($vars['node']->nid), t(theme_get_setting('comment_new_singular_' . $node_content_type)), t(theme_get_setting('comment_new_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_new_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'new', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-new-item'), 'html' => TRUE);
    }
    if (isset($vars['node']->links['comment_comments'])) {
        $node_content_type = theme_get_setting('comment_enable_content_type') == 1 ? $vars['node']->type : 'default';
        $vars['node']->links['comment_comments'] = array('title' => acquia_marina_themesettings_link(theme_get_setting('comment_prefix_' . $node_content_type), theme_get_setting('comment_suffix_' . $node_content_type), format_plural(comment_num_all($vars['node']->nid), t(theme_get_setting('comment_singular_' . $node_content_type)), t(theme_get_setting('comment_plural_' . $node_content_type))), "node/" . $vars['node']->nid, array('attributes' => array('title' => t(theme_get_setting('comment_title_' . $node_content_type))), 'query' => NULL, 'fragment' => 'comments', 'absolute' => FALSE, 'html' => TRUE)), 'attributes' => array('class' => 'comment-item'), 'html' => TRUE);
    }
    $vars['links'] = theme('links', $vars['node']->links, array('class' => 'links inline'));
}
Exemple #11
0
function zeropoint_preprocess_node(&$vars)
{
    $vars['template_files'][] = 'node-' . $vars['nid'];
    //print_r($vars);
    if ($vars['user']->uid) {
        $vars['content'] = preg_replace('~<foranonym>.*</foranonym>~s', '', $vars['content']);
    }
    $vars['content'] = preg_replace('~"http://baza-voprosov.ru/~', '"/', $vars['content']);
    // Build array of handy node classes
    $node_classes = array();
    $node_classes[] = $vars['zebra'];
    // Node is odd or even
    $node_classes[] = !$vars['node']->status ? 'node-unpublished' : '';
    // Node is unpublished
    $node_classes[] = $vars['sticky'] ? 'sticky' : '';
    // Node is sticky
    $node_classes[] = isset($vars['node']->teaser) ? 'teaser' : 'full-node';
    // Node is teaser or full-node
    $node_classes[] = 'node-type-' . $vars['node']->type;
    // Node is type-x, e.g., node-type-page
    // Add any taxonomy terms for node teasers
    if ($vars['teaser'] && isset($vars['taxonomy'])) {
        foreach ($vars['taxonomy'] as $taxonomy_id_string => $term_info) {
            $taxonomy_id = array_pop(explode('_', $taxonomy_id_string));
            $node_classes[] = 'tag-' . $taxonomy_id;
            // Node teaser has terms (tag-x)
            //      $taxonomy_name = id_safe($term_info['title']);
            //      if ($taxonomy_name) {
            //        $node_classes[] = 'tag-'. $taxonomy_name;                              // Node teaser has terms (tag-name)
            //      }
        }
    }
    $node_classes = array_filter($node_classes);
    // Remove empty elements
    $vars['node_classes'] = implode(' ', $node_classes);
    // Implode class list with spaces
    // Add node regions
    $vars['node_middle'] = theme('blocks', 'node_middle');
    $vars['node_bottom'] = theme('blocks', 'node_bottom');
    // Render Ubercart fields into separate variables for node-product.tpl.php
    if (module_exists('uc_product') && uc_product_is_product($vars) && $vars['template_files'][0] == 'node-product') {
        $node = node_build_content(node_load($vars['nid']));
        $vars['uc_image'] = drupal_render($node->content['image']);
        $vars['uc_body'] = drupal_render($node->content['body']);
        $vars['uc_display_price'] = drupal_render($node->content['display_price']);
        $vars['uc_add_to_cart'] = drupal_render($node->content['add_to_cart']);
        $vars['uc_weight'] = drupal_render($node->content['weight']);
        $vars['uc_dimensions'] = drupal_render($node->content['dimensions']);
        $vars['uc_model'] = drupal_render($node->content['model']);
        $vars['uc_list_price'] = drupal_render($node->content['list_price']);
        $vars['uc_sell_price'] = drupal_render($node->content['sell_price']);
        $vars['uc_cost'] = drupal_render($node->content['cost']);
        $vars['uc_additional'] = drupal_render($node->content);
    }
    // Node Theme Settings
    // Date & author
    if (!module_exists('submitted_by')) {
        $date = t('') . format_date($vars['node']->created, 'medium');
        // Format date as small, medium, or large
        $author = theme('username', $vars['node']);
        $author_only_separator = t('');
        $author_date_separator = t(' &#151; ');
        $submitted_by_content_type = theme_get_setting('submitted_by_enable_content_type') == 1 ? $vars['node']->type : 'default';
        $date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
        $author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
        $author_separator = $date_setting ? $author_date_separator : $author_only_separator;
        $date_author = $date_setting ? $date : '';
        $date_author .= $author_setting ? $author_separator . $author : '';
        $vars['submitted'] = $date_author;
    }
    // Taxonomy
    $taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default';
    $taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
    $taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
    if (module_exists('taxonomy') && ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page'])) {
        $vocabularies = taxonomy_get_vocabularies($vars['node']->type);
        $output = '';
        $term_delimiter = ' | ';
        foreach ($vocabularies as $vocabulary) {
            if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) {
                $terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid);
                if ($terms) {
                    $term_items = '';
                    foreach ($terms as $term) {
                        // Build vocabulary term items
                        $term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
                        $term_items .= '<li class="vocab-term">' . $term_link . $term_delimiter . '</li>';
                    }
                    if ($taxonomy_format == 'vocab') {
                        // Add vocabulary labels if separate
                        $output .= '<li class="vocab vocab-' . $vocabulary->vid . '"><span class="vocab-name">' . check_plain($vocabulary->name) . ':</span> <ul class="vocab-list">';
                        //$output .= '<li class="vocab vocab-'. $vocabulary->vid .'"> <ul class="vocab-list">';
                        $output .= substr_replace($term_items, '</li>', -(strlen($term_delimiter) + 5)) . '</ul></li>';
                    } else {
                        $output .= $term_items;
                    }
                }
            }
        }
        if ($output != '') {
            $output = $taxonomy_format == 'list' ? substr_replace($output, '</li>', -(strlen($term_delimiter) + 5)) : $output;
            $output = '<ul class="taxonomy">' . $output . '</ul>';
        }
        $vars['terms'] = $output;
    } else {
        $vars['terms'] = '';
    }
}
Exemple #12
0
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function phptemplate_settings($saved_settings)
{
    // Get the node types
    $node_types = node_get_types('names');
    /**
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the template.php file.
     */
    $defaults = array('user_notverified_display' => 1, 'breadcrumb_display' => 0, 'banner_display' => 0, 'iepngfix_display' => 0, 'colorswitch_display' => 0, 'suckerfish_display' => 0, 'foreground_bg' => 0, 'background_bg' => 0, 'foreground_border' => 0, 'background_border' => 0, 'foreground_font' => 0, 'background_font' => 0, 'search_snippet' => 1, 'search_info_type' => 1, 'search_info_user' => 1, 'search_info_date' => 1, 'search_info_comment' => 1, 'search_info_upload' => 1, 'mission_statement_pages' => 'home', 'front_page_title_display' => 'title_slogan', 'page_title_display_custom' => '', 'other_page_title_display' => 'ptitle_slogan', 'other_page_title_display_custom' => '', 'configurable_separator' => ' | ', 'meta_keywords' => '', 'meta_description' => '', 'taxonomy_display_default' => 'only', 'taxonomy_format_default' => 'vocab', 'taxonomy_enable_content_type' => 0, 'submitted_by_author_default' => 1, 'submitted_by_date_default' => 1, 'submitted_by_enable_content_type' => 0, 'readmore_default' => t('Read more'), 'readmore_title_default' => t('Read the rest of this posting.'), 'readmore_prefix_default' => '', 'readmore_suffix_default' => '', 'readmore_enable_content_type' => 0, 'comment_singular_default' => t('1 comment'), 'comment_plural_default' => t('@count comments'), 'comment_title_default' => t('Jump to the first comment of this posting.'), 'comment_prefix_default' => '', 'comment_suffix_default' => '', 'comment_new_singular_default' => t('1 new comment'), 'comment_new_plural_default' => t('@count new comments'), 'comment_new_title_default' => t('Jump to the first new comment of this posting.'), 'comment_new_prefix_default' => '', 'comment_new_suffix_default' => '', 'comment_add_default' => t('Add new comment'), 'comment_add_title_default' => t('Add a new comment to this page.'), 'comment_add_prefix_default' => '', 'comment_add_suffix_default' => '', 'comment_node_default' => t('Add new comment'), 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'), 'comment_node_prefix_default' => '', 'comment_node_suffix_default' => '', 'comment_enable_content_type' => 0);
    // Make the default content-type settings the same as the default theme settings,
    // so we can tell if content-type-specific settings have been altered.
    $defaults = array_merge($defaults, theme_get_settings());
    // Set the default values for content-type-specific settings
    foreach ($node_types as $type => $name) {
        $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
        $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
        $defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
        $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
        $defaults["readmore_{$type}"] = $defaults['readmore_default'];
        $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
        $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
        $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
        $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
        $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
        $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
        $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
        $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
        $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
        $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
        $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
        $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
        $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
        $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
        $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
        $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
        $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
        $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
        $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
        $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
        $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // If content type-specifc settings are not enabled, reset the values
    if ($settings['readmore_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $settings["readmore_{$type}"] = $settings['readmore_default'];
            $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
            $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
            $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
        }
    }
    if ($settings['comment_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
            $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
            $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
            $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
            $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
            $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
            $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
            $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
            $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
            $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
            $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
            $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
            $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
            $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
            $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
            $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
            $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
            $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
        }
    }
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('m4Music settings'), '#description' => t('Use these settings to change what and how information is displayed in your theme.'), '#collapsible' => TRUE, '#collapsed' => false);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Mission Statement
    $form['tnt_container']['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // ImageCache Settings
    if (module_exists('imagecache')) {
        m4music_add_imagecache_preset();
        // Banner Images with imagecache
        $form['tnt_container']['general_settings']['banner'] = array('#type' => 'fieldset', '#title' => t('Banner Images'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['banner']['banner_display'] = array('#type' => 'checkbox', '#title' => t('Display Banner with imagecache'), '#default_value' => $settings['banner_display']);
    }
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // iepngfix
    $form['tnt_container']['general_settings']['iepngfix'] = array('#type' => 'fieldset', '#title' => t('IE PNG Fix'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['iepngfix']['iepngfix_display'] = array('#type' => 'checkbox', '#title' => t('Use IE PNG Fix'), '#default_value' => $settings['iepngfix_display']);
    // colorswitch
    $form['tnt_container']['general_settings']['colorswitch'] = array('#type' => 'fieldset', '#title' => t('Color Switcher'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['colorswitch']['colorswitch_display'] = array('#type' => 'checkbox', '#title' => t('Use Color Switch'), '#default_value' => $settings['colorswitch_display']);
    // colorswitch foreground
    $form['tnt_container']['general_settings']['colorswitch']['foreground'] = array('#type' => 'fieldset', '#title' => t('Foreground Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['colorswitch']['foreground']['foreground_bg'] = array('#type' => 'textfield', '#title' => t('Background Color'), '#default_value' => $settings['foreground_bg'], '#description' => t('Color to use as background. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['foreground']['foreground_border'] = array('#type' => 'textfield', '#title' => t('Border Color'), '#default_value' => $settings['foreground_border'], '#description' => t('Color to use for borders. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['foreground']['foreground_font'] = array('#type' => 'textfield', '#title' => t('Font Color'), '#default_value' => $settings['foreground_font'], '#description' => t('Color to use for font. Use #FFF notation.'));
    // colorswitch background
    $form['tnt_container']['general_settings']['colorswitch']['background'] = array('#type' => 'fieldset', '#title' => t('Background Settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['colorswitch']['background']['background_bg'] = array('#type' => 'textfield', '#title' => t('Background Color'), '#default_value' => $settings['background_bg'], '#description' => t('Color to use as background. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['background']['background_border'] = array('#type' => 'textfield', '#title' => t('Border Color'), '#default_value' => $settings['background_border'], '#description' => t('Color to use for borders. Use #FFF notation.'));
    $form['tnt_container']['general_settings']['colorswitch']['background']['background_font'] = array('#type' => 'textfield', '#title' => t('Font Color'), '#default_value' => $settings['background_font'], '#description' => t('Color to use for font. Use #FFF notation.'));
    // suckerfish
    $form['tnt_container']['general_settings']['suckerfish'] = array('#type' => 'fieldset', '#title' => t('Suckerfish Menus'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['suckerfish']['suckerfish_display'] = array('#type' => 'checkbox', '#title' => t('Use Suckerfish Menus'), '#default_value' => $settings['suckerfish_display']);
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
    $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
        $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
        } else {
            if ($settings['submitted_by_enable_content_type'] == 0) {
                $form['submitted_by'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('“Read more”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('“Comment”'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('“Add new comment” link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('“Comments” link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('“New comments” link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // front page title
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
    // other pages title
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
    $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
    // SEO configurable separator
    $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results.  NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module.  These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts.  If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Return theme settings form
    return $form;
}
Exemple #13
0
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function acquia_marina_settings($saved_settings)
{
    global $base_url;
    // Retrieve & combine default and saved theme settings
    $defaults = acquia_marina_default_theme_settings();
    $settings = array_merge($defaults, $saved_settings);
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('Acquia Marina settings'), '#description' => t('Use these settings to change what and how information is displayed in your theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Mission Statement
    $form['tnt_container']['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    if (module_exists('search')) {
        $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    }
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author and date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    if (module_exists('submitted_by') == FALSE) {
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
            } else {
                if ($settings['submitted_by_enable_content_type'] == 0) {
                    $form['submitted_by'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    } else {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['#description'] = 'NOTICE: You currently have the "Submitted By" module installed and enabled, so the Author & Date theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Author & Date theme settings, you must first disable the "Submitted By" module.';
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_hide_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Hide vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_hide_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('"Read more"'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('"Comment"'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('"Comments" link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('"New comments" link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // front page title
    if (module_exists('page_title') == FALSE) {
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
        // other pages title
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
        // SEO configurable separator
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    } else {
        $form['tnt_container']['seo']['page_format_titles']['#description'] = 'NOTICE: You currently have the "Page Title" module installed and enabled, so the Page titles theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Page titles theme settings, you must first disable the "Page Title" module.';
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator']['#disabled'] = 'disabled';
    }
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags aren\'t used much by search engines anymore, but the meta description is important -- this is what will be shown as the description of your link in search engine results.  NOTE: For more advanced meta tag functionality, check out the Meta Tags (aka. Node Words) module.  These theme settings do not work in conjunction with this module and will not appear if you have it enabled.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "nodewords" module installed and enabled, so the meta tag theme settings have been disabled to prevent conflicts.  If you later wish to re-enable the meta tag theme settings, you must first disable the "nodewords" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Development settings
    $form['tnt_container']['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE);
    $form['tnt_container']['themedev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry for every page.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('This setting is useful while developing themes (see <a href="!link">rebuilding the theme registry</a>). However, it <strong>significantly degrades performance</strong> and should be turned off for any production website.', array('!link' => 'http://drupal.org/node/173880#theme-registry')));
    $form['tnt_container']['themedev']['fix_css_limit'] = array('#type' => 'checkbox', '#title' => t('Fix IE stylesheet limit.'), '#default_value' => $settings['fix_css_limit'], '#description' => t('This setting groups css files so Internet Explorer can see more than 30 of them. This is useful when you cannot use aggregation (e.g., when developing or using private file downloads). But because it degrades performance and can load files out of order, CSS aggregation (<a href="!link">Optimize CSS files</a>) is <strong>strongly</strong> recommended instead for any production website.', array('!link' => $base_url . '/admin/settings/performance')));
    //
    // Add custom settings, if present
    //
    // Custom settings
    $form['tnt_container']['custom_settings'] = array('#type' => 'fieldset', '#title' => t('Custom settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Theme width
    $form['tnt_container']['custom_settings']['theme_width_config'] = array('#type' => 'fieldset', '#title' => t('Theme width'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['custom_settings']['theme_width_config']['theme_width'] = array('#type' => 'radios', '#title' => t('Select a fixed or fluid width'), '#default_value' => $settings['theme_width'] ? $settings['theme_width'] : 'fixed', '#options' => array('fixed' => t('<strong>DEFAULT</strong> - Fixed'), 'fluid' => t('Fluid')));
    // Theme fonts
    $form['tnt_container']['custom_settings']['theme_fonts_config'] = array('#type' => 'fieldset', '#title' => t('Theme fonts'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['custom_settings']['theme_fonts_config']['theme_fonts'] = array('#type' => 'radios', '#title' => t('Select a font family'), '#default_value' => $settings['theme_fonts'] ? $settings['theme_fonts'] : 'fonts_1', '#options' => array('fonts_1' => t('<strong>DEFAULT</strong> - Tahoma, Verdana, Arial, Helvetica, sans-serif'), 'fonts_2' => t('Lucida Grande, Lucida Sans Unicode, Verdana, Helvetica, Arial, sans-serif'), 'fonts_3' => t('Helvetica, Arial, sans-serif'), 'fonts_4' => t('Georgia, Garamond, Times New Roman, serif')));
    // Return theme settings form
    return $form;
}
 /**
  * Implements Drupal\configuration\Config\Configuration::saveToActiveStore().
  */
 public function saveToActiveStore(ConfigIteratorSettings &$settings)
 {
     $vocabulary = (object) $this->getData();
     if (!empty($vocabulary->vid)) {
         unset($vocabulary->vid);
     }
     $existing = taxonomy_get_vocabularies();
     foreach ($existing as $existing_vocab) {
         if ($existing_vocab->machine_name === $vocabulary->machine_name) {
             $vocabulary->vid = $existing_vocab->vid;
             break;
         }
     }
     taxonomy_vocabulary_save($vocabulary);
     $settings->addInfo('imported', $this->getUniqueId());
 }
Exemple #15
0
function csa_base_settings($saved_settings, $subtheme_defaults = array())
{
    // Get the node types
    $node_types = node_get_types('names');
    // Get the default values from the .info file.
    $defaults = csa_base_get_default_settings('csa_base');
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Set the default values for content-type-specific settings
    foreach ($node_types as $type => $name) {
        $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
        $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
        $defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
        $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // Admin settings
    $form['admin_settings'] = array('#type' => 'fieldset', '#title' => t('Admin'), '#description' => t('Control how csa_base\'s admin features behave'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['admin_settings']['csa_base_move_sidebar'] = array('#type' => 'checkbox', '#title' => t('Append second sidebar to first when displaying admin pages'), '#default_value' => $settings['csa_base_move_sidebar']);
    $form['admin_settings']['breadcrumb_display_admin'] = array('#type' => 'checkbox', '#title' => t('Always show breadcrumb on admin pages'), '#default_value' => $settings['breadcrumb_display_admin'], '#description' => t('This overwrites the general breadcrumb setting for all admin pages'));
    // General Settings
    $form['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Primary Links
    $form['general_settings']['primary_links'] = array('#type' => 'fieldset', '#title' => t('Primary links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['primary_links']['primary_links_display_style'] = array('#type' => 'radios', '#title' => t('How should your Primary links be displayed?'), '#default_value' => $settings['primary_links_display_style'], '#options' => array('menu' => t('As a custom menu defined in style.css'), 'superfish sf-horizontal' => t('Superfish: horizontal menu with dropdowns'), 'superfish sf-vertical' => t('Superfish: vertical menu (for sidebar blocks)'), 'tabbed-menu' => t('Tabs: render menu as tabs')));
    $form['general_settings']['primary_links']['primary_links_allow_tree'] = array('#type' => 'checkbox', '#title' => t('Allow nested menu tree for Primary links (required for both Superfish and Tabs)'), '#default_value' => $settings['primary_links_allow_tree']);
    // Secondary Links
    $form['general_settings']['secondary_links'] = array('#type' => 'fieldset', '#title' => t('Secondary links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['secondary_links']['secondary_links_display_style'] = array('#type' => 'radios', '#title' => t('How should your Secondary links be displayed?'), '#default_value' => $settings['secondary_links_display_style'], '#options' => array('menu' => t('As a custom menu defined in style.css'), 'superfish sf-horizontal' => t('Superfish: horizontal menu with dropdowns'), 'superfish sf-vertical' => t('Superfish: vertical menu (for sidebar blocks)'), 'tabbed-menu' => t('Tabs: render menu as tabs')));
    $form['general_settings']['secondary_links']['secondary_links_allow_tree'] = array('#type' => 'checkbox', '#title' => t('Allow nested menu tree for Secondary links (required for both Superfish and Tabs)'), '#default_value' => $settings['secondary_links_allow_tree']);
    // Mission Statement
    $form['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // Breadcrumb
    $form['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    $form['general_settings']['breadcrumb']['breadcrumb_with_title'] = array('#type' => 'checkbox', '#title' => t('Display page title in the breadcrumb'), '#default_value' => $settings['breadcrumb_with_title']);
    // Search Settings
    $form['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
    $form['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
    $form['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
    $form['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
    $form['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
    $form['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    // Node Settings
    $form['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Author & Date Settings
    $form['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
        $form['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your <a href="@date-time-url">Date and Time</a> settings page)', array('@date-time-url' => url('admin/settings/date-time'))), '#default_value' => $settings["submitted_by_date_{$type}"]);
        // Options for default settings
        if ($type == 'default') {
            $form['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
            $form['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
            $form['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
        } else {
            if ($settings['submitted_by_enable_content_type'] == 0) {
                $form['submitted_by'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_type_specific']['display_taxonomy_container']['display'] = array('#type' => 'fieldset', '#title' => t('Display'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_type_specific']['display_taxonomy_container']['display']['taxonomy_format_delimiter'] = array('#type' => 'textfield', '#title' => t('Delimter'), '#size' => 60, '#default_value' => $settings['taxonomy_format_delimiter'], '#description' => t('Enter a custom delimiter for taxonomy terms'));
        $form['node_type_specific']['display_taxonomy_container']['display']["taxonomy_format_links"] = array('#type' => 'checkbox', '#title' => t('Display taxonomy terms in a links list (omitting delimiters)'), '#default_value' => $settings["taxonomy_format_links"]);
        $form['node_type_specific']['display_taxonomy_container']['display']["taxonomy_display_vocab_name"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary names'), '#default_value' => $settings["taxonomy_display_vocab_name"]);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms on a single line')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // SEO settings
    $form['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    $form['seo']['hide_front_page_title'] = array('#type' => 'checkbox', '#title' => t('Hide the title and author information on the frontpage?'), '#default_value' => $settings['hide_front_page_title']);
    // Page titles
    $form['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // front page title
    $form['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
    $form['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
    // other pages title
    $form['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
    $form['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
    // Return theme settings form
    return $form;
}
Exemple #16
0
function boron_print_text($node, $vid = NULL)
{
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($vocabularies as $vocabulary) {
        if ($vocabularies) {
            $terms = taxonomy_node_get_terms_by_vocabulary($node, $vocabulary->vid);
            if ($terms) {
                $links = array();
                foreach ($terms as $term) {
                    $links[] = $term->name;
                }
                $output .= implode(', ', $links);
            }
        }
    }
    return $output;
}
function bootstrap_theme_get_taxonomy_vocabularies()
{
    $vocabulary = taxonomy_get_vocabularies();
    return $vocabulary;
}
Exemple #18
0
 /**
  * {@inheritdoc}
  */
 public function termCreate(\stdClass $term)
 {
     // Map vocabulary names to vid, these take precedence over machine names.
     if (!isset($term->vid)) {
         $vocabularies = \taxonomy_get_vocabularies();
         foreach ($vocabularies as $vid => $vocabulary) {
             if ($vocabulary->name == $term->vocabulary_machine_name) {
                 $term->vid = $vocabulary->vid;
             }
         }
     }
     if (!isset($term->vid)) {
         // Try to load vocabulary by machine name.
         $vocabularies = \taxonomy_vocabulary_load_multiple(FALSE, array('machine_name' => $term->vocabulary_machine_name));
         if (!empty($vocabularies)) {
             $vids = array_keys($vocabularies);
             $term->vid = reset($vids);
         }
     }
     // If `parent` is set, look up a term in this vocab with that name.
     if (isset($term->parent)) {
         $parent = \taxonomy_get_term_by_name($term->parent, $term->vocabulary_machine_name);
         if (!empty($parent)) {
             $parent = reset($parent);
             $term->parent = $parent->tid;
         }
     }
     if (empty($term->vid)) {
         throw new \Exception(sprintf('No "%s" vocabulary found.'));
     }
     // Attempt to decipher any fields that may be specified.
     $this->expandEntityFields('taxonomy_term', $term);
     \taxonomy_term_save($term);
     return $term;
 }
<?php

module_load_include('inc', 'archimedes_drupal_site', 'archimedes_drupal_site.update');
$vocab = taxonomy_get_vocabularies($type = NULL);
$recommended = array();
foreach ($vocab as $v) {
    if ($v->name == 'Drupal Major Version') {
        $vid = $v->vid;
    }
}
if ($vid) {
    $proj = $row->node_data_field_dru_proj_field_dru_proj_value;
    $terms = taxonomy_get_tree($vid);
    foreach ($terms as $version) {
        if ($data = cache_get($proj . $version->name, 'cache_archimedes_drupal')) {
            $recom = $data->data['recommended_major'];
            foreach ($data->data['releases'] as $release) {
                if ($release['version_major'] == $recom) {
                    $recommended[] = $release['version'];
                    break;
                }
            }
        }
    }
}
if (!empty($recommended)) {
    $output = implode(', ', $recommended);
} else {
    $output = t('Could not accurately determine module version status.');
}
print $output;
function lms_clean_up_subject_structure($subject_type_name, $subject_display_name) {

  // 1. Clean up contnet types
  $course_type_machine_name = $subject_type_name. COURSE_SUBFIX; // machine name of course content type for the subject
  node_type_delete($course_type_machine_name);
  print "<h2>Content Type [$course_type_machine_name] has been deleted</h1>";

  $capability_type_machine_name = $subject_type_name. CAPABILITY_SUBFIX; // machine name of course content type for the subject
  node_type_delete($capability_type_machine_name);
  print "<h2>Content Type [capability_type_machine_name] has been deleted</h1>";

  $task_type_machine_name = $subject_type_name. TASK_SUBFIX; // machine name of course content type for the subject
  node_type_delete($task_type_machine_name);
  print "<h2>Content Type [$task_type_machine_name] has been deleted</h1>";

  // 2. clean up vocabulary
  $course_vocab_display_name = $subject_display_name . t(' course vocabulary'); //dsiplayname of course content type
  $capability_vocab_display_name = $subject_display_name . t(' capability vocabulary'); //dsiplayname of course content type
  $task_vocab_display_name = $subject_display_name . t(' task vocabulary'); //dsiplayname of course content type

  $vocabs = taxonomy_get_vocabularies();

  foreach ($vocabs as $vid => $vocab){
    if ($vocab->name == $course_vocab_display_name || $vocab->name == $capability_vocab_display_name || $vocab->name == $task_vocab_display_name) {
      taxonomy_del_vocabulary($vid);
      print "<h2>Vocabulary [$vocab->name] has been deleted</h1>";
    }
  }

}
Exemple #21
0
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function zeropoint_settings($saved_settings)
{
    global $base_url;
    // Retrieve & combine default and saved theme settings
    $defaults = zeropoint_default_theme_settings();
    $settings = array_merge($defaults, $saved_settings);
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('Zero Point settings'), '#description' => t('Use these settings to change what and how information is displayed in your theme.'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Layout Settings
    $form['tnt_container']['layout_settings'] = array('#type' => 'fieldset', '#title' => t('Layout settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => 'layout_settings'));
    $form['tnt_container']['layout_settings']['style'] = array('#type' => 'select', '#title' => t('Style'), '#default_value' => $settings['style'], '#options' => array('grey' => t('0 Point'), 'sky' => t('Sky'), 'nature' => t('Nature'), 'ivy' => t('Ivy'), 'ink' => t('Ink'), 'orange' => t('Orange'), 'sangue' => t('Sangue'), 'lime' => t('Lime'), 'themer' => t('- Themer -')));
    $form['tnt_container']['layout_settings']['layout-width'] = array('#type' => 'select', '#title' => t('Layout width'), '#default_value' => $settings['layout-width'], '#description' => t('<em>Fluid width</em> and <em>Fixed width</em> can be customized in _custom/custom-style.css.'), '#options' => array(0 => 'Adaptive width', 1 => 'Fluid width (custom)', 2 => 'Fixed width (custom)'));
    $form['tnt_container']['layout_settings']['sidebarslayout'] = array('#type' => 'select', '#title' => t('Sidebars layout'), '#default_value' => $settings['sidebarslayout'], '#description' => t('<b>Variable width sidebars (wide)</b>: If only one sidebar is enabled, content width is 250px for left sidebar and 300px for right sidebar. If both sidebars are enabled, content width is 160px for left sidebar and 234px for right sidebar. <br /> <b>Fixed width sidebars (wide)</b>: Content width is 160px for left sidebar and 234px for right sidebar. <br /> <em>Equal width sidebars</em> ca be customized in _custom/custom-style.css. For other details, please refer to readme.txt.'), '#options' => array(0 => 'Variable asyimmetrical sidebars (wide)', 1 => 'Fixed asyimmetrical sidebars (wide)', 2 => 'Variable asyimmetrical sidebars (narrow)', 3 => 'Fixed asyimmetrical sidebars (narrow)', 4 => 'Equal width sidebars (custom)'));
    $form['tnt_container']['layout_settings']['themedblocks'] = array('#type' => 'select', '#title' => t('Themed blocks'), '#default_value' => $settings['themedblocks'], '#options' => array(0 => 'Sidebars only', 1 => 'Sidebars + User regions'));
    $form['tnt_container']['layout_settings']['blockicons'] = array('#type' => 'select', '#title' => t('Block icons'), '#default_value' => $settings['blockicons'], '#options' => array(0 => 'No', 1 => 'Yes (32x32 pixels)', 2 => 'Yes (48x48 pixels)'));
    $form['tnt_container']['layout_settings']['pageicons'] = array('#type' => 'checkbox', '#title' => t('Page icons'), '#default_value' => $settings['pageicons']);
    $form['tnt_container']['layout_settings']['menutype'] = array('#type' => 'select', '#title' => t('Menu type'), '#default_value' => $settings['menutype'], '#description' => t('Choose "Drop Down" to enable support for Suckerfish drop down menus. <br /> NOTE: Go to <b><a href="/admin/build/menu">admin/build/menu</a></b> and expand all parents in primary menu.'), '#options' => array(0 => 'Static Menu', 1 => 'Drop Down Menu'));
    $form['tnt_container']['layout_settings']['navpos'] = array('#type' => 'select', '#title' => t('Menu position'), '#default_value' => $settings['navpos'], '#description' => t('NOTE: Only the static menu can be properly centered. <br /> NOTE for RTL sites: IE6 will accept only left positioned Drop-Down menu.'), '#options' => array(0 => 'Left', 1 => 'Center', 2 => 'Right'));
    $form['tnt_container']['layout_settings']['roundcorners'] = array('#type' => 'checkbox', '#title' => t('Rounded corners'), '#description' => t('Some page elements (mission, comments, search, blocks) and primary menu will have rounded corners in all browsers but IE. <br /> NOTE: With this option enabled 0 Point will not validate CSS2.'), '#default_value' => $settings['roundcorners']);
    $form['tnt_container']['layout_settings']['headerimg'] = array('#type' => 'checkbox', '#title' => t('Header image rotator'), '#description' => t('Rotates images in the _custom/headerimg folder.'), '#default_value' => $settings['headerimg']);
    $form['tnt_container']['layout_settings']['cssPreload'] = array('#type' => 'checkbox', '#title' => t('jQuery CSS image preload'), '#description' => t('Automatically Preload images from CSS.'), '#default_value' => $settings['cssPreload']);
    $form['tnt_container']['layout_settings']['loginlinks'] = array('#type' => 'checkbox', '#title' => t('0 Point login/register links'), '#default_value' => $settings['loginlinks']);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => 'general_settings'));
    // Mission Statement
    $form['tnt_container']['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should your mission statement be displayed?'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display mission statement only on front page'), 'all' => t('Display mission statement on all pages')));
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    if (module_exists('search')) {
        $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    }
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => 'node_settings'));
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    if (module_exists('submitted_by') == FALSE) {
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
            } else {
                if ($settings['submitted_by_enable_content_type'] == 0) {
                    $form['submitted_by'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    } else {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['#description'] = 'NOTICE: You currently have the "Submitted By" module installed and enabled, so the Author & Date theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Author & Date theme settings, you must first disable the "Submitted By" module.';
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_hide_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Hide vocabulary: @vocabulary', array('@vocabulary' => $vocab_name)), '#default_value' => $settings["taxonomy_vocab_hide_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page. [NOTE: For more advanced page title functionality, consider using the "Page Title" module.  However, the Page titles theme settings do not work in combination with the "Page Title" module and will be disabled if you have it enabled.]'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('page_title') == FALSE) {
        // front page title
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
        // other pages title
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
        // SEO configurable separator
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    } else {
        $form['tnt_container']['seo']['page_format_titles']['#description'] = 'NOTICE: You currently have the "Page Title" module installed and enabled, so the Page titles theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Page titles theme settings, you must first disable the "Page Title" module.';
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator']['#disabled'] = 'disabled';
    }
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags are not used as much by search engines anymore, but the meta description is important: it will be shown as the description of your link in search engine results. [NOTE: For more advanced meta tag functionality, consider using the "Meta Tags (or nodewords)" module.  However, the Meta tags theme settings do not work in combination with the "Meta Tags" module and will be disabled if you have it enabled.]'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "Meta Tags (or nodewords)" module installed and enabled, so the Meta tags theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Meta tags theme settings, you must first disable the "Meta Tags" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Development settings
    $form['tnt_container']['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE);
    $form['tnt_container']['themedev']['siteid'] = array('#type' => 'textfield', '#title' => t('Site ID bodyclass.'), '#description' => t('In order to have different styles of 0 Point in a multisite environment you may find usefull to choose a "one word" site ID and customize the look of each site in custom-style.css file.'), '#default_value' => $settings['siteid'], '#size' => 10);
    $form['tnt_container']['themedev']['fix_css_limit'] = array('#type' => 'checkbox', '#title' => t('Fix IE stylesheet limit.'), '#default_value' => $settings['fix_css_limit'], '#description' => t('This setting groups css files so Internet Explorer can see more than 30 of them. This is useful when you cannot use aggregation (e.g., when developing or using private file downloads), especially for RTL sites. But because it degrades performance and can load files out of order, CSS aggregation (<a href="!link">Optimize CSS files</a>) is <b>strongly</b> recommended instead for any production website.', array('!link' => $base_url . '/admin/settings/performance')));
    $form['tnt_container']['themedev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('During theme development, it can be very useful to continuously rebuild the theme registry. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')));
    // Return theme settings form
    return $form;
}
/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings 
 *   An array of saved settings for this theme.
 * @param $subtheme_defaults
 *   Allows a subtheme to override the default values.
 * @return
 *   An array of form. 
 */
function cms_base_settings($saved_settings, $subtheme_defaults = array())
{
    $defaults = cms_base_default_settings('cms_base');
    // Allows a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Merges the saved variables and their default values.
    $settings = array_merge($defaults, $saved_settings);
    // Creates the form for theme settings page.
    $form = array();
    // Extra variable settings for this theme
    // layout settings
    $form['layout'] = array('#type' => 'fieldset', '#title' => t('Layout settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['layout']['sidebar_left_width'] = array('#type' => 'textfield', '#title' => t('Left sidebar width'), '#size' => 10, '#default_value' => $settings['sidebar_left_width'], '#field_suffix' => t('px'));
    $form['layout']['width_sidebar_right'] = array('#type' => 'textfield', '#title' => t('Right sidebar width'), '#size' => 10, '#default_value' => $settings['width_sidebar_right'], '#field_suffix' => t('px'));
    $form['layout']['width_sidebar_right2'] = array('#type' => 'textfield', '#title' => t('Right sidebar 2 width'), '#size' => 10, '#default_value' => $settings['width_sidebar_right2'], '#field_suffix' => t('px'), '#description' => l(t('View instructions for using the sidebar settings'), 'http://www.cmsquickstart.com/drupal-theme-guides/sidebar-settings', array('attributes' => array('target' => "_blank"), 'absolute' => TRUE)));
    $form['layout']['show_tooltip'] = array('#type' => 'checkbox', '#title' => t('Check to show tool tip when hovering over the primary links menu.'), '#default_value' => $settings['show_tooltip'], '#weight' => 11);
    //font settings
    $form['font_settings'] = array('#type' => 'fieldset', '#title' => t('Font settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t(''));
    $form['font_settings']['use_css_for_fonts'] = array('#type' => 'checkbox', '#title' => t('Use CSS for fonts'), '#default_value' => $settings['use_css_for_fonts']);
    $form['font_settings']['body_text'] = array('#type' => 'fieldset', '#title' => t('Body text font'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('Font used for the body text of content types, comments, and blocks.'));
    $form['font_settings']['body_text']['body_text_font'] = array('#type' => 'select', '#title' => t('Font family'), '#default_value' => $settings['body_text_font'], '#options' => array("Georgia, 'Times New Roman', Times, serif" => t("Georgia, 'Times New Roman', Times, serif"), "'Times New Roman', Times, Georgia, serif" => t("'Times New Roman', Times, Georgia, serif"), "Verdana, Arial, Helvetica, sans-serif" => t("Verdana, Arial, Helvetica, sans-serif"), "Helvetica, Arial, Verdana, sans-serif" => t("Helvetica, Arial, Verdana, sans-serif'"), "Tahoma, Verdana, Arial, sans-serif" => t("Tahoma, Verdana, Arial, sans-serif"), 'Custom' => t('Custom (specify below)')), '#description' => t("Default font family -  Georgia, 'Times New Roman', Times, serif"));
    $form['font_settings']['body_text']['body_text_font_custom'] = array('#type' => 'textfield', '#title' => t('Custom font-family setting'), '#default_value' => $settings['body_text_font_custom'], '#size' => 40, '#maxlength' => 200, '#description' => t("Enter fonts in order of priority separated by commas. If the user's computer does not have the font it will use the next font listed in order of priority. For example: Verdana, Arial, 'Times New Roman' - in this example if the user does not have Verdana then their computer will look for Arial and then for Times Roman.<br /><b>Note:</b> Put ' before and after any fonts that have a space such as 'Times New Roman'."));
    $form['font_settings']['headings_text_font'] = array('#type' => 'fieldset', '#title' => t('Headings text font'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('Font used for h1-h6 headings, navigation links, site name and slogan.'));
    $form['font_settings']['headings_text_font']['heading_text_font'] = array('#type' => 'select', '#title' => t('Font family'), '#default_value' => $settings['heading_text_font'], '#options' => array("Georgia, 'Times New Roman', Times, serif" => t("Georgia, 'Times New Roman', Times, serif"), "'Times New Roman', Times, Georgia, serif" => t("'Times New Roman', Times, Georgia, serif"), "Verdana, Arial, Helvetica, sans-serif" => t("Verdana, Arial, Helvetica, sans-serif"), "Helvetica, Arial, Verdana, sans-serif" => t("Helvetica, Arial, Verdana, sans-serif'"), "Tahoma, Verdana, Arial, sans-serif" => t("Tahoma, Verdana, Arial, sans-serif"), 'Custom' => t('Custom (specify below)')), '#description' => t("Default font family -  Georgia, 'Times New Roman', Times"));
    $form['font_settings']['headings_text_font']['heading_text_font_custom'] = array('#type' => 'textfield', '#title' => t('Custom font-family setting'), '#default_value' => $settings['heading_text_font_custom'], '#size' => 40, '#maxlength' => 200, '#description' => t("Enter fonts in order of priority separated by commas. If the user's computer does not have the font it will use the next font listed in order of priority. For example: Verdana, Arial, 'Times New Roman' - in this example if the user does not have Verdana then their computer will look for Arial and then for Times Roman.<br /><b>Note:</b> Put ' before and after any fonts that have a space such as 'Times New Roman'."));
    // Search Settings
    if (module_exists('search')) {
        $form['search_settings'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('Select additional information you would like to be displayed with search results.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['search_settings']['search_author_name'] = array('#type' => 'checkbox', '#title' => t('Author name'), '#default_value' => $settings['search_author_name']);
        $form['search_settings']['search_posted_date'] = array('#type' => 'checkbox', '#title' => t('Node posted date'), '#default_value' => $settings['search_posted_date']);
        $form['search_settings']['search_text_snippet'] = array('#type' => 'checkbox', '#title' => t('Text snippet'), '#default_value' => $settings['search_text_snippet']);
        $form['search_settings']['search_node_type'] = array('#type' => 'checkbox', '#title' => t('Content type name'), '#default_value' => $settings['search_node_type']);
        $form['search_settings']['search_node_comments'] = array('#type' => 'checkbox', '#title' => t('Comment count'), '#default_value' => $settings['search_node_comments']);
        $form['search_settings']['search_attachment_count'] = array('#type' => 'checkbox', '#title' => t('Number of attachments'), '#default_value' => $settings['search_attachment_count']);
    }
    // Node Settings
    $form['node_specific_settings'] = array('#type' => 'fieldset', '#title' => t('Node display settings'), '#description' => t("Options for displaying or hiding post information for your site's content. For example you may wish to show the author and date for Blog posts and hide these options for info pages."), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'node_settings'));
    // Author & Date Settings
    $form['node_specific_settings']['post_info_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    if (!module_exists('submitted_by')) {
        foreach (array_merge(array('default' => 'Default'), node_get_types('names')) as $type => $name) {
            $form['node_specific_settings']['post_info_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            $form['node_specific_settings']['post_info_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
            $form['node_specific_settings']['post_info_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted'), '#default_value' => $settings["submitted_by_date_{$type}"]);
            // Options for default settings
            if ($type == 'default') {
                $form['node_specific_settings']['post_info_container']['submitted_by']['default']['#title'] = t('Default');
                $form['node_specific_settings']['post_info_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_content_type'] ? TRUE : FALSE;
                $form['node_specific_settings']['post_info_container']['submitted_by']['submitted_by_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_content_type']);
            } else {
                if ($settings['submitted_by_content_type'] == 0) {
                    $form['submitted_by'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    } else {
        $form['node_specific_settings']['post_info_container']['#description'] = 'NOTICE: You currently have the "Submitted By" module installed and enabled, so the Author & Date theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Author & Date theme settings, you must first disable the "Submitted By" module.';
    }
    // Read More & Comment Link Settings
    $form['node_specific_settings']['link_settings_container'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Define custom text for node links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Read more link settings
    $form['node_specific_settings']['link_settings_container']['readmore'] = array('#type' => 'fieldset', '#title' => t('Read more link'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array_merge(array('default' => 'Default'), node_get_types('names')) as $type => $name) {
        // Read more
        $form['node_specific_settings']['link_settings_container']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['node_specific_settings']['link_settings_container']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['node_specific_settings']['link_settings_container']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['node_specific_settings']['link_settings_container']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['node_specific_settings']['link_settings_container']['readmore']['default']['#title'] = t('Default');
            $form['node_specific_settings']['link_settings_container']['readmore']['default']['#collapsed'] = $settings['readmore_content_type'] ? TRUE : FALSE;
            $form['node_specific_settings']['link_settings_container']['readmore']['readmore_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_content_type']);
        } else {
            if ($settings['readmore_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['node_specific_settings']['link_settings_container']['comment'] = array('#type' => 'fieldset', '#title' => t('Comment links setting'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array_merge(array('default' => 'Default'), node_get_types('names')) as $type => $name) {
        $form['node_specific_settings']['link_settings_container']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('Full node view settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['node']['add']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['node']['add']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('Teasers view settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['add']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['add']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('"Comments" link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['standard']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['standard']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('"New comments" link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['new']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['node_specific_settings']['link_settings_container']['comment'][$type]['teaser']['new']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['node_specific_settings']['link_settings_container']['comment']['default']['#title'] = t('Default');
            $form['node_specific_settings']['link_settings_container']['comment']['default']['#collapsed'] = $settings['comment_content_type'] ? TRUE : FALSE;
            $form['node_specific_settings']['link_settings_container']['comment']['comment_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_content_type']);
        } else {
            if ($settings['comment_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['node_specific_settings']['taxonomy_settings_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array_merge(array('default' => 'Default'), node_get_types('names')) as $type => $name) {
            // taxonomy display per node
            $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Gets taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Displays taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy'][$type]["taxonomy_vocab_hide_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Hide vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_hide_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['node_specific_settings']['taxonomy_settings_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Username display settings
    $form['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Block editing settings
    $form['block_settings'] = array('#type' => 'fieldset', '#title' => t('Block editing settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['block_settings']['block_editing_link'] = array('#type' => 'checkbox', '#title' => t('Show block editing links on hover'), '#description' => t('When hovering over a block, privileged users will see block editing links.'), '#default_value' => $settings['block_editing_link']);
    // Breadcrumb display settings
    $form['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['breadcrumb']['breadcrumb'] = array('#type' => 'radios', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb'], '#options' => array('yes' => t('Yes'), 'no' => t('No'), 'admin' => t('Only in admin section')));
    $form['breadcrumb']['breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Don’t forget to include spaces.'), '#default_value' => $settings['breadcrumb_separator'], '#size' => 5, '#maxlength' => 10);
    $form['breadcrumb']['breadcrumb_home_link'] = array('#type' => 'checkbox', '#title' => t('Show home page link in breadcrumb'), '#default_value' => $settings['breadcrumb_home_link']);
    $form['breadcrumb']['breadcrumb_trailing_separator'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_trailing_separator'], '#description' => t('Useful when the breadcrumb is placed just before the title.'));
    $form['breadcrumb']['breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_title'], '#description' => t('Useful when the breadcrumb is not placed just before the title.'));
    // Development phase settings
    $form['theme_development'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['theme_development']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')), '#prefix' => '<strong>' . t('Theme registry:') . '</strong>');
    return $form;
}
/**
 * Defines configuration options for your access scheme.
 *
 * This function is fun, because it uses Drupal 7's new JavaScript
 * $states properties to control the settings form.
 *
 * Your module is responsible for defining how it interacts with the
 * main form. If the 'workbench_access' value is equal to the name
 * of your access scheme, your options will be presented.
 *
 * Essentially, this is a custom hook_form_FORM_ID_alter() convenience
 * function.
 *
 * Note that your form should normally return checkboxes within a fieldset.
 * Do not make the checkboxes required, as this may be confusing if they are
 * in the 'hidden' state.
 *
 * @see drupal_process_states()
 *
 * @param &$form
 *   The base form, passed by reference.
 * @param &$form_state
 *   The form state, passed by reference.
 *
 * @return
 *   No return value. Modify $form by reference.
 */
function hook_workbench_access_configuration(&$form, &$form_state)
{
    $options = array();
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($vocabularies as $vid => $vocabulary) {
        $options[$vocabulary->machine_name] = $vocabulary->name;
    }
    $form['taxonomy_workbench_access_info'] = array('#type' => 'fieldset', '#title' => t('Taxonomy scheme settings'), '#states' => array('visible' => array(':input[name=workbench_access]' => array('value' => 'taxonomy'))));
    $form['taxonomy_workbench_access_info']['workbench_access_taxonomy'] = array('#type' => 'checkboxes', '#title' => t('Editorial vocabulary'), '#description' => t('Select the vocabulary to be used for access control. <strong>Warning: Changing this value in production may disrupt your workflow.</strong>'), '#options' => $options, '#default_value' => variable_get('workbench_access_taxonomy', array()), '#states' => array('visible' => array(':input[name=workbench_access]' => array('value' => 'taxonomy'))));
}
Exemple #24
0
/**
 * Override or insert variables into the node templates.
 *
 * @param $vars
 *   An array of variables to pass to the theme template.
 */
function cmssimplicity_preprocess_node(&$vars)
{
    if ($vars['picture']) {
        $classes = explode(' ', $vars['classes']);
        $classes[] = 'user-picture';
        $vars['classes'] = implode(' ', $classes);
    }
    $node = $vars['node'];
    // override the subbmitted text according to requirment
    $author = "posted by ";
    $author .= theme('username', $node);
    $posted_date = date('F d, Y ', $node->created);
    $submitted = '';
    $submitted_by_content_type = theme_get_setting('submitted_by_content_type') == 1 ? $node->type : 'default';
    $author_setting = theme_get_setting('submitted_by_author_' . $submitted_by_content_type) == 1;
    $date_setting = theme_get_setting('submitted_by_date_' . $submitted_by_content_type) == 1;
    if ($author_setting) {
        $submitted = $author . ' ';
    }
    if ($date_setting) {
        $submitted .= $posted_date;
    }
    $vars['submitted'] = $submitted;
    //Formating taxonomy term list according to theme's requirement
    $taxonomy_content_type = theme_get_setting('taxonomy_enable_content_type') == 1 ? $vars['node']->type : 'default';
    $taxonomy_display = theme_get_setting('taxonomy_display_' . $taxonomy_content_type);
    $taxonomy_format = theme_get_setting('taxonomy_format_' . $taxonomy_content_type);
    if ($taxonomy_display == 'all' || $taxonomy_display == 'only' && $vars['page']) {
        $vocabularies = taxonomy_get_vocabularies($vars['node']->type);
        $vars['terms'] = '';
        $term_delimiter = '&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;';
        foreach ($vocabularies as $vocabulary) {
            if (theme_get_setting('taxonomy_vocab_hide_' . $taxonomy_content_type . '_' . $vocabulary->vid) != 1) {
                $terms = taxonomy_node_get_terms_by_vocabulary($vars['node'], $vocabulary->vid);
                if ($terms) {
                    $term_items = '';
                    foreach ($terms as $term) {
                        // Build vocabulary term items
                        $term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
                        $term_items .= $term_delimiter . $term_link;
                    }
                    if ($taxonomy_format == 'vocab') {
                        // Add vocabulary labels if separate
                        $vars['terms'] .= '<span class="vocab-name">' . $vocabulary->name . ':</span>';
                        $vars['terms'] .= $term_items;
                    } else {
                        $vars['terms'] .= $term_items;
                    }
                }
            }
        }
        if ($vars['terms'] != '') {
            $vars['terms'] = $vars['terms'];
        }
    }
}
Exemple #25
0
 /**
  * {@inheritDoc}
  */
 public function termCreate(\stdClass $term)
 {
     // Map vocabulary names to vid, these take precedence over machine names.
     if (!isset($term->vid)) {
         $vocabularies = \taxonomy_get_vocabularies();
         foreach ($vocabularies as $vid => $vocabulary) {
             if ($vocabulary->name == $term->vocabulary_machine_name) {
                 $term->vid = $vocabulary->vid;
             }
         }
     }
     if (!isset($term->vid)) {
         // Try to load vocabulary by machine name.
         $vocabularies = \taxonomy_vocabulary_load_multiple(FALSE, array('machine_name' => $term->vocabulary_machine_name));
         if (!empty($vocabularies)) {
             $vids = array_keys($vocabularies);
             $term->vid = reset($vids);
         }
     }
     // If `parent` is set, look up a term in this vocab with that name.
     if (isset($term->parent)) {
         $parent = \taxonomy_get_term_by_name($term->parent, $term->vocabulary_machine_name);
         if (!empty($parent)) {
             $parent = reset($parent);
             $term->parent = $parent->tid;
         }
     }
     if (empty($term->vid)) {
         throw new \Exception(sprintf('No "%s" vocabulary found.'));
     }
     \taxonomy_term_save($term);
     // Loading a term by name returns an array of term objects, but there should
     // only be one matching term in a testing context, so take the first match
     // by reset()'ing $matches.
     $matches = \taxonomy_get_term_by_name($term->name);
     $saved_term = reset($matches);
     return $saved_term;
 }
Exemple #26
0
 /**
  * {@inheritdoc}
  */
 public function termCreate(\stdClass $term)
 {
     // Map vocabulary names to vid, these take precedence over machine names.
     if (!isset($term->vid)) {
         $vocabularies = \taxonomy_get_vocabularies();
         foreach ($vocabularies as $vid => $vocabulary) {
             if ($vocabulary->name == $term->vocabulary_machine_name) {
                 $term->vid = $vocabulary->vid;
             }
         }
     }
     if (!isset($term->vid)) {
         // Try to load vocabulary by machine name.
         $vocabularies = $this->taxonomyVocabularyLoadMultiple(array($term->vid));
         if (!empty($vocabularies)) {
             $vids = array_keys($vocabularies);
             $term->vid = reset($vids);
         }
     }
     // If `parent` is set, look up a term in this vocab with that name.
     if (isset($term->parent)) {
         $parent = \taxonomy_get_term_by_name($term->parent);
         if (!empty($parent)) {
             $parent = reset($parent);
             $term->parent = $parent->tid;
         }
     }
     if (empty($term->vid)) {
         throw new \Exception(sprintf('No "%s" vocabulary found.'));
     }
     // Attempt to decipher any fields that may be specified.
     $this->expandEntityFields('taxonomy_term', $term);
     // Protect against a failure from hook_taxonomy_term_insert() in pathauto.
     $current_path = getcwd();
     chdir(DRUPAL_ROOT);
     $term_array = (array) $term;
     \taxonomy_save_term($term_array);
     chdir($current_path);
     // Loading a term by name returns an array of term objects, but there should
     // only be one matching term in a testing context, so take the first match
     // by reset()'ing $matches.
     $matches = \taxonomy_get_term_by_name($term->name);
     $saved_term = reset($matches);
     return $saved_term;
 }
/**
* Implementation of THEMEHOOK_settings() function.
*
* @param $saved_settings
*   array An array of saved settings for this theme.
* @return
*   array A form array.
*/
function phptemplate_settings($saved_settings)
{
    // Only open one of the general or node setting fieldsets at a time
    $js = <<<SCRIPT
    \$(document).ready(function(){
      \$("fieldset.general_settings > legend > a").click(function(){
      \tif(!\$("fieldset.node_settings").hasClass("collapsed")) {
          Drupal.toggleFieldset(\$("fieldset.node_settings"));
      \t}
      });
      \$("fieldset.node_settings > legend > a").click(function(){
      \tif (!\$("fieldset.general_settings").hasClass("collapsed")) {
          Drupal.toggleFieldset(\$("fieldset.general_settings"));
      \t}
      });
    });
SCRIPT;
    drupal_add_js($js, 'inline');
    // Get the node types
    $node_types = node_get_types('names');
    /**
     * The default values for the theme variables. Make sure $defaults exactly
     * matches the $defaults in the template.php file.
     */
    $defaults = array('user_notverified_display' => 1, 'breadcrumb_display' => 0, 'search_snippet' => 1, 'search_info_type' => 1, 'search_info_user' => 1, 'search_info_date' => 1, 'search_info_comment' => 1, 'search_info_upload' => 1, 'mission_statement_pages' => 'home', 'front_page_title_display' => 'title_slogan', 'page_title_display_custom' => '', 'other_page_title_display' => 'ptitle_slogan', 'other_page_title_display_custom' => '', 'configurable_separator' => ' | ', 'meta_keywords' => '', 'meta_description' => '', 'taxonomy_display_default' => 'only', 'taxonomy_format_default' => 'vocab', 'taxonomy_enable_content_type' => 0, 'submitted_by_author_default' => 1, 'submitted_by_date_default' => 1, 'submitted_by_enable_content_type' => 0, 'readmore_default' => t('Read more'), 'readmore_title_default' => t('Read the rest of this posting.'), 'readmore_prefix_default' => '', 'readmore_suffix_default' => '', 'readmore_enable_content_type' => 0, 'comment_singular_default' => t('1 comment'), 'comment_plural_default' => t('@count comments'), 'comment_title_default' => t('Jump to the first comment of this posting.'), 'comment_prefix_default' => '', 'comment_suffix_default' => '', 'comment_new_singular_default' => t('1 new comment'), 'comment_new_plural_default' => t('@count new comments'), 'comment_new_title_default' => t('Jump to the first new comment of this posting.'), 'comment_new_prefix_default' => '', 'comment_new_suffix_default' => '', 'comment_add_default' => t('Add new comment'), 'comment_add_title_default' => t('Add a new comment to this page.'), 'comment_add_prefix_default' => '', 'comment_add_suffix_default' => '', 'comment_node_default' => t('Add new comment'), 'comment_node_title_default' => t('Share your thoughts and opinions related to this posting.'), 'comment_node_prefix_default' => '', 'comment_node_suffix_default' => '', 'comment_enable_content_type' => 0, 'rebuild_registry' => 0);
    // Make the default content-type settings the same as the default theme settings,
    // so we can tell if content-type-specific settings have been altered.
    $defaults = array_merge($defaults, theme_get_settings());
    // Set the default values for content-type-specific settings
    foreach ($node_types as $type => $name) {
        $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
        $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
        $defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
        $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
        $defaults["readmore_{$type}"] = $defaults['readmore_default'];
        $defaults["readmore_title_{$type}"] = $defaults['readmore_title_default'];
        $defaults["readmore_prefix_{$type}"] = $defaults['readmore_prefix_default'];
        $defaults["readmore_suffix_{$type}"] = $defaults['readmore_suffix_default'];
        $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
        $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
        $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
        $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
        $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
        $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
        $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
        $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
        $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
        $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
        $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
        $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
        $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
        $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
        $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
        $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
        $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
        $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // If content type-specifc settings are not enabled, reset the values
    if ($settings['readmore_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $settings["readmore_{$type}"] = $settings['readmore_default'];
            $settings["readmore_title_{$type}"] = $settings['readmore_title_default'];
            $settings["readmore_prefix_{$type}"] = $settings['readmore_prefix_default'];
            $settings["readmore_suffix_{$type}"] = $settings['readmore_suffix_default'];
        }
    }
    if ($settings['comment_enable_content_type'] == 0) {
        foreach ($node_types as $type => $name) {
            $defaults["comment_singular_{$type}"] = $defaults['comment_singular_default'];
            $defaults["comment_plural_{$type}"] = $defaults['comment_plural_default'];
            $defaults["comment_title_{$type}"] = $defaults['comment_title_default'];
            $defaults["comment_prefix_{$type}"] = $defaults['comment_prefix_default'];
            $defaults["comment_suffix_{$type}"] = $defaults['comment_suffix_default'];
            $defaults["comment_new_singular_{$type}"] = $defaults['comment_new_singular_default'];
            $defaults["comment_new_plural_{$type}"] = $defaults['comment_new_plural_default'];
            $defaults["comment_new_title_{$type}"] = $defaults['comment_new_title_default'];
            $defaults["comment_new_prefix_{$type}"] = $defaults['comment_new_prefix_default'];
            $defaults["comment_new_suffix_{$type}"] = $defaults['comment_new_suffix_default'];
            $defaults["comment_add_{$type}"] = $defaults['comment_add_default'];
            $defaults["comment_add_title_{$type}"] = $defaults['comment_add_title_default'];
            $defaults["comment_add_prefix_{$type}"] = $defaults['comment_add_prefix_default'];
            $defaults["comment_add_suffix_{$type}"] = $defaults['comment_add_suffix_default'];
            $defaults["comment_node_{$type}"] = $defaults['comment_node_default'];
            $defaults["comment_node_title_{$type}"] = $defaults['comment_node_title_default'];
            $defaults["comment_node_prefix_{$type}"] = $defaults['comment_node_prefix_default'];
            $defaults["comment_node_suffix_{$type}"] = $defaults['comment_node_suffix_default'];
        }
    }
    // Create theme settings form widgets using Forms API
    // TNT Fieldset
    $form['tnt_container'] = array('#type' => 'fieldset', '#title' => t('Acquia Slate settings'), '#description' => t('Use these settings to change what and how information is displayed in your theme.'), '#collapsible' => TRUE, '#collapsed' => false);
    // General Settings
    $form['tnt_container']['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array('class' => 'general_settings'));
    // Breadcrumb
    $form['tnt_container']['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'checkbox', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display']);
    // Username
    $form['tnt_container']['general_settings']['username'] = array('#type' => 'fieldset', '#title' => t('Username'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['tnt_container']['general_settings']['username']['user_notverified_display'] = array('#type' => 'checkbox', '#title' => t('Display "not verified" for unregistered usernames'), '#default_value' => $settings['user_notverified_display']);
    // Search Settings
    if (module_exists('search')) {
        $form['tnt_container']['general_settings']['search_container'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed on your search results page?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
        $form['tnt_container']['general_settings']['search_container']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    }
    // Node Settings
    $form['tnt_container']['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Node settings'), '#description' => t('Here you can make adjustments to which information is shown with your content, and how it is displayed.  You can modify these settings so they apply to all content types, or check the "Use content-type specific settings" box to customize them for each content type.  For example, you may want to show the date on stories, but not pages.'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'node_settings'));
    // Author & Date Settings
    $form['tnt_container']['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author & date'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    if (module_exists('submitted_by') == FALSE) {
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
            $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on your Date and Time settings page)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['submitted_by_enable_content_type']);
            } else {
                if ($settings['submitted_by_enable_content_type'] == 0) {
                    $form['submitted_by'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    } else {
        $form['tnt_container']['node_type_specific']['submitted_by_container']['#description'] = 'NOTICE: You currently have the "Submitted By" module installed and enabled, so the Author & Date theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Author & Date theme settings, you must first disable the "Submitted By" module.';
    }
    // Taxonomy Settings
    if (module_exists('taxonomy')) {
        $form['tnt_container']['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy terms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Default & content-type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            // taxonomy display per node
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
            // display
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('' => '', 'never' => t('Never display taxonomy terms'), 'all' => t('Always display taxonomy terms'), 'only' => t('Only display taxonomy terms on full node pages')));
            // format
            $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
            // Get taxonomy vocabularies by node type
            $vocabs = array();
            $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
            foreach ($vocabs_by_type as $key => $value) {
                $vocabs[$value->vid] = $value->name;
            }
            // Display taxonomy checkboxes
            foreach ($vocabs as $key => $vocab_name) {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_hide_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Hide vocabulary: ' . $vocab_name), '#default_value' => $settings["taxonomy_vocab_hide_{$type}_{$key}"]);
            }
            // Options for default settings
            if ($type == 'default') {
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                $form['tnt_container']['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['taxonomy_enable_content_type']);
            } else {
                if ($settings['taxonomy_enable_content_type'] == 0) {
                    $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Read More & Comment Link Settings
    $form['tnt_container']['node_type_specific']['link_settings'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Customize the text of node links'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Read more link settings
    $form['tnt_container']['node_type_specific']['link_settings']['readmore'] = array('#type' => 'fieldset', '#title' => t('"Read more"'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        // Read more
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["readmore_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["readmore_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["readmore_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['readmore'][$type]["readmore_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["readmore_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['default']['#collapsed'] = $settings['readmore_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['readmore']['readmore_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['readmore_enable_content_type']);
        } else {
            if ($settings['readmore_enable_content_type'] == 0) {
                $form['readmore'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // Comments link settings
    $form['tnt_container']['node_type_specific']['link_settings']['comment'] = array('#type' => 'fieldset', '#title' => t('"Comment"'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Default & content-type specific settings
    foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type] = array('#type' => 'fieldset', '#title' => t('!name', array('!name' => t($name))), '#collapsible' => TRUE, '#collapsed' => TRUE);
        // Full nodes
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node'] = array('#type' => 'fieldset', '#title' => t('For full content'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when the full content is being displayed.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_node_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']["comment_node_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_node_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_node_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['node']['add']['extra']["comment_node_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_node_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Teasers
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser'] = array('#type' => 'fieldset', '#title' => t('For teasers'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add'] = array('#type' => 'fieldset', '#title' => t('"Add new comment" link'), '#description' => t('The link when there are no comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text'), '#default_value' => $settings["comment_add_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']["comment_add_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_add_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_add_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['add']['extra']["comment_add_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_add_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard'] = array('#type' => 'fieldset', '#title' => t('"Comments" link'), '#description' => t('The link when there are one or more comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 comment'), '#default_value' => $settings["comment_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple comments'), '#default_value' => $settings["comment_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']["comment_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['standard']['extra']["comment_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new'] = array('#type' => 'fieldset', '#title' => t('"New comments" link'), '#description' => t('The link when there are one or more new comments.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_singular_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there is 1 new comment'), '#default_value' => $settings["comment_new_singular_{$type}"], '#description' => t('HTML is allowed.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_plural_{$type}"] = array('#type' => 'textfield', '#title' => t('Link text when there are multiple new comments'), '#default_value' => $settings["comment_new_plural_{$type}"], '#description' => t('HTML is allowed. @count will be replaced with the number of comments.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']["comment_new_title_{$type}"] = array('#type' => 'textfield', '#title' => t('Title text (tool tip)'), '#default_value' => $settings["comment_new_title_{$type}"], '#description' => t('Displayed when hovering over link. Plain text only.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra'] = array('#type' => 'fieldset', '#title' => t('Advanced'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_prefix_{$type}"] = array('#type' => 'textfield', '#title' => t('Prefix'), '#default_value' => $settings["comment_new_prefix_{$type}"], '#description' => t('Text or HTML placed before the link.'));
        $form['tnt_container']['node_type_specific']['link_settings']['comment'][$type]['teaser']['new']['extra']["comment_new_suffix_{$type}"] = array('#type' => 'textfield', '#title' => t('Suffix'), '#default_value' => $settings["comment_new_suffix_{$type}"], '#description' => t('Text or HTML placed after the link.'));
        // Options for default settings
        if ($type == 'default') {
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#title'] = t('Default');
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['default']['#collapsed'] = $settings['comment_enable_content_type'] ? TRUE : FALSE;
            $form['tnt_container']['node_type_specific']['link_settings']['comment']['comment_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use custom settings for each content type instead of the default above'), '#default_value' => $settings['comment_enable_content_type']);
        } else {
            if ($settings['comment_enable_content_type'] == 0) {
                $form['comment'][$type]['#collapsed'] = TRUE;
            }
        }
    }
    // SEO settings
    $form['tnt_container']['seo'] = array('#type' => 'fieldset', '#title' => t('Search engine optimization (SEO) settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
    // Page titles
    $form['tnt_container']['seo']['page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Page titles'), '#description' => t('This is the title that displays in the title bar of your web browser. Your site title, slogan, and mission can all be set on your Site Information page. [NOTE: For more advanced page title functionality, consider using the "Page Title" module.  However, the Page titles theme settings do not work in combination with the "Page Title" module and will be disabled if you have it enabled.]'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('page_title') == FALSE) {
        // front page title
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Front page title'), '#description' => t('Your front page in particular should have important keywords for your site in the page title'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['front_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of front page title'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['front_page_title_display'], '#options' => array('title_slogan' => t('Site title | Site slogan'), 'slogan_title' => t('Site slogan | Site title'), 'title_mission' => t('Site title | Site mission'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['front_page_format_titles']['page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['page_title_display_custom'], '#description' => t('Enter a custom page title for your front page'));
        // other pages title
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles'] = array('#type' => 'fieldset', '#title' => t('Other page titles'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display'] = array('#type' => 'select', '#title' => t('Set text of other page titles'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#default_value' => $settings['other_page_title_display'], '#options' => array('ptitle_slogan' => t('Page title | Site slogan'), 'ptitle_stitle' => t('Page title | Site title'), 'ptitle_smission' => t('Page title | Site mission'), 'ptitle_custom' => t('Page title | Custom (below)'), 'custom' => t('Custom (below)')));
        $form['tnt_container']['seo']['page_format_titles']['other_page_format_titles']['other_page_title_display_custom'] = array('#type' => 'textfield', '#title' => t('Custom'), '#size' => 60, '#default_value' => $settings['other_page_title_display_custom'], '#description' => t('Enter a custom page title for all other pages'));
        // SEO configurable separator
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator'] = array('#type' => 'textfield', '#title' => t('Title separator'), '#description' => t('Customize the separator character used in the page title'), '#size' => 60, '#default_value' => $settings['configurable_separator']);
    } else {
        $form['tnt_container']['seo']['page_format_titles']['#description'] = 'NOTICE: You currently have the "Page Title" module installed and enabled, so the Page titles theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Page titles theme settings, you must first disable the "Page Title" module.';
        $form['tnt_container']['seo']['page_format_titles']['configurable_separator']['#disabled'] = 'disabled';
    }
    // Metadata
    $form['tnt_container']['seo']['meta'] = array('#type' => 'fieldset', '#title' => t('Meta tags'), '#description' => t('Meta tags are not used as much by search engines anymore, but the meta description is important: it will be shown as the description of your link in search engine results. [NOTE: For more advanced meta tag functionality, consider using the "Meta Tags (or nodewords)" module.  However, the Meta tags theme settings do not work in combination with the "Meta Tags" module and will be disabled if you have it enabled.]'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (module_exists('nodewords') == FALSE) {
        $form['tnt_container']['seo']['meta']['meta_keywords'] = array('#type' => 'textfield', '#title' => t('Meta keywords'), '#description' => t('Enter a comma-separated list of keywords'), '#size' => 60, '#default_value' => $settings['meta_keywords']);
        $form['tnt_container']['seo']['meta']['meta_description'] = array('#type' => 'textarea', '#title' => t('Meta description'), '#cols' => 60, '#rows' => 6, '#default_value' => $settings['meta_description']);
    } else {
        $form['tnt_container']['seo']['meta']['#description'] = 'NOTICE: You currently have the "Meta Tags (or nodewords)" module installed and enabled, so the Meta tags theme settings have been disabled to prevent conflicts.  If you wish to re-enable the Meta tags theme settings, you must first disable the "Meta Tags" module.';
        $form['tnt_container']['seo']['meta']['meta_keywords']['#disabled'] = 'disabled';
        $form['tnt_container']['seo']['meta']['meta_description']['#disabled'] = 'disabled';
    }
    // Development settings
    $form['tnt_container']['themedev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#collapsible' => TRUE, '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE);
    $form['tnt_container']['themedev']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild theme registry on every page.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING: this is a huge performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')));
    // Return theme settings form
    return $form;
}
/**
* Implementation of themehook_settings() function.
* The inspiration for these theme settings comes mainly from three themes - Zen,
* Acquia Marina and Mothership. I have added many other settings and refactored most
* of the original code to suit our purpose. Kudos to those who did it first.
*
* @param $saved_settings
*   An array of saved settings for this theme.
* @return
*   A form array.
*/
function adaptivetheme_settings($saved_settings, $subtheme_defaults = array())
{
    global $theme_info;
    // Get the node types
    $node_types = node_get_types('names');
    // Get the default values from the .info file.
    $defaults = adaptivetheme_theme_get_default_settings('adaptivetheme');
    // Allow a subtheme to override the default values.
    $defaults = array_merge($defaults, $subtheme_defaults);
    // Set the default values for content type specific settings
    foreach ($node_types as $type => $name) {
        $defaults["taxonomy_display_{$type}"] = $defaults['taxonomy_display_default'];
        $defaults["taxonomy_format_{$type}"] = $defaults['taxonomy_format_default'];
        $defaults["taxonomy_delimiter_{$type}"] = $defaults['taxonomy_delimiter_default'];
        $defaults["submitted_by_author_{$type}"] = $defaults['submitted_by_author_default'];
        $defaults["submitted_by_date_{$type}"] = $defaults['submitted_by_date_default'];
        $defaults["display_links_{$type}"] = $defaults['display_links_default'];
    }
    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);
    // Export theme settings
    $exportable_settings = array('skip_navigation_display' => $settings['skip_navigation_display'], 'breadcrumb_display' => $settings['breadcrumb_display'], 'breadcrumb_separator' => $settings['breadcrumb_separator'], 'breadcrumb_home' => $settings['breadcrumb_home'], 'breadcrumb_trailing' => $settings['breadcrumb_trailing'], 'breadcrumb_title' => $settings['breadcrumb_title'], 'display_search_form_label' => $settings['display_search_form_label'], 'search_snippet' => $settings['search_snippet'], 'search_info_type' => $settings['search_info_type'], 'search_info_user' => $settings['search_info_user'], 'search_info_date' => $settings['search_info_date'], 'search_info_comment' => $settings['search_info_comment'], 'search_info_upload' => $settings['search_info_upload'], 'search_info_separator' => $settings['search_info_separator'], 'primary_links_tree' => $settings['primary_links_tree'], 'secondary_links_tree' => $settings['secondary_links_tree'], 'mission_statement_pages' => $settings['mission_statement_pages'], 'taxonomy_settings_enabled' => $settings['taxonomy_settings_enabled'], 'taxonomy_display_default' => $settings['taxonomy_display_default'], 'taxonomy_format_default' => $settings['taxonomy_format_default'], 'taxonomy_delimiter_default' => $settings['taxonomy_delimiter_default'], 'taxonomy_enable_content_type' => $settings['taxonomy_enable_content_type'], 'submitted_by_settings_enabled' => $settings['submitted_by_settings_enabled'], 'submitted_by_author_default' => $settings['submitted_by_author_default'], 'submitted_by_date_default' => $settings['submitted_by_date_default'], 'submitted_by_enable_content_type' => $settings['submitted_by_enable_content_type'], 'display_links_settings_enabled' => $settings['display_links_settings_enabled'], 'display_links_default' => $settings['display_links_default'], 'display_links_enable_content_type' => $settings['display_links_enable_content_type'], 'rebuild_registry' => $settings['rebuild_registry'], 'show_theme_info' => $settings['show_theme_info'], 'cleanup_classes_section' => $settings['cleanup_classes_section'], 'cleanup_classes_front' => $settings['cleanup_classes_front'], 'cleanup_classes_user_status' => $settings['cleanup_classes_user_status'], 'cleanup_classes_normal_path' => $settings['cleanup_classes_normal_path'], 'cleanup_classes_node_type' => $settings['cleanup_classes_node_type'], 'cleanup_classes_add_edit_delete' => $settings['cleanup_classes_add_edit_delete'], 'cleanup_classes_language' => $settings['cleanup_classes_language'], 'cleanup_article_id' => $settings['cleanup_article_id'], 'cleanup_article_classes_promote' => $settings['cleanup_article_classes_promote'], 'cleanup_article_classes_sticky' => $settings['cleanup_article_classes_sticky'], 'cleanup_article_classes_teaser' => $settings['cleanup_article_classes_teaser'], 'cleanup_article_classes_preview' => $settings['cleanup_article_classes_preview'], 'cleanup_article_classes_type' => $settings['cleanup_article_classes_type'], 'cleanup_article_classes_language' => $settings['cleanup_article_classes_language'], 'cleanup_comment_anonymous' => $settings['cleanup_comment_anonymous'], 'cleanup_comment_article_author' => $settings['cleanup_comment_article_author'], 'cleanup_comment_by_viewer' => $settings['cleanup_comment_by_viewer'], 'cleanup_comment_new' => $settings['cleanup_comment_new'], 'cleanup_comment_zebra' => $settings['cleanup_comment_zebra'], 'cleanup_comment_wrapper_type' => $settings['cleanup_comment_wrapper_type'], 'cleanup_block_block_module_delta' => $settings['cleanup_block_block_module_delta'], 'cleanup_block_classes_module' => $settings['cleanup_block_classes_module'], 'cleanup_block_classes_zebra' => $settings['cleanup_block_classes_zebra'], 'cleanup_block_classes_region' => $settings['cleanup_block_classes_region'], 'cleanup_block_classes_count' => $settings['cleanup_block_classes_count'], 'cleanup_menu_menu_class' => $settings['cleanup_menu_menu_class'], 'cleanup_menu_leaf_class' => $settings['cleanup_menu_leaf_class'], 'cleanup_menu_first_last_classes' => $settings['cleanup_menu_first_last_classes'], 'cleanup_menu_active_classes' => $settings['cleanup_menu_active_classes'], 'cleanup_menu_title_class' => $settings['cleanup_menu_title_class'], 'cleanup_links_type_class' => $settings['cleanup_links_type_class'], 'cleanup_links_active_classes' => $settings['cleanup_links_active_classes'], 'cleanup_links_first_last_classes' => $settings['cleanup_links_first_last_classes'], 'cleanup_item_list_zebra' => $settings['cleanup_item_list_zebra'], 'cleanup_item_list_first_last' => $settings['cleanup_item_list_first_last'], 'cleanup_views_css_name' => $settings['cleanup_views_css_name'], 'cleanup_views_view_name' => $settings['cleanup_views_view_name'], 'cleanup_views_display_id' => $settings['cleanup_views_display_id'], 'cleanup_views_dom_id' => $settings['cleanup_views_dom_id'], 'cleanup_views_unformatted' => $settings['cleanup_views_unformatted'], 'cleanup_views_item_list' => $settings['cleanup_views_item_list'], 'cleanup_fields_type' => $settings['cleanup_fields_type'], 'cleanup_fields_name' => $settings['cleanup_fields_name'], 'cleanup_fields_zebra' => $settings['cleanup_fields_zebra'], 'cleanup_headings_title_class' => $settings['cleanup_headings_title_class'], 'cleanup_headings_namespaced_class' => $settings['cleanup_headings_namespaced_class'], 'links_add_span_elements' => $settings['links_add_span_elements'], 'at_user_menu' => $settings['at_user_menu'], 'block_edit_links' => $settings['block_edit_links'], 'at_admin_hide_help' => $settings['at_admin_hide_help'], 'layout_method' => $settings['layout_method'], 'layout_width' => $settings['layout_width'], 'layout_sidebar_first_width' => $settings['layout_sidebar_first_width'], 'layout_sidebar_last_width' => $settings['layout_sidebar_last_width'], 'layout_enable_settings' => $settings['layout_enable_settings'], 'layout_enable_width' => $settings['layout_enable_width'], 'layout_enable_sidebars' => $settings['layout_enable_sidebars'], 'layout_enable_method' => $settings['layout_enable_method'], 'layout_enable_frontpage' => $settings['layout_enable_frontpage'], 'equal_heights_sidebars' => $settings['equal_heights_sidebars'], 'equal_heights_blocks' => $settings['equal_heights_blocks'], 'equal_heights_gpanels' => $settings['equal_heights_gpanels'], 'horizontal_login_block' => $settings['horizontal_login_block'], 'horizontal_login_block_overlabel' => $settings['horizontal_login_block_overlabel'], 'horizontal_login_block_enable' => $settings['horizontal_login_block_enable'], 'color_schemes' => $settings['color_schemes'], 'color_enable_schemes' => $settings['color_enable_schemes']);
    // Output key value pairs formatted as settings
    foreach ($exportable_settings as $key => $value) {
        $value = filter_xss($value);
        $output .= "settings[{$key}]=\"{$value}\"\n";
    }
    $exports = $output;
    // Create the form using Forms API: http://api.drupal.org/api/6
    // General Settings
    $form['general_settings'] = array('#type' => 'fieldset', '#title' => t('General settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Skip Navigation
    $form['general_settings']['skip_navigation'] = array('#type' => 'fieldset', '#title' => t('Skip Navigation'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['skip_navigation']['skip_navigation_display'] = array('#type' => 'radios', '#title' => t('Modify the display of the skip navigation'), '#default_value' => $settings['skip_navigation_display'], '#options' => array('show' => t('Show skip navigation'), 'focus' => t('Show skip navigation when in focus, otherwise is hidden'), 'hide' => t('Hide skip navigation')));
    // Mission Statement
    $form['general_settings']['mission_statement'] = array('#type' => 'fieldset', '#title' => t('Mission statement'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['mission_statement']['mission_statement_pages'] = array('#type' => 'radios', '#title' => t('Where should the mission statement be displayed'), '#default_value' => $settings['mission_statement_pages'], '#options' => array('home' => t('Display the mission statement only on the home page'), 'all' => t('Display the mission statement on all pages')));
    // Breadcrumbs
    $form['general_settings']['breadcrumb'] = array('#type' => 'fieldset', '#title' => t('Breadcrumb'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['breadcrumb']['breadcrumb_display'] = array('#type' => 'select', '#title' => t('Display breadcrumb'), '#default_value' => $settings['breadcrumb_display'], '#options' => array('yes' => t('Yes'), 'no' => t('No'), 'admin' => t('Only in the admin section')));
    $form['general_settings']['breadcrumb']['breadcrumb_separator'] = array('#type' => 'textfield', '#title' => t('Breadcrumb separator'), '#description' => t('Text only. Dont forget to include spaces.'), '#default_value' => $settings['breadcrumb_separator'], '#size' => 8, '#maxlength' => 10, '#prefix' => '<div id="div-breadcrumb-collapse">');
    $form['general_settings']['breadcrumb']['breadcrumb_home'] = array('#type' => 'checkbox', '#title' => t('Show the home page link in breadcrumbs'), '#default_value' => $settings['breadcrumb_home']);
    $form['general_settings']['breadcrumb']['breadcrumb_trailing'] = array('#type' => 'checkbox', '#title' => t('Append a separator to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_trailing'], '#description' => t('Useful when the breadcrumb is placed just before the title.'));
    $form['general_settings']['breadcrumb']['breadcrumb_title'] = array('#type' => 'checkbox', '#title' => t('Append the content title to the end of the breadcrumb'), '#default_value' => $settings['breadcrumb_title'], '#description' => t('Useful when the breadcrumb is not placed just before the title.'), '#suffix' => '</div>');
    // Search Settings
    $form['general_settings']['search'] = array('#type' => 'fieldset', '#title' => t('Search'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Search forms
    $form['general_settings']['search']['search_form'] = array('#type' => 'fieldset', '#title' => t('Search forms'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['search']['search_form']['display_search_form_label'] = array('#type' => 'checkbox', '#title' => t('Display the search form label <em>"Search this site"</em>'), '#default_value' => $settings['display_search_form_label']);
    // Search results
    $form['general_settings']['search']['search_results'] = array('#type' => 'fieldset', '#title' => t('Search results'), '#description' => t('What additional information should be displayed in your search results?'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['general_settings']['search']['search_results']['search_snippet'] = array('#type' => 'checkbox', '#title' => t('Display text snippet'), '#default_value' => $settings['search_snippet']);
    $form['general_settings']['search']['search_results']['search_info_type'] = array('#type' => 'checkbox', '#title' => t('Display content type'), '#default_value' => $settings['search_info_type']);
    $form['general_settings']['search']['search_results']['search_info_user'] = array('#type' => 'checkbox', '#title' => t('Display author name'), '#default_value' => $settings['search_info_user']);
    $form['general_settings']['search']['search_results']['search_info_date'] = array('#type' => 'checkbox', '#title' => t('Display posted date'), '#default_value' => $settings['search_info_date']);
    $form['general_settings']['search']['search_results']['search_info_comment'] = array('#type' => 'checkbox', '#title' => t('Display comment count'), '#default_value' => $settings['search_info_comment']);
    $form['general_settings']['search']['search_results']['search_info_upload'] = array('#type' => 'checkbox', '#title' => t('Display attachment count'), '#default_value' => $settings['search_info_upload']);
    // Search_info_separator
    $form['general_settings']['search']['search_results']['search_info_separator'] = array('#type' => 'textfield', '#title' => t('Search info separator'), '#description' => t('Modify the separator. The default is a hypen with a space before and after.'), '#default_value' => $settings['search_info_separator'], '#size' => 8, '#maxlength' => 10);
    // Primary and Secondary Links Settings
    $form['general_settings']['menu_trees'] = array('#type' => 'fieldset', '#title' => t('Primary and Secondary Links'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('Output Primary and Secondary links as standard Drupal menus (shows levels expanded and with the standard menu classes).'));
    $form['general_settings']['menu_trees']['primary_links_tree'] = array('#type' => 'checkbox', '#title' => 'Modify Primary Links', '#default_value' => $settings['primary_links_tree']);
    $form['general_settings']['menu_trees']['secondary_links_tree'] = array('#type' => 'checkbox', '#title' => 'Modify Secondary Links', '#default_value' => $settings['secondary_links_tree']);
    // Node Settings
    $form['node_type_specific'] = array('#type' => 'fieldset', '#title' => t('Content type settings'), '#description' => t('Use these settings to change the meta information shown with your content.  You can apply these settings to all content types, or check <em>"Use content type specific settings"</em> to customize them for each content type.  For example, you may want to show the date on Stories, but not on other content types.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Author & Date Settings
    $form['node_type_specific']['submitted_by_container'] = array('#type' => 'fieldset', '#title' => t('Author &amp; Date'), '#description' => t('Modify the output of the Author and Date for content types'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['node_type_specific']['submitted_by_container']['submitted_by_settings_enabled'] = array('#type' => 'checkbox', '#title' => t('Enable Author &amp; Date Settings'), '#description' => t('These settings are disabled by default to avoid conflicts with modules, such as the <a href="!link">Submitted By</a> module. If you encounter issues with a module try disabling this setting.', array('!link' => 'http://drupal.org/project/submitted_by')), '#default_value' => $settings['submitted_by_settings_enabled']);
    if ($settings['submitted_by_settings_enabled'] == 1) {
        if (module_exists('submitted_by') == FALSE) {
            // Default & content type specific settings
            foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
                $form['node_type_specific']['submitted_by_container']['submitted_by'][$type] = array('#type' => 'fieldset', '#title' => t('@name', array('@name' => $name)), '#description' => t('These settings allow you to modify the output of the Author and Date information shown on articles. For more options you can install the <a href="!link">Submitted By</a> module.', array('!link' => 'http://drupal.org/project/submitted_by')), '#collapsible' => TRUE, '#collapsed' => TRUE);
                $form['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_author_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display author\'s username'), '#default_value' => $settings["submitted_by_author_{$type}"]);
                $form['node_type_specific']['submitted_by_container']['submitted_by'][$type]["submitted_by_date_{$type}"] = array('#type' => 'checkbox', '#title' => t('Display date posted (you can customize this format on the Date and Time settings page.)'), '#default_value' => $settings["submitted_by_date_{$type}"]);
                // Options for default settings
                if ($type == 'default') {
                    $form['node_type_specific']['submitted_by_container']['submitted_by']['default']['#title'] = t('Default');
                    $form['node_type_specific']['submitted_by_container']['submitted_by']['default']['#collapsed'] = $settings['submitted_by_enable_content_type'] ? TRUE : FALSE;
                    $form['node_type_specific']['submitted_by_container']['submitted_by']['submitted_by_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use content type specific settings.'), '#default_value' => $settings['submitted_by_enable_content_type']);
                } else {
                    if ($settings['submitted_by_enable_content_type'] == 0) {
                        $form['submitted_by'][$type]['#collapsed'] = TRUE;
                    }
                }
            }
        } else {
            $form['node_type_specific']['submitted_by_container']['#description'] = t('NOTICE: You currently have the <a href="!link">Submitted By</a> module installed and enabled - the author and date theme settings have been disabled to prevent conflicts.', array('!link' => 'http://drupal.org/project/submitted_by'));
            $form['node_type_specific']['submitted_by_container']['submitted_by'][$type]['#disabled'] = 'disabled';
        }
    }
    // Taxonomy term display
    if (module_exists('taxonomy')) {
        $form['node_type_specific']['display_taxonomy_container'] = array('#type' => 'fieldset', '#title' => t('Taxonomy Terms'), '#description' => t('Modify the output of the Taxonomy Terms for content types'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['node_type_specific']['display_taxonomy_container']['taxonomy_settings_enabled'] = array('#type' => 'checkbox', '#title' => t('Enable Taxonomy Term Settings'), '#description' => t('These settings are disabled by default to avoid conflicts with modules. If you encounter issues with a module that modifies the display or output of Taxonomy Terms try disabling this setting.'), '#default_value' => $settings['taxonomy_settings_enabled']);
        if ($settings['taxonomy_settings_enabled'] == 1) {
            // Default & content type specific settings
            foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
                // taxonomy display per node
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type] = array('#type' => 'fieldset', '#title' => t('@name', array('@name' => $name)), '#collapsible' => TRUE, '#collapsed' => TRUE);
                // Display
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_display_{$type}"] = array('#type' => 'select', '#title' => t('When should taxonomy terms be displayed?'), '#default_value' => $settings["taxonomy_display_{$type}"], '#options' => array('all' => t('Always display terms'), 'only' => t('Hide terms on teasers'), 'never' => t('Never display terms')));
                // Formatting
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_format_{$type}"] = array('#type' => 'radios', '#title' => t('Taxonomy display format'), '#default_value' => $settings["taxonomy_format_{$type}"], '#options' => array('vocab' => t('Display each vocabulary on a new line'), 'list' => t('Display all taxonomy terms together in single list')));
                // Delimiter
                $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_delimiter_{$type}"] = array('#type' => 'textfield', '#title' => t('Delimiter'), '#description' => t('Modify the delimiter. The default is a comma followed by a space.'), '#default_value' => $settings['taxonomy_delimiter_default'], '#size' => 8, '#maxlength' => 10);
                // Get taxonomy vocabularies by node type
                $vocabs = array();
                $vocabs_by_type = $type == 'default' ? taxonomy_get_vocabularies() : taxonomy_get_vocabularies($type);
                foreach ($vocabs_by_type as $key => $value) {
                    $vocabs[$value->vid] = $value->name;
                }
                // Display taxonomy checkboxes
                foreach ($vocabs as $key => $vocab_name) {
                    $form['node_type_specific']['display_taxonomy_container']['display_taxonomy'][$type]["taxonomy_vocab_display_{$type}_{$key}"] = array('#type' => 'checkbox', '#title' => t('Display vocabulary: @vocab_name', array('@vocab_name' => $vocab_name)), '#default_value' => $settings["taxonomy_vocab_display_{$type}_{$key}"]);
                }
                // Options for default settings
                if ($type == 'default') {
                    $form['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#title'] = t('Default');
                    $form['node_type_specific']['display_taxonomy_container']['display_taxonomy']['default']['#collapsed'] = $settings['taxonomy_enable_content_type'] ? TRUE : FALSE;
                    $form['node_type_specific']['display_taxonomy_container']['display_taxonomy']['taxonomy_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use content type specific settings.'), '#default_value' => $settings['taxonomy_enable_content_type']);
                } else {
                    if ($settings['taxonomy_enable_content_type'] == 0) {
                        $form['display_taxonomy'][$type]['#collapsed'] = TRUE;
                    }
                }
            }
        }
    }
    // Links display
    $form['node_type_specific']['links_container'] = array('#type' => 'fieldset', '#title' => t('Links'), '#description' => t('Links are the "links" displayed at the bottom of articles.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['node_type_specific']['links_container']['display_links_settings_enabled'] = array('#type' => 'checkbox', '#title' => t('Enable Links Settings'), '#description' => t('These settings are disabled by default to avoid conflicts with modules. If you encounter issues with a module that modifies the display or output of Links try disabling this setting.'), '#default_value' => $settings['display_links_settings_enabled']);
    if ($settings['display_links_settings_enabled'] == 1) {
        // Default & content type specific settings
        foreach (array('default' => 'Default') + node_get_types('names') as $type => $name) {
            $form['node_type_specific']['links_container']['links'][$type] = array('#type' => 'fieldset', '#title' => t('@name', array('@name' => @$name)), '#collapsible' => TRUE, '#collapsed' => TRUE);
            $form['node_type_specific']['links_container']['links'][$type]["display_links_{$type}"] = array('#type' => 'select', '#title' => t('Display Links'), '#default_value' => $settings["display_links_{$type}"], '#options' => array('all' => t('Always display links'), 'only' => t('Hide links on teasers'), 'never' => t('Never display links')));
            // Options for default settings
            if ($type == 'default') {
                $form['node_type_specific']['links_container']['links']['default']['#title'] = t('Default');
                $form['node_type_specific']['links_container']['links']['default']['#collapsed'] = $settings['display_links_enable_content_type'] ? TRUE : FALSE;
                $form['node_type_specific']['links_container']['links']['display_links_enable_content_type'] = array('#type' => 'checkbox', '#title' => t('Use content type specific settings.'), '#default_value' => $settings['display_links_enable_content_type']);
            } else {
                if ($settings['display_links_enable_content_type'] == 0) {
                    $form['links'][$type]['#collapsed'] = TRUE;
                }
            }
        }
    }
    // Layout settings
    $form['layout'] = array('#type' => 'fieldset', '#title' => t('Layout settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if ($settings['layout_enable_settings'] == 'on') {
        $image_path = drupal_get_path('theme', 'adaptivetheme') . '/css/core-images';
        $form['layout']['page_layout'] = array('#type' => 'fieldset', '#title' => t('Page Layout'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('Use these settings to customize the layout of your theme.'));
        if ($settings['layout_enable_width'] == 'on') {
            $form['layout']['page_layout']['layout_width_help'] = array('#prefix' => '<div class="layout-help">', '#suffix' => '</div>', '#value' => t('<dl><dt>Page width</dt><dd>Set the overall width of the the page.</dd></dl>'));
            $form['layout']['page_layout']['layout_width'] = array('#type' => 'select', '#prefix' => '<div class="page-width">', '#suffix' => '</div>', '#default_value' => $settings['layout_width'], '#options' => array('720px' => t('720px'), '780px' => t('780px'), '840px' => t('840px'), '900px' => t('900px'), '960px' => t('960px'), '1020px' => t('1020px'), '1080px' => t('1080px'), '1140px' => t('1140px'), '1200px' => t('1200px'), '1260px' => t('1260px'), '100%' => t('100% Fluid')), '#attributes' => array('class' => 'field-layout-width'));
        }
        // endif width
        if ($settings['layout_enable_sidebars'] == 'on') {
            $form['layout']['page_layout']['layout_sidebar_help'] = array('#prefix' => '<div class="layout-help">', '#suffix' => '</div>', '#value' => t('<dl><dt>Sidebar widths</dt><dd>Set the width of each sidebar. The content columm will stretch to fill the rest of the page width.</dd></dl>'));
            $form['layout']['page_layout']['layout_sidebar_first_width'] = array('#type' => 'select', '#title' => t('Sidebar first'), '#prefix' => '<div class="sidebar-width"><div class="sidebar-width-left">', '#suffix' => '</div>', '#default_value' => $settings['layout_sidebar_first_width'], '#options' => array('60' => t('60px'), '120' => t('120px'), '160' => t('160px'), '180' => t('180px'), '240' => t('240px'), '300' => t('300px'), '320' => t('320px'), '360' => t('360px'), '420' => t('420px'), '480' => t('480px'), '540' => t('540px'), '600' => t('600px'), '660' => t('660px'), '720' => t('720px'), '780' => t('780px'), '840' => t('840px'), '900' => t('900px'), '960' => t('960px')), '#attributes' => array('class' => 'sidebar-width-select'));
            $form['layout']['page_layout']['layout_sidebar_last_width'] = array('#type' => 'select', '#title' => t('Sidebar last'), '#prefix' => '<div class="sidebar-width-right">', '#suffix' => '</div></div>', '#default_value' => $settings['layout_sidebar_last_width'], '#options' => array('60' => t('60px'), '120' => t('120px'), '160' => t('160px'), '180' => t('180px'), '240' => t('240px'), '300' => t('300px'), '320' => t('320px'), '360' => t('360px'), '420' => t('420px'), '480' => t('480px'), '540' => t('540px'), '600' => t('600px'), '660' => t('660px'), '720' => t('720px'), '780' => t('780px'), '840' => t('840px'), '900' => t('900px'), '960' => t('960px')), '#attributes' => array('class' => 'sidebar-width-select'));
        }
        //endif layout sidebars
        if ($settings['layout_enable_method'] == 'on') {
            $form['layout']['page_layout']['layout_method_help'] = array('#prefix' => '<div class="layout-help">', '#suffix' => '</div>', '#value' => t('<dl><dt>Sidebar layout</dt><dd>Set the default sidebar configuration. You can choose a standard three column layout or place both sidebars to the right or left of the main content column.</dd></dl>'));
            $form['layout']['page_layout']['layout_method'] = array('#type' => 'radios', '#prefix' => '<div class="layout-method">', '#suffix' => '</div>', '#default_value' => $settings['layout_method'], '#options' => array('0' => t('<strong>Layout #1</strong>') . theme('image', $image_path . '/layout-default.png') . t('<span class="layout-type">Standard three column layout—left, content, right.</span>'), '1' => t('<strong>Layout #2</strong>') . theme('image', $image_path . '/layout-sidebars-right.png') . t('<span class="layout-type">Two columns on the right—content, left, right.</span>'), '2' => t('<strong>Layout #3</strong>') . theme('image', $image_path . '/layout-sidebars-left.png') . t('<span class="layout-type">Two columns on the left—left, right, content.</span>')), '#attributes' => array('class' => 'layouts'));
            $form['layout']['page_layout']['layout_enable_settings'] = array('#type' => 'hidden', '#value' => $settings['layout_enable_settings']);
        }
        // endif layout method
    }
    // endif layout settings
    // Equal heights settings
    $form['layout']['equal_heights'] = array('#type' => 'fieldset', '#title' => t('Equal Heights'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('These settings allow you to set the sidebars and/or region blocks to be equal height.'));
    // Equal height sidebars
    $form['layout']['equal_heights']['equal_heights_sidebars'] = array('#type' => 'checkbox', '#title' => t('Equal Height Sidebars'), '#default_value' => $settings['equal_heights_sidebars'], '#description' => t('This setting will make the sidebars and the main content column equal to the height of the tallest column.'));
    // Equal height gpanels
    $form['layout']['equal_heights']['equal_heights_gpanels'] = array('#type' => 'checkbox', '#title' => t('Equal Height Gpanels'), '#default_value' => $settings['equal_heights_gpanels'], '#description' => t('This will make all Gpanel blocks equal to the height of the tallest block in any Gpanel, regardless of which Gpanel the blocks are in. Good for creating a grid type block layout, however it could be too generic if you have more than one Gpanel active in the page.'));
    // Equal height blocks per region
    $equalized_blocks = array('leaderboard' => t('Leaderboard region'), 'header' => t('Header region'), 'secondary-content' => t('Secondary Content region'), 'content-top' => t('Content Top region'), 'content-bottom' => t('Content Bottom region'), 'tertiary-content' => t('Tertiary Content region'), 'footer' => t('Footer region'));
    $form['layout']['equal_heights']['equal_heights_blocks'] = array('#type' => 'fieldset', '#title' => t('Equal Height Blocks'));
    $form['layout']['equal_heights']['equal_heights_blocks'] += array('#prefix' => '<div id="div-equalize-collapse">', '#suffix' => '</div>', '#description' => t('<p>Equal height blocks only makes sense for blocks aligned horizontally so do not apply to sidebars. The equal height settings work well in conjunction with the Skinr block layout classes.</p>'));
    foreach ($equalized_blocks as $name => $title) {
        $form['layout']['equal_heights']['equal_heights_blocks']['equalize_' . $name] = array('#type' => 'checkbox', '#title' => $title, '#default_value' => $settings['equalize_' . $name]);
    }
    // Horizonatal login block
    if ($settings['horizontal_login_block_enable'] == 'on') {
        $form['layout']['login_block'] = array('#type' => 'fieldset', '#title' => t('Login Block'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['layout']['login_block']['horizontal_login_block'] = array('#type' => 'checkbox', '#title' => t('Horizontal Login Block'), '#default_value' => $settings['horizontal_login_block'], '#description' => t('Checking this setting will enable a horizontal style login block (all elements on one line). Note that if you are using OpenID this does not work well and you will need a more sophistocated approach than can be provided here.'));
        $form['layout']['login_block']['horizontal_login_block_overlabel'] = array('#type' => 'checkbox', '#title' => t('Use Overlabel JavaScript'), '#default_value' => $settings['horizontal_login_block_overlabel'], '#description' => t('Checking this setting will place the "User name:*" and "Password:*" labels inside the user name and password text fields.'));
    }
    // endif horizontal block settings
    // Admin settings
    $form['admin_settings']['administration'] = array('#type' => 'fieldset', '#title' => t('Admin settings'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    // Show user menu
    $form['admin_settings']['administration']['at_user_menu'] = array('#type' => 'checkbox', '#title' => t('Show the built in User Menu.'), '#default_value' => $settings['at_user_menu'], '#description' => t('This will show or hide useful links in the header. NOTE that if the <a href="!link">Admin Menu</a> module is installed most links will not show up because they are included in the Admin Menu.', array('!link' => 'http://drupal.org/project/admin_menu')));
    // Show block edit links
    $form['admin_settings']['administration']['block_edit_links'] = array('#type' => 'checkbox', '#title' => t('Show block editing and configuration links.'), '#default_value' => $settings['block_edit_links'], '#description' => t('When hovering over a block or viewing blocks in the blocks list page privileged users will see block editing and configuration links.'));
    // Hide help messages
    $form['admin_settings']['administration']['at_admin_hide_help'] = array('#type' => 'checkbox', '#title' => t('Hide help messages.'), '#default_value' => $settings['at_admin_hide_help'], '#description' => t('When this setting is checked all help messages will be hidden.'));
    // Development settings
    $form['themedev']['dev'] = array('#type' => 'fieldset', '#title' => t('Theme development settings'), '#description' => t('WARNING: These settings are for the theme developer! Changing these settings may break your site. Make sure you really know what you are doing before changing these.'), '#collapsible' => TRUE, '#collapsed' => $settings['rebuild_registry'] ? FALSE : TRUE);
    // Global settings
    $form['themedev']['dev']['global'] = array('#type' => 'fieldset', '#title' => t('Global Settings'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Rebuild registry
    $form['themedev']['dev']['global']['rebuild_registry'] = array('#type' => 'checkbox', '#title' => t('Rebuild the theme registry on every page load.'), '#default_value' => $settings['rebuild_registry'], '#description' => t('During theme development, it can be very useful to continuously <a href="!link">rebuild the theme registry</a>. WARNING! This is a performance penalty and must be turned off on production websites.', array('!link' => 'http://drupal.org/node/173880#theme-registry')));
    // Show $theme_info
    $form['themedev']['dev']['global']['show_theme_info'] = array('#type' => 'checkbox', '#title' => t('Show theme info.'), '#default_value' => $settings['show_theme_info'], '#description' => t('This will show the output of the global $theme_info variable using Krumo.'));
    if (!module_exists('devel')) {
        $form['themedev']['dev']['global']['show_theme_info']['#description'] = t('NOTICE: The setting requires the <a href="!link">Devel module</a> to be installed. This will show the output of the global $theme_info variable using Krumo.', array('!link' => 'http://drupal.org/project/devel'));
        $form['themedev']['dev']['global']['show_theme_info']['#disabled'] = 'disabled';
    }
    // Add or remove markup
    $form['themedev']['dev']['markup'] = array('#type' => 'fieldset', '#title' => t('Add or Remove Markup'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Add spans to theme_links
    $form['themedev']['dev']['markup']['links_add_span_elements'] = array('#type' => 'checkbox', '#title' => t('Add SPAN tags to Primary and Secondary links anchor text.'), '#description' => t('Wrapping SPAN tags around the anchor text can help out when building sliding door type tabs with hover states.'), '#default_value' => $settings['links_add_span_elements']);
    // Add or remove extra classes
    $form['themedev']['dev']['classses'] = array('#type' => 'fieldset', '#title' => t('Add or Remove CSS Classes'), '#description' => t('<p>This is a fast and easy way to add or remove CSS classes during theme development, so you only print what you require. Once you have decided which classes you need you can set new defaults in your subthemes .info file - this is useful if your theme needs to be portable, such as a commercial theme or when moving from development server to the live site. Use the <b>Export Advanced Theme Settings</b> to copy/paste your theme settings to the .info file (save them first if you have made changes).</p><p>Note that whenever you change the defaults in the .info file you need to click <em>"Reset to defaults"</em> to save them to the variables table and have them applied.</p>'), '#collapsible' => FALSE, '#collapsed' => FALSE);
    // Body classes
    $form['themedev']['dev']['classses']['body_classes'] = array('#type' => 'fieldset', '#title' => t('Page Classes'), '#description' => t('Page classes are added to the BODY element and apply to the whole page.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_section'] = array('#type' => 'checkbox', '#title' => t('Print section classes (.section-$section, uses the path-alias)'), '#default_value' => $settings['cleanup_classes_section']);
    $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_front'] = array('#type' => 'checkbox', '#title' => t('Print .front and .not-front classes.'), '#default_value' => $settings['cleanup_classes_front']);
    $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_user_status'] = array('#type' => 'checkbox', '#title' => t('Print .logged-in and .not-logged-in classes.'), '#default_value' => $settings['cleanup_classes_user_status']);
    $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_normal_path'] = array('#type' => 'checkbox', '#title' => t('Print .page-[$normal_path] classes.'), '#default_value' => $settings['cleanup_classes_normal_path']);
    $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_node_type'] = array('#type' => 'checkbox', '#title' => t('Print .article-type-[type] classes.'), '#default_value' => $settings['cleanup_classes_node_type']);
    $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_add_edit_delete'] = array('#type' => 'checkbox', '#title' => t('Print classes for article add, edit and delete pages (.article-[arg]).'), '#default_value' => $settings['cleanup_classes_add_edit_delete']);
    if (function_exists('locale')) {
        $form['themedev']['dev']['classses']['body_classes']['cleanup_classes_language'] = array('#type' => 'checkbox', '#title' => t('Print classes for Locale page language such as .lang-en, .lang-sv'), '#default_value' => $settings['cleanup_classes_language']);
    }
    // Node classes
    $form['themedev']['dev']['classses']['article_classes'] = array('#type' => 'fieldset', '#title' => t('Article Classes'), '#description' => t('Article classes apply to nodes. They print in the main wrapper DIV for all articles (nodes) in node.tpl.php.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['article_classes']['cleanup_article_id'] = array('#type' => 'checkbox', '#title' => t('Print a unique ID for each article e.g. #article-1.'), '#default_value' => $settings['cleanup_article_id']);
    $form['themedev']['dev']['classses']['article_classes']['cleanup_article_classes_sticky'] = array('#type' => 'checkbox', '#title' => t('Print .article-sticky class for articles set to sticky.'), '#default_value' => $settings['cleanup_article_classes_sticky']);
    $form['themedev']['dev']['classses']['article_classes']['cleanup_article_classes_promote'] = array('#type' => 'checkbox', '#title' => t('Print .article-promoted class for articles promoted to front.'), '#default_value' => $settings['cleanup_article_classes_promote']);
    $form['themedev']['dev']['classses']['article_classes']['cleanup_article_classes_teaser'] = array('#type' => 'checkbox', '#title' => t('Print .article-teaser class on article teasers.'), '#default_value' => $settings['cleanup_article_classes_teaser']);
    $form['themedev']['dev']['classses']['article_classes']['cleanup_article_classes_preview'] = array('#type' => 'checkbox', '#title' => t('Print .article-preview class for article previews.'), '#default_value' => $settings['cleanup_article_classes_preview']);
    $form['themedev']['dev']['classses']['article_classes']['cleanup_article_classes_type'] = array('#type' => 'checkbox', '#title' => t('Print .[content-type]-article classes.'), '#default_value' => $settings['cleanup_article_classes_type']);
    if (function_exists('i18n_init')) {
        $form['themedev']['dev']['classses']['article_classes']['cleanup_article_classes_language'] = array('#type' => 'checkbox', '#title' => t('Print .article-lang-[language] classes (requires i18n module)'), '#default_value' => $settings['cleanup_article_classes_language']);
    }
    // Comment classes
    $form['themedev']['dev']['classses']['comment_classes'] = array('#type' => 'fieldset', '#title' => t('Comment Classes'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['comment_classes']['comments'] = array('#type' => 'fieldset', '#title' => t('Comments'), '#description' => t('Comment classes apply to all comments. They print in comment.tpl.php on the wrapper DIV for each comment.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['comment_classes']['comments']['cleanup_comment_anonymous'] = array('#type' => 'checkbox', '#title' => t('Print .comment-by-anonymous for anonymous comments.'), '#default_value' => $settings['cleanup_comment_anonymous']);
    $form['themedev']['dev']['classses']['comment_classes']['comments']['cleanup_comment_article_author'] = array('#type' => 'checkbox', '#title' => t('Print .comment-by-article-author for author comments.'), '#default_value' => $settings['cleanup_comment_article_author']);
    $form['themedev']['dev']['classses']['comment_classes']['comments']['cleanup_comment_by_viewer'] = array('#type' => 'checkbox', '#title' => t('Print .comment-by-viewer for viewer comments.'), '#default_value' => $settings['cleanup_comment_by_viewer']);
    $form['themedev']['dev']['classses']['comment_classes']['comments']['cleanup_comment_new'] = array('#type' => 'checkbox', '#title' => t('Print .comment-new for new comments.'), '#default_value' => $settings['cleanup_comment_new']);
    $form['themedev']['dev']['classses']['comment_classes']['comments']['cleanup_comment_zebra'] = array('#type' => 'checkbox', '#title' => t('Print .odd and .even classes for comments.'), '#default_value' => $settings['cleanup_comment_zebra']);
    $form['themedev']['dev']['classses']['comment_classes']['comment-wrapper'] = array('#type' => 'fieldset', '#title' => t('Comment Wrapper'), '#description' => t('This class prints in comment-wrapper.tpl.php. The DIV wrapper encloses both the comments and the comment form (if on the same page).'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['comment_classes']['comment-wrapper']['cleanup_comment_wrapper_type'] = array('#type' => 'checkbox', '#title' => t('Print a content type class on the comments wrapper i.e. .[content-type]-comments.'), '#default_value' => $settings['cleanup_comment_wrapper_type']);
    // Block classes
    $form['themedev']['dev']['classses']['block_classes'] = array('#type' => 'fieldset', '#title' => t('Block Classes'), '#description' => t('Comment classes apply to blocks. They print in the main wrapper DIV for all blocks in block.tpl.php.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['block_classes']['cleanup_block_block_module_delta'] = array('#type' => 'checkbox', '#title' => t('Print a unique ID for each block (#block-module-delta).'), '#default_value' => $settings['cleanup_block_block_module_delta']);
    $form['themedev']['dev']['classses']['block_classes']['cleanup_block_classes_module'] = array('#type' => 'checkbox', '#title' => t('Print a .block-[module] class.'), '#default_value' => $settings['cleanup_block_classes_module']);
    $form['themedev']['dev']['classses']['block_classes']['cleanup_block_classes_zebra'] = array('#type' => 'checkbox', '#title' => t('Print .odd and .even classes for blocks.'), '#default_value' => $settings['cleanup_block_classes_zebra']);
    $form['themedev']['dev']['classses']['block_classes']['cleanup_block_classes_region'] = array('#type' => 'checkbox', '#title' => t('Print .block-[region] classes.'), '#default_value' => $settings['cleanup_block_classes_region']);
    $form['themedev']['dev']['classses']['block_classes']['cleanup_block_classes_count'] = array('#type' => 'checkbox', '#title' => t('Print .block-[count] classes.'), '#default_value' => $settings['cleanup_block_classes_count']);
    // Menu classes
    $form['themedev']['dev']['classses']['menu_classes'] = array('#type' => 'fieldset', '#title' => t('Menu, Primary &amp; Secondary Links Classes'), '#description' => t('Standard menus get their classes via the <code>theme_menu_tree</code> function override while the Primary and Secondary links use the <code>theme_links</code> function override (both are found in template.theme-overrides.inc). Note that the standard menu class options will not appear and will not be applied if the <a href="!link">DHTML Menu</a> module is installed.', array('!link' => 'http://drupal.org/project/dhtml_menu')), '#collapsible' => TRUE, '#collapsed' => TRUE);
    if (!function_exists('dhtml_menu_init')) {
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes'] = array('#type' => 'fieldset', '#title' => t('Menu Classes'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes']['cleanup_menu_menu_class'] = array('#type' => 'checkbox', '#title' => t('Print the ul.menu class.'), '#default_value' => $settings['cleanup_menu_menu_class']);
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes']['cleanup_menu_leaf_class'] = array('#type' => 'checkbox', '#title' => t('Print the .leaf class on menu list items.'), '#default_value' => $settings['cleanup_menu_leaf_class']);
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes']['cleanup_menu_first_last_classes'] = array('#type' => 'checkbox', '#title' => t('Print the .first and .last classes on menu list items. If there is only one item in the menu the class .single-item will replace the .last class (requires the .leaf class).'), '#default_value' => $settings['cleanup_menu_first_last_classes']);
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes']['cleanup_menu_active_classes'] = array('#type' => 'checkbox', '#title' => t('Print the .active classes on menu list items (active classes always print on the anchor).'), '#default_value' => $settings['cleanup_menu_active_classes']);
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes']['cleanup_menu_title_class'] = array('#type' => 'checkbox', '#title' => t('Print classes based on the menu title, i.e. .menu-[title].'), '#default_value' => $settings['cleanup_menu_title_class']);
    } else {
        $form['themedev']['dev']['classses']['menu_classes']['#description'] = t('NOTICE: You currently have the DHTML Menu module installed. The custom menu class options have been disabled because this module will not work correctly with them enabled - you can still set classes for the Primary and Secondary links (below).');
        $form['themedev']['dev']['classses']['menu_classes']['menu_menu_classes']['#disabled'] = 'disabled';
    }
    $form['themedev']['dev']['classses']['menu_classes']['menu_links_classes'] = array('#type' => 'fieldset', '#title' => t('Primary and Secondary Links Classes'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['menu_classes']['menu_links_classes']['cleanup_links_type_class'] = array('#type' => 'checkbox', '#title' => t('Print the type class on Primary and Secondary links.'), '#default_value' => $settings['cleanup_links_type_class']);
    $form['themedev']['dev']['classses']['menu_classes']['menu_links_classes']['cleanup_links_active_classes'] = array('#type' => 'checkbox', '#title' => t('Print the active classes on Primary and Secondary links.'), '#default_value' => $settings['cleanup_links_active_classes']);
    $form['themedev']['dev']['classses']['menu_classes']['menu_links_classes']['cleanup_links_first_last_classes'] = array('#type' => 'checkbox', '#title' => t('Print .first and .last classes.'), '#default_value' => $settings['cleanup_links_first_last_classes']);
    // Item list classes
    $form['themedev']['dev']['classses']['itemlist_classes'] = array('#type' => 'fieldset', '#title' => t('Item list Classes'), '#description' => t('Item list classes are applied using the <code>theme_item_list</code> function override in template.theme-overrides.inc'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['itemlist_classes']['cleanup_item_list_zebra'] = array('#type' => 'checkbox', '#title' => t('Print .odd and .even classes for list items.'), '#default_value' => $settings['cleanup_item_list_zebra']);
    $form['themedev']['dev']['classses']['itemlist_classes']['cleanup_item_list_first_last'] = array('#type' => 'checkbox', '#title' => t('Print .first and .last classes for the first and last items in the list.'), '#default_value' => $settings['cleanup_item_list_first_last']);
    // Views classes
    if (module_exists('views')) {
        $form['themedev']['dev']['classses']['views_classes'] = array('#type' => 'fieldset', '#title' => t('Views Classes'), '#description' => t('NOTE: If you are using custom Views templates you must use the template overrides that come with Adaptivetheme to preserve this functality.'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['themedev']['dev']['classses']['views_classes']['display'] = array('#type' => 'fieldset', '#title' => t('Display Classes'), '#description' => t('Control the classes for Views displays (views-view.tpl.php).'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['themedev']['dev']['classses']['views_classes']['display']['cleanup_views_css_name'] = array('#type' => 'checkbox', '#title' => t('Print the CSS Name class.'), '#default_value' => $settings['cleanup_views_css_name']);
        $form['themedev']['dev']['classses']['views_classes']['display']['cleanup_views_view_name'] = array('#type' => 'checkbox', '#title' => t('Print the View Name class.'), '#default_value' => $settings['cleanup_views_view_name']);
        $form['themedev']['dev']['classses']['views_classes']['display']['cleanup_views_display_id'] = array('#type' => 'checkbox', '#title' => t('Print the Display ID class.'), '#default_value' => $settings['cleanup_views_display_id']);
        $form['themedev']['dev']['classses']['views_classes']['display']['cleanup_views_dom_id'] = array('#type' => 'checkbox', '#title' => t('Print the DOM ID class.'), '#default_value' => $settings['cleanup_views_dom_id']);
        $form['themedev']['dev']['classses']['views_classes']['style'] = array('#type' => 'fieldset', '#title' => t('Views Style Classes'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['themedev']['dev']['classses']['views_classes']['style']['cleanup_views_unformatted'] = array('#type' => 'checkbox', '#title' => t('Print extra classes for unformatted views (views-view-unformatted.tpl.php).'), '#default_value' => $settings['cleanup_views_unformatted']);
        $form['themedev']['dev']['classses']['views_classes']['style']['cleanup_views_item_list'] = array('#type' => 'checkbox', '#title' => t('Print extra classes for item list views (views-view-list.tpl.php).'), '#default_value' => $settings['cleanup_views_item_list']);
    }
    // Field classes (CCK).
    if (module_exists('content')) {
        $form['themedev']['dev']['classses']['field_classes'] = array('#type' => 'fieldset', '#title' => t('Field Classes'), '#collapsible' => TRUE, '#collapsed' => TRUE);
        $form['themedev']['dev']['classses']['field_classes']['cleanup_fields_type'] = array('#type' => 'checkbox', '#title' => t('Print field type classes.'), '#default_value' => $settings['cleanup_fields_type']);
        $form['themedev']['dev']['classses']['field_classes']['cleanup_fields_name'] = array('#type' => 'checkbox', '#title' => t('Print field name classes.'), '#default_value' => $settings['cleanup_fields_name']);
        $form['themedev']['dev']['classses']['field_classes']['cleanup_fields_zebra'] = array('#type' => 'checkbox', '#title' => t('Print odd/even zebra classes on CCK fields.'), '#default_value' => $settings['cleanup_fields_zebra']);
    }
    // Title classes for headings
    $form['themedev']['dev']['classses']['heading_classes'] = array('#type' => 'fieldset', '#title' => t('Heading Classes'), '#description' => t('Heading classes apply to article, block and comment titles (h2, h3 etc).'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['themedev']['dev']['classses']['heading_classes']['cleanup_headings_title_class'] = array('#type' => 'checkbox', '#title' => t('Add the .title class to all headings.'), '#default_value' => $settings['cleanup_headings_title_class']);
    $form['themedev']['dev']['classses']['heading_classes']['cleanup_headings_namespaced_class'] = array('#type' => 'checkbox', '#title' => t('Add a pseudo name spaced title class to headings, i.e. .article-title, .block-title, .comment-title.'), '#default_value' => $settings['cleanup_headings_namespaced_class']);
    // Theme Settings Export
    $form['theme_settings_export']['export'] = array('#type' => 'fieldset', '#title' => t('Export Advanced Theme Settings'), '#description' => t('<p>Copy/paste these settings to a text file for backup or paste to your themes .info file (over-write the defaults) - useful if you are moving your theme to a new site and want to retain custom settings.</p><p>NOTE: Content type specific settings are NOT included here, these cannot be set via the info file.</p><p>WARNING! If you are using a WYSIWYG editor it must be disabled for this text area, otherwise all special characters are likely to be converted to HTML entities. If your editor has a \'view source\' feature try that first.</p>'), '#collapsible' => TRUE, '#collapsed' => TRUE);
    $form['theme_settings_export']['export']['exported_settings'] = array('#type' => 'textarea', '#default_value' => $exports, '#resizable' => FALSE, '#cols' => 60, '#rows' => 25);
    return $form;
}