You are here

function theme_simplemeta_meta_list in Simple Meta 6.2

Same name and namespace in other branches
  1. 7 simplemeta.theme.inc \theme_simplemeta_meta_list()

@file theming

1 theme call to theme_simplemeta_meta_list()
simplemeta_meta_list in ./simplemeta.admin.inc

File

./simplemeta.theme.inc, line 7
theming

Code

function theme_simplemeta_meta_list($items) {
  $header = array(
    t('Path'),
    t('Alias'),
    t('Action'),
  );
  $rows = array();
  foreach ($items as $meta) {

    // @todo think about how to determine that path is pattern, like node/%/edit
    $pattern = strpos($meta->path, '%') !== FALSE;
    $alias = drupal_get_path_alias($meta->path);
    $rows[] = array(
      !$pattern ? l($meta->path, $meta->path) : check_plain($meta->path),
      !$pattern && $alias != $meta->path ? l($alias, $meta->path) : '-',
      l(t('Edit'), 'admin/content/simplemeta/' . $meta->sid . '/edit') . ' | ' . l(t('Delete'), 'admin/content/simplemeta/' . $meta->sid . '/delete'),
    );
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('There is no saved meta data'),
        'colspan' => 3,
      ),
    );
  }
  return theme('table', $header, $rows);
}