diff --git a/smart_paging.module b/smart_paging.module index 5c2d590..7f1e384 100644 --- a/smart_paging.module +++ b/smart_paging.module @@ -468,70 +468,6 @@ function smart_paging_entity_insert($entity, $entity_type) { } /** - * Implements hook_url_inbound_alter(). - */ -function smart_paging_url_inbound_alter(&$path, &$original_path, $path_language) { - $arg_count = count(arg()) - 1; - $page = arg($arg_count); - $sub_page = arg($arg_count - 1); - // Check if path has pattern of http://example.com//// - if ($arg_count > 2 && is_numeric($sub_page) && is_numeric($page)) { - if (arg($arg_count - 2) == variable_get('smart_paging_path_prefix', 'page')) { - // Set the 'page' value of GET method - $_GET['page'] = "$sub_page,$page"; - // Extract alias from arg() - $alias = arg(); - unset($alias[$arg_count - 2], $alias[$arg_count - 1], $alias[$arg_count]); - // Get the Drupal system URL for a path alias - $drupal_path = drupal_lookup_path('source', implode('/', $alias) , $path_language); - if (!empty($drupal_path)) { - // Alter inbound URL request - $path = $drupal_path; - } - else { - $path = implode('/', $alias); - } - } - } -} - -/** - * Implements hook_url_outbound_alter(). - * - * Change pagination query type URL to a clean URL - */ -function smart_paging_url_outbound_alter(&$path, &$options, $original_path) { - if (isset($options['query']['page'])) { - if (!empty($path) && !$options['alias']) { - $language = isset($options['language']) && isset($options['language']->language) ? $options['language']->language : NULL; - $alias = drupal_get_path_alias($original_path, $language); - if ($alias != $original_path) { - $path = $alias; - $options['alias'] = TRUE; - } - else { - $path_arg = arg(); - $path_arg = array_slice($path_arg, 0, array_search(variable_get('smart_paging_path_prefix', 'page'), $path_arg)); - $path = empty($path_arg) ? $original_path : implode('/', $path_arg); - } - } - $page_query = explode(',', $options['query']['page']); - if (isset($page_query[1]) && $page_query[1] != 0) { - $sub_page = $page_query[0]; - $page = isset($page_query[1]) ? $page_query[1] : '0'; - $path .= '/' . variable_get('smart_paging_path_prefix', 'page') . "/$sub_page/$page"; - } - else { - $sub_page = $page_query[0]; - if ($sub_page) { - $path .= '/' . variable_get('smart_paging_path_prefix', 'page') . "/$sub_page/0"; - } - } - unset($options['query']['page']); - } -} - -/** * Implements hook_field_attach_view_alter(). */ function smart_paging_field_attach_view_alter(&$build, $context) {