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


PHP Codendi_HTMLPurifier::purify方法代码示例

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


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

示例1: projects

 public function projects()
 {
     $projects = array();
     foreach ($this->repository_list_for_projects as $presenter) {
         $projects[] = array('project_id' => $presenter->project_id, 'project_name' => $this->purifier->purify($presenter->project_name));
     }
     return $projects;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:8,代码来源:AdminRepositoryListPresenter.class.php

示例2: getReportSelector

 private function getReportSelector(Tracker_Report $report, array $reports)
 {
     $options = '';
     if (count($reports) > 1) {
         $options = '<select id="tracker_select_report" name="select_report">';
         $optgroup = array('personal' => '', 'public' => '');
         foreach ($reports as $r) {
             $prefix = '<option value="' . $r->id . '"';
             $suffix = '>' . $this->purifier->purify($r->name, CODENDI_PURIFIER_CONVERT_HTML) . '</option>';
             $selected = $r->id == $report->id ? 'selected="selected"' : '';
             $optgroup[$r->isPublic() ? 'public' : 'personal'] .= $prefix . ' ' . $selected . $suffix;
         }
         if ($optgroup['personal']) {
             $options .= '<optgroup label="Personal reports">';
             $options .= $optgroup['personal'];
             $options .= '</optgroup>';
         }
         if ($optgroup['public']) {
             $options .= '<optgroup label="Public reports">';
             $options .= $optgroup['public'];
             $options .= '</optgroup>';
         }
         $options .= '</select>';
         $options .= '<noscript><input type="submit" value="' . $GLOBALS['Language']->getText('global', 'btn_submit') . '" /></noscript>';
     } else {
         $options = $this->purifier->purify($report->name, CODENDI_PURIFIER_CONVERT_HTML);
     }
     return $options;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:29,代码来源:Tracker_Report_HeaderRenderer.php

示例3: fetchArtifactParentsOptions

 private function fetchArtifactParentsOptions($prefill_parent, $label, array $possible_parents, Codendi_HTMLPurifier $hp)
 {
     $html = '';
     if ($possible_parents) {
         $html .= '<optgroup label="' . $label . '">';
         foreach ($possible_parents as $possible_parent) {
             $selected = '';
             if ($possible_parent->getId() == $prefill_parent) {
                 $selected = ' selected="selected"';
             }
             $html .= '<option value="' . $possible_parent->getId() . '"' . $selected . '>' . $hp->purify($possible_parent->getXRefAndTitle()) . '</option>';
         }
         $html .= '</optgroup>';
     }
     return $html;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:16,代码来源:Tracker_FormElement_Field_ArtifactLink.class.php

示例4: purify

 /**
  * @return string
  */
 protected function purify($value)
 {
     return $this->hp->purify($value);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:ColumnDefinition.class.php

示例5: fetchParentsTitle

 private function fetchParentsTitle(Codendi_HTMLPurifier $hp, array $parents, $padding_prefix = '')
 {
     $html = '';
     $parent = array_pop($parents);
     if ($parent) {
         $html .= '<ul class="tracker-hierarchy">';
         $html .= '<li>';
         $html .= $padding_prefix;
         $html .= '<div class="tree-last">&nbsp;</div> ';
         if ($parents) {
             $html .= $parent->fetchDirectLinkToArtifactWithTitle();
         } else {
             $html .= $hp->purify($parent->getXRefAndTitle());
         }
         if ($parents) {
             $html .= '</a>';
             $div_prefix = '';
             $div_suffix = '';
             if (count($parents) == 1) {
                 $div_prefix = '<div class="tracker_artifact_title">';
                 $div_suffix = '</div>';
             }
             $html .= $div_prefix;
             $html .= $this->fetchParentsTitle($hp, $parents, $padding_prefix . '<div class="tree-blank">&nbsp;</div>');
             $html .= $div_suffix;
         }
         $html .= '</li>';
         $html .= '</ul>';
     }
     return $html;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:31,代码来源:Tracker_Artifact.class.php

示例6: default_new_followers_email

 public function default_new_followers_email()
 {
     return $this->purifier->purify('Type logins, emails or mailing lists. Multiple values separated by coma.', CODENDI_PURIFIER_CONVERT_HTML);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:adminPresenter.class.php

示例7: purify

 /**
  * Perform HTML purification depending of level purification required and create links. 
  */
 function purify($html, $level = 0, $groupId = 0)
 {
     $clean = '';
     switch ($level) {
         case CODENDI_PURIFIER_FORUMML:
             require_once $GLOBALS['htmlpurifier_dir'] . '/HTMLPurifier.auto.php';
             $hp = HTMLPurifier::getInstance();
             $config = $this->getHPConfig($level);
             $clean = util_make_links($hp->purify($html, $config), $groupId);
             break;
         default:
             $clean = parent::purify($html, $level, $groupId);
     }
     return $clean;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:18,代码来源:ForumML_HTMLPurifier.class.php


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