diff --git a/search_autocomplete.features.inc b/search_autocomplete.features.inc index 018707c46e9337f8281bd7433293664d1ca6a1a3..b395db955b09cbd2c0f91f8c0db5f79fd7b47905 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 8e334f036f24185566dd73788522886d31c96f63..84c76791d10d2cbed58535d4898eddf87178970f 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 8dc005ad4ddc681c67b893cbadf37b1922e56ff7..e4358d07619be26c9c83518e4bf72f2454fbec40 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 [search-phrase] --')) ->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 46bbe5d6d950c85128b943c19147425a365d365e..78a95894a7098a80903e74ea19606bed4ebf373e 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 c9993363c2077c757f83f7ad322970d4c03bd874..e190039a2eb0c6b610b5808b86ee31a64cb2b543 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) { @@ -159,21 +159,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(). */ diff --git a/views/plugins/search_autocomplete.views_plugin_style.inc b/views/plugins/search_autocomplete.views_plugin_style.inc index 53456f9afa65d7cd9b6cfe34393312f3907cb975..7cad2fac669fb4417d15e4ade4d008261311c34e 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 3a3191bf7d6399823a23cf24b8e56b12a5e02f2d..360373e18323210e04c1e6100bb091a4cf00f888 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 07d6d30c5e284565be6088965bce68c941573720..a2b14e1b64f2fce1786ac01871a9fa9e2de91512 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);