diff --git a/instruments/.gitignore b/instruments/.gitignore index 7a098c9..a4178eb 100644 --- a/instruments/.gitignore +++ b/instruments/.gitignore @@ -5,3 +5,5 @@ /mmoda_nb2w_example/ /mmoda_euclid/ /mmoda_icecube/ +/mmoda_photoz_euclid/ +/mmoda_ctaimaging/ \ No newline at end of file diff --git a/mmoda.info b/mmoda.info index 2523651..de0f552 100644 --- a/mmoda.info +++ b/mmoda.info @@ -1,6 +1,7 @@ name = MMODA description = Multi-Messenger Online Data Analysis core = 7.x +version = 7.x-1.0 dependencies[] = libraries:libraries (2.x) dependencies[] = drupal:block dependencies[] = drupal:book diff --git a/mmoda.install b/mmoda.install index 71f1243..3f92365 100644 --- a/mmoda.install +++ b/mmoda.install @@ -91,14 +91,17 @@ function mmoda_add_custom_fields() field_create_field($field); } foreach (mmoda_help_page_field_default_field_instances() as $instance) { - field_create_instance($instance); + if(!is_null($instance)) + field_create_instance($instance); } } function mmoda_del_custom_fields() { foreach (mmoda_help_page_field_default_field_instances() as $instance) { - field_delete_instance($instance); + if (!is_null($instance)) { + field_delete_instance($instance); + } } // foreach (array_keys(mmoda_help_page_field_default_field_bases()) as $field) { // field_delete_field($field); @@ -133,6 +136,7 @@ function mmoda_install() $module_settings['common']['T2'] = '2017-03-06T15:32:27.0'; $module_settings['common']['T_format'] = 'isot'; $module_settings[$module_name . '_debug'] = true; + $module_settings['frontend_version'] = mmoda_get_frontend_version(); $module_settings['modules'] = array(); // Create role for user managers @@ -171,7 +175,7 @@ function mmoda_install() // variable_set('menu_options_'.$help_page_content_type, array(0)); // Add custom fields to book page content type - mmoda_add_custom_fields(); + // mmoda_add_custom_fields(); $book_allowed_types = variable_get('book_allowed_types', array( 'book' diff --git a/mmoda.lib.inc b/mmoda.lib.inc index 683eeb0..716ab90 100644 --- a/mmoda.lib.inc +++ b/mmoda.lib.inc @@ -432,6 +432,25 @@ function mmoda_get_users_with_role($role, $active_user = TRUE) return $users; } +function mmoda_get_frontend_version() +{ + $version = ''; + + $query = db_select('system', 'sys'); + $query->addExpression('CONVERT(sys.info USING utf8)', 'info'); + $query->condition('sys.name', 'mmoda'); + $query_result = $query->execute()->fetch(); + + if (!empty($query_result)) { + $unserialized_info = unserialize($query_result->info); + $version = "{$unserialized_info['version']}"; + } + else + watchdog('MMODA', 'frontened version not found in the database.'); + + return $version; +} + function _mmoda_write_log_file($filename, $content) { $filename = '/tmp/' . $filename; diff --git a/mmoda.module b/mmoda.module index eb0ed93..e00e4f1 100644 --- a/mmoda.module +++ b/mmoda.module @@ -365,11 +365,14 @@ function mmoda_main_block_content() // $mmoda_settings ['support_email'] = array('mohamed.meharga@unige.ch'); // variable_set ( 'mmoda_settings', $mmoda_settings ); + // watchdog('MMODA', 'content of mmoda_settings: ' . var_dump($mmoda_settings)); + $items['session_id'] = $session_id; $items['session_count'] = $session_count; $items['name_resolve_form'] = drupal_get_form('mmoda_name_resolve'); $items['common_form'] = drupal_get_form('mmoda_common'); $items['mmoda_debug'] = $mmoda_settings['mmoda_debug']; + $items['frontend_version'] = $mmoda_settings['frontend_version']; $items['auth_cookie'] = '_oauth2_proxy'; if (empty($mmoda_settings['instruments'])) { diff --git a/templates/mmoda-main.tpl.php b/templates/mmoda-main.tpl.php index c9f47f5..71975ac 100644 --- a/templates/mmoda-main.tpl.php +++ b/templates/mmoda-main.tpl.php @@ -298,12 +298,21 @@ class="glyphicon glyphicon-info-sign"> + +
+
version:
+ + +
+
version:
+ +