APF_Demo_ManageOptions_Export::replyToModifyFileName PHP Method

replyToModifyFileName() public method

public replyToModifyFileName ( $sFileName, $sFieldID, $sInputID, $vData, $oFactory )
    public function replyToModifyFileName($sFileName, $sFieldID, $sInputID, $vData, $oFactory)
    {
        // Change the exporting file name based on the selected format type in the other field.
        $sSelectedFormatType = isset($_POST[$this->_oFactory->oProp->sOptionKey][$this->_sSectionID]['export_format_type']) ? $_POST[$this->_oFactory->oProp->sOptionKey][$this->_sSectionID]['export_format_type'] : null;
        $aFileNameParts = pathinfo($sFileName);
        $sFileNameWOExt = $aFileNameParts['filename'];
        switch ($sSelectedFormatType) {
            default:
            case 'json':
                $sReturnName = $sFileNameWOExt . '.json';
                break;
            case 'text':
            case 'array':
                $sReturnName = $sFileNameWOExt . '.txt';
                break;
        }
        return $sReturnName;
    }