Exemplo n.º 1
0
/**
 * Implements template_preprocess_maintenance_page().
 */
function solkit_octal_preprocess_maintenance_page(&$variables)
{
    global $install_state;
    if ($install_state) {
        // Find the number of tasks to run.
        $tasks = install_tasks_to_display($install_state);
        $total = sizeof($tasks);
        // Find the position of the active task.
        $keys = array_keys($tasks);
        $active_task = $install_state['active_task'];
        $current = array_search($active_task, $keys) + 1;
        // Show steps.
        $variables['steps'] = t('Step @current of @total', array('@current' => $current, '@total' => $total));
        $variables['title'] = $tasks[$active_task];
    }
    $profile = isset($_GET['profile']) ? $_GET['profile'] : '';
    if ($profile) {
        $path = drupal_get_path('profile', $profile);
        $info_file = $path . '/' . $profile . '.info';
        $info = drupal_parse_info_file($info_file);
        $variables['site_name'] = $info['name'];
        $version['version'] = $info['version'];
        // Use copyright from distro info file.
        if (isset($info['copyright'])) {
            $variables['copyright'] = $info['copyright'];
        } else {
            $variables['copyright'] = st('@name @version', array('@name' => $info['name'], '@version' => $info['version']));
        }
        // Quick fix to add the required radix-progress.js.
        // We assume that Radix is at profiles/*/themes/radix.
        // TODO: handle this better.
        drupal_add_js($path . '/themes/radix/assets/javascripts/radix-progress.js');
    }
}
Exemplo n.º 2
0
/**
 * Display themed installer output and end the page request.
 *
 * Installation tasks should use drupal_set_title() to set the desired page
 * title, but otherwise this function takes care of theming the overall page
 * output during every step of the installation.
 *
 * @param $output
 *   The content to display on the main part of the page.
 * @param $install_state
 *   An array of information about the current installation state.
 */
function install_display_output($output, $install_state)
{
    drupal_page_header();
    // Only show the task list if there is an active task; otherwise, the page
    // request has ended before tasks have even been started, so there is nothing
    // meaningful to show.
    if (isset($install_state['active_task'])) {
        // Let the theming function know when every step of the installation has
        // been completed.
        $active_task = $install_state['installation_finished'] ? NULL : $install_state['active_task'];
        drupal_add_region_content('sidebar_first', theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task)));
    }
    print theme($install_state['database_tables_exist'] ? 'maintenance_page' : 'install_page', array('content' => $output));
    exit;
}