You are here

function theme_favorites in Favorites 6

Same name and namespace in other branches
  1. 7.2 favorites.module \theme_favorites()
  2. 7 favorites.module \theme_favorites()

Theme callback.

Return a themed item list of favorites with title, link and link to delete.

1 theme call to theme_favorites()
favorites_list in ./favorites.module
Generate the "My Favorites" list.

File

./favorites.module, line 137
The favorites module allows users to bookmark any path within a site.

Code

function theme_favorites($favorites = array()) {
  $items = array();
  $destination = explode('=', drupal_get_destination(), 2);
  foreach ($favorites as $favorite) {
    $items[] = l($favorite->title, $favorite->path, array(
      'query' => $favorite->query,
    )) . ' ' . l('x', 'favorites/remove/' . $favorite->fid, array(
      'query' => array(
        'token' => $favorite->token,
        'destination' => $destination[1],
      ),
      'attributes' => array(
        'class' => 'favorites-remove',
        'title' => t('delete this item'),
      ),
    ));
  }
  return theme('item_list', $items);
}