summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique CLAUSE2015-02-05 16:15:57 (GMT)
committerDominique CLAUSE2015-02-05 16:15:57 (GMT)
commit84bac3e1a7e3619f46a780d4127a8b55fab37825 (patch)
tree35b7c47cae00738af3e7b7e471058eba9963ee9a
parent3662a8816579491afa20285a8996454a8845b17a (diff)
[DCE] Code review : level minor.7.x-4.47.x-4.3
-rw-r--r--search_autocomplete.features.inc17
-rw-r--r--search_autocomplete.form.configure.inc10
-rw-r--r--search_autocomplete.install12
-rw-r--r--search_autocomplete.module2
-rw-r--r--search_autocomplete.view_autocomplete.inc17
-rw-r--r--views/plugins/search_autocomplete.views_plugin_style.inc2
-rw-r--r--views/search_autocomplete.views.inc2
-rw-r--r--views/theme/views_search_autocomplete_style.theme.inc4
8 files changed, 20 insertions, 46 deletions
diff --git a/search_autocomplete.features.inc b/search_autocomplete.features.inc
index 018707c..b395db9 100644
--- a/search_autocomplete.features.inc
+++ b/search_autocomplete.features.inc
@@ -31,7 +31,7 @@ function search_autocomplete_config_features_export_options() {
}
/**
- * Implementation of hook_features_export [component hook]
+ * Implements hook_features_export().
*
* This is a component hook, rather then a module hook, therefore this is the
* callback from hook_features_api which relates to the specific component we
@@ -58,7 +58,7 @@ function search_autocomplete_config_features_export($data, &$export, $module_nam
}
/**
- * Implementation of hook_features_export_render. [component hook]
+ * Implements hook_features_export_render().
*
* This hook will be invoked in order to export
* Component hook. The hook should be implemented using the name ot the
@@ -78,7 +78,8 @@ function search_autocomplete_config_features_export($data, &$export, $module_nam
* @return array
* An associative array of rendered PHP code where the key is the name of the
* hook that should wrap the PHP code. The hook should not include the name
- * of the module, e.g. the key for `hook_example` should simply be `example`.
+ * of the module, for example the key for `hook_example` should simply be
+ * `example`.
*/
function search_autocomplete_config_features_export_render($module_name, $data, $export = NULL) {
$code = array();
@@ -96,7 +97,7 @@ function search_autocomplete_config_features_export_render($module_name, $data,
}
/**
- * Implements hook_features_revert(). [component_hook]
+ * Implements hook_features_revert().
*/
function search_autocomplete_config_features_revert($module) {
search_autocomplete_config_features_rebuild($module);
@@ -121,13 +122,11 @@ function search_autocomplete_config_features_rebuild($module) {
}
}
-/*
- * Get machine name of all search data
- * @return array of machine name
+/**
+ * Get machine name of all search data.
* @return
* An associative array, or FALSE if there is no next row.
*/
-
function search_autocomplete_get_data() {
$codes = db_select('search_autocomplete_forms', 'sa')
->fields('sa', array())
@@ -136,7 +135,7 @@ function search_autocomplete_get_data() {
}
/**
- * Will retrieve data on basis of fid
+ * Will retrieve data on basis of fid.
* @param type $fid
* @return type
*/
diff --git a/search_autocomplete.form.configure.inc b/search_autocomplete.form.configure.inc
index 8e334f0..84c7679 100644
--- a/search_autocomplete.form.configure.inc
+++ b/search_autocomplete.form.configure.inc
@@ -296,16 +296,6 @@ function search_autocomplete_form_configure_submit($form, &$form_state) {
$callback = $values['callback_textfield'];
// Static resource => type = 2.
$data_type = $values['suggestions'];
-// if ($data_type == 'callback' && $callback != '') {
-// // If path is absolute:
-// if (url_is_external($callback)) {
-// // If path is internal:
-// if (strcmp(substr($callback, 0, strlen($base_url)), $base_url) === 0) {
-// // Get it relative.
-// $callback = str_replace($base_url . "/", "", $callback);
-// }
-// }
-// }
// In the case of view, we use a custom callback to retrieve the view data.
if ($data_type == 'view') {
$callback = 'search_autocomplete/autocomplete/' . $values['fid'] . '/';
diff --git a/search_autocomplete.install b/search_autocomplete.install
index 8dc005a..e4358d0 100644
--- a/search_autocomplete.install
+++ b/search_autocomplete.install
@@ -321,7 +321,7 @@ function search_autocomplete_update_7407(&$sandbox) {
->condition('sa.selector', '#search-form[action="/search/node"] #edit-keys', '=')
->execute()
->fetchAssoc();
- db_update('search_autocomplete_forms') // Table name no longer needs {}
+ db_update('search_autocomplete_forms')
->fields(array(
'data_source' => 'view',
'data_callback' => 'search_autocomplete/autocomplete/' . $fid['fid'] . '/',
@@ -336,7 +336,7 @@ function search_autocomplete_update_7407(&$sandbox) {
->condition('sa.selector', '#search-form[action="/search/user"] #edit-keys', '=')
->execute()
->fetchAssoc();
- db_update('search_autocomplete_forms') // Table name no longer needs {}
+ db_update('search_autocomplete_forms')
->fields(array(
'data_source' => 'view',
'data_view' => 'users_autocomplete',
@@ -351,7 +351,7 @@ function search_autocomplete_update_7407(&$sandbox) {
->condition('sa.selector', '#edit-search-block-form--2', '=')
->execute()
->fetchAssoc();
- db_update('search_autocomplete_forms') // Table name no longer needs {}
+ db_update('search_autocomplete_forms')
->fields(array(
'data_source' => 'view',
'data_view' => 'nodes_autocomplete',
@@ -387,7 +387,7 @@ function search_autocomplete_update_7408(&$sandbox) {
*/
function search_autocomplete_update_7410(&$sandbox) {
if (db_field_exists('search_autocomplete_forms', 'no_results')) {
- db_update('search_autocomplete_forms') // Table name no longer needs {}
+ db_update('search_autocomplete_forms')
->fields(array('no_results' => '-- No results found for <b>[search-phrase]</b> --'))
->execute();
}
@@ -414,7 +414,7 @@ function search_autocomplete_update_7411(&$sandbox) {
'size' => 'big',
));
}
- db_update('search_autocomplete_forms') // Table name no longer needs {}
+ db_update('search_autocomplete_forms')
->fields(array('no_results' => json_encode(array(
'label' => t('No results found for [search-phrase]. Click to perform full search.'),
'value' => '[search-phrase]',
@@ -433,7 +433,7 @@ function search_autocomplete_update_7411(&$sandbox) {
);
db_add_field('search_autocomplete_forms', 'all_results', $field);
}
- db_update('search_autocomplete_forms') // Table name no longer needs {}
+ db_update('search_autocomplete_forms')
->fields(array('all_results' => json_encode(array(
'label' => t('View all results for [search-phrase].'),
'value' => '[search-phrase]',
diff --git a/search_autocomplete.module b/search_autocomplete.module
index 46bbe5d..78a9589 100644
--- a/search_autocomplete.module
+++ b/search_autocomplete.module
@@ -168,7 +168,7 @@ function search_autocomplete_get_translite() {
}
/**
- * Implementation of hook_features_api
+ * Implements hook_features_api().
*
* Here we define the components that we want to make exportable. For this
* particular module, we want to make the configurations exportable.
diff --git a/search_autocomplete.view_autocomplete.inc b/search_autocomplete.view_autocomplete.inc
index c999336..e190039 100644
--- a/search_autocomplete.view_autocomplete.inc
+++ b/search_autocomplete.view_autocomplete.inc
@@ -99,7 +99,7 @@ function _search_autocomplete_render_fields($view, $row) {
* @deprecated The $option parameter in PHP 5.4.0 json_encode() deprecates this
* function.
*
- * @see _search_autocomplete_json_encode
+ * @see _search_autocomplete_json_encode()
*/
function _search_autocomplete_encode_formatted($json, $depth = 0) {
@@ -160,21 +160,6 @@ function _search_autocomplete_encode_formatted($json, $depth = 0) {
}
/**
- * Helper function to finish debugging.
- *
- * @param mixed $var
- * A variable to dump.
- * @param string $location
- * A location to output.
- */
-function _search_autocomplete_debug_stop($var, $location) {
- print("Location:$location\n");
- var_dump($var);
- module_Invoke_all('exit');
- exit;
-}
-
-/**
* Implements hook_views_default_views().
*/
function search_autocomplete_views_default_views() {
diff --git a/views/plugins/search_autocomplete.views_plugin_style.inc b/views/plugins/search_autocomplete.views_plugin_style.inc
index 53456f9..7cad2fa 100644
--- a/views/plugins/search_autocomplete.views_plugin_style.inc
+++ b/views/plugins/search_autocomplete.views_plugin_style.inc
@@ -7,7 +7,7 @@
/**
* Implements views_plugin_style
*/
-class search_autocomplete_views_plugin_style extends views_plugin_style {
+class SearchAutocompleteViewsPluginStyle extends views_plugin_style {
/**
* {@inheritdoc}
*/
diff --git a/views/search_autocomplete.views.inc b/views/search_autocomplete.views.inc
index 3a3191b..360373e 100644
--- a/views/search_autocomplete.views.inc
+++ b/views/search_autocomplete.views.inc
@@ -20,7 +20,7 @@ function search_autocomplete_views_plugins() {
'title' => t('Autocompletion JSON'),
'path' => $path . '/plugins',
'help' => t('Displays nodes in the JSON data format.'),
- 'handler' => 'search_autocomplete_views_plugin_style',
+ 'handler' => 'SearchAutocompleteViewsPluginStyle',
'theme' => 'views_search_autocomplete_style',
'theme file' => 'views_search_autocomplete_style.theme.inc',
'theme path' => $path . '/theme',
diff --git a/views/theme/views_search_autocomplete_style.theme.inc b/views/theme/views_search_autocomplete_style.theme.inc
index 07d6d30..a2b14e1 100644
--- a/views/theme/views_search_autocomplete_style.theme.inc
+++ b/views/theme/views_search_autocomplete_style.theme.inc
@@ -57,10 +57,10 @@ function template_preprocess_views_search_autocomplete_style(&$vars) {
$link_value = $matches[2];
}
if (url_is_external($link_value) || valid_url($link_value, TRUE)) {
- $link = $link_value;
+ $link = $link_value;
}
else {
- $link = $base_root . $link_value;
+ $link = $base_root . $link_value;
}
// And build the link object.
$object['link'] = trim($link);