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


PHP Xml::escapeTagsOnly方法代码示例

本文整理汇总了PHP中Xml::escapeTagsOnly方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::escapeTagsOnly方法的具体用法?PHP Xml::escapeTagsOnly怎么用?PHP Xml::escapeTagsOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xml的用法示例。


在下文中一共展示了Xml::escapeTagsOnly方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testEscapeTagsOnly

 /**
  * @covers Xml::escapeTagsOnly
  */
 public function testEscapeTagsOnly()
 {
     $this->assertEquals('&quot;&gt;&lt;', Xml::escapeTagsOnly('"><'), 'replace " > and < with their HTML entitites');
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:XmlTest.php

示例2: renderPreTag

 /**
  * Tag hook handler for 'pre'.
  */
 function renderPreTag($text, $attribs)
 {
     // Backwards-compatibility hack
     $content = StringUtils::delimiterReplace('<nowiki>', '</nowiki>', '$1', $text, 'i');
     $attribs = Sanitizer::validateTagAttributes($attribs, 'pre');
     return Xml::openElement('pre', $attribs) . Xml::escapeTagsOnly($content) . '</pre>';
 }
开发者ID:josephdye,项目名称:wikireader,代码行数:10,代码来源:Parser.php

示例3: nowiki

 /**
  * Core parser tag hook function for 'nowiki'. Text within this section
  * gets interpreted as a string of text with HTML-compatible character
  * references, and wiki markup within it will not be expanded.
  *
  * Uses undocumented extended tag hook return values, introduced in r61913.
  *
  * @param string $content
  * @param array $attributes
  * @param Parser $parser
  * @return array
  */
 public static function nowiki($content, $attributes, $parser)
 {
     $content = strtr($content, array('-{' => '-&#123;', '}-' => '&#125;-'));
     return array(Xml::escapeTagsOnly($content), 'markerType' => 'nowiki');
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:17,代码来源:CoreTagHooks.php

示例4: getTag

 /**
  * Custom tag implementation. This is called by efCategoryTreeParserHook, which is used to
  * load CategoryTreeFunctions.php on demand.
  * @param $parser Parser
  * @param $category
  * @param $hideroot bool
  * @param $attr
  * @param $depth int
  * @param $allowMissing bool
  * @return bool|string
  */
 function getTag($parser, $category, $hideroot = false, $attr, $depth = 1, $allowMissing = false)
 {
     global $wgCategoryTreeDisableCache, $wgCategoryTreeDynamicTag;
     static $uniq = 0;
     $category = trim($category);
     if ($category === '') {
         return false;
     }
     if ($parser && $wgCategoryTreeDisableCache && !$wgCategoryTreeDynamicTag) {
         $parser->disableCache();
     }
     $title = self::makeTitle($category);
     if ($title === false || $title === null) {
         return false;
     }
     if (isset($attr['class'])) {
         $attr['class'] .= ' CategoryTreeTag';
     } else {
         $attr['class'] = ' CategoryTreeTag';
     }
     $attr['data-ct-mode'] = $this->mOptions['mode'];
     $attr['data-ct-options'] = Xml::escapeTagsOnly($this->getOptionsAsJsStructure());
     $html = '';
     $html .= Xml::openElement('div', $attr);
     if (!$allowMissing && !$title->getArticleID()) {
         $html .= Xml::openElement('span', array('class' => 'CategoryTreeNotice'));
         if ($parser) {
             $html .= $parser->recursiveTagParse(wfMsgNoTrans('categorytree-not-found', $category));
         } else {
             $html .= wfMsgExt('categorytree-not-found', 'parseinline', htmlspecialchars($category));
         }
         $html .= Xml::closeElement('span');
     } else {
         if (!$hideroot) {
             $html .= $this->renderNode($title, $depth, $wgCategoryTreeDynamicTag);
         } elseif (!$wgCategoryTreeDynamicTag) {
             $html .= $this->renderChildren($title, $depth);
         } else {
             $uniq += 1;
             $load = 'ct-' . $uniq . '-' . mt_rand(1, 100000);
             $html .= Xml::openElement('script', array('type' => 'text/javascript', 'id' => $load));
             $html .= 'categoryTreeLoadChildren("' . Xml::escapeJsString($title->getDBkey()) . '", ' . $this->getOptionsAsJsStructure($depth) . ', document.getElementById("' . $load . '").parentNode);';
             $html .= Xml::closeElement('script');
         }
     }
     $html .= Xml::closeElement('div');
     $html .= "\n\t\t";
     return $html;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:60,代码来源:CategoryTreeFunctions.php

示例5: createSchemaXMLFromForm

 /**
  * Creates Page Schemas XML for form-wide information.
  */
 public static function createSchemaXMLFromForm()
 {
     global $wgRequest;
     $formName = null;
     $xml = '';
     $isStandardInputsOpen = false;
     foreach ($wgRequest->getValues() as $var => $val) {
         $val = str_replace(array('<', '>'), array('&lt;', '&gt;'), $val);
         if ($var == 'sf_form_name') {
             $formName = $val;
         } elseif ($var == 'sf_page_name_formula') {
             if (!empty($val)) {
                 $val = Xml::escapeTagsOnly($val);
                 $xml .= '<PageNameFormula>' . $val . '</PageNameFormula>';
             }
         } elseif ($var == 'sf_create_title') {
             if (!empty($val)) {
                 $xml .= '<CreateTitle>' . $val . '</CreateTitle>';
             }
         } elseif ($var == 'sf_edit_title') {
             if (!empty($val)) {
                 $xml .= '<EditTitle>' . $val . '</EditTitle>';
             }
         } elseif ($var == 'sf_fi_free_text_label') {
             $isStandardInputsOpen = true;
             $xml .= '<standardInputs ';
             if (!empty($val)) {
                 $xml .= 'freeTextLabel="' . Xml::escapeTagsOnly($val) . '" ';
             }
         } elseif ($var == 'sf_fi_free_text') {
             if (!empty($val)) {
                 $xml .= 'inputFreeText="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_summary') {
             if (!empty($val)) {
                 $xml .= 'inputSummary="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_minor_edit') {
             if (!empty($val)) {
                 $xml .= 'inputMinorEdit="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_watch') {
             if (!empty($val)) {
                 $xml .= 'inputWatch="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_save') {
             if (!empty($val)) {
                 $xml .= 'inputSave="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_preview') {
             if (!empty($val)) {
                 $xml .= 'inputPreview="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_changes') {
             if (!empty($val)) {
                 $xml .= 'inputChanges="' . $val . '" ';
             }
         } elseif ($var == 'sf_fi_cancel') {
             if (!empty($val)) {
                 $xml .= 'inputCancel="' . $val . '"';
             }
         }
     }
     if ($isStandardInputsOpen) {
         $isStandardInputsOpen = false;
         $xml .= ' />';
     }
     $xml = '<semanticforms_Form name="' . $formName . '" >' . $xml;
     $xml .= '</semanticforms_Form>';
     return $xml;
 }
开发者ID:Rikuforever,项目名称:wiki,代码行数:74,代码来源:SF_PageSchemas.php


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