本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: purify
/**
* @return string
*/
protected function purify($value)
{
return $this->hp->purify($value);
}
示例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"> </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"> </div>');
$html .= $div_suffix;
}
$html .= '</li>';
$html .= '</ul>';
}
return $html;
}
示例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);
}
示例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;
}