-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile.profile
49 lines (46 loc) · 1.42 KB
/
profile.profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
// $Id$
/**
* Implements hook_form_alter().
*
* Allows the profile to alter the site configuration form.
*/
function openpublish_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'install_configure_form') {
// Set default for site name field.
$form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME'];
}
}
/**
* Implements hook_appstore_stores_info
*/
function openpublish_apps_servers_info() {
$info = drupal_parse_info_file(dirname(__file__) . '/openpublish.info');
return array(
'openpublish' => array(
'title' => 'Openpublish',
'description' => "Apps for the OpenPublish distribution",
'manifest' => 'http://appserver.openpublishapp.com/app/query/openpublish',
'profile' => 'Openpublish',
'profile_version' => isset($info['version']) ? $info['version'] : '7.x-1.0-alpha2',
'server_name' => $_SERVER['SERVER_NAME'],
'server_ip' => $_SERVER['SERVER_ADDR'],
),
);
}
/**
* Implements hook_init
*/
function openpublish_init() {
$cache = cache_get("openpublish_info");
if (isset($cache->data)) {
$data = $cache->data;
}
else {
$info = drupal_parse_info_file(dirname(__file__) . '/openpublish.info');
$version = array_key_exists('version', $info) ? $info['version'] : '7.x-1.x';
$data = array("profile" => "openpublish", "profile_version" => $version);
cache_set("openpublish_info", $data);
}
drupal_add_js($data, 'setting');
}