You are here

function commons_bw_create_all_widget in Drupal Commons 7.3

Provides a styled content creation dropdown widget for the 'all' tab of the group homepage browsing widget.

Parameters

$group: The group node associated with the group homepage.

Return value

string The content creation dropdown widget HTML.

1 string reference to 'commons_bw_create_all_widget'
commons_bw_hook_info in modules/commons/commons_bw/commons_bw.module
Implements hook_hook_info().

File

modules/commons/commons_bw/commons_bw.module, line 394

Code

function commons_bw_create_all_widget($group) {
  $links = array();

  // Collect definitions from implementing modules.
  $items = module_invoke_all('commons_bw_create_all_widget', $group);
  uasort($items, 'element_sort');
  foreach ($items as $module => $item) {
    $links[] = $item['link'] . ' ' . $item['text'];

    // Populate the default content creation link.
    if (isset($item['default']) && $item['default']) {
      $default = $item;
    }
  }
  $output = '';
  if (!empty($default)) {
    $output .= $default['link'] . '<a class="commons-bw-create-choose"><span></span></a>';
  }
  $output .= '<div class="commons-bw-create-choose-bg"></div><div class="commons-bw-create-choose-holder">' . theme('item_list', array(
    'items' => $links,
    'type' => 'ul',
    'attributes' => array(
      'class' => 'commons-bw-create-all-widget-types',
    ),
  )) . '</div>';
  return $output;
}