【发布时间】:2016-07-28 14:50:38
【问题描述】:
我正在尝试将“文件”类型字段添加到我的主题设置中。我没有使用基本主题,而是在 Drupal 7 中工作。该字段显示在正确的位置,我可以选择一个文件,但是,当我保存设置时,该文件不会显示在我的文件夹中并正在运行设置上的 theme_get_settings 返回一个空字符串。我做错了什么?
这是我的域代码:
// footer settings
$form['footer_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Footer Settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['footer_settings']['footer_logo_path'] = array(
'#type' => 'textfield',
'#title' => t('Footer Logo Path'),
'#default_value' => theme_get_setting('footer_logo', ''),
);
$form['footer_settings']['footer_logo'] = array(
'#type' => 'file',
'#title' => t('Footer Logo'),
'#description' => t('Upload a new logo image to be displayed in the footer of the website here.'),
'#upload_location' => file_default_scheme() . '://',
);
【问题讨论】:
标签: php drupal drupal-7 drupal-forms