本文整理汇总了PHP中CMbString::highlightCode方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbString::highlightCode方法的具体用法?PHP CMbString::highlightCode怎么用?PHP CMbString::highlightCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbString
的用法示例。
在下文中一共展示了CMbString::highlightCode方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CHL7v2Message
/**
* @package Mediboard
* @subpackage hl7
* @version $Revision: 15455 $
* @author SARL OpenXtrem
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
$er7 = CValue::post("er7");
$query = CValue::post("query");
$hl7_message = new CHL7v2Message();
$hl7_message->parse($er7);
$xml = $hl7_message->toXML();
if ($query) {
$xpath = new CMbXPath($xml);
$results = @$xpath->query("//{$query}");
$nodes = array();
// Création du template
$smarty = new CSmartyDP();
if ($results) {
foreach ($results as $result) {
$nodes[] = CMbString::highlightCode("xml", $xml->saveXML($result));
}
}
$smarty->assign("nodes", $nodes);
$smarty->display("inc_er7_xml_result.tpl");
} else {
ob_clean();
header("Content-Type: text/xml");
echo $xml->saveXML();
CApp::rip();
}
示例2: stripslashes
* $Id$
*
* @category Hprimsante
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
CCanDo::checkRead();
$message_string = CValue::post("message");
if (!$message_string) {
return;
}
$message_string = stripslashes($message_string);
CValue::setSession("message", $message_string);
try {
$message = new CHPrimSanteMessage();
$message->parse($message_string);
$message->_errors_msg = !$message->isOK(CHL7v2Error::E_ERROR);
$message->_warnings_msg = !$message->isOK(CHL7v2Error::E_WARNING);
$message->_xml = CMbString::highlightCode("xml", $message->toXML()->saveXML());
} catch (CHL7v2Exception $e) {
CAppUI::stepMessage(UI_MSG_ERROR, $e->getMessage() . " (" . $e->extraData . ")");
return;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("message", $message);
$smarty->assign("key", "input");
$smarty->display("inc_display_hprim_message.tpl");
示例3: traceQuery
/**
* Trace a query applying syntax coloring
*
* @param string $query Query to execute
* @param array $values Values to prepare
*
* @return void
*/
static function traceQuery($query, $values = array())
{
self::$last_query = $query;
self::$last_values = $values;
// Verbose
if (!self::$verbose) {
return;
}
// Inject values into query
foreach ($values as $_value) {
$_value = str_replace("'", "\\'", $_value);
$query = preg_replace("/\\?/", "'{$_value}'", $query, 1);
}
echo utf8_decode(CMbString::highlightCode("sql", $query, false, "white-space: pre-wrap;"));
}
示例4: displayReport
/**
* Displays the SQL report
*
* @return void
*/
static function displayReport()
{
$totals = array();
$distribution = array();
foreach (self::$report_data as $_hash => $_data) {
$totals[$_hash] = array_sum(CMbArray::pluck($_data, 0));
$_distribution = array("", "", "", "", "", "", "", "", "");
foreach ($_data as $_pair) {
$duration = $_pair[0] * 1000;
$log = (int) floor(log10($duration) + 0.5);
if (!isset($_distribution[$log])) {
$_distribution[$log] = "";
}
$_distribution[$log] .= "#";
}
$distribution[$_hash] = $_distribution;
}
arsort($totals);
foreach ($totals as $_hash => $_total) {
CAppUI::stepMessage(UI_MSG_OK, "Query was called %d times for %01.3fms", count(self::$report_data[$_hash]), $_total);
echo utf8_decode(CMbString::highlightCode("sql", self::$report_data[$_hash][0][1], false, "white-space: pre-wrap;"));
$_dist = $distribution[$_hash];
// No input for 1µs and 10µs magnitudes (< 31.6µs)
$lines = array("100µs {$_dist['2']}", " 1ms {$_dist['3']}", " 10ms {$_dist['4']}", "100ms {$_dist['5']}", " 1s {$_dist['6']}", " 10s {$_dist['7']}");
echo "<pre>" . implode("\n", $lines) . "</pre>";
}
}
示例5: showxml
/**
* Affiche le message au format xml
*
* @param String $message message
*
* @return String
*/
static function showxml($message)
{
return CMbString::highlightCode("xml", $message);
}
示例6:
$doc = $msg_segment_group->toXML();
if (count($msg_segment_group->children) > $limit_size) {
$doc->formatOutput = true;
$msg_segment_group->_xml = "<pre>" . CMbString::htmlEntities($doc->saveXML()) . "</pre>";
} else {
$msg_segment_group->_xml = CMbString::highlightCode("xml", $doc->saveXML());
}
}
$ack_segment_group = $exchange->getACK();
if ($ack_segment_group) {
$doc = $ack_segment_group->toXML();
if (count($ack_segment_group->children) > $limit_size) {
$doc->formatOutput = true;
$ack_segment_group->_xml = "<pre>" . CMbString::htmlEntities($doc->saveXML()) . "</pre>";
} else {
$ack_segment_group->_xml = CMbString::highlightCode("xml", $doc->saveXML());
}
}
$smarty->assign("msg_segment_group", $msg_segment_group);
$smarty->assign("ack_segment_group", $ack_segment_group);
$smarty->assign("limit_size", $limit_size);
$smarty->display("inc_exchange_tabular_details.tpl");
break;
case $exchange instanceof CEchangeXML:
$smarty->display("inc_exchange_xml_details.tpl");
break;
case $exchange instanceof CExchangeDicom:
$exchange->decodeContent();
$smarty->display("inc_exchange_dicom_details.tpl");
break;
default:
示例7: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
return utf8_decode(CMbString::highlightCode("xml", $object->{$this->fieldName}, false));
}
示例8: getValue
/**
* @see parent::getValue()
*/
function getValue($object, $smarty = null, $params = array())
{
$propValue = $object->{$this->fieldName};
$propValue = !empty($params['export']) ? var_export($propValue, true) : $propValue;
return utf8_decode(CMbString::highlightCode("php", $propValue, false));
}
示例9:
<?php
/**
* $Id$
*
* Affiche le code xml du datatype choisi
*
* @category CDA
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @link http://www.mediboard.org */
$name = CValue::get("name");
echo CMbString::purifyHTML("<h1>{$name}</h1>");
echo CMbString::highlightCode("xml", CCdaTools::showNodeXSD($name, "modules/cda/resources/datatypes-base_original.xsd"));
示例10: file_get_contents
<?php
/* $Id $ */
/**
* @package Mediboard
* @subpackage hl7
* @version $Revision:$
* @author SARL OpenXtrem
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
CCanDo::checkAdmin();
$path = CValue::get("path");
echo CMbString::purifyHTML("<h1>{$path}</h1>");
echo CMbString::highlightCode("xml", file_get_contents($path));