1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* Plugins are described by creating a $plugin array which will be used
|
5
|
* by the system that includes this file.
|
6
|
*/
|
7
|
$plugin = array(
|
8
|
'single' => TRUE,
|
9
|
'icon' => 'icon_user_form.png',
|
10
|
'title' => t('User form timezone field'),
|
11
|
'description' => t('The user timezone form.'),
|
12
|
'required context' => new ctools_context_required(t('Form'), 'form'),
|
13
|
'category' => t('Form'),
|
14
|
);
|
15
|
|
16
|
/**
|
17
|
* Ctools plugin content type render for the timezone form field.
|
18
|
*/
|
19
|
function ctools_user_form_timezone_content_type_render($subtype, $conf, $panel_args, &$context) {
|
20
|
$block = new stdClass();
|
21
|
$block->module = t('user-form');
|
22
|
|
23
|
$block->delta = 'title-options';
|
24
|
|
25
|
if (isset($context->form)) {
|
26
|
if (!empty($context->form['timezone'])) {
|
27
|
$block->content['timezone'] = $context->form['timezone'];
|
28
|
unset($context->form['timezone']);
|
29
|
}
|
30
|
}
|
31
|
else {
|
32
|
$block->content = t('User timezone form.');
|
33
|
}
|
34
|
return $block;
|
35
|
}
|
36
|
|
37
|
/**
|
38
|
* Ctools plugin admin title function for the timezone form field.
|
39
|
*/
|
40
|
function ctools_user_form_timezone_content_type_admin_title($subtype, $conf, $context) {
|
41
|
return t('"@s" user form timezone field', array('@s' => $context->identifier));
|
42
|
}
|
43
|
|
44
|
/**
|
45
|
* Ctools plugin configuration edit form for the timezone form field.
|
46
|
*
|
47
|
* Provide a blank form so we have a place to have context setting.
|
48
|
*/
|
49
|
function ctools_user_form_timezone_content_type_edit_form($form, &$form_state) {
|
50
|
return $form;
|
51
|
}
|