You are here

function _media_sitemap_list in Media Sitemap 7

List the available sitemap.

1 string reference to '_media_sitemap_list'
media_sitemap_menu in ./media_sitemap.module
Implements hook_menu().

File

./media_sitemap.module, line 149
This module is used for creating XML sitemap of Image/Video for Google.

Code

function _media_sitemap_list() {
  $output = '';
  $header = array(
    t('SITEMAP URL'),
    t('CREATED DATE'),
    t('TOTAL LINKS'),
    t('ACTIONS'),
  );
  $rows = array();
  $url = 'media_sitemap/image_sitemap.xml';
  $url = variable_get('file_public_path', 'sites/default/files') . '/' . $url;

  // Rows of table.
  $image_sitemap_created = variable_get('image_sitemap_created');
  $image_sitemap_number_of_urls = variable_get('image_sitemap_number_of_urls');
  if (isset($image_sitemap_created) && isset($image_sitemap_number_of_urls)) {
    $rows[] = array(
      $build_link = l($url, $url),
      date('d-M-Y ', variable_get('image_sitemap_created')),
      variable_get('image_sitemap_number_of_urls'),
      l(t('Re-Generate'), MEDIA_SITEMAP_ADMIN_PATH . '/generate'),
    );
  }
  $theme_args = array(
    'header' => $header,
    'rows' => $rows,
    'empty' => t('No sitemaps available.') . ' ' . l(t('Add a new media sitemap'), MEDIA_SITEMAP_ADMIN_PATH . '/generate'),
  );
  $output = theme('table', $theme_args);
  return $output;
}