You are here

function hfs_footer_settings in Header and Footer Scripts 7.2

Administrative settings.

Return value

array Add styles and scripts in footer (before closing the body tag).

1 string reference to 'hfs_footer_settings'
hfs_menu in ./hfs.module
Implements hook_menu().

File

./hfs.admin.inc, line 110
Administrative page code for the Header Footer Script module.

Code

function hfs_footer_settings($form, &$form_state) {
  $footer_section = variable_get('header_and_footer_scripts_footer_settings');
  $form['header_and_footer_scripts_footer'] = array(
    '#type' => 'fieldset',
    '#title' => t('Add Scripts and Styles in Footer'),
    '#description' => t('All the defined scripts and styles in this section would be added just before closing the <strong>body</strong> tag.'),
  );
  $form['header_and_footer_scripts_footer']['styles'] = array(
    '#type' => 'textarea',
    '#title' => t('Footer Styles'),
    '#default_value' => isset($footer_section['styles']) ? $footer_section['styles'] : '',
    '#description' => t('<p>You can add multiple <strong>stylesheets</strong> here with multiple ways, For example: </p><p>1. &lt;link type="text/css" rel="stylesheet" href="http://www.example.com/style.css" media="all" /&gt;</p><p> 2. &lt;link type="text/css" rel="stylesheet" href="/style.css" media="all" /&gt;</p><p> 3. &lt;style&gt;#header { color: grey; }&lt;/style&gt;</p>'),
    '#rows' => 10,
  );
  $form['header_and_footer_scripts_footer']['scripts'] = array(
    '#type' => 'textarea',
    '#title' => t('Footer Scripts'),
    '#default_value' => isset($footer_section['scripts']) ? $footer_section['scripts'] : '',
    '#description' => t('<p>You can add multiple <strong>scripts</strong> here with multiple ways, For example: </p><p>1. &lt;script type="text/javascript" src="http://www.example.com/script.js"&gt;&lt;/script&gt;</p><p> 2. &lt;script type="text/javascript" src="/script.js"&gt;&lt;/script&gt;</p><p> 3. &lt;script type="text/javascript"&gt;&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--// close script tag //--&gt;&lt;!]]&gt;&lt;/script&gt;</p>'),
    '#rows' => 10,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save Footer Settings',
  );
  return $form;
}