本文整理汇总了PHP中String::stripUnsafeHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP String::stripUnsafeHtml方法的具体用法?PHP String::stripUnsafeHtml怎么用?PHP String::stripUnsafeHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String::stripUnsafeHtml方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element = $row->getData();
$columnId = $column->getId();
assert(is_a($element, 'DataObject') && !empty($columnId));
// there is only one column in the Footer grid.
switch ($columnId) {
case 'title':
return array('label' => '<a href="' . String::stripUnsafeHtml($element->getLocalizedUrl()) . '" target="_blank">' . $element->getLocalizedTitle() . '</a>');
}
}
示例2: getTemplateVarsFromRowColumn
/**
* Extracts variables for a given column from a data element
* so that they may be assigned to template before rendering.
* @param $row GridRow
* @param $column GridColumn
* @return array
*/
function getTemplateVarsFromRowColumn($row, $column)
{
$element =& $row->getData();
$columnId = $column->getId();
assert(!empty($columnId));
switch ($columnId) {
case 'url':
return array('label' => '<a href="' . String::stripUnsafeHtml($element['url']) . '" target="_blank">' . String::stripUnsafeHtml($element['url']) . '</a>');
case 'shares':
return array('label' => $element['shares']);
}
}
示例3: array
<?php
$this->_tag_stack[] = array('iterate', array('from' => 'issues', 'item' => 'issue'));
$_block_repeat = true;
$this->_plugins['block']['iterate'][0][0]->smartyIterate($this->_tag_stack[count($this->_tag_stack) - 1][1], null, $this, $_block_repeat);
while ($_block_repeat) {
ob_start();
?>
<tr valign="top" class="data" id="issue-<?php
echo $this->_tpl_vars['issue']->getId();
?>
">
<td class="drag"><a href="<?php
echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'issueToc', 'path' => $this->_tpl_vars['issue']->getId()), $this);
?>
" class="action"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getIssueIdentification()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</a></td>
<td class="drag"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getDatePublished()) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['dateFormatShort']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['dateFormatShort'])) ? $this->_run_mod_handler('default', true, $_tmp, "—") : smarty_modifier_default($_tmp, "—");
?>
</td>
<td class="drag"><?php
echo is_array($_tmp = $this->_tpl_vars['issue']->getNumArticles()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
</td>
<td><a href="<?php
echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'moveIssue', 'd' => 'u', 'id' => $this->_tpl_vars['issue']->getId(), 'issuesPage' => $this->_tpl_vars['page']), $this);
?>
">↑</a> <a href="<?php
echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'moveIssue', 'd' => 'd', 'id' => $this->_tpl_vars['issue']->getId(), 'issuesPage' => $this->_tpl_vars['page']), $this);
示例4: is_array
$this->assign('issue', $this->_tpl_vars['articleData']['issue']);
?>
<tr valign="top">
<td><input type="checkbox" name="articleId[]" value="<?php
echo $this->_tpl_vars['article']->getId();
?>
"/></td>
<td><a href="<?php
echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('page' => 'issue', 'op' => 'view', 'path' => $this->_tpl_vars['issue']->getId()), $this);
?>
" class="action"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getIssueIdentification()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</a></td>
<td><?php
echo is_array($_tmp = $this->_tpl_vars['article']->getLocalizedTitle()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
?>
</td>
<td><?php
echo is_array($_tmp = $this->_tpl_vars['article']->getAuthorString()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
</td>
<td align="right"><a href="<?php
echo $this->_plugins['function']['plugin_url'][0][0]->smartyPluginUrl(array('path' => is_array($_tmp = 'exportArticle') ? $this->_run_mod_handler('to_array', true, $_tmp, $this->_tpl_vars['article']->getId()) : $this->_plugins['modifier']['to_array'][0][0]->smartyToArray($_tmp, $this->_tpl_vars['article']->getId())), $this);
?>
" class="action"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.export"), $this);
?>
</a></td>
</tr>
<tr>
示例5: setupTemplate
/**
* Set up the comment template.
* @param $request PKPRequest
* @param $article Article
* @param $galleyId int
* @param $comment Comment
*/
function setupTemplate(&$request, $article, $galleyId, $comment = null)
{
parent::setupTemplate();
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_READER);
$templateMgr =& TemplateManager::getManager();
$journal =& $request->getJournal();
if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
$templateMgr->setCacheability(CACHEABILITY_PUBLIC);
}
$pageHierarchy = array(array($request->url(null, 'article', 'view', array($article->getBestArticleId($request->getJournal()), $galleyId)), String::stripUnsafeHtml($article->getLocalizedTitle()), true));
if ($comment) {
$pageHierarchy[] = array($request->url(null, 'comment', 'view', array($article->getId(), $galleyId)), 'comments.readerComments');
}
$templateMgr->assign('pageHierarchy', $pageHierarchy);
}
示例6: setupTemplate
function setupTemplate($paper, $galleyId, $comment = null)
{
parent::setupTemplate();
$templateMgr =& TemplateManager::getManager();
$templateMgr->setCacheability(CACHEABILITY_PUBLIC);
Locale::requireComponents(array(LOCALE_COMPONENT_PKP_READER));
$pageHierarchy = array(array(Request::url(null, null, 'paper', 'view', array($paper->getBestPaperId(Request::getConference()), $galleyId)), String::stripUnsafeHtml($paper->getLocalizedTitle()), true));
if ($comment) {
$pageHierarchy[] = array(Request::url(null, null, 'comment', 'view', array($paper->getId(), $galleyId)), 'comments.readerComments');
}
$templateMgr->assign('pageHierarchy', $pageHierarchy);
}
示例7: is_array
?>
<?php
if ($this->_tpl_vars['currentJournal']->getSetting('metaCitations')) {
?>
<div id="citations">
<h4><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
?>
</h4>
<table width="100%" class="data">
<tr valign="top">
<td width="20%" class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
?>
</td>
<td width="80%" class="value"><?php
echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['submission']->getCitations()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "—") : smarty_modifier_default($_tmp, "—");
?>
</td>
</tr>
</table>
</div>
<?php
}
?>
</div><!-- metadata -->
示例8: _formatEmail
/**
* Format the contents of the email
* @param $emailLogEntry EmailLogEntry
* @return string Formatted email
*/
function _formatEmail($emailLogEntry)
{
assert(is_a($emailLogEntry, 'EmailLogEntry'));
$text = array();
$text[] = __('email.from') . ': ' . htmlspecialchars($emailLogEntry->getFrom());
$text[] = __('email.to') . ': ' . htmlspecialchars($emailLogEntry->getRecipients());
$text[] = __('email.subject') . ': ' . htmlspecialchars($emailLogEntry->getSubject());
$text[] = $emailLogEntry->getBody();
return nl2br(String::stripUnsafeHtml(implode(PHP_EOL . PHP_EOL, $text)));
}
示例9: is_array
echo is_array($_tmp = $this->_tpl_vars['referral']->getDateAdded()) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['dateFormatShort']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['dateFormatShort']);
?>
</td>
<td><?php
echo is_array($_tmp = $this->_tpl_vars['referral']->getLinkCount()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
</td>
<td><a href="<?php
echo is_array($_tmp = $this->_tpl_vars['referral']->getUrl()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['referral']->getUrl()) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : $this->_plugins['modifier']['truncate'][0][0]->smartyTruncate($_tmp, 50)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
</a></td>
<td><?php
echo is_array($_tmp = $this->_tpl_vars['articleTitles'][$this->_tpl_vars['articleId']]) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
?>
</td>
<td><?php
echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['referral']->getReferralName()) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : $this->_plugins['modifier']['truncate'][0][0]->smartyTruncate($_tmp, 50)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "—") : smarty_modifier_default($_tmp, "—");
?>
</td>
<td><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => $this->_tpl_vars['referral']->getStatusKey()), $this);
?>
</td>
<td align="right">
<a class="action" href="<?php
echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('page' => 'referral', 'op' => 'editReferral', 'path' => $this->_tpl_vars['referral']->getId()), $this);
?>
"><?php
示例10: setupTemplate
function setupTemplate($article, $galleyId, $comment = null)
{
$templateMgr =& TemplateManager::getManager();
$journal =& Request::getJournal();
if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
$templateMgr->setCacheability(CACHEABILITY_PUBLIC);
}
$pageHierarchy = array(array(Request::url(null, 'article', 'view', array($article->getBestArticleId(Request::getJournal()), $galleyId)), String::stripUnsafeHtml($article->getArticleTitle()), true));
if ($comment) {
$pageHierarchy[] = array(Request::url(null, 'comment', 'view', array($article->getArticleId(), $galleyId)), 'comments.readerComments');
}
$templateMgr->assign('pageHierarchy', $pageHierarchy);
}
示例11: is_array
<?php
if ($this->_tpl_vars['error']) {
?>
<span class="pkp_form_error"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => $this->_tpl_vars['error'], 'reason' => $this->_tpl_vars['reason']), $this);
?>
</span>
<br />
<br />
<?php
}
?>
<input type="hidden" name="source" value="<?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['source']) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
" />
<?php
if (!$this->_tpl_vars['implicitAuth']) {
?>
<table id="signinTable" class="data">
<tr>
<td class="label"><label for="loginUsername"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.username"), $this);
?>
</label></td>
<td class="value"><input type="text" id="loginUsername" name="username" value="<?php
echo is_array($_tmp = $this->_tpl_vars['username']) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
示例12: is_array
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.mailingAddress"), $this);
?>
:</td>
<td class="value"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getMailingAddress()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<tr valign="top">
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.biography"), $this);
?>
:</td>
<td class="value"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getLocalizedBiography()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<tr valign="top">
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.workingLanguages"), $this);
?>
:</td>
<td class="value"><?php
$_from = $this->_tpl_vars['user']->getLocales();
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$this->_foreach['workingLanguages'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['workingLanguages']['total'] > 0) {
示例13: is_array
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.country"), $this);
?>
</td>
<td class="value"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['country']) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "—") : smarty_modifier_default($_tmp, "—");
?>
</td>
</tr>
<tr valign="top">
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.biography"), $this);
?>
</td>
<td class="value"><?php
echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getUserBiography()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "—") : smarty_modifier_default($_tmp, "—");
?>
</td>
</tr>
<tr valign="top">
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.workingLanguages"), $this);
?>
</td>
<td class="value"><?php
$_from = $this->_tpl_vars['user']->getLocales();
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$this->_foreach['workingLanguages'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['workingLanguages']['total'] > 0) {
示例14: submissionOutputFilter
/**
* Output filter adds data citation to submission summary.
* @param $output string
* @param $templateMgr TemplateManager
* @return $string
*/
function submissionOutputFilter($output, &$templateMgr)
{
$submission =& $templateMgr->get_template_vars('submission');
if (!isset($submission)) {
return $output;
}
$dataverseStudyDao =& DAORegistry::getDAO('DataverseStudyDAO');
$study =& $dataverseStudyDao->getStudyBySubmissionId($submission->getId());
$dataCitation = '';
if (isset($study)) {
$dataCitation = $this->_formatDataCitation($study->getDataCitation(), $study->getPersistentUri());
} else {
// There may be an external data citation
$dataCitation = $submission->getLocalizedData('externalDataCitation');
}
if (!$dataCitation) {
return $output;
}
$index = strpos($output, '<td class="label">' . __('submission.submitter'));
if ($index !== false) {
$newOutput = substr($output, 0, $index);
$newOutput .= '<td class="label">' . __('plugins.generic.dataverse.dataCitation') . '</td>';
$newOutput .= '<td class="value" colspan="2">' . String::stripUnsafeHtml($dataCitation) . '</td></tr><tr>';
$newOutput .= substr($output, $index);
$output = $newOutput;
}
$templateMgr->unregister_outputfilter('submissionSummaryOutputFilter');
return $output;
}
示例15: unset
<?php
}
unset($_from);
?>
</td>
</tr>
<?php
if ($this->_tpl_vars['submission']->getCommentsToEditor()) {
?>
<tr valign="top">
<td width="20%" class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "article.commentsToEditor"), $this);
?>
</td>
<td width="80%" colspan="2" class="data"><?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['submission']->getCommentsToEditor()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<?php
}
?>
<?php
if ($this->_tpl_vars['publishedArticle']) {
?>
<tr>
<td class="label"><?php
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.abstractViews"), $this);
?>
</td>
<td><?php