summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--i18n.module14
-rw-r--r--i18ntaxonomy/i18ntaxonomy.module13
2 files changed, 22 insertions, 5 deletions
diff --git a/i18n.module b/i18n.module
index a331ba1..d6bdebd 100644
--- a/i18n.module
+++ b/i18n.module
@@ -487,6 +487,20 @@ function i18n_db_rewrite_where($alias, $type, $mode = NULL) {
}
/**
+ * Implementation of hook_preprocess_page().
+ *
+ * Add the language code to the classes for the <body> tag. Unfortunately, some
+ * themes will not respect the variable we're modifying to achieve this - in
+ * particular, Garland and Minelli do not.
+ */
+function i18n_preprocess_page(&$variables) {
+ if (isset($variables['body_classes'])) {
+ global $language;
+ $variables['body_classes'] .= ' i18n-' . $language->language;
+ }
+}
+
+/**
* Implementation of hook_exit().
*/
function i18n_exit() {
diff --git a/i18ntaxonomy/i18ntaxonomy.module b/i18ntaxonomy/i18ntaxonomy.module
index 32915ea..2ad2f00 100644
--- a/i18ntaxonomy/i18ntaxonomy.module
+++ b/i18ntaxonomy/i18ntaxonomy.module
@@ -101,10 +101,13 @@ function i18ntaxonomy_menu() {
* Take over the taxonomy pages
*/
function i18ntaxonomy_menu_alter(&$items) {
- // Taxonomy term page. Localize terms.
- $items['taxonomy/term/%']['module'] = 'i18ntaxonomy';
- $items['taxonomy/term/%']['page callback'] = 'i18ntaxonomy_term_page';
- $items['taxonomy/term/%']['file'] = 'i18ntaxonomy.pages.inc';
+ // If ctool's page manager is active for the path skip this modules override.
+ if (variable_get('page_manager_term_view_disabled', TRUE)) {
+ // Taxonomy term page. Localize terms.
+ $items['taxonomy/term/%']['module'] = 'i18ntaxonomy';
+ $items['taxonomy/term/%']['page callback'] = 'i18ntaxonomy_term_page';
+ $items['taxonomy/term/%']['file'] = 'i18ntaxonomy.pages.inc';
+ }
// Localize autocomplete
$items['taxonomy/autocomplete']['module'] = 'i18ntaxonomy';
@@ -431,7 +434,7 @@ function i18ntaxonomy_form_alter(&$form, $form_state, $form_id) {
break;
default:
if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id
- && ($node = $form['#node']) && isset($form['taxonomy']) ) {
+ && ($node = $form['#node']) && isset($form['taxonomy']) && !variable_get('taxonomy_override_selector', FALSE)) {
// Node form. Translate vocabularies.
i18ntaxonomy_node_form($form);
}