我已经使用 template.php 和 user-profile-form.php 自定义了编辑配置文件视图所有显示正确,但提交(和删除)按钮..我正在使用自适应主题,我已经修改如下:
模板.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']);
}
然后在 user-profile-form.tpl.php :
<div id="user-profile-form">
<?php echo $account; ?>
<?php echo $timezone; ?>
<?php echo $submit; ?>
<?php echo $delete; ?>
</div>
帐户的编辑表单正确显示。我已尝试成功添加/删除变量(即 $timezone),但缺少提交/删除。我不知道出了什么问题。我尝试更改变量“提交”和“删除”的名称,但仍然没有出现按钮。当然,我每次需要(而不是)时都清除了缓存。我也没有隐藏按钮的 JS。我通过 Panel 中的自定义块呈现此表单:
<?
module_load_include('inc', 'user', 'user.pages');
global $user;
print drupal_render(drupal_get_form('user_profile_form', $user));
?>
也许面板有问题???
任何想法表示赞赏:)
感谢阅读
二湾