Commit 88a2fce9 authored by minakshiPh's avatar minakshiPh Committed by RobertRagas

Issue #2810843 by minakshiPh, nileshlohar: missing drupal coding standards

parent b9490ef6
This diff is collapsed.
<?php
/**
* @file yoast.forms.inc
* @file
* Contains node form alters.
*/
/**
* Adds extra settings to the node content type edit page.
*
* @param $form
* @param array $form
* Node settings form.
*/
function _yoast_seo_process_node_settings_form(&$form) {
......@@ -38,8 +39,9 @@ function _yoast_seo_process_node_settings_form(&$form) {
}
}
/**
* @todo remove this after https://www.drupal.org/node/1149078 was fixed and use
/*
* @todo remove this after https://www.drupal.org/node/1149078 was fixed
* and use
* $states = array(
* 'disabled' => array(
* ':input[name=yoast_seo_body_fields[]]' => array('value' => array('0')),
......@@ -61,13 +63,13 @@ function _yoast_seo_process_node_settings_form(&$form) {
$disabled = TRUE;
$states = array(
'enabled' => array(
$conditions
$conditions,
),
);
}
else {
if (isset($fields['body'])) {
// if we have body we skip conditions
// If we have body we skip conditions.
$conditions = array();
}
$default = variable_get('yoast_seo_enable_node__' . $node_type, TRUE);
......@@ -75,7 +77,7 @@ function _yoast_seo_process_node_settings_form(&$form) {
$disabled = FALSE;
$states = array(
'enabled' => array(
$conditions
$conditions,
),
);
}
......@@ -89,10 +91,11 @@ function _yoast_seo_process_node_settings_form(&$form) {
'#states' => $states,
);
/**
* Here we allow users to use different fields or multiple for using instead of body.
* @todo change this to multiselect after https://www.drupal.org/node/1149078 was fixed
/*
* Here we allow users to use different fields or multiple for using
* instead of body.
* @todo change this to multiselect after
* https://www.drupal.org/node/1149078 was fixed
* '#type' => 'select',
* '#multiple' => TRUE,
*/
......
<?php
/**
* @file
*/
/**
* View handler class yoast_seo_handler_rating.
*/
class yoast_seo_handler_rating extends views_handler_field {
/**
* @inheritdoc
*/
function query() {
public function query() {
$this->ensure_my_table();
}
/**
* Renders the field handler.
*/
function render($values) {
public function render($values) {
$output = '';
if (user_access('use yoast seo')) {
......@@ -36,4 +44,5 @@ class yoast_seo_handler_rating extends views_handler_field {
return $output;
}
}
\ No newline at end of file
}
<?php
/**
* @file
* Install, update, and uninstall functions for the Yoast SEO for Drupal module.
......@@ -51,7 +52,7 @@ function yoast_seo_schema() {
),
),
'indexes' => array(
'type_revision' => array('entity_type','revision_id'),
'type_revision' => array('entity_type', 'revision_id'),
),
'primary key' => array(
'entity_type',
......
<?php
/**
* @file
* Primary hook implementations for Yoast SEO for Drupal module.
......@@ -105,7 +106,7 @@ function yoast_seo_configuration_form(array &$form, $instance, array $options =
$form['yoast_seo']['#group'] = $key;
break;
}
}
}
$metatag_config = metatag_config_load_with_defaults($options['instance']);
$new_entity = empty($form['#entity']->nid) ? TRUE : FALSE;
......@@ -166,8 +167,10 @@ function yoast_seo_configuration_form(array &$form, $instance, array $options =
}
/**
* Actually we need access to all fields listed or selected
* Actually we need access to all fields listed or selected.
*
* @param array $form
*
* @return bool
*/
function _yoast_check_fields_access(array $form) {
......@@ -246,7 +249,8 @@ function yoast_seo_configuration_form_after_build($form, &$form_state) {
$langcode = LANGUAGE_NONE;
}
// Lets put the container in the bottom of page, above additional_settings tabs.
// Lets put the container in the bottom of page, above additional_settings
// tabs.
$form['yoast_seo']['#weight'] = $form['additional_settings']['#weight'] - 2;
// Generate unique HTML IDs.
......@@ -298,7 +302,7 @@ function yoast_seo_configuration_form_after_build($form, &$form_state) {
$seo_title_overwritten = TRUE;
}
// Collect all body fields and field id's
// Collect all body fields and field id's.
$text_content = array();
if (isset($form['body'])) {
// We use the language of the body element so we know where to add the
......@@ -309,7 +313,7 @@ function yoast_seo_configuration_form_after_build($form, &$form_state) {
$yoast_fields = variable_get('yoast_seo_body_fields_' . $form['#bundle'], array());
foreach ($yoast_fields as $yoast_field) {
// We use the language of the field element
// We use the language of the field element.
$field_language = $form[$yoast_field]['#language'];
$text_content += _yoast_seo_process_field($form[$yoast_field][$field_language]);
}
......@@ -361,9 +365,10 @@ function yoast_seo_configuration_form_after_build($form, &$form_state) {
}
/**
* Helper function that extracts field values and id's
* Helper function that extracts field values and id's.
*
* @param array $field
*
* @return array
*/
function _yoast_seo_process_field(array $field) {
......@@ -377,7 +382,7 @@ function _yoast_seo_process_field(array $field) {
}
}
else {
// Multi field
// Multi field.
for ($i = 0; $i <= $field['#max_delta']; $i++) {
$fields_content[$field[$i]['value']['#id']] = '';
if (isset($field[$i]['value']['#default_value']) && !empty($field[$i]['value']['#default_value'])) {
......@@ -892,7 +897,7 @@ function yoast_seo_entity_supports_yoast_seo($entity_type = NULL, $bundle = NULL
//
// // Disable metatags for file_entity.
// $conf['metatag_enable_file'] = FALSE;
//
// .
// @see Settings page.
if (variable_get('yoast_seo_enable_' . $entity_name, FALSE) == FALSE) {
$entity_types[$entity_name] = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment