I am working on my first module called moodle_courselist. I implemented hook_theme() and call it with:

$content = theme('moodle_courselist', $links);

but It doesn't look to me like its getting called. What did I do wrong?


// THEME FUNCTIONS
/**
 * Implementation of hook_theme() 
 */
function moodle_courselist_theme() {
   drupal_set_message("did we get here?");
   return array(
    'moodle_courselist' => array(
      'arguments' => array('linklist' => null),
    ),
  );
}

/**
 * Theme function for theming quotes.
 *
 * @param $linklist A list of courses
 * @return string An HTML themed list of links.
 */
function theme_moodle_courselist($linklist) {
    drupal_set_message("did we get here?");
    $output = '<div id="moodle_courselist-links">'. $linklist .'</div>';
    return $output;
}

Comments

agerson’s picture

Thank you Anton, that solved it.

Adam