css_class); } function block_class_attributes($block) { $ret = db_fetch_object(db_query('SELECT css_class FROM {block_class} WHERE module = "%s" AND delta = "%s"', $block->module, $block->delta)); if ($ret !== FALSE) { return $ret; } $undef = (object) NULL; $undef->css_class = ''; return $undef; } function block_class_form_alter($form_id, &$form) { if ($form_id == 'block_admin_configure') { $block->module = $form['module']['#value']; $block->delta = $form['delta']['#value']; $attributes = block_class_attributes($block); $form['block_class'] = array( '#type' => 'fieldset', '#title' => t('Block Class settings'), '#collapsible' => TRUE, '#weight' => -1, ); $form['block_class']['css_class'] = array( '#type' => 'textfield', '#title' => t('CSS class(es)'), '#default_value' => $attributes->css_class, '#description' => t('Separate classes with a space. IMPORTANT: You must add <?php print block_class($block); ?> to your theme\'s block.tpl.php file to make the classes appear.'), ); } }