You are here

function theme_multiblock_general in MultiBlock 6

Same name and namespace in other branches
  1. 5 multiblock.module \theme_multiblock_general()
  2. 7 multiblock.module \theme_multiblock_general()

Theme function for the "Manage Block Instances" page.

1 theme call to theme_multiblock_general()
multiblock_general in ./multiblock.module
Page callback for the "Manage Block Instances page".

File

./multiblock.module, line 303

Code

function theme_multiblock_general($add_block_form, $multiblocks, $edit = FALSE) {
  $output = '';

  //  $noyes = array('No', 'Yes');
  $noyes = array(
    'misc/watchdog-error.png',
    'misc/watchdog-ok.png',
  );
  $output .= '<p><h3>' . ($edit ? t('Edit Instance') : t('Add Instance')) . '</h3>' . $add_block_form . '</p>';
  $header = array(
    t('Title'),
    t('Original Block Title'),
    t('Original Module'),
    t('MultiBlock Enabled'),
    t('Original Delta'),
    t('Action'),
  );
  foreach ($multiblocks as $row) {
    $ops_link = l(t('Edit'), 'admin/build/block/instances/edit/' . $row->delta) . ' ' . l(t('Delete'), 'admin/build/block/instances/delete/' . $row->delta);
    $title = multiblock_get_block_title($row->module, $row->orig_delta);
    $mb_enabled = $noyes[$row->multi_settings];
    $alt = t('Not Multiblock enabled');
    if ($row->multi_settings) {
      $alt = t('Multiblock enabled');
    }
    $rows[] = array(
      check_plain($row->title),
      check_plain($title),
      $row->module,
      array(
        'data' => theme('image', $mb_enabled, $alt, $alt),
        'align' => 'center',
      ),
      $row->orig_delta,
      $ops_link,
    );
  }
  $output .= '<p><h3>' . t('Manage Instances') . '</h3>' . theme('table', $header, $rows) . '</p>';
  return $output;
}