You are here

function custompage_tile_wrap in Custom Page 7

Same name and namespace in other branches
  1. 6 custompage_util.inc \custompage_tile_wrap()

Wrap custompage tiles in some HTML that allows for easy inline editing.

4 calls to custompage_tile_wrap()
custompage_menu_tile in ./custompage_util.inc
custompage_node_tile in ./custompage_util.inc
custompage_region_tile in ./custompage_util.inc
Put a regions content in a custompage tile.
custompage_view_tile in ./custompage_util.inc
Render a custompage tile for a view.

File

./custompage_util.inc, line 181

Code

function custompage_tile_wrap($content, $editlink) {
  if (empty($content)) {
    return '';
  }

  // Don't do anything if empty
  $out = $content;
  $extraclass = '';
  if (user_access('edit custompage tiles') && variable_get('custompage_inline_edit', FALSE)) {
    $out = '<div class="edit">' . $editlink . '</div>' . $out;
    $extraclass = 'cp_showborder';
  }
  return '<div class="cp_tile ' . $extraclass . '">' . $out . '</div>';
}