Custom theme and preprocessing

codecrow - October 15, 2009 - 20:13

I'm creating a new look for the revision summary for a node, but I can't seem to get the preprocessing for the theme to work as described in various literature. My override is being called, but the preprocessing function that I want to change some of the row values is not.

Right now, I have this code:

<?php
/**
* Implementation of hook_theme().
* Register the theme_hooks() available in this module, with their arguments
* and default values.
*
* This is working.
*/
function gravityswitch_theme() {
  return array(
   
'table_revisions' => array(
     
'arguments' => array('header' => NULL, 'rows' => NULL , 'attributes' => NULL, 'caption' => NULL),
     
//'template' => 'revisions-table', // revisions-table.tpl.php
   
),
  );
}

/**
* We have to do some stuff to the table for revisions before passing it on, like adding the extra link to the cells
*
* Currently, it should just echo some variables and stop to prove that it gets there,'
* But it doesn't.
*
**/

function gravityswitch_preprocess_table_revisions(&$variables) {
    echo(
"variables:<br />\n");
   
print_r($variables);
    exit;
}

/**
* Copied from the table theming code to start with.
*
* Implement (in your own module) the function below if you want to override
* the way in which the Revisions table is constructed.
* If you do, don't forget to register this theme_hook() via <your_module>_theme()
* in a manner similar to revisioning_theme() in this file.
*
* @param $header
* @param $rows
* @return themed HTML, see for instance /includes/theme.inc/theme_table() and
*         diff.module/theme_diff_table()
*
* @ingroup themeable
*
*/

function theme_table_revisions($header, $rows) {
    
// Add sticky headers, if applicable.
    
.
     .
     .
     return
$output;
}
?>

If anyone can see what I'm doing incorrectly, I would be very grateful.

 
 

Drupal is a registered trademark of Dries Buytaert.