本文整理匯總了PHP中Browser::AddCdata方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browser::AddCdata方法的具體用法?PHP Browser::AddCdata怎麽用?PHP Browser::AddCdata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Browser
的用法示例。
在下文中一共展示了Browser::AddCdata方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetMessages
function GetMessages($threadid, $meth, $isvisitor, &$lastid, $forceShowingRates = false)
{
if ($forceShowingRates || $isvisitor == false && Operator::getInstance()->isCurrentUserAdmin()) {
$crm = MapperFactory::getMapper('Rate');
$rates = $crm->getByThreadidWithOperator($threadid);
$current_rate = array_shift($rates);
} else {
$current_rate = null;
}
$res = MapperFactory::getMapper("Message")->getListMessages($threadid, $lastid, $isvisitor);
$messages = array();
foreach ($res as $msg) {
$message = "";
switch ($meth) {
case 'xml':
if ($msg['kind'] == KIND_AVATAR) {
$message = "<avatar>" . Browser::AddCdata($msg['message']) . "</avatar>";
} else {
$message = "<message>" . Browser::AddCdata($this->messageToHtml($msg)) . "</message>\n";
}
break;
case 'text':
$message = $this->messageToText($msg);
break;
case 'html':
if ($current_rate && $current_rate['date'] < $msg['created']) {
$messages[] = $this->rateToHtml($current_rate);
$current_rate = array_shift($rates);
}
$isvisitor = verify_param("visitor", "/^true\$/", "false") == 'true';
$cleanup_special_tags = !$isvisitor;
$message = $this->messageToHtml($msg, $cleanup_special_tags);
break;
}
if (!empty($message)) {
$messages[] = $message;
}
if ($msg['messageid'] > $lastid) {
$lastid = $msg['messageid'];
}
}
return $messages;
}
示例2: displayAjaxError
static function displayAjaxError($text)
{
$message = Resources::Get('agent.not_logged_in');
$message = Browser::AddCdata($message);
echo "<error type=\"1\"><descr>" . $message . "</descr></error>";
}