You are here

function clock_links_pre_render in Clock 7.2

Populates an element's #links property with child elements that are links.

1 string reference to 'clock_links_pre_render'
clock_element_info in ./clock.module
Implements hook_element_info().

File

./clock.module, line 297
Display clocks on your site.

Code

function clock_links_pre_render($elements) {

  // Support setting '#links' manually.
  $elements['#links'] = isset($elements['#links']) ? $elements['#links'] : array();
  foreach (element_children($elements, TRUE) as $child) {
    if (isset($elements[$child]['#type']) && $elements[$child]['#type'] == 'link') {
      $elements['#links'][$child] = array(
        'title' => $elements[$child]['#title'],
        'href' => $elements[$child]['#href'],
        'html' => isset($elements[$child]['#html']) ? $elements[$child]['#html'] : FALSE,
        'attributes' => isset($elements[$child]['#attributes']) ? $elements[$child]['#attributes'] : array(),
      );
    }
  }
  return $elements;
}