当前位置: 首页>>代码示例>>PHP>>正文


PHP SugarTinyMCE::cleanEncodedMCEHtml方法代码示例

本文整理汇总了PHP中SugarTinyMCE::cleanEncodedMCEHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarTinyMCE::cleanEncodedMCEHtml方法的具体用法?PHP SugarTinyMCE::cleanEncodedMCEHtml怎么用?PHP SugarTinyMCE::cleanEncodedMCEHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SugarTinyMCE的用法示例。


在下文中一共展示了SugarTinyMCE::cleanEncodedMCEHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: substr

    //extract the input tag string
    $working_str = substr($bodyHTML, $marker - 3, $end_border - ($marker - 3));
    //replace input markup with text areas markups
    $new_str = str_replace('input', 'textarea', $working_str);
    $new_str = str_replace("type='text'", ' ', $new_str);
    $new_str = $new_str . '> </textarea';
    //replace the marker with generic term
    $new_str = str_replace('ta_replace', 'sugarslot', $new_str);
    //merge the processed string back into bodyhtml string
    $bodyHTML = str_replace($working_str, $new_str, $bodyHTML);
}
//<<<----------end replacing marked text inputs with text area tags
$guid = create_guid();
$form_file = "upload://{$guid}";
$SugarTiny = new SugarTinyMCE();
$html = $SugarTiny->cleanEncodedMCEHtml($bodyHTML);
//Check to ensure we have <html> tags in the form. Without them, IE8 will attempt to display the page as XML.
if (stripos($html, "<html") === false) {
    $langHeader = get_language_header();
    $html = "<html {$langHeader}><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>" . $html . "</body></html>";
}
file_put_contents($form_file, $html);
$xtpl = new XTemplate('modules/Campaigns/WebToLeadDownloadForm.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$webformlink = "<b>{$mod_strings['LBL_DOWNLOAD_TEXT_WEB_TO_LEAD_FORM']}</b><br/>";
$webformlink .= "<a href=\"index.php?entryPoint=download&id={$guid}&isTempFile=1&tempName=WebToLeadForm.html&type=temp\">{$mod_strings['LBL_DOWNLOAD_WEB_TO_LEAD_FORM']}</a>";
$xtpl->assign("LINK_TO_WEB_FORM", $webformlink);
$xtpl->assign("RAW_SOURCE", htmlspecialchars($html));
$xtpl->parse("main.copy_source");
$xtpl->parse("main");
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:WebToLeadFormSave.php

示例2: SugarTinyMCE

 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once 'include/formbase.php';
require_once 'include/SugarTinyMCE.php';
global $mod_strings;
global $app_strings;
$rawsource = false;
if (!empty($_REQUEST['body_html'])) {
    $dir_path = "{$GLOBALS['sugar_config']['cache_dir']}generated_forms/";
    if (!file_exists($dir_path)) {
        sugar_mkdir($dir_path, 0777);
    }
    //Check to ensure we have <html> tags in the form. Without them, IE8 will attempt to display the page as XML.
    $rawsource = $_REQUEST['body_html'];
    $SugarTiny = new SugarTinyMCE();
    $rawsource = $SugarTiny->cleanEncodedMCEHtml($rawsource);
    $html = from_html($rawsource);
    if (stripos($html, "<html") === false) {
        $html = "<html><body>" . $html . "</body></html>";
    }
    $file = $dir_path . 'WebToLeadForm_' . time() . '.html';
    $fp = sugar_fopen($file, 'wb');
    fwrite($fp, $html);
    fclose($fp);
}
$xtpl = new XTemplate('modules/Campaigns/WebToLeadDownloadForm.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$webformlink = "<b>{$mod_strings['LBL_DOWNLOAD_TEXT_WEB_TO_LEAD_FORM']}</b><br/>";
$webformlink .= "<a href={$GLOBALS['sugar_config']['cache_dir']}generated_forms/WebToLeadForm_" . time() . ".html>{$mod_strings['LBL_DOWNLOAD_WEB_TO_LEAD_FORM']}</a>";
$xtpl->assign("LINK_TO_WEB_FORM", $webformlink);
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:WebToLeadFormSave.php


注:本文中的SugarTinyMCE::cleanEncodedMCEHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。