本文整理汇总了PHP中from_html函数的典型用法代码示例。如果您正苦于以下问题:PHP from_html函数的具体用法?PHP from_html怎么用?PHP from_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了from_html函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:30,代码来源:json.php
示例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;
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:30,代码来源:ProductOptions.php
示例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);
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:vCard.php
示例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);
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:31,代码来源:vCard.php
示例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);
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:SubpanelMetaDataParser.php
示例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;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:18,代码来源:EmailFormatter.php
示例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;
}
开发者ID:latechdirect,项目名称:vtiger,代码行数:8,代码来源:PurchaseOrderPDFController.php
示例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
}
开发者ID:mslokhat,项目名称:corebos,代码行数:56,代码来源:saveworkflow.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);
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:11,代码来源:dbUtilsTest.php
示例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)');
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Bug33284_Test.php
示例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']);
}
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:SugarFieldHtml.php
示例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);
}
}
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:20,代码来源:parser.label.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:14,代码来源:UpgradeHistory.php
示例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]);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:18,代码来源:Bug49772Test.php
示例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));
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:50,代码来源:TemplateDatetimecombo.php
示例16: buildAttachmentsArray
function buildAttachmentsArray($attachments)
{
$attachment_array = array();
foreach ($attachments as $attachment) {
if ($attachment->category_id == 'ContractAttachment') {
$is_default = 1;
} else {
$is_default = 0;
}
$rev_number = $attachment->revision ? '_rev.' . $attachment->revision : '';
$rev_id = $attachment->doc_rev_id ? $attachment->doc_rev_id : $attachment->document_revision_id;
$attachment_array[] = array('document_name' => from_html($attachment->document_name) . $rev_number, 'document_revision_id' => $rev_id, 'file_url' => downloadLink($rev_id), 'id' => $attachment->id, 'is_default' => $is_default);
}
return $attachment_array;
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:15,代码来源:Attachments.php
示例17: insertIntoFAQCommentTable
/** Function to insert values in vtiger_faqcomments table for the specified module,
* @param $table_name -- table name:: Type varchar
* @param $module -- module:: Type varchar
*/
function insertIntoFAQCommentTable($table_name, $module)
{
global $log, $adb;
$log->info("in insertIntoFAQCommentTable " . $table_name . " module is " . $module);
$current_time = $adb->formatDate(date('Y-m-d H:i:s'), true);
if ($this->column_fields['comments'] != '') {
$comment = $this->column_fields['comments'];
} else {
$comment = $_REQUEST['comments'];
}
if ($comment != '') {
$params = array('', $this->id, from_html($comment), $current_time);
$sql = "insert into vtiger_faqcomments values(?, ?, ?, ?)";
$adb->pquery($sql, $params);
}
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:20,代码来源:Faq.php
示例18: getQuotesRelatedData
function getQuotesRelatedData($bean)
{
$return = array();
$emailId = $_REQUEST['recordId'];
require_once "modules/Emails/EmailUI.php";
$email = new Email();
$email->retrieve($emailId);
$return['subject'] = $email->name;
$return['body'] = from_html($email->description_html);
$return['toAddress'] = $email->to_addrs;
$ret = array();
$ret['uid'] = $emailId;
$ret = EmailUI::getDraftAttachments($ret);
$return['attachments'] = $ret['attachments'];
$return['email_id'] = $emailId;
return $return;
}
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:17,代码来源:Compose.php
示例19: serve
/**
* This method calls functions on the implementation class and returns the output or Fault object in case of error to client
*
* @return unknown
*/
function serve()
{
$GLOBALS['log']->info('Begin: SugarRestSerialize->serve');
$data = !empty($_REQUEST['rest_data']) ? $_REQUEST['rest_data'] : '';
if (empty($_REQUEST['method']) || !method_exists($this->implementation, $_REQUEST['method'])) {
$er = new SoapError();
$er->set_error('invalid_call');
$this->fault($er);
} else {
$method = $_REQUEST['method'];
$data = unserialize(from_html($data));
if (!is_array($data)) {
$data = array($data);
}
$GLOBALS['log']->info('End: SugarRestSerialize->serve');
return call_user_func_array(array($this->implementation, $method), $data);
}
// else
}
开发者ID:klr2003,项目名称:sourceread,代码行数:24,代码来源:SugarRestSerialize.php
示例20: template_handle_export
function template_handle_export(&$reporter)
{
ini_set('zlib.output_compression', 'Off');
$reporter->plain_text_output = true;
//disable paging so we get all results in one pass
$reporter->enable_paging = false;
$reporter->run_query();
$reporter->_load_currency();
$header_arr = array();
$header_row = $reporter->get_header_row();
$content = '';
foreach ($header_row as $cell) {
array_push($header_arr, $cell);
}
$header = implode("\"" . getDelimiter() . "\"", array_values($header_arr));
$header = "\"" . $header;
$header .= "\"\r\n";
$content .= $header;
while (($row = $reporter->get_next_row('result', 'display_columns', false, true)) != 0) {
$new_arr = array();
for ($i = 0; $i < count($row['cells']); $i++) {
array_push($new_arr, preg_replace("/\"/", "\"\"", from_html($row['cells'][$i])));
}
$line = implode("\"" . getDelimiter() . "\"", $new_arr);
$line = "\"" . $line;
$line .= "\"\r\n";
$content .= $line;
}
global $locale;
$transContent = $GLOBALS['locale']->translateCharset($content, 'UTF-8', $GLOBALS['locale']->getExportCharset());
ob_clean();
header("Pragma: cache");
header("Content-type: application/octet-stream; charset=" . $locale->getExportCharset());
header("Content-Disposition: attachment; filename={$_REQUEST['module']}.csv");
header("Content-transfer-encoding: binary");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . TimeDate::httpTime());
header("Cache-Control: post-check=0, pre-check=0", false);
header("Content-Length: " . mb_strlen($transContent, '8bit'));
$BOM = "";
print $BOM . $transContent;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:42,代码来源:templates_export.php
注:本文中的from_html函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论