本文整理汇总了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>";
}