You are here

function views_atom_handler_area_atom_tombstone::render in Views Atom 7

Render the area.

Overrides views_handler_area_text::render

File

includes/views_atom_handler_area_atom_tombstone.inc, line 72
Views area text handler.

Class

views_atom_handler_area_atom_tombstone

Code

function render($empty = FALSE) {
  if (!$empty || !empty($this->options['empty'])) {
    $updated = date('c', REQUEST_TIME);

    // If we are using the REQUEST as the updated variable then we don't really
    // know when the entity was deleted and a human-readable comment will be set.
    $show_updated_comment = TRUE;
    $tombstone_array = array(
      // @todo, what should title be, a field?
      'title' => t('Atom Tombstone'),
      'use_push' => $this->options['use_push'],
      'hub_url' => $this
        ->render_option_as_url('hub_url'),
      'feed_url' => $this
        ->render_option_as_url('feed_url'),
      'updated' => $updated,
      'show_updated_comment' => $show_updated_comment,
      'items' => array(),
    );
    if (!empty($this->options['item_url'])) {

      // @todo, security on tokenize? What happens if something maliscious is used in "!1" ?
      $tombstone_array['items'][] = array(
        'guid' => $this
          ->render_option_as_url('item_url'),
        'when' => $updated,
      );
    }
    return theme('views_atom_tombstone', $tombstone_array);
  }
  return '';
}