summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortimeisenhuth2013-09-03 13:24:43 +0200
committerEmil Stjerneman2013-09-03 13:24:43 +0200
commit46e6fed6c78134b23e9ebd99e2d62fdc922d6894 (patch)
tree2f6f9f65b25f8bd1a629371bc278e15fad0e2cdd
parentafc6570898e9db0dc68a98a650ecb152812b1761 (diff)
Added #2079909 by tim-e Added target attribute.7.x-3.0
-rw-r--r--plugins/linkit_attribute/target.inc33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/linkit_attribute/target.inc b/plugins/linkit_attribute/target.inc
new file mode 100644
index 0000000..b5de072
--- /dev/null
+++ b/plugins/linkit_attribute/target.inc
@@ -0,0 +1,33 @@
+<?php
+/**
+ * @file
+ * Define Linkit target attribute plugin.
+ */
+
+$plugin = array(
+ 'name' => t('Target'),
+ 'callback' => 'linkit_attribute_plugin_target',
+);
+
+/**
+ * Create a FAPI element.
+ *
+ * @param array $plugin
+ * This is the plugin definition.
+ *
+ * @param array $settings
+ * An array of settings for this attribute. This is from the profile settings.
+ *
+ * @return
+ * An FAPI element.
+ *
+ * @see LinkitProfile::setAttributes()
+ */
+function linkit_attribute_plugin_target($plugin, $settings = array()) {
+ return array(
+ '#type' => 'select',
+ '#title' => $plugin['name'],
+ '#options' => array('_self' => '_self', '_blank' => '_blank', '_parent' => '_parent', '_top' => '_top'),
+ '#weight' => isset($settings['weight']) ? $settings['weight'] : 0,
+ );
+}