You are here

function theme_boxes_box in Boxes 7

Same name and namespace in other branches
  1. 6 boxes.admin.inc \theme_boxes_box()

Theme function for the form.

1 theme call to theme_boxes_box()
boxes_block_view in ./boxes.module
Implements hook_block_view().

File

./boxes.admin.inc, line 74

Code

function theme_boxes_box($variables) {
  $block = $variables['block'];
  $empty = '';

  // Box is empty
  if ((empty($block['title']) || $block['title'] == '<none>') && empty($block['content'])) {

    // add a class to mark the box as empty
    $empty = ' box-empty';

    // show something if the block is empty but the user has the permission to edit it
    if (boxes_access_edit()) {
      $block['content'] = t('This box appears empty when displayed on this page. This is simply placeholder text.');
    }
    else {
      return;
    }
  }
  $output = "<div id='boxes-box-" . $block['delta'] . "' class='boxes-box" . (!empty($block['editing']) ? ' boxes-box-editing' : '') . $empty . "'>";
  $output .= '<div class="boxes-box-content">' . $block['content'] . '</div>';
  if (!empty($block['controls'])) {
    $output .= '<div class="boxes-box-controls">';
    $output .= $block['controls'];
    $output .= '</div>';
  }
  if (!empty($block['editing'])) {
    $output .= '<div class="box-editor">' . drupal_render($block['editing']) . '</div>';
  }
  $output .= '</div>';
  return $output;
}