我已經使用template.php和user-profile-form.php自定義編輯配置文件視圖 所有顯示正確,但提交(和刪除)按鈕.. 我使用自適應主題和我修改這樣的:無法呈現提交按鈕
的template.php
function adaptivetheme_theme(&$existing, $type, $theme, $path) {
return array(
'user_profile_form' => array(
'template' => 'templates/user-profile-form',
'render element' => 'form',
),
);
}
function adaptivetheme_preprocess_user_profile_form(&$vars) {
$vars['form']['account']['name']['#description'] = t('blabla');
$vars['form']['submit']['#value'] = t('Save profile');
$vars['form']['delete']['#value'] = t('Delete account');
$vars['account'] = drupal_render($vars['form']['account']);
$vars['theme_select'] = drupal_render($vars['form']['theme_select']);
$vars['picture'] = drupal_render($vars['form']['picture']);
$vars['signature_settings'] = drupal_render($vars['form']['signature_settings']);
$vars['contact'] = drupal_render($vars['form']['contact']);
$vars['timezone'] = drupal_render($vars['form']['timezone']);
$vars['submit'] = drupal_render($vars['form']['submit']);
$vars['delete'] = drupal_render($vars['form']['delete']);
}
然後在用戶配置文件的form.tpl.php:
<div id="user-profile-form">
<?php echo $account; ?>
<?php echo $timezone; ?>
<?php echo $submit; ?>
<?php echo $delete; ?>
</div>
的ACC的編輯形式ount顯示正確。我嘗試成功地添加/刪除變量(即$時區),但提交/刪除失蹤。 我不知道什麼是錯的.. 我試圖改變變量'提交'和'刪除'的名稱,但仍然沒有任何按鈕顯示。當然,我已經清除了每次需要的緩存(而不是)。 我沒有JS隱藏按鈕既不.. 我一個面板中顯示這個表單通過自定義塊:
<?
module_load_include('inc', 'user', 'user.pages');
global $user;
print drupal_render(drupal_get_form('user_profile_form', $user));
?>
也許有問題,面板???
任何想法表示讚賞:)
THX閱讀
二萬