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


PHP Codendi_HTMLPurifier::instance方法代码示例

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


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

示例1: 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');
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Docman_MetaMetadataHtml.class.php

示例2: 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;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:28,代码来源:Widget_MyBookmarks.class.php

示例3: __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();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Permissions.class.php

示例4: 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');
 }
开发者ID:nterray,项目名称:tuleap,代码行数:7,代码来源:RegisterProjectStep_Name.class.php

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

示例6: getContent

 function getContent()
 {
     $html = '';
     $i = 1;
     $UH = UserHelper::instance();
     $hp = Codendi_HTMLPurifier::instance();
     while ($data = db_fetch_array($this->getLatestRevisions())) {
         $html .= '<div class="' . util_get_alt_row_color($i++) . '" style="border-bottom:1px solid #ddd">';
         $html .= '<div style="font-size:0.98em;">';
         $html .= '<a href="' . $this->_getLinkToCommit($data) . '">#' . $data['revision'] . '</a>';
         $html .= ' by ';
         if (isset($data['whoid'])) {
             $name = $UH->getDisplayNameFromUserId($data['whoid']);
         } else {
             $name = $UH->getDisplayNameFromUserName($data['who']);
         }
         $html .= $hp->purify($name, CODENDI_PURIFIER_CONVERT_HTML) . ' on ';
         //In the db, svn dates are stored as int whereas cvs dates are stored as timestamp
         $html .= format_date($GLOBALS['Language']->getText('system', 'datefmt'), is_numeric($data['date']) ? $data['date'] : strtotime($data['date']));
         $html .= '</div>';
         $html .= '<div style="padding-left:20px; padding-bottom:4px; color:#555">';
         $html .= util_make_links(substr($data['description'], 0, 255), $this->group_id);
         if (strlen($data['description']) > 255) {
             $html .= '&nbsp;[...]';
         }
         $html .= '</div>';
         $html .= '</div>';
     }
     $html .= '<div style="text-align:center" class="' . util_get_alt_row_color($i++) . '">';
     $html .= '<a href="' . $this->_getLinkToMore() . '">[ More ]</a>';
     $html .= '</div>';
     return $html;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:33,代码来源:Widget_ProjectLatestCommits.class.php

示例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 "&nbsp; &nbsp; ";
    }
    html_image('ic/cfolder15.png', array());
    print '&nbsp; ' . $purifier->purify($text) . " ";
    if ($nodeid != 0) {
        print '&nbsp; <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> ';
    }
    if ($delete_ok) {
        print '&nbsp; <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> ';
    }
    if ($nodeid != 0) {
        print '&nbsp;' . 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);
    }
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:26,代码来源:trove_cat_list.php

示例8: Docman_ReportHtml

 /**
  *
  */
 function Docman_ReportHtml($report, $view, $defaultUrl)
 {
     $this->report = $report;
     $this->view = $view;
     $this->defaultUrl = $defaultUrl;
     $this->hp = Codendi_HTMLPurifier::instance();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:Docman_ReportHtml.class.php

示例9: _displayItem

 function _displayItem($item, $params)
 {
     $hp = Codendi_HTMLPurifier::instance();
     if (!$params['exclude'] || $params['exclude'] != $item->getId()) {
         echo '<option value="' . ($item->getRank() + 1) . '" ' . ($params['force_ordering'] === "" . ($item->getRank() + 1) ? 'selected="selected"' : '') . '>After ' . $hp->purify($item->getTitle(), CODENDI_PURIFIER_CONVERT_HTML) . '</option>';
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Docman_View_PositionWithinFolder.class.php

示例10: 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())));
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Milestone.class.php

示例11: 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>';
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:SubmitAbstractRenderer.class.php

示例12: _getReportTableContent

 /**
  *
  */
 function _getReportTableContent($reportIter, $isAdmin, &$altRowClass)
 {
     $hp = Codendi_HTMLPurifier::instance();
     $html = '';
     $reportIter->rewind();
     while ($reportIter->valid()) {
         $r = $reportIter->current();
         $trclass = html_get_alt_row_color($altRowClass++);
         $html .= '<tr class="' . $trclass . '">';
         // Name
         $rUrl = $this->defaultUrl . '&action=report_settings&report_id=' . $r->getId();
         $rName = '<a href="' . $rUrl . '">' . $hp->purify($r->getName(), CODENDI_PURIFIER_CONVERT_HTML) . '</a>';
         $html .= '<td align="left">' . $rName . '</td>';
         // Scope
         $scopeName = $GLOBALS['Language']->getText('plugin_docman', 'report_scope_' . $r->getScope());
         $html .= '<td align="center">' . $scopeName . '</td>';
         // Delete
         $trashLink = $this->defaultUrl . '&action=report_del&report_id=' . $r->getId();
         $trashWarn = $GLOBALS['Language']->getText('plugin_docman', 'report_settings_delete', $hp->purify(addslashes($r->getName()), CODENDI_PURIFIER_CONVERT_HTML));
         $trashAlt = $GLOBALS['Language']->getText('plugin_docman', 'report_settings_delete_alt', $hp->purify($r->getName(), CODENDI_PURIFIER_CONVERT_HTML));
         $delUrl = $this->defaultUrl . '&action=report_del&report_id=' . $r->getId();
         $delName = html_trash_link($trashLink, $trashWarn, $trashAlt);
         $html .= '<td align="center">' . $delName . '</td>';
         $html .= "</tr>\n";
         $reportIter->next();
     }
     return $html;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:31,代码来源:Docman_View_ReportSettings.class.php

示例13: __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']);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:SearchProjectResultPresenter.php

示例14: getContent

 public function getContent()
 {
     $request =& HTTPRequest::instance();
     $group_id = $request->get('group_id');
     $pm = ProjectManager::instance();
     $project = $pm->getProject($group_id);
     $res_admin = db_query("SELECT user.user_id AS user_id,user.user_name AS user_name, user.realname as realname " . "FROM user,user_group " . "WHERE user_group.user_id=user.user_id AND user_group.group_id=" . db_ei($group_id) . " AND " . "user_group.admin_flags = 'A'");
     if (db_numrows($res_admin) > 0) {
         $user_helper = UserHelper::instance();
         $hp = Codendi_HTMLPurifier::instance();
         $em = EventManager::instance();
         echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_admins') . ':</span><br />';
         while ($row_admin = db_fetch_array($res_admin)) {
             $display_name = '';
             $em->processEvent('get_user_display_name', array('user_id' => $row_admin['user_id'], 'user_name' => $row_admin['user_name'], 'realname' => $row_admin['realname'], 'user_display_name' => &$display_name));
             if (!$display_name) {
                 $display_name = $hp->purify($user_helper->getDisplayNameFromUserId($row_admin['user_id']));
             }
             echo '<a href="/users/' . $row_admin['user_name'] . '/">' . $display_name . '</a><br />';
         }
     }
     echo '<span class="develtitle">' . $GLOBALS['Language']->getText('include_project_home', 'proj_members') . ':</span><br />';
     // count of developers on this project
     $res_count = db_query("SELECT user_id FROM user_group WHERE group_id=" . db_ei($group_id));
     echo db_numrows($res_count);
     echo ' <a href="/project/memberlist.php?group_id=' . $group_id . '">[' . $GLOBALS['Language']->getText('include_project_home', 'view_members') . ']</a>';
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:27,代码来源:Widget_ProjectMembers.class.php

示例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;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:33,代码来源:Transition_PostAction_Field_Int.class.php


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