Add enabled setting display in list

NancyDru - January 3, 2009 - 17:52
Project:MultiBlock
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:NancyDru
Status:closed
Description

To make sure MB knows I enabled my module, I modified "theme_multiblock_general" to show the enabled status. This might be useful information for other developers.

function theme_multiblock_general($add_block_form, $multiblocks) {
  $output = '';
  $noyes = array('No', 'Yes');
 
  $output .= '<p><h3>'. t('Add Instance') .'</h3>'. $add_block_form .'</p>';
 
  $header = array(t('Title'), t('Original Block Title'), t('Original Module'), t('Enabled'), t('Original Delta'), t('Action'));
 
  foreach ($multiblocks as $row) {
    $delete_link = 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];
    $rows[] = array(check_plain($row->title), $title, $row->module, $mb_enabled, $row->orig_delta, $delete_link);
  }
 
  $output .= '<p><h3>'. t('Manage Instances') .'</h3>'. theme('table', $header, $rows) .'</p>';
 
  return $output;
}

#1

NancyDru - January 3, 2009 - 18:00

Fix committed to DRUPAL-5 and DRUPAL-6--1 branches.

#2

NancyDru - January 3, 2009 - 18:00
Status:needs review» fixed

#3

andrewlevine - January 3, 2009 - 18:08
Status:fixed» active

I think the title "Enabled" might be a little confusing, maybe "MultiBlock Enabled" is a little better? That still is even a little confusing because my guess is 80% of users won't know what that means. Let me know what you think. Useful feature anyways though, thanks for adding it.

#4

NancyDru - January 3, 2009 - 19:00

How about "Module enabled"?

#5

andrewlevine - January 4, 2009 - 03:29

I'm not sure that would be accurate because it doesn't have to do with whether the module is enabled or not. How about "Saves Per-block Settings"?

#6

NancyDru - January 4, 2009 - 04:39

Actually, I've come back to your original suggestion because it pretty much says what the README and handbook page says. It will go in with the title editing fix tomorrow.

#7

NancyDru - January 4, 2009 - 13:39
Status:active» fixed

Fix committed on both branches. Plus the "yes/no" is changed to check mark or red X.

#8

andrewlevine - January 5, 2009 - 21:40
Status:fixed» active

I think we need to run the check/X images through theme_image so it corrects the path in the case that the Drupal site isn't at the root.

#9

NancyDru - January 6, 2009 - 07:37
Status:active» fixed

Committed on both branches.

#10

System Message - January 20, 2009 - 07:40
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.