All pastes #80984 Raw Edit

Untitled

public php v1 · immutable
·published 2006-07-07 00:28 UTC
rendered paste body
<?php/* * Created on 6-jul-2006 by Heine * */function dump($msg, $var_name, $return = FALSE) {  static $count;  $style = (($count % 2) == 1) ? 'background-color: #FFDDDD;' : 'background-color: #DDDDFF;';  $style .= 'font-size: 11px;';   $output = $msg .'<pre style="'. $style .'">';  $output .= check_plain(print_r($var_name, TRUE));  $output .= '</pre></p>';  $count++;  if($return) {    return $output;  }  print $output;}function test_form_alter($form_id, &$form) {    if (variable_get('test_display_form_id', FALSE)) {    $form['#suffix'] .= '<br /><b>'. check_plain($form_id) .'</b><br />';  }  if (variable_get('test_display_form_dump', FALSE)) {    $form['#suffix'] .= dump('', $form, TRUE);   }}function test_help($section) {  switch ($section) {    case 'admin/modules#description':      // This description is shown in the listing at admin/modules.      return t('All-round test module for Deelstra.');      break;  }    }function test_settings() {  $form['test_display_form_id'] = array(    '#type' => 'checkbox',    '#default_value' => variable_get('test_display_form_id', FALSE),    '#title' => t('Display form ids'),  );  $form['test_display_form_dump'] = array(    '#type' => 'checkbox',    '#default_value' => variable_get('test_display_form_dump', FALSE),    '#title' => t('Display form dumps'),  );  return $form;}