0

我需要编辑以下表格,使其具有附加文件功能:

function _getWriteForm()
{
    $aForm = array(
        'form_attrs' => array(
            'name' => 'WallPostText',
            'action' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/',
            'method' => 'post',
            'enctype' => 'multipart/form-data',
            'target' => 'WallPostIframe',
            'onsubmit' => 'javascript:return ' . $this->_sJsPostObject . '.postSubmit(this);'
        ),
        'inputs' => array(
            'content' => array(
                'type' => 'textarea',
                'name' => 'content',
                'caption' => '',
                'colspan' => true
            ),
            'submit' => array(
                'type' => 'submit',
                'name' => 'submit',
                'value' => _t('_wall_post'),
                'colspan' => true
            )
        ),
    );

我想先编辑 HTML 文件,但唯一的 HTML 代码是:

<!-- Post Text -->
<div class="wall-ptype-cnt wall_text">__post_wall_text__</div>

有人可以帮我编辑数组以允许文件附件吗?谢谢你。

4

1 回答 1

0

你应该尝试这样的事情:

function _getWriteForm()
{
$aForm = array(
    'form_attrs' => array(
        'name' => 'WallPostText',
        'action' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/',
        'method' => 'post',
        'enctype' => 'multipart/form-data',
        'target' => 'WallPostIframe',
        'onsubmit' => 'javascript:return ' . $this->_sJsPostObject . '.postSubmit(this);'
    ),
    'inputs' => array(
        'content' => array(
            'type' => 'textarea',
            'name' => 'content',
            'caption' => '',
            'colspan' => true
        ),
         'file' => array(
            'type' => 'file',
            'name' => 'upload_file',
            'caption' => 'Upload',
            'colspan' => true
        ),
        'file_two' => array(    //I added a second input file
            'type' => 'file',
            'name' => 'upload_file_two',
            'caption' => 'Upload',
            'colspan' => true
        ),
        'submit' => array(
            'type' => 'submit',
            'name' => 'submit',
            'value' => _t('_wall_post'),
            'colspan' => true
        )
    ),
);

我希望它有所帮助。

萨卢多斯 ;)

于 2013-03-12T18:13:51.733 回答