You are here

function theme_feeds_ui_container in Feeds 6

Same name and namespace in other branches
  1. 8.2 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_container()
  2. 7.2 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_container()
  3. 7 feeds_ui/feeds_ui.admin.inc \theme_feeds_ui_container()

Render a simple container. A container can have a title, a description and one or more actions. Recursive.

@todo Replace with theme_fieldset or a wrapper to theme_fieldset?

Parameters

$container: An array that describes the container. All elements are optional: array( 'title' => 'the title', 'body' => 'the body of the container, may also be an array of more containers.', 'class' => 'the class of the container.', 'id' => 'the id of the container', );

1 call to theme_feeds_ui_container()
theme_feeds_ui_plugin_form in feeds_ui/feeds_ui.admin.inc
Theme feeds_ui_plugin_form().
1 theme call to theme_feeds_ui_container()
theme_feeds_ui_edit_page in feeds_ui/feeds_ui.admin.inc
Theme feeds_ui_edit_page().

File

feeds_ui/feeds_ui.admin.inc, line 736
Contains all page callbacks, forms and theming functions for Feeds administrative pages.

Code

function theme_feeds_ui_container($container) {
  $class = empty($container['class']) ? ' plain' : " {$container['class']}";
  $id = empty($container['id']) ? '' : ' id="' . $container['id'] . '"';
  $output = '<div class="feeds-container' . $class . '"' . $id . '>';
  if (isset($container['actions']) && count($container['actions'])) {
    $output .= '<ul class="container-actions">';
    foreach ($container['actions'] as $action) {
      $output .= '<li>' . $action . '</li>';
    }
    $output .= '</ul>';
  }
  if (!empty($container['title'])) {
    $output .= '<h4 class="feeds-container-title">';
    $output .= $container['title'];
    $output .= '</h4>';
  }
  if (!empty($container['body'])) {
    $output .= '<div class="feeds-container-body">';
    if (is_array($container['body'])) {
      foreach ($container['body'] as $c) {
        $output .= theme('feeds_ui_container', $c);
      }
    }
    else {
      $output .= $container['body'];
    }
    $output .= '</div>';
  }
  $output .= '</div>';
  return $output;
}