Project

General

Profile

Paste
Download (1.41 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / ctools / plugins / content_types / user_form / user_form_status.inc @ 6e3ce7c2

1 6e3ce7c2 Assos Assos
<?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 status field'),
11
  'description' => t('The user status 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 status form field.
18
 */
19
function ctools_user_form_status_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['account']['status'])) {
27
      $block->content['status'] = $context->form['account']['status'];
28
      unset($context->form['account']['status']);
29
    }
30
  }
31
  else {
32
    $block->content = t('User status form.');
33
  }
34
  return $block;
35
}
36
37
/**
38
 * Ctools plugin admin title function for the status form field.
39
 */
40
function ctools_user_form_status_content_type_admin_title($subtype, $conf, $context) {
41
  return t('"@s" user form status field', array('@s' => $context->identifier));
42
}
43
44
/**
45
 * Ctools plugin configuration edit form for the status form field.
46
 *
47
 * Provide a blank form so we have a place to have context setting.
48
 */
49
function ctools_user_form_status_content_type_edit_form($form, &$form_state) {
50
  return $form;
51
}