Index: l10n_community/moderate.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/moderate.inc,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 moderate.inc --- l10n_community/moderate.inc 18 Sep 2009 18:03:19 -0000 1.1.2.3 +++ l10n_community/moderate.inc 6 Nov 2009 15:58:26 -0000 @@ -49,10 +49,13 @@ function l10n_community_moderate_page($l * Filters used to present this moderation view. */ function l10n_community_moderation_form(&$form_state, $strings = array(), $language = NULL, $filters) { + + $form['#redirect'] = array($_GET['q'], l10n_community_flat_filters($filters)); + $form['pager'] = array( '#value' => theme('pager', NULL, $filters['limit'], 0) ); - + // Keep language code in form for further reference. $form['langcode'] = array( '#type' => 'value', Index: l10n_community/translate.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/translate.inc,v retrieving revision 1.1.2.7.2.24 diff -u -p -r1.1.2.7.2.24 translate.inc --- l10n_community/translate.inc 6 Nov 2009 15:29:48 -0000 1.1.2.7.2.24 +++ l10n_community/translate.inc 6 Nov 2009 15:58:26 -0000 @@ -185,15 +185,8 @@ function l10n_community_filter_form_subm if ($form_state['values']['op'] == t('Filter')) { $filters = l10n_community_build_filter_values($form_state['values']); - // Replace some values by their string representation. - foreach (array('project' => 'uri', 'author' => 'name') as $name => $key) { - if (!empty($filters[$name])) { - $filters[$name] = $filters[$name]->$key; - } - } - // Redirect keeping the relevant filters intact in the URL. - $form_state['redirect'] = array($_GET['q'], $filters); + $form_state['redirect'] = array($_GET['q'], l10n_community_flat_filters($filters)); } } @@ -267,16 +260,10 @@ function l10n_community_translate_form(& // after submission, the same page can be shown. $filters['page'] = (int) $_GET['page']; } - // Replace some values by their string representation for URL redirects. - foreach (array('project' => 'uri', 'author' => 'name') as $name => $key) { - if (!empty($filters[$name])) { - $filters[$name] = $filters[$name]->$key; - } - } $form = array( '#tree' => TRUE, - '#redirect' => array($_GET['q'], $filters) + '#redirect' => array($_GET['q'], l10n_community_flat_filters($filters)) ); $form['pager_top'] = array( '#weight' => -10, @@ -767,3 +754,20 @@ function l10n_community_build_filter_val } return $filter; } + +/** + * Replace complex data filters (objects or arrays) with string representations. + * + * @param $filters + * Associative array with filters passed. + * @return + * The modified filter array only containing string and number values. + */ +function l10n_community_flat_filters($filters) { + foreach (array('project' => 'uri', 'author' => 'name') as $name => $key) { + if (!empty($filters[$name])) { + $filters[$name] = $filters[$name]->$key; + } + } + return $filters; +}