本文整理汇总了PHP中dol_html_entity_decode函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_html_entity_decode函数的具体用法?PHP dol_html_entity_decode怎么用?PHP dol_html_entity_decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dol_html_entity_decode函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jsUnEscape
/**
* Same function than javascript unescape() function but in PHP.
*
* @param string $source String to decode
* @return string Unescaped string
*/
function jsUnEscape($source)
{
$decodedStr = "";
$pos = 0;
$len = strlen($source);
while ($pos < $len) {
$charAt = substr($source, $pos, 1);
if ($charAt == '%') {
$pos++;
$charAt = substr($source, $pos, 1);
if ($charAt == 'u') {
// we got a unicode character
$pos++;
$unicodeHexVal = substr($source, $pos, 4);
$unicode = hexdec($unicodeHexVal);
$entity = "&#" . $unicode . ';';
$decodedStr .= utf8_encode($entity);
$pos += 4;
} else {
// we have an escaped ascii character
$hexVal = substr($source, $pos, 2);
$decodedStr .= chr(hexdec($hexVal));
$pos += 2;
}
} else {
$decodedStr .= $charAt;
$pos++;
}
}
return dol_html_entity_decode($decodedStr, ENT_COMPAT);
}
示例2: createFromClone
/** Load an object from its id and create a new one in database
*
* @param int $fromid Id of object to clone
* @param int $project_id Id of project to attach clone task
* @param int $parent_task_id Id of task to attach clone task
* @param bool $clone_change_dt recalculate date of task regarding new project start date
* @param bool $clone_affectation clone affectation of project
* @param bool $clone_time clone time of project
* @param bool $clone_file clone file of project
* @param bool $clone_note clone note of project
* @param bool $clone_prog clone progress of project
* @return int New id of clone
*/
function createFromClone($fromid, $project_id, $parent_task_id, $clone_change_dt = false, $clone_affectation = false, $clone_time = false, $clone_file = false, $clone_note = false, $clone_prog = false)
{
global $user, $langs, $conf;
$error = 0;
//Use 00:00 of today if time is use on task.
$now = dol_mktime(0, 0, 0, dol_print_date(dol_now(), '%m'), dol_print_date(dol_now(), '%d'), dol_print_date(dol_now(), '%Y'));
$datec = $now;
$clone_task = new Task($this->db);
$origin_task = new Task($this->db);
$clone_task->context['createfromclone'] = 'createfromclone';
$this->db->begin();
// Load source object
$clone_task->fetch($fromid);
$origin_task->fetch($fromid);
$defaultref = '';
$obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON;
if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . ".php")) {
require_once DOL_DOCUMENT_ROOT . "/core/modules/project/task/" . $conf->global->PROJECT_TASK_ADDON . '.php';
$modTask = new $obj();
$defaultref = $modTask->getNextValue(0, $clone_task);
}
$ori_project_id = $clone_task->fk_project;
$clone_task->id = 0;
$clone_task->ref = $defaultref;
$clone_task->fk_project = $project_id;
$clone_task->fk_task_parent = $parent_task_id;
$clone_task->date_c = $datec;
$clone_task->planned_workload = $origin_task->planned_workload;
$clone_task->rang = $origin_task->rang;
//Manage Task Date
if ($clone_change_dt) {
$projectstatic = new Project($this->db);
$projectstatic->fetch($ori_project_id);
//Origin project strat date
$orign_project_dt_start = $projectstatic->date_start;
//Calcultate new task start date with difference between origin proj start date and origin task start date
if (!empty($clone_task->date_start)) {
$clone_task->date_start = $now + $clone_task->date_start - $orign_project_dt_start;
}
//Calcultate new task end date with difference between origin proj end date and origin task end date
if (!empty($clone_task->date_end)) {
$clone_task->date_end = $now + $clone_task->date_end - $orign_project_dt_start;
}
}
if (!$clone_prog) {
$clone_task->progress = 0;
}
// Create clone
$result = $clone_task->create($user);
// Other options
if ($result < 0) {
$this->error = $clone_task->error;
$error++;
}
// End
if (!$error) {
$clone_task_id = $clone_task->id;
$clone_task_ref = $clone_task->ref;
//Note Update
if (!$clone_note) {
$clone_task->note_private = '';
$clone_task->note_public = '';
} else {
$this->db->begin();
$res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_public, ENT_QUOTES), '_public');
if ($res < 0) {
$this->error .= $clone_task->error;
$error++;
$this->db->rollback();
} else {
$this->db->commit();
}
$this->db->begin();
$res = $clone_task->update_note(dol_html_entity_decode($clone_task->note_private, ENT_QUOTES), '_private');
if ($res < 0) {
$this->error .= $clone_task->error;
$error++;
$this->db->rollback();
} else {
$this->db->commit();
}
}
//Duplicate file
if ($clone_file) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
//retreive project origin ref to know folder to copy
$projectstatic = new Project($this->db);
//.........这里部分代码省略.........
示例3: pdf_getlinedesc
/**
* Return line description translated in outputlangs and encoded into htmlentities and with <br>
*
* @param Object $object Object
* @param int $i Current line number (0 = first line, 1 = second line, ...)
* @param Translate $outputlangs Object langs for output
* @param int $hideref Hide reference
* @param int $hidedesc Hide description
* @param int $issupplierline Is it a line for a supplier object ?
* @return string String with line
*/
function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $issupplierline = 0)
{
global $db, $conf, $langs;
$idprod = !empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false;
$label = !empty($object->lines[$i]->label) ? $object->lines[$i]->label : (!empty($object->lines[$i]->product_label) ? $object->lines[$i]->product_label : '');
$desc = !empty($object->lines[$i]->desc) ? $object->lines[$i]->desc : (!empty($object->lines[$i]->description) ? $object->lines[$i]->description : '');
$ref_supplier = !empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '');
// TODO Not yet saved for supplier invoices, only supplier orders
$note = !empty($object->lines[$i]->note) ? $object->lines[$i]->note : '';
$dbatch = !empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false;
if ($issupplierline) {
$prodser = new ProductFournisseur($db);
} else {
$prodser = new Product($db);
}
if ($idprod) {
$prodser->fetch($idprod);
// If a predefined product and multilang and on other lang, we renamed label with label translated
if (!empty($conf->global->MAIN_MULTILANGS) && $outputlangs->defaultlang != $langs->defaultlang) {
$translatealsoifmodified = !empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED);
// By default if value was modified manually, we keep it (no translation because we don't have it)
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
// ($textwasmodified is replaced with $textwasmodifiedorcompleted and we add completion).
// Set label
// If we want another language, and if label is same than default language (we did force it to a specific value), we can use translation.
//var_dump($outputlangs->defaultlang.' - '.$langs->defaultlang.' - '.$label.' - '.$prodser->label);exit;
$textwasmodified = $label == $prodser->label;
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) {
$label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
}
// Set desc
// Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no
$textwasmodified = false;
if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
$textwasmodified = strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML401), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML401)) !== false;
} else {
$textwasmodified = $desc == $prodser->description;
}
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasmodified || $translatealsoifmodified)) {
$desc = $prodser->multilangs[$outputlangs->defaultlang]["description"];
}
// Set note
$textwasmodified = $note == $prodser->note;
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) {
$note = $prodser->multilangs[$outputlangs->defaultlang]["note"];
}
}
}
// Description short of product line
$libelleproduitservice = $label;
// Description long of product line
if (!empty($desc) && $desc != $label) {
if ($libelleproduitservice && empty($hidedesc)) {
$libelleproduitservice .= '__N__';
}
if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) {
$discount = new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except);
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $discount->ref_facture_source);
} elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except) {
$discount = new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except);
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $discount->ref_facture_source);
// Add date of deposit
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) {
echo ' (' . dol_print_date($discount->datec, 'day', '', $outputlangs) . ')';
}
} else {
if ($idprod) {
if (empty($hidedesc)) {
$libelleproduitservice .= $desc;
}
} else {
$libelleproduitservice .= $desc;
}
}
}
// If line linked to a product
if ($idprod) {
// We add ref
if ($prodser->ref) {
$prefix_prodserv = "";
$ref_prodserv = "";
if (!empty($conf->global->PRODUCT_ADD_TYPE_IN_DOCUMENTS)) {
if ($prodser->isService()) {
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Service") . " ";
} else {
$prefix_prodserv = $outputlangs->transnoentitiesnoconv("Product") . " ";
}
//.........这里部分代码省略.........
示例4: restrictedArea
$socid = $user->societe_id;
}
$result = restrictedArea($user, 'contrat', $id);
$object = new Contrat($db);
$object->fetch($id, $ref);
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($action == 'setnote_public' && $user->rights->contrat->creer) {
$result = $object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_public')), ENT_QUOTES), '_public');
if ($result < 0) {
dol_print_error($db, $object->error);
}
} else {
if ($action == 'setnote_private' && $user->rights->contrat->creer) {
$result = $object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_private')), ENT_QUOTES), '_private');
if ($result < 0) {
dol_print_error($db, $object->error);
}
}
}
/******************************************************************************/
/* Affichage fiche */
/******************************************************************************/
llxHeader();
$form = new Form($db);
if ($id > 0 || !empty($ref)) {
dol_htmloutput_mesg($mesg);
$object->fetch_thirdparty();
$head = contract_prepare_head($object);
$hselected = 2;
示例5: fetch
/**
* Get object from database
*
* @param int $rowid Id of emailing
* @return int <0 if KO, >0 if OK
*/
function fetch($rowid)
{
global $conf;
$sql = "SELECT m.rowid, m.titre, m.sujet, m.body, m.bgcolor, m.bgimage";
$sql .= ", m.email_from, m.email_replyto, m.email_errorsto";
$sql .= ", m.statut, m.nbemail";
$sql .= ", m.fk_user_creat, m.fk_user_valid";
$sql .= ", m.date_creat";
$sql .= ", m.date_valid";
$sql .= ", m.date_envoi";
$sql .= ", m.extraparams";
$sql .= " FROM " . MAIN_DB_PREFIX . "mailing as m";
$sql .= " WHERE m.rowid = " . $rowid;
dol_syslog(get_class($this) . "::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->statut = $obj->statut;
$this->nbemail = $obj->nbemail;
$this->titre = $obj->titre;
$this->sujet = $obj->sujet;
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401))) {
$this->body = dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML401);
} else {
$this->body = $obj->body;
}
$this->bgcolor = $obj->bgcolor;
$this->bgimage = $obj->bgimage;
$this->email_from = $obj->email_from;
$this->email_replyto = $obj->email_replyto;
$this->email_errorsto = $obj->email_errorsto;
$this->user_creat = $obj->fk_user_creat;
$this->user_valid = $obj->fk_user_valid;
$this->date_creat = $this->db->jdate($obj->date_creat);
$this->date_valid = $this->db->jdate($obj->date_valid);
$this->date_envoi = $this->db->jdate($obj->date_envoi);
$this->extraparams = (array) json_decode($obj->extraparams, true);
return 1;
} else {
dol_syslog(get_class($this) . "::fetch Erreur -1");
return -1;
}
} else {
dol_syslog(get_class($this) . "::fetch Erreur -2");
return -2;
}
}
示例6: restrictedArea
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('usercard', 'globalcard'));
/******************************************************************************/
/* Actions */
/******************************************************************************/
$parameters = array('id' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
// Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (empty($reshook)) {
if ($action == 'update' && $user->rights->user->user->creer && !$_POST["cancel"]) {
$db->begin();
$res = $object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
if ($res < 0) {
$mesg = '<div class="error">' . $adh->error . '</div>';
$db->rollback();
} else {
$db->commit();
}
}
}
/******************************************************************************/
/* Affichage fiche */
/******************************************************************************/
llxHeader();
$form = new Form($db);
if ($id) {
$head = user_prepare_head($object);
示例7: createFromClone
/**
* Load an object from its id and create a new one in database
*
* @param int $fromid Id of object to clone
* @param bool $clone_contact clone contact of project
* @param bool $clone_task clone task of project
* @param bool $clone_project_file clone file of project
* @param bool $clone_task_file clone file of task (if task are copied)
* @param bool $clone_note clone note of project
* @param bool $notrigger no trigger flag
* @return int New id of clone
*/
function createFromClone($fromid, $clone_contact = false, $clone_task = true, $clone_project_file = false, $clone_task_file = false, $clone_note = true, $notrigger = 0)
{
global $user, $langs, $conf;
$error = 0;
dol_syslog("createFromClone clone_contact=" . $clone_contact . " clone_task=" . $clone_task . " clone_project_file=" . $clone_project_file . " clone_note=" . $clone_note);
$now = dol_mktime(0, 0, 0, idate('m', dol_now()), idate('d', dol_now()), idate('Y', dol_now()));
$clone_project = new Project($this->db);
$clone_project->context['createfromclone'] = 'createfromclone';
$this->db->begin();
// Load source object
$clone_project->fetch($fromid);
$clone_project->fetch_thirdparty();
$orign_dt_start = $clone_project->date_start;
$orign_project_ref = $clone_project->ref;
$clone_project->id = 0;
$clone_project->date_start = $now;
if (!empty($clone_project->date_end)) {
$clone_project->date_end = $clone_project->date_end + ($now - $orign_dt_start);
}
$clone_project->datec = $now;
if (!$clone_note) {
$clone_project->note_private = '';
$clone_project->note_public = '';
}
//Generate next ref
$defaultref = '';
$obj = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
if (!empty($conf->global->PROJECT_ADDON) && is_readable(DOL_DOCUMENT_ROOT . "/core/modules/project/" . $conf->global->PROJECT_ADDON . ".php")) {
require_once DOL_DOCUMENT_ROOT . "/core/modules/project/" . $conf->global->PROJECT_ADDON . '.php';
$modProject = new $obj();
$defaultref = $modProject->getNextValue(is_object($clone_project->thirdparty) ? $clone_project->thirdparty->id : 0, $clone_project);
}
if (is_numeric($defaultref) && $defaultref <= 0) {
$defaultref = '';
}
$clone_project->ref = $defaultref;
// Create clone
$result = $clone_project->create($user, $notrigger);
// Other options
if ($result < 0) {
$this->error .= $clone_project->error;
$error++;
}
if (!$error) {
//Get the new project id
$clone_project_id = $clone_project->id;
//Note Update
if (!$clone_note) {
$clone_project->note_private = '';
$clone_project->note_public = '';
} else {
$this->db->begin();
$res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_public, ENT_QUOTES), '_public');
if ($res < 0) {
$this->error .= $clone_project->error;
$error++;
$this->db->rollback();
} else {
$this->db->commit();
}
$this->db->begin();
$res = $clone_project->update_note(dol_html_entity_decode($clone_project->note_private, ENT_QUOTES), '_private');
if ($res < 0) {
$this->error .= $clone_project->error;
$error++;
$this->db->rollback();
} else {
$this->db->commit();
}
}
//Duplicate contact
if ($clone_contact) {
$origin_project = new Project($this->db);
$origin_project->fetch($fromid);
foreach (array('internal', 'external') as $source) {
$tab = $origin_project->liste_contact(-1, $source);
foreach ($tab as $contacttoadd) {
$clone_project->add_contact($contacttoadd['id'], $contacttoadd['code'], $contacttoadd['source'], $notrigger);
if ($clone_project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
$this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType");
$error++;
} else {
if ($clone_project->error != '') {
$this->error .= $clone_project->error;
$error++;
}
}
//.........这里部分代码省略.........
示例8: restrictedArea
$socid = 0;
if ($user->societe_id > 0) {
$socid = $user->societe_id;
}
$feature2 = $socid && $user->rights->user->self->creer ? '' : 'user';
if ($user->id == $id) {
$feature2 = '';
}
// A user can always read its own card
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
/******************************************************************************/
/* Actions */
/******************************************************************************/
if ($action == 'update' && $user->rights->user->user->creer && !$_POST["cancel"]) {
$db->begin();
$res = $fuser->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
if ($res < 0) {
$mesg = '<div class="error">' . $adh->error . '</div>';
$db->rollback();
} else {
$db->commit();
}
}
/******************************************************************************/
/* Affichage fiche */
/******************************************************************************/
llxHeader();
$form = new Form($db);
if ($id) {
$head = user_prepare_head($fuser);
$title = $langs->trans("User");
示例9: dol_html_entity_decode
if (!empty($_POST["fromname"])) {
$email_from = $_POST["fromname"] . ' ';
}
if (!empty($_POST["frommail"])) {
$email_from .= '<' . $_POST["frommail"] . '>';
}
$errors_to = $_POST["errorstomail"];
$sendto = $_POST["sendto"];
$sendtocc = $_POST["sendtocc"];
$sendtoccc = $_POST["sendtoccc"];
$subject = $_POST['subject'];
$body = $_POST['message'];
$deliveryreceipt = $_POST["deliveryreceipt"];
//Check if we have to decode HTML
if (!empty($conf->global->FCKEDITOR_ENABLE_MAILING) && dol_textishtml(dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401))) {
$body = dol_html_entity_decode($body, ENT_COMPAT | ENT_HTML401);
}
// Create form object
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$attachedfiles = $formmail->get_attached_files();
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
if (empty($_POST["frommail"])) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")), 'errors');
$action = 'test';
$error++;
}
if (empty($sendto)) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTo")), 'errors');
示例10: dol_entity_decode
/**
* This function is called to decode a string with HTML entities (it decodes entities tags)
* @param stringhtml stringhtml
* @param pagecodeto Encoding of input string
* @return string decodestring
*/
function dol_entity_decode($stringhtml, $pagecodeto = 'UTF-8')
{
$ret = dol_html_entity_decode($stringhtml, ENT_COMPAT, $pagecodeto);
return $ret;
}
示例11: header
}
$adht->update($user);
header("Location: " . $_SERVER["PHP_SELF"] . "?rowid=" . $_POST["rowid"]);
exit;
}
}
if ($action == 'delete' && $user->rights->adherent->configurer) {
$adht = new AdherentType($db);
$adht->delete($rowid);
header("Location: " . $_SERVER["PHP_SELF"]);
exit;
}
if ($action == 'commentaire' && $user->rights->adherent->configurer) {
$don = new Don($db);
$don->fetch($rowid);
$don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES));
}
/*
* View
*/
llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
$form = new Form($db);
// Liste of members type
if (!$rowid && $action != 'create' && $action != 'edit') {
print_fiche_titre($langs->trans("MembersTypes"));
$sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote";
$sql .= " FROM " . MAIN_DB_PREFIX . "adherent_type as d";
$sql .= " WHERE d.entity IN (" . getEntity() . ")";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
示例12: htmlToUTFAndPreOdf
/**
* Function to convert a HTML string into an ODT string
*
* @param string $value String to convert
*/
public function htmlToUTFAndPreOdf($value)
{
// We decode into utf8, entities
$value = dol_html_entity_decode($value, ENT_QUOTES);
// We convert html tags
$ishtml = dol_textishtml($value);
if ($ishtml) {
// If string is "MYPODUCT - Desc <strong>bold</strong> with é accent<br />\n<br />\nUn texto en español ?"
// Result after clean must be "MYPODUCT - Desc bold with é accent\n\nUn texto en español ?"
// We want to ignore \n and we want all <br> to be \n
$value = preg_replace('/(\\r\\n|\\r|\\n)/i', '', $value);
$value = preg_replace('/<br>/i', "\n", $value);
$value = preg_replace('/<br\\s+[^<>\\/]*>/i', "\n", $value);
$value = preg_replace('/<br\\s+[^<>\\/]*\\/>/i', "\n", $value);
//$value=preg_replace('/<strong>/','__lt__text:p text:style-name=__quot__bold__quot____gt__',$value);
//$value=preg_replace('/<\/strong>/','__lt__/text:p__gt__',$value);
$value = dol_string_nohtmltag($value, 0);
}
return $value;
}
示例13: dol_htmlentitiesbr_decode
/**
* This function is called to decode a HTML string (it decodes entities and br tags)
*
* @param string $stringtodecode String to decode
* @param string $pagecodeto Page code for result
* @return string String decoded
*/
function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8')
{
$ret = dol_html_entity_decode($stringtodecode, ENT_COMPAT, $pagecodeto);
$ret = preg_replace('/' . "\r\n" . '<br(\\s[\\sa-zA-Z_="]*)?\\/?>/i', "<br>", $ret);
$ret = preg_replace('/<br(\\s[\\sa-zA-Z_="]*)?\\/?>' . "\r\n" . '/i', "\r\n", $ret);
$ret = preg_replace('/<br(\\s[\\sa-zA-Z_="]*)?\\/?>' . "\n" . '/i', "\n", $ret);
$ret = preg_replace('/<br(\\s[\\sa-zA-Z_="]*)?\\/?>/i', "\n", $ret);
return $ret;
}