You are here

function _ds_field_object_info in Display Suite 6.3

Same name and namespace in other branches
  1. 6 includes/ds.fields.inc \_ds_field_object_info()
  2. 6.2 includes/ds.fields.inc \_ds_field_object_info()

Return info about the value field, including token info.

Parameters

array $form The current form.:

string $object The object name (ie node, user, comment):

array $field The field array.:

1 call to _ds_field_object_info()
ds_code_field_form in includes/ds.fields.inc
Code field form.

File

includes/ds.fields.inc, line 248
Manage fields.

Code

function _ds_field_object_info(&$form, $object, $field) {
  $form['code_identity']['help'] = array(
    '#type' => 'item',
    '#value' => t('Every field will be wrapped in &lt;div class="field field-key"&gt;VALUE&lt;/div&gt;.<br/>Enter PHP code between &lt;?php ?&gt;. If you are using PHP, the variable for the ' . $object . ' is called $object.<br/>Note that executing incorrect PHP-code can break your Drupal site.'),
  );
  if (module_exists('token')) {
    $form['code_identity']['code_token'] = array(
      '#type' => 'checkbox',
      '#title' => t('Toggle this checkbox if you are using tokens in this field.'),
      '#default_value' => $field['properties']['token'],
    );
    $form['code_identity']['tokens'] = array(
      '#type' => 'fieldset',
      '#title' => t('Placeholder tokens'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['code_identity']['tokens']['help'] = array(
      '#value' => theme('token_help', $object),
    );
  }
  else {
    $form['code_identity']['help']['code_token'] = array(
      '#type' => 'value',
      '#value' => FALSE,
    );
    $form['code_identity']['help']['#value'] .= '<br />' . t("To use dynamic placeholder tokens in your custom fields (the ID or title of the current node, for example), download and install the <a href='@token'>Token module</a> from Drupal.org.", array(
      '@token' => 'http://www.drupal.org/project/token',
    ));
  }
}