diff --git a/sites/all/modules/unl/includes/unl.admin.inc b/sites/all/modules/unl/includes/unl.admin.inc new file mode 100644 index 0000000000000000000000000000000000000000..7fd339b35c81f612f69d545193400d75101dceaa --- /dev/null +++ b/sites/all/modules/unl/includes/unl.admin.inc @@ -0,0 +1,28 @@ +<?php + +function unl_config($form, &$form_state) { + + $form['root'] = array( + '#tree' => TRUE, + '#type' => 'fieldset', + '#title' => 'UNL Settings', + ); + + $form['root']['unl_use_base_tag'] = array( + '#type' => 'checkbox', + '#title' => 'Use Base Tag', + '#description' => 'Insert the HTML Base tag in the head of all pages on this site.', + '#default_value' => variable_get('unl_use_base_tag', TRUE), + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => 'Update', + ); + + return $form; +} + +function unl_config_submit($form, &$form_state) { + variable_set('unl_use_base_tag', $form_state['values']['root']['unl_use_base_tag']); +} diff --git a/sites/all/modules/unl/unl.info b/sites/all/modules/unl/unl.info index d030c496434502ba9fcd68480706038d809b9481..52f3787a6f48f0cc587e0600933a2b6e747f65fb 100644 --- a/sites/all/modules/unl/unl.info +++ b/sites/all/modules/unl/unl.info @@ -4,6 +4,7 @@ package = UNL dependencies[] = wysiwyg core = 7.x version = "7.x-1.0-20100920" +configure = admin/config/system/unl files[] = unl.install files[] = unl.module diff --git a/sites/all/modules/unl/unl.module b/sites/all/modules/unl/unl.module index 4d166f8a7dbdc9d0907edbf42559045fae49d3c3..ef83028162ac168f4fd7418ba0144f71aaaf32f6 100644 --- a/sites/all/modules/unl/unl.module +++ b/sites/all/modules/unl/unl.module @@ -330,6 +330,17 @@ function unl_menu() { 'page callback' => 'unl_still_alive', 'access callback' => TRUE, ); + + // UNL + $items['admin/config/system/unl'] = array( + 'title' => 'UNL', + 'description' => 'Configure UNL System Settings', + 'access callback' => 'unl_user_is_administrator', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('unl_config'), + 'file' => 'includes/unl.admin.inc', + 'weight' => 1, + ); if (module_exists('imce')) { // Add IMCE file browser to Content section @@ -961,6 +972,18 @@ function unl_init() { drupal_goto($primary_base_url . current_path()); } } + + if (variable_get('unl_use_base_tag', TRUE)) { + $base_tag = array( + '#type' => 'html_tag', + '#tag' => 'base', + '#attributes' => array( + 'href' => url('<front>', array('absoule' => TRUE)), + ), + ); + drupal_add_html_head($base_tag, 'base'); + } + _unl_handle_directory_index(); } @@ -1253,4 +1276,3 @@ function unl_block_view_my_sites() - diff --git a/sites/all/themes/unl_wdn/html.tpl.php b/sites/all/themes/unl_wdn/html.tpl.php index 7ed1cea4d9af5f02acb901f700f2fd060cdd7b3c..8f4250be68099cc26b3bc814050c5422387e27cf 100644 --- a/sites/all/themes/unl_wdn/html.tpl.php +++ b/sites/all/themes/unl_wdn/html.tpl.php @@ -33,12 +33,6 @@ $t = unl_wdn_get_instance(); -if (theme_get_setting('use_base')) { - $t->head = PHP_EOL - . '<base href="' . url('<front>', array('absolute' => TRUE)) . '" />' . PHP_EOL - . $t->head; -} - $t->head .= PHP_EOL . $head . PHP_EOL . $styles . PHP_EOL diff --git a/sites/all/themes/unl_wdn/theme-settings.php b/sites/all/themes/unl_wdn/theme-settings.php index 1333f0dd09e22a6165983642c4401b15f85ee66b..b2998e18917055cb0b418081ceb00aede6fc9270 100644 --- a/sites/all/themes/unl_wdn/theme-settings.php +++ b/sites/all/themes/unl_wdn/theme-settings.php @@ -69,12 +69,6 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) { '#default_value' => theme_get_setting('zen_forms'), '#description' => t('Transforms all forms into the list-based zen forms.'), ), - 'use_base' => array( - '#type' => 'checkbox', - '#title' => t('Use HTML Base Tag in Head'), - '#default_value' => theme_get_setting('use_base'), - '#description' => t('Adds an HTML Base tag to the <head> section with href="' . url('<front>', array('absolute' => TRUE)) . '"'), - ), 'wdn_beta' => array( '#type' => 'checkbox', '#title' => t('Use WDN Beta/Development CSS and JavaScript'), diff --git a/sites/all/themes/unl_wdn/unl_wdn.info b/sites/all/themes/unl_wdn/unl_wdn.info index 30c540f6920eb02b7e1f018dfc79fa140c1b3dc1..c6a05a8bc3dcf37dfba6ecacd3ae91239b2c8c13 100644 --- a/sites/all/themes/unl_wdn/unl_wdn.info +++ b/sites/all/themes/unl_wdn/unl_wdn.info @@ -31,7 +31,6 @@ plugins[panels][layouts] = layouts settings[toggle_favicon] = 0 settings[zen_forms] = 0 -settings[use_base] = 1 settings[wdn_beta] = 0 settings[sidebar_first_width] = 3 settings[sidebar_second_width] = 3