You are here

function finder_ui_element_item in Finder 7.2

Finder UI element item.

Parameters

$finder: The finder object.

$feid: The element machine name.

$item_key: The item key.

$item: The item.

Return value

The output.

2 calls to finder_ui_element_item()
finder_ui_element_item_page in modules/finder_ui/includes/element-item.inc
Finder UI element item page.
finder_ui_element_list in modules/finder_ui/includes/element.inc
Finder UI element list.

File

modules/finder_ui/includes/element-item.inc, line 125

Code

function finder_ui_element_item($finder, $feid, $item_key, $item) {
  $element =& $finder->elements[$feid];
  $output = $item['#item']['#title'] ? '<span class="label">' . $item['#item']['#title'] . ':</span>' : '';
  $value = strip_tags($item['#item']['#value']);

  // Ensure the value works out to something clickable.
  if (!$item['#item']['#value']) {

    // There is no original value.
    $value = '<em>' . t('empty') . '</em>';
  }
  elseif (!trim($value)) {

    // There is a value, but it is dodgy to display.
    $value = t('Yes');
  }
  $output .= finder_ui_modal_link($value, 'admin/structure/finder/list/' . $finder->name . '/element-item/' . $feid . '/' . $item_key . '/nojs', t('Edit'), 'ctools-modal-finder-modal-style');
  if (!empty($item['#item']['#extra'])) {
    $output .= '<span class="extra">' . filter_xss($item['#item']['#extra']) . '</span>';
  }
  $getq = explode('/', $_GET['q']);
  if (end($getq) == 'ajax' && !empty($item['#item']['#refresh'])) {
    $output .= '<div class="finder-ui-needs-reload"></div>';
  }
  return $output;
}