View source
<?php
include_once 'install_from_db/install_from_db.profile';
function openatrium_apps_servers_info() {
$info = drupal_parse_info_file(dirname(__FILE__) . '/openatrium.info');
$version = !empty($info['version']) ? 'openatrium-stable' : 'openatrium-development';
return array(
'openatrium' => array(
'title' => 'OpenAtrium',
'description' => "Apps for the OpenAtrium distribution",
'manifest' => 'http://appserver.openatrium.com/app/query/' . $version,
'profile' => 'openatrium',
'profile_version' => isset($info['version']) ? $info['version'] : '7.x-2.x-dev',
'server_name' => !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '',
'server_ip' => !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '',
),
);
}
function openatrium_form_install_configure_form_alter(&$form, &$form_state) {
openatrium_remove_message('offers a wide range of customization options', 'warning');
openatrium_remove_message('The image resize filter has been installed', 'warning');
openatrium_remove_message('To use menu blocks, find the "Add menu block');
$form['#validate'][] = 'openatrium_clean_urls_validate';
}
function openatrium_clean_urls_validate($form, &$form_state) {
if (empty($form_state['values']['clean_url'])) {
form_set_error('clean_url', t('Clean Urls must be available and enabled to use OpenAtrium.'));
}
}
function openatrium_form_panopoly_theme_selection_form_alter(&$form, &$form_state, $form_id) {
unset($form['theme_wrapper']['theme']['#options']['radix']);
unset($form['theme_wrapper']['theme']['#options']['radix_starter']);
$form['theme_wrapper']['theme']['#default_value'] = 'oa_radix';
}
function openatrium_features_post_restore($op, $items) {
openatrium_remove_message('The following views were using the index', 'warning');
}
function openatrium_remove_message($partial_message, $type = 'status') {
if (!empty($_SESSION['messages'][$type])) {
foreach ($_SESSION['messages'][$type] as $key => $message) {
if (strpos($message, $partial_message) !== FALSE) {
unset($_SESSION['messages'][$type][$key]);
}
}
if (empty($_SESSION['messages'][$type])) {
unset($_SESSION['messages'][$type]);
}
}
}