AdminPageFrameworkLoader_AdminPage_Tool_Generator_CustomFieldTypes::replyToModifyFileContents PHP Метод

replyToModifyFileContents() публичный Метод

Modifies the file contents.
С версии: 3.6.0
public replyToModifyFileContents ( $sFileContents, $sPathInArchive, $aFormData, $oFactory ) : string
Результат string
    public function replyToModifyFileContents($sFileContents, $sPathInArchive, $aFormData, $oFactory)
    {
        // Check the file extension.
        $_aAllowedExtensions = apply_filters(AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_allowed_file_extensions', array('php', 'css', 'js'));
        if (!in_array(pathinfo($sPathInArchive, PATHINFO_EXTENSION), $_aAllowedExtensions)) {
            return $sFileContents;
        }
        // Skip the framework bootstrap file.
        if ($this->oFactory->oUtil->hasSuffix('admin-page-framework.php', $sPathInArchive)) {
            return $sFileContents;
        }
        // The inclusion class list file needs to be handled differently.
        if ($this->oFactory->oUtil->hasSuffix('admin-page-framework-include-class-list.php', $sPathInArchive)) {
            return $this->_getModifiedInclusionList($sFileContents);
        }
        $_bsParsingClassName = $this->_getClassNameIfSelected($sPathInArchive);
        if ($_bsParsingClassName) {
            return $this->_getModifiedFileContents($sFileContents, $sPathInArchive, $_bsParsingClassName);
        }
        return $sFileContents;
    }