本文整理汇总了PHP中Codendi_HTMLPurifier类的典型用法代码示例。如果您正苦于以下问题:PHP Codendi_HTMLPurifier类的具体用法?PHP Codendi_HTMLPurifier怎么用?PHP Codendi_HTMLPurifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Codendi_HTMLPurifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchAdmin
public function fetchAdmin($tracker)
{
$html = '';
$hp = Codendi_HTMLPurifier::instance();
$html .= '<fieldset class="tracker-admin-container tracker-admin-fieldset" id="tracker-admin-formElements_' . $this->id . '"><legend title="' . $hp->purify($this->getDescription(), CODENDI_PURIFIER_CONVERT_HTML) . '"><label>';
$html .= $hp->purify($this->getLabel(), CODENDI_PURIFIER_CONVERT_HTML);
$html .= '</label><span class="tracker-admin-field-controls">';
$html .= '<a class="edit-field" href="' . $this->getAdminEditUrl() . '">' . $GLOBALS['HTML']->getImage('ic/edit.png', array('alt' => 'edit')) . '</a> ';
if ($this->canBeUnused()) {
$html .= '<a href="?' . http_build_query(array('tracker' => $this->tracker_id, 'func' => 'admin-formElement-remove', 'formElement' => $this->id)) . '">' . $GLOBALS['HTML']->getImage('ic/cross.png', array('alt' => 'remove')) . '</a>';
} else {
$html .= '<span style="color:gray;" title="' . $GLOBALS['Language']->getText('plugin_tracker_common_fieldset_factory', 'delete_only_empty_fieldset') . '">';
$html .= $GLOBALS['HTML']->getImage('ic/cross-disabled.png', array('alt' => 'remove'));
$html .= '</span>';
}
$html .= '</span>';
$html .= '</legend>';
$content = array();
foreach ($this->getFormElements() as $formElement) {
$content[] = $formElement->fetchAdmin($tracker);
}
$html .= implode('', $content);
$html .= '</fieldset>';
return $html;
}
示例2: fetch
/**
* @see Workflow_Transition_Condition::fetch()
* @return string The field wrapped in Html
*/
public function fetch()
{
$purifier = Codendi_HTMLPurifier::instance();
$html = '';
$html .= $GLOBALS['Language']->getText('workflow_admin', 'label_define_transition_required_field');
$html .= '<br />';
$html .= $GLOBALS['Language']->getText('workflow_admin', 'the_field') . ' ';
$html .= '<select name="add_notempty_condition">';
$selected = '';
if (!$this->getField()) {
$selected = 'selected="selected"';
}
$html .= '<option value="0" ' . $selected . '>';
$html .= $GLOBALS['Language']->getText('global', 'please_choose_dashed');
$html .= '</option>';
foreach ($this->getFields() as $field) {
$selected = '';
if ($this->getFieldId() == $field->getId()) {
$selected .= 'selected="selected"';
}
$html .= '<option value="' . $purifier->purify($field->getId()) . '" ' . $selected . '>';
$html .= $purifier->purify($field->getLabel());
$html .= '</option>';
}
$html .= '</select>';
$html .= ' ' . $GLOBALS['Language']->getText('workflow_admin', 'field_not_empty');
return $html;
}
示例3: getCrumbs
public function getCrumbs()
{
$hp = Codendi_HTMLPurifier::instance();
$tracker = $this->milestone->getArtifact()->getTracker();
$url_parameters = array('planning_id' => $this->milestone->getPlanningId(), 'action' => 'show', 'group_id' => $this->milestone->getGroupId(), 'aid' => $this->milestone->getArtifactId());
return array(array('url' => $this->plugin_path . '/?' . http_build_query($url_parameters), 'title' => $hp->purify($this->milestone->getArtifactTitle()), 'default_name' => $hp->purify($tracker->getName() . ' #' . $this->milestone->getArtifactId())));
}
示例4: fetchSubmitInstructions
protected function fetchSubmitInstructions()
{
if ($this->tracker->submit_instructions) {
$hp = Codendi_HTMLPurifier::instance();
return '<p class="submit_instructions">' . $hp->purify($this->tracker->submit_instructions, CODENDI_PURIFIER_FULL) . '</p>';
}
}
示例5: __construct
public function __construct(PFUser $user)
{
$hp = Codendi_HTMLPurifier::instance();
$user_name = $hp->purify($user->getRealName());
$steps = array(new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'welcome_title'), $GLOBALS['Language']->getText('my_tour', 'welcome', $user_name)), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'my_personal_page_title'), $GLOBALS['Language']->getText('my_tour', 'my_personal_page'), 'bottom', 'ul.nav > li:first-child'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'projects_title'), $GLOBALS['Language']->getText('my_tour', 'projects'), 'bottom', 'ul.nav > li.projects-nav'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'help_title'), $GLOBALS['Language']->getText('my_tour', 'help'), 'bottom', 'ul.nav > li.help-nav'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'search_title'), $GLOBALS['Language']->getText('my_tour', 'search'), 'bottom', 'ul.nav.pull-right > form'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'user_menu_title'), $GLOBALS['Language']->getText('my_tour', 'user_menu'), 'bottom', 'ul.nav.pull-right > li.user-menu'), new Tuleap_Tour_Step($GLOBALS['Language']->getText('my_tour', 'end_tour_title'), $GLOBALS['Language']->getText('my_tour', 'end_tour')));
parent::__construct(self::TOUR_NAME, $steps);
}
示例6: fetchFolder
function fetchFolder($folder, $params)
{
$hp = Codendi_HTMLPurifier::instance();
$selected = '';
if (!isset($params['selected']) || !$params['selected']) {
if ($this->docman->userCanWrite($folder['id']) && (!$params['select'] || $params['select'] == $folder['id'])) {
$selected = 'checked="checked"';
$params['selected'] = true;
}
}
$disabled = $this->docman->userCanWrite($folder['id']) ? '' : 'disabled="disabled"';
$label_classes = $selected ? 'docman_item_actual_parent' : '';
$h = '<li class="' . Docman_View_Browse::getItemClasses(array('is_last' => $params['is_last'])) . '">';
$h .= '<label for="item_parent_id_' . $folder['id'] . '" class="' . $label_classes . '" >';
$h .= '<input type="radio" ' . $selected . ' name="' . $params['input_name'] . '" value="' . $folder['id'] . '" id="item_parent_id_' . $folder['id'] . '" ' . $disabled . ' />';
$h .= '<img src="' . $folder['icon_src'] . '" class="docman_item_icon" />';
$h .= $hp->purify($folder['title'], CODENDI_PURIFIER_CONVERT_HTML) . '</label>';
$h .= '<script type="text/javascript">docman.addParentFoldersForNewItem(' . $folder['id'] . ', ' . $folder['parent_id'] . ", '" . $hp->purify(addslashes($folder['title']), CODENDI_PURIFIER_CONVERT_HTML) . "');</script>\n";
$h .= '<ul class="docman_items">';
$params['is_last'] = false;
$nb = count($folder['items']);
$i = 0;
foreach ($folder['items'] as $item) {
$i++;
if ($i == $nb) {
$params['is_last'] = true;
}
$h .= $this->fetchFolder($item, $params);
}
return $h . '</ul></li>';
}
示例7: printnode
function printnode($nodeid, $text, $depth = 0, $delete_ok = false)
{
global $Language;
$purifier = Codendi_HTMLPurifier::instance();
// print current node, then all subnodes
print '<BR>';
for ($i = 0; $i < $depth; $i++) {
print " ";
}
html_image('ic/cfolder15.png', array());
print ' ' . $purifier->purify($text) . " ";
if ($nodeid != 0) {
print ' <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> ';
}
if ($delete_ok) {
print ' <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> ';
}
if ($nodeid != 0) {
print ' ' . help_button('trove_cat', $nodeid) . "\n";
}
$res_child = db_query("SELECT trove_cat_id,fullname,parent FROM trove_cat " . "WHERE parent='" . db_ei($nodeid) . "' ORDER BY fullpath");
while ($row_child = db_fetch_array($res_child)) {
$delete_ok = $row_child["parent"] != 0;
printnode($row_child["trove_cat_id"], $row_child["fullname"], $depth + 1, $delete_ok);
}
}
示例8: __construct
public function __construct($controller)
{
$this->controller = $controller;
$this->request = $controller->getRequest();
$this->HTMLPurifier = Codendi_HTMLPurifier::instance();
$this->user = $controller->getUser();
}
示例9: __construct
public function __construct(ProjectUGroup $ugroup)
{
parent::__construct($ugroup);
$this->permissions_manager = PermissionsManager::instance();
$this->event_manager = EventManager::instance();
$this->html_purifier = Codendi_HTMLPurifier::instance();
}
示例10: __construct
public function __construct(array $result)
{
$hp = Codendi_HTMLPurifier::instance();
$this->project_name = util_unconvert_htmlspecialchars($result['group_name']);
$this->project_unix_name = $result['unix_group_name'];
$this->project_description = $hp->purify($result['short_description'], CODENDI_PURIFIER_BASIC, $result['group_id']);
}
示例11: Docman_MetaMetadataHtml
function Docman_MetaMetadataHtml(&$md)
{
$this->md =& $md;
$this->hp =& Codendi_HTMLPurifier::instance();
$this->str_yes = $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_param_yes');
$this->str_no = $GLOBALS['Language']->getText('plugin_docman', 'admin_md_detail_param_no');
}
示例12: getContent
function getContent()
{
$html_my_bookmarks = '';
$result = db_query("SELECT bookmark_url, bookmark_title, bookmark_id from user_bookmarks where " . "user_id='" . user_getid() . "' ORDER BY bookmark_title");
$rows = db_numrows($result);
if (!$result || $rows < 1) {
$html_my_bookmarks .= $GLOBALS['Language']->getText('my_index', 'no_bookmark');
$html_my_bookmarks .= db_error();
} else {
$purifier = Codendi_HTMLPurifier::instance();
$html_my_bookmarks .= '<table style="width:100%">';
for ($i = 0; $i < $rows; $i++) {
$bookmark_url = $purifier->purify(db_result($result, $i, 'bookmark_url'), CODENDI_PURIFIER_CONVERT_HTML);
if (my_has_URL_invalid_content($bookmark_url)) {
$bookmark_url = '';
}
$bookmark_title = $purifier->purify(db_result($result, $i, 'bookmark_title'), CODENDI_PURIFIER_CONVERT_HTML);
$html_my_bookmarks .= '<TR class="' . util_get_alt_row_color($i) . '"><TD>';
$html_my_bookmarks .= '<A HREF="' . $bookmark_url . '">' . $bookmark_title . '</A> ';
$html_my_bookmarks .= '<small><A HREF="/my/bookmark_edit.php?bookmark_id=' . db_result($result, $i, 'bookmark_id') . '">[' . $GLOBALS['Language']->getText('my_index', 'edit_link') . ']</A></SMALL></TD>';
$html_my_bookmarks .= '<td style="text-align:right"><A HREF="/my/bookmark_delete.php?bookmark_id=' . db_result($result, $i, 'bookmark_id') . '">';
$html_my_bookmarks .= '<IMG SRC="' . util_get_image_theme("ic/trash.png") . '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="DELETE"></A></td></tr>';
}
$html_my_bookmarks .= '</table>';
}
$html_my_bookmarks .= '<div style="text-align:center; font-size:0.8em;"><a href="/my/bookmark_add.php">[' . $GLOBALS['Language']->getText('my_index', 'add_bookmark') . ']</a></div>';
return $html_my_bookmarks;
}
示例13: display
function display($data)
{
$hp = Codendi_HTMLPurifier::instance();
$full_name = $hp->purify(isset($data['project']['form_full_name']) ? $data['project']['form_full_name'] : '', CODENDI_PURIFIER_CONVERT_HTML);
$unix_name = $hp->purify(isset($data['project']['form_unix_name']) ? $data['project']['form_unix_name'] : '', CODENDI_PURIFIER_CONVERT_HTML);
include $GLOBALS['Language']->getContent('project/projectname');
}
示例14: Docman_ReportHtml
/**
*
*/
function Docman_ReportHtml($report, $view, $defaultUrl)
{
$this->report = $report;
$this->view = $view;
$this->defaultUrl = $defaultUrl;
$this->hp = Codendi_HTMLPurifier::instance();
}
示例15: fetch
/**
* Get the html code needed to display the post action in workflow admin
*
* @return string html
*/
public function fetch()
{
$purifier = Codendi_HTMLPurifier::instance();
$html = '';
$input_value = '<input type="text" name="workflow_postaction_field_int_value[' . $purifier->purify($this->id) . ']" value="' . $purifier->purify($this->getValue()) . '"/>';
//define the selectbox for date fields
$tracker = $this->transition->getWorkflow()->getTracker();
$tff = $this->getFormElementFactory();
$fields_int = $tff->getUsedFormElementsByType($tracker, array('int'));
$select_field = '<select name="workflow_postaction_field_int[' . $purifier->purify($this->id) . ']">';
$options_field = '';
$one_selected = false;
foreach ($fields_int as $field_int) {
$selected = '';
if ($this->field && $this->field->getId() == $field_int->getId()) {
$selected = 'selected="selected"';
$one_selected = true;
}
$options_field .= '<option value="' . $purifier->purify($field_int->getId()) . '" ' . $selected . '>' . $purifier->purify($field_int->getLabel()) . '</option>';
}
if (!$one_selected) {
$select_field .= '<option value="0" ' . ($this->field ? 'selected="selected"' : '') . '>' . $GLOBALS['Language']->getText('global', 'please_choose_dashed') . '</option>';
}
$select_field .= $options_field;
$select_field .= '</select>';
$html .= $GLOBALS['Language']->getText('workflow_admin', 'change_value_int_field_to', array($select_field, $input_value));
return $html;
}