title.inc 741 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @file
  4. * Define Linkit title attribute plugin.
  5. */
  6. $plugin = array(
  7. 'name' => t('Title'),
  8. 'callback' => 'linkit_attribute_plugin_title',
  9. );
  10. /**
  11. * Create a FAPI element.
  12. *
  13. * @param array $plugin
  14. * This is the plugin definition.
  15. *
  16. * @param array $settings
  17. * An array of settings for this attribute. This is from the profile settings.
  18. *
  19. * @return
  20. * An FAPI element.
  21. *
  22. * @see LinkitProfile::setAttributes()
  23. */
  24. function linkit_attribute_plugin_title($plugin, $settings = array()) {
  25. return array(
  26. '#type' => 'textfield',
  27. '#title' => $plugin['name'],
  28. '#maxlength' => 255,
  29. '#size' => 40,
  30. '#default_value' => '',
  31. '#weight' => isset($settings['weight']) ? $settings['weight'] : 0,
  32. );
  33. }