From e235d91a41fea6bd0edf2b3cac8aa7ebf8f2058d Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Tue, 7 Jul 2015 18:31:59 -0400 Subject: [PATCH] Add a configurable link in the footer to the Applications page (DBOINCP-121) --- .../boinc/modules/boincuser/boincuser.admin.inc | 12 ++++++++++++ drupal/sites/default/boinc/themes/boinc/template.php | 6 ++++++ .../boinc/themes/boinc/templates/page.tpl.php | 3 +++ 3 files changed, 21 insertions(+) diff --git a/drupal/sites/default/boinc/modules/boincuser/boincuser.admin.inc b/drupal/sites/default/boinc/modules/boincuser/boincuser.admin.inc index 836a3dea94..1ec5e25752 100644 --- a/drupal/sites/default/boinc/modules/boincuser/boincuser.admin.inc +++ b/drupal/sites/default/boinc/modules/boincuser/boincuser.admin.inc @@ -42,6 +42,7 @@ function boincuser_admin_environment(&$form_state) { 'boinc_user_image_dir' => variable_get('boinc_user_image_dir', ''), 'boinc_host_sched_logs_dir' => variable_get('boinc_host_sched_logs_dir', ''), 'boinc_server_status_url' => variable_get('boinc_server_status_url', ''), + 'boinc_app_list_url' => variable_get('boinc_app_list_url', ''), 'boinc_debug_mode' => variable_get('boinc_debug_mode', 0), ); //drupal_set_message(print_r($default, true)); @@ -127,6 +128,17 @@ function boincuser_admin_environment(&$form_state) { ) ), ); + $form['boinc_app_list_url'] = array( + '#type' => 'textfield', + '#title' => t('BOINC applications page URL (optional)'), + '#default_value' => $default['boinc_app_list_url'], + '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).', + array( + '%full_url' => $base_url . '/apps.php', + '%relative_url' => 'apps.php', + ) + ), + ); $form['boinc_host_sched_logs_dir'] = array( '#type' => 'textfield', '#title' => t('BOINC host scheduler log directory (optional)'), diff --git a/drupal/sites/default/boinc/themes/boinc/template.php b/drupal/sites/default/boinc/themes/boinc/template.php index ab78892aee..c5a71fd23c 100644 --- a/drupal/sites/default/boinc/themes/boinc/template.php +++ b/drupal/sites/default/boinc/themes/boinc/template.php @@ -173,6 +173,12 @@ function boinc_preprocess_page(&$vars, $hook) { } $vars['server_status_url'] = $server_status_url; + $app_list_url = variable_get('boinc_app_list_url', ''); + if (!$app_list_url) { + $app_list_url = 'apps.php'; + } + $vars['app_list_url'] = $app_list_url; + // Remove title from search page if (arg(0) == 'search') { unset($vars['title']); diff --git a/drupal/sites/default/boinc/themes/boinc/templates/page.tpl.php b/drupal/sites/default/boinc/themes/boinc/templates/page.tpl.php index 7c667eba10..2874e8531f 100644 --- a/drupal/sites/default/boinc/themes/boinc/templates/page.tpl.php +++ b/drupal/sites/default/boinc/themes/boinc/templates/page.tpl.php @@ -333,6 +333,9 @@