BxDolFilesModule::actionShare PHP Method

actionShare() public method

public actionShare ( $sFileUri )
    function actionShare($sFileUri)
    {
        $sLangPref = '_' . $this->_oConfig->getMainPrefix() . '_';
        $sFileUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $sFileUri;
        $aForm = $this->getSubmitForm($sFileUri, 'share');
        $oForm = new BxTemplFormView($aForm);
        $oForm->initChecker();
        if ($oForm->isSubmittedAndValid()) {
            if ($this->sendFileInfo($_POST['email'], nl2br(process_pass_data($_POST['messageText'])), $sFileUrl, $_POST['mediaAction'])) {
                $sCode = $GLOBALS['oFunctions']->msgBox(_t('_File info was sent'));
            } else {
                $sCode = $GLOBALS['oFunctions']->msgBox(_t('_Error'));
            }
        } else {
            $sCode = $this->_oTemplate->parseHtmlByName('default_padding.html', array('content' => $oForm->getCode()));
            $sCode = $this->_oTemplate->parseHtmlByName('popup.html', array('title' => _t('_Share'), 'content' => $sCode));
            $sCode = $GLOBALS['oFunctions']->transBox($sCode, true);
        }
        header('Content-type:text/html;charset=utf-8');
        echo $sCode;
        exit;
    }