target.inc 894 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Define Linkit target attribute plugin.
  5. */
  6. $plugin = array(
  7. 'name' => t('Target'),
  8. 'callback' => 'linkit_attribute_plugin_target',
  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_target($plugin, $settings = array()) {
  25. return array(
  26. '#type' => 'select',
  27. '#title' => $plugin['name'],
  28. '#options' => array(
  29. '' => '',
  30. '_blank' => t('New window (_blank)'),
  31. '_top' => t('Top window (_top)'),
  32. '_self' => t('Same window (_self)'),
  33. '_parent' => t('Parent window (_parent)')
  34. ),
  35. '#weight' => isset($settings['weight']) ? $settings['weight'] : 0,
  36. );
  37. }