summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Reyero2007-03-14 21:02:39 (GMT)
committer Jose Reyero2007-03-14 21:02:39 (GMT)
commit41c3c9d7e03169a3519e5b0d672e26be4a15c2d0 (patch)
tree639b4263155873cee06338b30a5093c8800371a2
parent47c571b586e51f46062ea74bf0cee1ed34e7d989 (diff)
Changed default behaviour. Now, language conditions are applied unless there's some exposed language filter.
-rw-r--r--i18nviews/i18nviews.module12
1 files changed, 10 insertions, 2 deletions
diff --git a/i18nviews/i18nviews.module b/i18nviews/i18nviews.module
index b6cf204..b76bfcc 100644
--- a/i18nviews/i18nviews.module
+++ b/i18nviews/i18nviews.module
@@ -79,7 +79,7 @@ function i18n_views_filter_handler($filterdata, $filterinfo, &$query) {
// If this filter is used, rollback value set in pre_query and set the new one.
i18n_selection_mode('reset');
i18n_selection_mode($mode);
- }
+ }
}
/**
* Implementation of hook_views_pre_query().
@@ -87,7 +87,15 @@ function i18n_views_filter_handler($filterdata, $filterinfo, &$query) {
* Disable language conditions for views. This is called before filter handlers
*/
function i18n_views_pre_query(&$view) {
- i18n_selection_mode('off');
+ // If any language filter, the language selection mode will be 'off'
+ foreach($view->exposed_filter as $filter) {
+ if($filter['field'] == 'i18n.language') {
+ $mode = 'off';
+ break;
+ }
+ }
+ // If no filter, sets again the same mode so we can just 'reset' after the query
+ i18n_selection_mode(isset($mode) ? $mode : i18n_selection_mode());
}
/**
* Implementation of hook_views_pre_view().