本文整理汇总了PHP中from_html函数的典型用法代码示例。如果您正苦于以下问题:PHP from_html函数的具体用法?PHP from_html怎么用?PHP from_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了from_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_get_full_list
function json_get_full_list()
{
global $beanFiles;
global $beanList;
require_once 'include/utils.php';
require_once $beanFiles[$beanList[$_REQUEST['module']]];
$json = getJSONobj();
$where = str_replace('\\', '', rawurldecode($_REQUEST['where']));
$order = str_replace('\\', '', rawurldecode($_REQUEST['order']));
$focus = new $beanList[$_REQUEST['module']]();
$fullList = $focus->get_full_list($order, $where, '');
$all_fields = array_merge($focus->column_fields, $focus->additional_column_fields);
$js_fields_arr = array();
$i = 1;
// js doesn't like 0 index?
foreach ($fullList as $note) {
$js_fields_arr[$i] = array();
foreach ($all_fields as $field) {
if (isset($note->{$field})) {
$note->{$field} = from_html($note->{$field});
$note->{$field} = preg_replace('/\\r\\n/', '<BR>', $note->{$field});
$note->{$field} = preg_replace('/\\n/', '<BR>', $note->{$field});
$js_fields_arr[$i][$field] = addslashes($note->{$field});
}
}
$i++;
}
$out = $json->encode($js_fields_arr, true);
print $out;
}
示例2: buildProductOptionsArray
function buildProductOptionsArray($options, $current_id, $current_ratio)
{
global $app_strings;
global $app_list_strings;
$options_array = array();
foreach ($options as $option) {
if ($option->currency_id != $current_id) {
$optionCurrency = new Currency();
if (!empty($option->currency_id) && $option->currency_id != '-99') {
$optionCurrency->retrieve($option->currency_id);
$option_conversion_rate = $optionCurrency->conversion_rate;
} else {
$option_conversion_rate = 1;
}
$option->price = $option->price * $current_ratio / $option_conversion_rate;
}
if ($option->deleted) {
$option->name .= '<br>' . $app_strings['LBL_OQC_PRODUCT_DELETE'];
}
if (!$option->active) {
$option->name .= '<br>' . $app_strings['LBL_OQC_PRODUCT_INACTIVE'];
}
//2.2RC2 translation eroor fix
if (isset($app_list_strings["oqc_product_status_list"][$option->status])) {
$option->status = $app_list_strings["oqc_product_status_list"][$option->status];
}
$options_array[] = array('name' => from_html($option->name), 'id' => $option->id, 'status' => $option->status, 'price' => $option->price, 'is_recurring' => $option->is_recurring, 'version' => $option->version, 'date_modified' => $option->date_modified, 'modified_by_name' => $option->modified_by_name, 'option_url' => $option->deleted ? '' : option_downloadLink($option->id), 'currency_id' => $current_id, 'row_status' => $option->deleted ? 'delete' : 'saved');
}
return $options_array;
}
示例3: loadContact
function loadContact($contactid, $module = 'Contacts')
{
global $app_list_strings;
$contact = BeanFactory::getBean($module, $contactid);
// Bug 21824 - Filter fields exported to a vCard by ACLField permissions.
$contact->ACLFilterFields();
// cn: bug 8504 - CF/LB break Outlook's vCard import
$bad = array("\n", "\r");
$good = array("=0A", "=0D");
$encoding = '';
if (strpos($contact->primary_address_street, "\n") || strpos($contact->primary_address_street, "\r")) {
$contact->primary_address_street = str_replace($bad, $good, $contact->primary_address_street);
$encoding = 'QUOTED-PRINTABLE';
}
$this->setName(from_html($contact->first_name), from_html($contact->last_name), $app_list_strings['salutation_dom'][from_html($contact->salutation)]);
if (isset($contact->birthdate)) {
$this->setBirthDate(from_html($contact->birthdate));
}
$this->setPhoneNumber(from_html($contact->phone_fax), 'FAX');
$this->setPhoneNumber(from_html($contact->phone_home), 'HOME');
$this->setPhoneNumber(from_html($contact->phone_mobile), 'CELL');
$this->setPhoneNumber(from_html($contact->phone_work), 'WORK');
$this->setEmail(from_html($contact->email1));
$this->setAddress(from_html($contact->primary_address_street), from_html($contact->primary_address_city), from_html($contact->primary_address_state), from_html($contact->primary_address_postalcode), from_html($contact->primary_address_country), 'WORK', $encoding);
if (isset($contact->account_name)) {
$this->setORG(from_html($contact->account_name), from_html($contact->department));
} else {
$this->setORG('', from_html($contact->department));
}
$this->setTitle($contact->title);
}
示例4: loadContact
function loadContact($contactid, $module = 'Contacts')
{
global $app_list_strings;
require_once $GLOBALS['beanFiles'][$GLOBALS['beanList'][$module]];
$contact = new $GLOBALS['beanList'][$module]();
$contact->retrieve($contactid);
// cn: bug 8504 - CF/LB break Outlook's vCard import
$bad = array("\n", "\r");
$good = array("=0A", "=0D");
$encoding = '';
if (strpos($contact->primary_address_street, "\n") || strpos($contact->primary_address_street, "\r")) {
$contact->primary_address_street = str_replace($bad, $good, $contact->primary_address_street);
$encoding = 'QUOTED-PRINTABLE';
}
$this->setName(from_html($contact->first_name), from_html($contact->last_name), $app_list_strings['salutation_dom'][from_html($contact->salutation)]);
if (isset($contact->birthdate)) {
$this->setBirthDate(from_html($contact->birthdate));
}
$this->setPhoneNumber(from_html($contact->phone_fax), 'FAX');
$this->setPhoneNumber(from_html($contact->phone_home), 'HOME');
$this->setPhoneNumber(from_html($contact->phone_mobile), 'CELL');
$this->setPhoneNumber(from_html($contact->phone_work), 'WORK');
$this->setEmail(from_html($contact->email1));
$this->setAddress(from_html($contact->primary_address_street), from_html($contact->primary_address_city), from_html($contact->primary_address_state), from_html($contact->primary_address_postalcode), from_html($contact->primary_address_country), 'WORK', $encoding);
if (isset($contact->account_name)) {
$this->setORG(from_html($contact->account_name), from_html($contact->department));
} else {
$this->setORG('', from_html($contact->department));
}
$this->setTitle($contact->title);
}
示例5: handleSave
function handleSave($populate = true)
{
if ($populate) {
$this->_populateFromRequest();
if (isset($_REQUEST['subpanel_title']) && isset($_REQUEST['subpanel_title_key'])) {
$authenticatedUserLanguage = !empty($_SESSION['authenticated_user_language']) ? $_SESSION['authenticated_user_language'] : false;
$selected_lang = !empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $authenticatedUserLanguage;
if (empty($selected_lang)) {
$selected_lang = $GLOBALS['sugar_config']['default_language'];
}
require_once 'modules/ModuleBuilder/parsers/parser.label.php';
$labelParser = new ParserLabel($_REQUEST['view_module'], isset($_REQUEST['view_package']) ? $_REQUEST['view_package'] : null);
$labelParser->addLabels($selected_lang, array($_REQUEST['subpanel_title_key'] => remove_xss(from_html($_REQUEST['subpanel_title']))), $_REQUEST['view_module']);
}
}
// Bug 46291 - Missing widget_class for edit_button and remove_button
foreach ($this->_viewdefs as $key => $def) {
if (isset($this->_fielddefs[$key]['widget_class'])) {
$this->_viewdefs[$key]['widget_class'] = $this->_fielddefs[$key]['widget_class'];
}
}
$defs = $this->restoreInvisibleFields($this->_invisibleFields, $this->_viewdefs);
// unlike our parent, do not force the field names back to upper case
$defs = $this->makeRelateFieldsAsLink($defs);
$this->implementation->deploy($defs);
}
示例6: translateCharacters
/**
* Performs character set and HTML character translations on the string.
*
* @access public
* @param string $string required The string that is to be translated.
* @param Localization $locale required The locale object for doing the character set translation.
* @param string $toCharset required Translate to this character set.
* @param string $fromCharset Translate from this character set.
* @return string The translated string.
*/
public function translateCharacters($string, Localization $locale, $toCharset, $fromCharset = "UTF-8")
{
// perform character set translations on the string
$string = $locale->translateCharset($string, $fromCharset, $toCharset);
// perform HTML character translations on the string
$string = from_html($string);
return $string;
}
示例7: buildFooterModel
function buildFooterModel()
{
$footerModel = new Vtiger_PDF_Model();
$termsconditionLabel = getTranslatedString('Description', $this->moduleName);
$footerModel->set('title', $termsconditionLabel);
$footerModel->set('content', from_html($this->focusColumnValue("description")));
return $footerModel;
}
示例8: vtWorkflowSave
function vtWorkflowSave($adb, $request)
{
$util = new VTWorkflowUtils();
$module = new VTWorkflowApplication("saveworkflow");
$mod = return_module_language($current_language, $module->name);
$request = vtlib_purify($request);
// this cleans all values of the array
if (!$util->checkAdminAccess()) {
$errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
$util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
return;
}
$description = from_html($request["description"]);
$moduleName = $request["module_name"];
$conditions = $request["conditions"];
$taskId = $request["task_id"];
$saveType = $request["save_type"];
$executionCondition = $request['execution_condition'];
$wm = new VTWorkflowManager($adb);
if ($saveType == 'new') {
$wf = $wm->newWorkflow($moduleName);
$wf->description = $description;
$wf->test = $conditions;
$wf->taskId = $taskId;
$wf->executionConditionAsLabel($executionCondition);
$wm->save($wf);
} else {
if ($saveType == 'edit') {
$wf = $wm->retrieve($request["workflow_id"]);
$wf->description = $description;
$wf->test = $conditions;
$wf->taskId = $taskId;
$wf->executionConditionAsLabel($executionCondition);
$wm->save($wf);
} else {
throw new Exception();
}
}
if (isset($request["return_url"])) {
$returnUrl = $request["return_url"];
} else {
$returnUrl = $module->editWorkflowUrl($wf->id);
}
?>
<script type="text/javascript" charset="utf-8">
window.location="<?php
echo $returnUrl;
?>
";
</script>
<a href="<?php
echo $returnUrl;
?>
">Return</a>
<?php
}
示例9: testfrom_html
public function testfrom_html()
{
$string = '';
$expected = '';
$actual = from_html($string);
$this->assertSame($expected, $actual);
$string = ''test'&trial<">';
$expected = "'test'&trial<\">";
$actual = from_html($string);
$this->assertSame($expected, $actual);
}
示例10: test_get_tracker_substring2
public function test_get_tracker_substring2()
{
global $sugar_config;
$test_string = '"Hello There How Are You? " This has quotes too';
$default_length = 15;
$sugar_config['tracker_max_display_length'] = $default_length;
$display_string = getTrackerSubstring($test_string);
$this->assertEquals(strlen(from_html($display_string)), $default_length, 'Assert that the string length is equal to ' . $default_length . ' characters (default)');
$test_string = '早前於美國完成民族音樂學博士學位回港後在大專院校的音樂系任教123456789';
$display_string = getTrackerSubstring($test_string);
$this->assertEquals(mb_strlen(from_html($display_string), 'UTF-8'), $default_length, 'Assert that the string length is equal to ' . $default_length . ' characters (default)');
}
示例11: getVardefValue
function getVardefValue($vardef)
{
if (empty($vardef['value'])) {
if (!empty($vardef['default'])) {
return from_html($vardef['default']);
} elseif (!empty($vardef['default_value'])) {
return from_html($vardef['default_value']);
}
} else {
return from_html($vardef['value']);
}
}
示例12: handleSave
/**
* Takes in the request params from a save request and processes
* them for the save.
* @param REQUEST $params Labels as "label_".System label => Display label pairs
* @param string $language Language key, for example 'en_us'
*/
function handleSave($params, $language)
{
$labels = array();
foreach ($params as $key => $value) {
if (preg_match('/^label_/', $key) && strcmp($value, 'no_change') != 0) {
$labels[strtoupper(substr($key, 6))] = remove_xss(from_html($value), false);
}
}
if (!empty($this->packageName)) {
return self::addLabels($language, $labels, $this->moduleName, "custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/language");
} else {
return self::addLabels($language, $labels, $this->moduleName);
}
}
示例13: UninstallAvailable
function UninstallAvailable($patch_list, $patch_to_check)
{
foreach ($patch_list as $more_recent_patch) {
if ($more_recent_patch->id == $patch_to_check->id) {
break;
}
$patch_to_check_backup_path = clean_path(remove_file_extension(from_html($patch_to_check->filename))) . '-restore';
$more_recent_patch_backup_path = clean_path(remove_file_extension(from_html($more_recent_patch->filename))) . '-restore';
if ($this->foundConflict($patch_to_check_backup_path, $more_recent_patch_backup_path) && $more_recent_patch->date_entered >= $patch_to_check->date_entered) {
return false;
}
}
return true;
}
示例14: testLabelSaving
/**
* Generating new label with HTML tags
* @group 43069
*/
public function testLabelSaving()
{
$mod_strings = return_module_language($this->_lang, $this->_test_module);
$this->_old_label = $mod_strings[$this->_test_label];
$pref = '<img alt="<script>" src="www.test.com/img.png" ="alert(7001)" width="1" height="1"/>';
$prepared_pref = to_html(strip_tags(from_html($pref)));
$new_label = $prepared_pref . ' ' . $this->_old_label;
// save the new label to the language file
ParserLabel::addLabels($this->_lang, array($this->_test_label => $new_label), $this->_test_module);
// read the language file to get the new value
include "custom/modules/{$this->_test_module}/language/{$this->_lang}.lang.php";
$this->assertEquals($new_label, $mod_strings[$this->_test_label]);
$this->assertNotEquals($pref . ' ' . $this->_old_label, $mod_strings[$this->_test_label]);
}
示例15: populateFromPost
function populateFromPost()
{
parent::populateFromPost();
// Handle empty massupdate checkboxes
$this->massupdate = !empty($_REQUEST['massupdate']);
if (!empty($_REQUEST['defaultDate']) && !empty($_REQUEST['defaultTime'])) {
$_REQUEST['default'] = $_REQUEST['defaultDate'] . '&' . $_REQUEST['defaultTime'];
$defaultTime = $_REQUEST['defaultTime'];
$hours = substr($defaultTime, 0, 2);
$minutes = substr($defaultTime, 3, 2);
$meridiem = substr($defaultTime, 5, 2);
if (empty($meridiem)) {
if ($hours == '00') {
$hours = 12;
$meridiem = 'am';
} else {
if ($hours >= 12) {
//lets add the PM meridiem, but only subtract 12 if hours is greater than 12
if ($hours > 12) {
$hours -= 12;
}
$meridiem = 'pm';
} else {
$meridiem = 'am';
}
}
//lets format the string to make sure the leading 0's are added back in for hours and minutes
$_REQUEST['default'] = $_REQUEST['defaultDate'] . '&' . sprintf('%02d:%02d%s', $hours, $minutes, $meridiem);
}
} else {
$_REQUEST['default'] = '';
}
unset($_REQUEST['defaultDate']);
unset($_REQUEST['defaultTime']);
foreach ($this->vardef_map as $vardef => $field) {
if (isset($_REQUEST[$vardef])) {
// Bug #48826. Some fields are allowed to have special characters and must be decoded from the request
// Bug 49774, 49775: Strip html tags from 'formula' and 'dependency'.
if (is_string($_REQUEST[$vardef]) && in_array($vardef, $this->decode_from_request_fields_map)) {
$this->{$vardef} = html_entity_decode(strip_tags(from_html($_REQUEST[$vardef])));
} else {
$this->{$vardef} = $_REQUEST[$vardef];
}
if ($vardef != $field) {
$this->{$field} = $this->{$vardef};
}
}
}
$GLOBALS['log']->debug('populate: ' . print_r($this, true));
}