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; }
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; }
/** * @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; }
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()))); }
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>'; } }
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); }
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>'; }
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); } }
public function __construct($controller) { $this->controller = $controller; $this->request = $controller->getRequest(); $this->HTMLPurifier = Codendi_HTMLPurifier::instance(); $this->user = $controller->getUser(); }
public function __construct(ProjectUGroup $ugroup) { parent::__construct($ugroup); $this->permissions_manager = PermissionsManager::instance(); $this->event_manager = EventManager::instance(); $this->html_purifier = Codendi_HTMLPurifier::instance(); }
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']); }
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'); }
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; }
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'); }
/** * */ function Docman_ReportHtml($report, $view, $defaultUrl) { $this->report = $report; $this->view = $view; $this->defaultUrl = $defaultUrl; $this->hp = Codendi_HTMLPurifier::instance(); }
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; }
/** * 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; }
/** * */ 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; }
function getTable($params) { $this->defaultUrl = $params['default_url']; $content = ''; $content .= html_build_list_table_top(array($GLOBALS['Language']->getText('plugin_docman', 'view_documenttable_title'), $GLOBALS['Language']->getText('plugin_docman', 'view_documenttable_location'), $GLOBALS['Language']->getText('plugin_docman', 'admin_lock_infos_who'), $GLOBALS['Language']->getText('plugin_docman', 'admin_lock_infos_when'))); // Get list of all locked documents in the project. $dPM = Docman_PermissionsManager::instance($params['group_id']); $lockInfos = $dPM->getLockFactory()->getProjectLockInfos($params['group_id']); $uH = UserHelper::instance(); $hp = Codendi_HTMLPurifier::instance(); require_once dirname(__FILE__) . '/../Docman_ItemFactory.class.php'; $dIF = new Docman_ItemFactory($params['group_id']); $altRowClass = 0; foreach ($lockInfos as $row) { $trclass = html_get_alt_row_color($altRowClass++); $item = $dIF->getItemFromDb($row['item_id']); $parent = $dIF->getItemFromDb($item->getParentId()); $content .= '<tr class="' . $trclass . '">'; $content .= '<td>' . '<a href="/plugins/docman/?group_id=' . $params['group_id'] . '&action=details&id=' . $item->getId() . '">' . $item->getTitle() . '</a></td>'; $content .= '<td>'; if ($dIF->isRoot($parent)) { $content .= '</td>'; } else { $content .= '<a href="' . $this->defaultUrl . '&action=show&id=' . $parent->getId() . '">' . $parent->getTitle() . '</a></td>'; } $content .= '<td>' . $hp->purify($uH->getDisplayNameFromUserId($row['user_id'])) . '</td>'; $content .= '<td>' . format_date($GLOBALS['Language']->getText('system', 'datefmt'), $row['lock_date']) . '</td>'; $content .= '</tr>'; } $content .= '</table>'; return $content; }
function Widget_MySurveys() { $this->Widget('mysurveys'); $no_survey = true; // Get id and title of the survey that will be promoted to user page. default = survey whose id=1 if ($GLOBALS['sys_my_page_survey']) { $developer_survey_id = $GLOBALS['sys_my_page_survey']; } else { $developer_survey_id = "1"; } $survey = SurveySingleton::instance(); $sql = "SELECT * from surveys WHERE survey_id=" . db_ei($developer_survey_id); $result = db_query($sql); $group_id = db_result($result, 0, 'group_id'); $purifier = Codendi_HTMLPurifier::instance(); $survey_title = $purifier->purify($survey->getSurveyTitle(db_result($result, 0, 'survey_title'))); // Check that the survey is active $devsurvey_is_active = db_result($result, 0, 'is_active'); if ($devsurvey_is_active == 1) { $sql = "SELECT * FROM survey_responses " . "WHERE survey_id='" . db_ei($developer_survey_id) . "' AND user_id='" . db_ei(user_getid()) . "'"; $result = db_query($sql); if (db_numrows($result) < 1) { $no_survey = false; $this->content .= '<a href="/survey/survey.php?group_id=' . $group_id . '&survey_id=' . $developer_survey_id . '">' . $survey_title . '</a>'; } } if ($no_survey) { $this->content .= $GLOBALS['Language']->getText('my_index', 'no_survey'); } }
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 .= ' [...]'; } $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; }
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>'; }
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>'; } }
public function __construct($id, $user_name = null, $display_name = null) { parent::__construct($id, false); $this->user_name = $user_name; $this->display_name = $display_name; $this->hp = Codendi_HTMLPurifier::instance(); }
function listMessages() { $dao = new MaillogDao(CodendiDataAccess::instance()); $dar = $dao->getAllMessages(); $nb = $dao->getNbMessages(); echo "<h1>List of emails sent by " . $GLOBALS['sys_name'] . "</h1>\n"; echo "<div style=\"text-align: center;\">Nb messages: " . $nb . "</div>\n"; echo "<form name=\"maillog\" method=\"post\" action=\"?\">\n"; echo "<p>\n"; echo "<input type=\"submit\" name=\"delete\" value=\"Delete\" />\n"; echo "</p>\n"; $hp =& Codendi_HTMLPurifier::instance(); while ($dar->valid()) { $row = $dar->current(); $dar2 = $dao->getAllHeaders($row['id_message']); echo "<div style=\"background-color: lightgrey;\">\n"; while ($dar2->valid()) { $row2 = $dar2->current(); echo "<strong>" . $hp->purify($row2['name']) . ":</strong> " . $hp->purify($row2['value']) . "<br>\n"; $dar2->next(); } echo "</div>\n"; echo '<div style="width: 80em; font-family: monospace; margin-bottom: 0.5em;">' . "\n"; echo $hp->purify($row['body'], CODENDI_PURIFIER_BASIC); echo "</div>\n"; $dar->next(); } echo "</form>"; }
private function displayTransitionDetails(TrackerManager $engine, Codendi_Request $request, PFUser $current_user, Transition $transition) { $hp = Codendi_HTMLPurifier::instance(); $this->displayHeader($engine); if ($transition->getFieldValueFrom()) { $from_label = $transition->getFieldValueFrom()->getLabel(); } else { $from_label = $GLOBALS['Language']->getText('workflow_admin', 'new_artifact'); } $to_label = $transition->getFieldValueTo()->getLabel(); echo '<h3>'; echo $GLOBALS['Language']->getText('workflow_admin', 'title_define_transition_details', array($hp->purify($from_label), $hp->purify($to_label))); echo '</h3>'; $form_action = TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => Workflow::FUNC_ADMIN_TRANSITIONS, 'transition' => $transition->getId())); echo '<form action="' . $form_action . '" method="POST">'; echo '<table><tr><td>'; $section_conditions = new Widget_Static($GLOBALS['Language']->getText('workflow_admin', 'under_the_following_condition')); $section_conditions->setContent($transition->fetchConditions()); $section_conditions->display(); $actions = ''; $actions .= $transition->fetchPostActions(); $actions .= $this->post_action_factory->fetchPostActions(); $section_postactions = new Widget_Static($GLOBALS['Language']->getText('workflow_admin', 'following_action_performed')); $section_postactions->setContent($actions); $section_postactions->display(); $back_to_transitions_link = TRACKER_BASE_URL . '/?' . http_build_query(array('tracker' => (int) $this->tracker->id, 'func' => Workflow::FUNC_ADMIN_TRANSITIONS)); echo '<p>'; echo '<a href="' . $back_to_transitions_link . '">←' . $GLOBALS['Language']->getText('plugin_tracker_admin', 'clean_cancel') . '</a>'; echo ' '; echo '<input type="submit" name="workflow_details" value="' . $GLOBALS['Language']->getText('global', 'btn_submit') . '" />'; echo '</p>'; echo '</td></tr></table>'; echo '</form>'; $this->displayFooter($engine); }
/** @return string[] */ private function formatAllMilestonesAsSelectboxOptions(array $planning_trackers_ids, $selected_milestone_id, Tracker $backlog_tracker, PFUser $user) { $hp = Codendi_HTMLPurifier::instance(); $options = array(); $current_milestone = array(); $options[] = $this->addTopBacklogPlanningEntry($selected_milestone_id, $backlog_tracker, $user); foreach ($planning_trackers_ids as $id) { $current_milestone[$id] = null; } foreach ($this->dao->getAllMilestoneByTrackers($planning_trackers_ids) as $row) { foreach ($planning_trackers_ids as $index => $id) { $milestone_id = $row['m' . $id . '_id']; $milestone_title = $row['m' . $id . '_title']; if (!$milestone_id) { continue; } if ($current_milestone[$id] === $milestone_id) { continue; } $content = str_pad('', $index, '-') . ' ' . $hp->purify($milestone_title); $options[] = $this->getOptionForSelectBox($selected_milestone_id, $milestone_id, $content); $current_milestone[$id] = $milestone_id; } } return $options; }
/** * Singleton access. * * @return Codendi_HTMLPurifier */ public static function instance() { if (!isset(self::$Codendi_HTMLPurifier_instance)) { $c = __CLASS__; self::$Codendi_HTMLPurifier_instance = new $c(); } return self::$Codendi_HTMLPurifier_instance; }
function Docman_View_ItemDetailsSection(&$item, $url, $id, $title) { $this->id = $id; $this->title = $title; $this->item =& $item; $this->url = $url; $this->hp =& Codendi_HTMLPurifier::instance(); }
protected function renderValue() { $hp = Codendi_HTMLPurifier::instance(); $html = '<textarea id="' . $this->id . '" cols="40" rows="5" name="' . $hp->purify($this->name, CODENDI_PURIFIER_CONVERT_HTML) . '">'; $html .= $hp->purify($this->value, CODENDI_PURIFIER_CONVERT_HTML); $html .= '</textarea>'; return $html; }