You are here

protected function OAuth2ServerScopeUIController::overviewTableRow in OAuth2 Server 7

Overrides EntityDefaultUIController::overviewTableRow().

Overrides EntityDefaultUIController::overviewTableRow

File

includes/oauth2_server.scope_admin.inc, line 107
Admin UI for scopes.

Class

OAuth2ServerScopeUIController
UI controller.

Code

protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
  $entity_uri = entity_uri($this->entityType, $entity);
  $entity_label = entity_label($this->entityType, $entity);
  if ($this->server && $this->server->settings['default_scope'] == $entity->name) {
    $entity_label .= ' (' . t('Default') . ')';
  }
  $row[] = array(
    'data' => array(
      '#theme' => 'entity_ui_overview_item',
      '#label' => $entity_label,
      '#name' => FALSE,
      '#url' => $entity_uri ? $entity_uri : FALSE,
      '#entity_type' => $this->entityType,
    ),
  );

  // Add in any passed additional cols.
  foreach ($additional_cols as $col) {
    $row[] = $col;
  }

  // Add the edit and delete links.
  $row[] = l(t('edit'), $this->path . '/' . $id);
  if (module_exists('i18n_string')) {
    $row[] = l(t('translate'), $this->path . '/' . $id . '/translate');
  }
  $row[] = l(t('delete'), $this->path . '/' . $id . '/delete', array(
    'query' => drupal_get_destination(),
  ));
  return $row;
}