forked from firfin/campaignion_starterkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
campaignion_starterkit.profile
43 lines (39 loc) · 1.14 KB
/
campaignion_starterkit.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
<?php
/**
* Implements hook_user_login().
*/
function campaignion_starterkit_user_login(&$edit, $account) {
if (in_array('editor', $account->roles) || in_array('administrator', $account->roles)) {
$edit['redirect'] = '<front>';
}
}
/**
* Implements hook_ctools_plugin_api().
*/
function campaignion_starterkit_ctools_plugin_api() {
list($module, $api) = func_get_args();
if ($module == "context" && $api == "context") {
return array("version" => "3");
}
}
function campaignion_starterkit_field_widget_form_alter(&$element, &$form_state, $context) {
if ($context['field']['type'] == 'pgbar') {
$field = &$element['options']['display']['template'];
$field['#type'] = 'select';
$field['#options'] = array(
'pgbar' => t('Progress bar'),
'thermometer' => t('Thermometer'),
);
if (!$field['#default_value'])
$field['#default_value'] = 'pgbar';
}
}
/**
* Implements hook_form_FORM_ID_alter().
* Implements hook_form_node_form_alter().
*
* Deactivate node revisions.
*/
function campaignion_starterkit_form_node_form_alter(&$form, &$form_state) {
$form['revision_information']['#access'] = FALSE;
}