From 83cbcefff9e7f2d4ecf87b80175fb4e65684a324 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Tue, 20 Dec 2016 12:22:42 +0100 Subject: [PATCH] re-added temporarly translate_perms --- .../gui/translate_perms/translate_perms.info | 29 ++++++ .../translate_perms/translate_perms.module | 92 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 sites/all/modules/gui/translate_perms/translate_perms.info create mode 100644 sites/all/modules/gui/translate_perms/translate_perms.module diff --git a/sites/all/modules/gui/translate_perms/translate_perms.info b/sites/all/modules/gui/translate_perms/translate_perms.info new file mode 100644 index 00000000..073eee95 --- /dev/null +++ b/sites/all/modules/gui/translate_perms/translate_perms.info @@ -0,0 +1,29 @@ +name = Translate Perms +description = "The description of this module" + +; Core version (required) +core = 7.x + +; Package name (see http://drupal.org/node/542202 for a list of names) +; package = + +; PHP version requirement (optional) +; php = 5.2 + +; Loadable code files +; files[] = translate_perms.module +; files[] = translate_perms.admin.inc +; files[] = translate_perms.class.inc + +; Module dependencies +; dependencies[] = mymodule +; dependencies[] = theirmodule (1.2) +; dependencies[] = anothermodule (>=2.4) +; dependencies[] = views (3.x) + +; Configuration page +; configure = admin/config/translate_perms + + +; For further information about configuration options, see +; - http://drupal.org/node/542202 diff --git a/sites/all/modules/gui/translate_perms/translate_perms.module b/sites/all/modules/gui/translate_perms/translate_perms.module new file mode 100644 index 00000000..c0698102 --- /dev/null +++ b/sites/all/modules/gui/translate_perms/translate_perms.module @@ -0,0 +1,92 @@ + array( + 'title' => t('Access translations overview') + ), + + 'access_translation_table_fields' => array( + 'title' => t('Access translation Fields table') + ), + 'access_translation_table_content_type' => array( + 'title' => t('Access translation Content types table') + ), + 'access_translation_table_menu' => array( + 'title' => t('Access translation menu table') + ), + 'access_translation_table_taxonomy' => array( + 'title' => t('Access translation taxonomy table') + ), + + 'translate_strings' => array( + 'title' => t('Translate strings') + ), + 'import_translations' => array( + 'title' => t('Import translations') + ), + 'refresh_strings' => array( + 'title' => t('Refresh strings') + ), + 'update_modules_translations' => array( + 'title' => t('Update modules translations') + ), + 'export_translations' => array( + 'title' => t('Import translations') + ), + ); +} + + +/** + * Implements hook_menu_alter(). + */ +function translate_perms_menu_alter(&$items) { + + if(isset($items['admin/config/regional/translate'])) + $items['admin/config/regional/translate']['access arguments'] = array('access_translations_overview'); + + + if(isset($items['admin/config/regional/translate/table'])) + $items['admin/config/regional/translate/table']['access arguments'] = array('access_translation_table_fields'); + + if(isset($items['admin/config/regional/translate/table/nodetype'])) + $items['admin/config/regional/translate/table/nodetype']['access arguments'] = array('access_translation_table_content_type'); + + if(isset($items['admin/config/regional/translate/table/menu'])) + $items['admin/config/regional/translate/table/menu']['access arguments'] = array('access_translation_table_menu'); + + if(isset($items['admin/config/regional/translate/table/taxonomy'])) + $items['admin/config/regional/translate/table/taxonomy']['access arguments'] = array('access_translation_table_taxonomy'); + + + + if(isset($items['admin/config/regional/translate/translate'])) + $items['admin/config/regional/translate/translate']['access arguments'] = array('translate_strings'); + + if(isset($items['admin/config/regional/translate/import'])) + $items['admin/config/regional/translate/import']['access arguments'] = array('import_translations'); + + if(isset($items['admin/config/regional/translate/i18n_string'])) + $items['admin/config/regional/translate/i18n_string']['access arguments'] = array('refresh_strings'); + + if(isset($items['admin/config/regional/translate/update'])) + $items['admin/config/regional/translate/update']['access arguments'] = array('update_modules_translations'); + + if(isset($items['admin/config/regional/translate/export'])) + $items['admin/config/regional/translate/export']['access arguments'] = array('export_translations'); + + +} +