Issue #2886150 by samiahmedsiddiqui: Fixed Coding Standard issues

This commit is contained in:
samiahmedsiddiqui 2017-08-12 02:17:22 +05:00
parent 8ab394f0e6
commit c0a641bae3
3 changed files with 15 additions and 13 deletions

View File

@ -1,5 +1,6 @@
HFS (Header Footer Scripts) module for Drupal 7.x. HFS (Header Footer Scripts) module for Drupal 7.x.
This module allows you to add style and scripts in different region of the page from the front-end. You don't need to open any file for this purpose. This module allows you to add style and scripts in different region of the page
from the front-end. You don't need to open any file for this purpose.
INSTALLATION INSTRUCTIONS INSTALLATION INSTRUCTIONS
------------------------- -------------------------
@ -8,11 +9,12 @@ INSTALLATION INSTRUCTIONS
2. Login as site administrator. 2. Login as site administrator.
3. Enable the HFS (Header Footer Scripts) module on the Administer -> Modules 3. Enable the HFS (Header Footer Scripts) module on the Administer -> Modules
page. page.
4. Add styles and scripts in settings on the Administer -> Configuration -> Development -> 4. Add styles and scripts in settings on the Administer -> Configuration ->
HFS (Header Footer Scripts) Page. Development -> HFS (Header Footer Scripts) Page.
5. Enjoy. 5. Enjoy.
NOTES NOTES
----- -----
This module adds the styles and scripts on all over the site. There are 3 setting pages. This module adds the styles and scripts on all over the site. There are 3
setting pages.
These setting pages are allow you add the scripts in the desired region. These setting pages are allow you add the scripts in the desired region.

View File

@ -10,7 +10,7 @@
/** /**
* Administrative settings. * Administrative settings.
* *
* @return * @return array
* Add styles and scripts in header. * Add styles and scripts in header.
*/ */
function hfs_header_settings_form($form, &$form_state) { function hfs_header_settings_form($form, &$form_state) {
@ -47,7 +47,7 @@ function hfs_header_settings_form($form, &$form_state) {
* Submit handler(). * Submit handler().
*/ */
function hfs_header_settings_form_submit($form, &$form_state) { function hfs_header_settings_form_submit($form, &$form_state) {
$header['styles'] = $form_state['values']['styles']; $header['styles'] = $form_state['values']['styles'];
$header['scripts'] = $form_state['values']['scripts']; $header['scripts'] = $form_state['values']['scripts'];
serialize($header); serialize($header);
variable_set('hfs_header_scripts', $header); variable_set('hfs_header_scripts', $header);
@ -56,12 +56,12 @@ function hfs_header_settings_form_submit($form, &$form_state) {
/** /**
* Administrative settings. * Administrative settings.
* *
* @return * @return array
* Add styles and scripts at the start of the body tag. * Add styles and scripts at the start of the body tag.
*/ */
function hfs_body_settings_form($form, &$form_state) { function hfs_body_settings_form($form, &$form_state) {
$body_section = variable_get('hfs_body_scripts'); $body_section = variable_get('hfs_body_scripts');
$form['hfs_body'] = array( $form['hfs_body'] = array(
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => t('Add Scripts and Styles in body'), '#title' => t('Add Scripts and Styles in body'),
@ -102,7 +102,7 @@ function hfs_body_settings_form_submit($form, &$form_state) {
/** /**
* Administrative settings. * Administrative settings.
* *
* @return * @return array
* Add styles and scripts in footer (before closing the body tag). * Add styles and scripts in footer (before closing the body tag).
*/ */
function hfs_footer_settings_form($form, &$form_state) { function hfs_footer_settings_form($form, &$form_state) {
@ -131,7 +131,7 @@ function hfs_footer_settings_form($form, &$form_state) {
'#type' => 'submit', '#type' => 'submit',
'#value' => 'Save Footer Settings', '#value' => 'Save Footer Settings',
); );
return $form; return $form;
} // End of hfs_footer_settings_form(). } // End of hfs_footer_settings_form().
@ -139,7 +139,7 @@ function hfs_footer_settings_form($form, &$form_state) {
* Submit handler(). * Submit handler().
*/ */
function hfs_footer_settings_form_submit($form, &$form_state) { function hfs_footer_settings_form_submit($form, &$form_state) {
$footer['styles'] = $form_state['values']['styles']; $footer['styles'] = $form_state['values']['styles'];
$footer['scripts'] = $form_state['values']['scripts']; $footer['scripts'] = $form_state['values']['scripts'];
serialize($footer); serialize($footer);
variable_set('hfs_footer_scripts', $footer); variable_set('hfs_footer_scripts', $footer);

View File

@ -65,7 +65,7 @@ function hfs_permission() {
$permissions['administer hfs module'] = array( $permissions['administer hfs module'] = array(
'title' => t('Add Scripts all over the site'), 'title' => t('Add Scripts all over the site'),
'restrict access' => TRUE, 'restrict access' => TRUE,
'description' => t('Users who have this permission can add and remove the scripts from the site.') 'description' => t('Users who have this permission can add and remove the scripts from the site.'),
); );
return $permissions; return $permissions;
@ -77,7 +77,7 @@ function hfs_permission() {
* Add scripts on overall the site which are defined on the settings page. * Add scripts on overall the site which are defined on the settings page.
*/ */
function hfs_process_html(&$variables) { function hfs_process_html(&$variables) {
$header_scripts = variable_get('hfs_header_scripts'); $header_scripts = variable_get('hfs_header_scripts');
$body_scripts = variable_get('hfs_body_scripts'); $body_scripts = variable_get('hfs_body_scripts');
$footer_scripts = variable_get('hfs_footer_scripts'); $footer_scripts = variable_get('hfs_footer_scripts');