Add a configurable link in the footer to the Applications page

(DBOINCP-121)
This commit is contained in:
Tristan Olive 2015-07-07 18:31:59 -04:00
parent 00c0eea9e8
commit e235d91a41
3 changed files with 21 additions and 0 deletions

View File

@ -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)'),

View File

@ -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']);

View File

@ -333,6 +333,9 @@
<ul id="server-status" class="tab-list">
<li class="first tab">
<?php print l(bts('Applications'), $app_list_url); ?>
</li>
<li class="last tab">
<?php print l(bts('Server status'), $server_status_url); ?>
</li>
<!--<li class="first tab">Server status</li>