You are here

function node_gallery_list in Node Gallery 6.2

Same name and namespace in other branches
  1. 6 node_gallery.pages.inc \node_gallery_list()
1 string reference to 'node_gallery_list'
node_gallery_menu in ./node_gallery.module
Implementation of hook_menu().

File

./node_gallery.pages.inc, line 36
Node gallery pages.

Code

function node_gallery_list($account = NULL, $gallery_config = NULL) {
  $uid = isset($account->uid) ? $account->uid : 0;
  $gallery_type = empty($gallery_config) ? '' : $gallery_config['gallery_type'];
  $galleries = node_gallery_get_gallery_list($uid, $gallery_type);
  $breadcrumbs = array(
    l(t('Home'), NULL),
    l(t('Galleries'), 'galleries'),
  );
  if (isset($account->name)) {
    $breadcrumbs[] = l(t('!user\'s Galleries', array(
      '!user' => $account->name,
    )), 'galleries/' . $account->uid);
  }
  drupal_set_breadcrumb($breadcrumbs);
  if (!empty($galleries)) {
    foreach ($galleries as $gallery) {
      $gallery->config = node_gallery_get_config($gallery->type);
      $items[] = theme('gallery_cover_view', $gallery);
    }
  }
  return theme('gallery_list', $items, $account) . theme('pager', NULL, variable_get('node_gallery_page_number', 20), 0);
}