annotate openmindattribute/link.devel_generate.inc @ 31:48bbba800c03

remove unused method.
author casties
date Thu, 21 Jan 2016 18:24:51 +0100
parents 124ef8f3b22d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
2
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
3 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
4 * @file
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 * Devel Generate support for Link module.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
7
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
8 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
9 * Implements hook_devel_generate().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
10 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
11 function link_devel_generate($object, $field, $instance, $bundle) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
12 if (field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_CUSTOM) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
13 return devel_generate_multiple('_link_devel_generate', $object, $field, $instance, $bundle);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
14 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
15 else {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 return _link_devel_generate($object, $field, $instance, $bundle);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
17 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
19
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
20 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 * Callback for hook_devel_generate().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
22 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 function _link_devel_generate($object, $field, $instance, $bundle) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 $link = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 'url' => url('<front>', array('absolute' => TRUE)),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
26 'attributes' => _link_default_attributes(),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
28 if ($instance['settings']['title'] != 'none') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 $link['title'] = devel_create_greeking(mt_rand(1, 3), TRUE);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
30 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
31 return $link;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
32 }