BxDolFilesModule::getSubmitForm PHP Method

getSubmitForm() public method

public getSubmitForm ( $sFileUri, $sAction )
    function getSubmitForm($sFileUri, $sAction)
    {
        $aEmails = array();
        $sFileLink = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $sFileUri;
        switch ($sAction) {
            case 'share':
                $aEmails = array('type' => 'text', 'name' => 'email', 'caption' => _t("_Enter email(s)"), 'required' => true, 'checker' => array('func' => 'emailSet', 'error' => _t("_Incorrect Email")));
                $aShareSites = array('type' => 'custom', 'colspan' => 2, 'content' => $this->_oTemplate->getSitesSetBox($sFileLink));
                break;
            case 'report':
                $aEmails = array('type' => 'hidden', 'name' => 'email', 'value' => $GLOBALS['site']['email_notify']);
                $aShareSites = array('type' => 'custom', 'content' => '');
                break;
        }
        $aForm = array('form_attrs' => array('name' => 'submitAction', 'action' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . $sAction . '/' . $sFileUri, 'method' => 'post', 'onsubmit' => "return bx_ajax_form_check(this)"), 'params' => array('db' => array('submit_name' => 'do_submit'), 'checker_helper' => 'BxSupportCheckerHelper'), 'inputs' => array('sites' => $aShareSites, 'email' => $aEmails, 'message' => array('type' => 'textarea', 'name' => 'messageText', 'caption' => _t('_Message text'), 'value' => '', 'required' => 1, 'checker' => array('func' => 'length', 'params' => array(3, 65536), 'error' => _t('_td_err_incorrect_length'))), array('type' => 'input_set', 0 => array('type' => 'submit', 'name' => 'send', 'value' => _t('_Send')), 1 => array('type' => 'reset', 'name' => 'rest', 'value' => _t('_Reset'))), 'do_submit' => array('type' => 'hidden', 'name' => 'do_submit', 'value' => 1), 'fileUri' => array('type' => 'hidden', 'name' => 'fileUri', 'value' => $sFileLink), 'mediaAction' => array('type' => 'hidden', 'name' => 'mediaAction', 'value' => $sAction)));
        return $aForm;
    }