当前位置: 首页>>代码示例>>PHP>>正文


PHP CMbString::highlightCode方法代码示例

本文整理汇总了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();
}
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_get_er7_xml.php

示例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");
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_display_hprim_message.php

示例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;"));
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:23,代码来源:CRecordSante400.class.php

示例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>";
     }
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:32,代码来源:CSQLDataSource.class.php

示例5: showxml

 /**
  * Affiche le message au format xml
  *
  * @param String $message message
  *
  * @return String
  */
 static function showxml($message)
 {
     return CMbString::highlightCode("xml", $message);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:11,代码来源:CCdaTools.class.php

示例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:
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_vw_exchange_details.php

示例7: getValue

 /**
  * @see parent::getValue()
  */
 function getValue($object, $smarty = null, $params = array())
 {
     return utf8_decode(CMbString::highlightCode("xml", $object->{$this->fieldName}, false));
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:7,代码来源:CXmlSpec.class.php

示例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));
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:9,代码来源:CPhpSpec.class.php

示例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"));
开发者ID:fbone,项目名称:mediboard4,代码行数:15,代码来源:ajax_show_xml_type.php

示例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));
开发者ID:fbone,项目名称:mediboard4,代码行数:14,代码来源:ajax_display_hl7v2_schema.php


注:本文中的CMbString::highlightCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。