2010-02-19 102 views
0

我創建了一個生成小表單的模塊。 我也做了一個應該主題形式的功能,覆蓋標準主題。 但由於某些原因,它不會調用theme_函數。我忘了什麼嗎?drupal表單覆蓋主題功能

function mailinglist_menu() { 

    $items['mailinglist'] = array(
    'title' => t('Beheer mailinglist'), 
    'page callback' => 'mailinglist_overzicht', 
    'access arguments' => array('access content'), 
    'type' => MENU_CALLBACK, 
); 

    return $items; 
} 

function mailinglist_overzicht() { 

    return drupal_get_form('mailinglist_form'); 

} 

function mailinglist_form($form_state) { 

    $form['to'] = array(
    '#type' => 'fieldset', 
    '#title' => t('Aan'), 
    '#tree' => TRUE, 
); 
    $form['to']['functies'] = array(
    '#type' => 'checkboxes', 
    '#title' => t('Functies'), 
    '#options' => mailinglist_getFuncties(), 
    '#description' => t('Selecteer de functies die je wilt mailen.'), 
); 

    return $form; 
} 

function theme_mailinglist_form($form) { 
    $output .= '<div class="foo" style="background-color: #000;">sdfsdfsdfdfs'; 
    $output = drupal_render($form['to']['functies']); 
    $output .= '<div class="bar">'; 
    $output .= '</div></div>'; 
    $output .= drupal_render($form); 

    return $output; 
} 

回答

1

我想你忘了實現hook_theme。嘗試添加此:

function mailinglist_theme() { 
    return array(
    'mailinglist_form' => array(
     'arguments' => array('form' => NULL), 
    ), 
); 
} 

添加此代碼後不要忘記刷新您的主題註冊表。

+0

that works,tnx。 – dazz 2010-02-19 11:21:33

+0

graag gedaan :-) – marcvangend 2010-02-19 11:46:38