本文整理汇总了PHP中html::escapeHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP html::escapeHTML方法的具体用法?PHP html::escapeHTML怎么用?PHP html::escapeHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::escapeHTML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getURL
public final function getURL($escape = false)
{
if ($escape) {
return html::escapeHTML($this->url);
}
return $this->url;
}
示例2: prepend
protected function prepend()
{
global $oktAutoloadPaths;
# chargement des principales locales
l10n::set(__DIR__ . '/locales/' . $this->okt->user->language . '/main');
# autoload
$oktAutoloadPaths['diaryController'] = __DIR__ . '/inc/class.diary.controller.php';
$oktAutoloadPaths['diaryRecordset'] = __DIR__ . '/inc/class.diary.recordset.php';
$oktAutoloadPaths['diaryMonthlyCalendar'] = __DIR__ . '/inc/class.diary.monthly.calendar.php';
$oktAutoloadPaths['diaryFilters'] = __DIR__ . '/inc/class.diary.filters.php';
# permissions
$this->okt->addPermGroup('diary', __('m_diary_perm_group'));
$this->okt->addPerm('diary', __('m_diary_perm_global'), 'diary');
$this->okt->addPerm('diary_add', __('m_diary_perm_add'), 'diary');
$this->okt->addPerm('diary_remove', __('m_diary_perm_remove'), 'diary');
$this->okt->addPerm('diary_display', __('m_diary_perm_display'), 'diary');
$this->okt->addPerm('diary_config', __('m_diary_perm_config'), 'diary');
# tables
$this->table = $this->db->prefix . 'mod_diary';
# configuration
$this->config = $this->okt->newConfig('conf_diary');
$this->config->url = $this->okt->page->getBaseUrl() . $this->config->public_list_url[$this->okt->user->language];
# définition des routes
$this->okt->router->addRoute('diaryList', new oktRoute('^(?:' . html::escapeHTML(implode('|', $this->config->public_list_url)) . ')/?(.*)?$', 'diaryController', 'diaryList'));
$this->okt->router->addRoute('diaryEvent', new oktRoute('^(?:' . html::escapeHTML(implode('|', $this->config->public_event_url)) . ')/(.*)$', 'diaryController', 'diaryEvent'));
# répertoire upload
$this->upload_dir = OKT_UPLOAD_PATH . '/diary/';
$this->upload_url = OKT_UPLOAD_URL . '/diary/';
}
示例3: init
protected function init()
{
$this->name = __('Database export');
$this->task = __('Download database of current blog');
$this->export_name = html::escapeHTML($this->core->blog->id . '-backup.txt');
$this->export_type = 'export_blog';
}
示例4: gui
public function gui()
{
if ($this->status) {
dcPage::success(__('Content successfully imported.'));
}
echo '<form action="' . $this->getURL(true) . '" method="post">' . '<p>' . sprintf(__('Add a feed content to the current blog: <strong>%s</strong>.'), html::escapeHTML($this->core->blog->name)) . '</p>' . '<p><label for="feed_url">' . __('Feed URL:') . '</label>' . form::field('feed_url', 50, 300, html::escapeHTML($this->feed_url)) . '</p>' . '<p>' . $this->core->formNonce() . form::hidden(array('do'), 1) . '<input type="submit" value="' . __('Import') . '" /></p>' . '</form>';
}
示例5: publicTplFormBottom
/**
* Affichage du captcha côté public
*
* @param object $okt
* @param string $sCaptchaId
*/
public static function publicTplFormBottom($okt, $sCaptchaId)
{
if ($sCaptchaId == 'recaptcha') {
$aAcceptedLanguages = array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr');
if (in_array($okt->user->language, $aAcceptedLanguages)) {
$sLanguage = $okt->user->language;
} elseif (in_array($okt->config->language, $aAcceptedLanguages)) {
$sLanguage = $okt->config->language;
} else {
$sLanguage = 'en';
}
echo '<script type="text/javascript">
//<![CDATA[
var RecaptchaOptions = {
theme: "' . $okt->recaptcha->config->theme . '",
lang: "' . $sLanguage . '"
};
//]]>
</script>';
require_once __DIR__ . '/recaptcha-php-1.11/recaptchalib.php';
echo recaptcha_get_html(html::escapeHTML($okt->recaptcha->config->publickey));
}
}
示例6: postLine
private function postLine()
{
$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
switch ($this->rs->post_status) {
case 1:
$img_status = sprintf($img, __('published'), 'check-on.png');
break;
case 0:
$img_status = sprintf($img, __('unpublished'), 'check-off.png');
break;
case -1:
$img_status = sprintf($img, __('scheduled'), 'scheduled.png');
break;
case -2:
$img_status = sprintf($img, __('pending'), 'check-wrn.png');
break;
}
$protected = '';
if ($this->rs->post_password) {
$protected = sprintf($img, __('protected'), 'locker.png');
}
$selected = '';
if ($this->rs->post_selected) {
$selected = sprintf($img, __('selected'), 'selected.png');
}
$attach = '';
$nb_media = $this->rs->countMedia();
if ($nb_media > 0) {
$attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments');
$attach = sprintf($img, sprintf($attach_str, $nb_media), 'attach.png');
}
$res = '<tr class="line' . ($this->rs->post_status != 1 ? ' offline' : '') . '"' . ' id="p' . $this->rs->post_id . '">';
$res .= '<td class="nowrap">' . form::checkbox(array('entries[]'), $this->rs->post_id, '', '', '', !$this->rs->isEditable()) . '</td>' . '<td class="maximal"><a href="' . $this->core->getPostAdminURL($this->rs->post_type, $this->rs->post_id) . '">' . html::escapeHTML($this->rs->post_title) . '</a></td>' . '<td class="nowrap">' . dt::dt2str(__('%Y-%m-%d %H:%M'), $this->rs->post_dt) . '</td>' . '<td class="nowrap">' . $this->rs->user_id . '</td>' . '<td class="nowrap">' . $this->rs->nb_comment . '</td>' . '<td class="nowrap">' . $this->rs->nb_trackback . '</td>' . '<td class="nowrap status">' . $img_status . ' ' . $selected . ' ' . $protected . ' ' . $attach . '</td>' . '</tr>';
return $res;
}
示例7: gui
public function gui()
{
if ($this->status) {
echo '<p class="message">' . __('Content successfully imported.') . '</p>';
}
echo '<h3>' . __('Import from a feed') . '</h3>' . '<p>' . sprintf(__('This will import a feed (RSS or Atom) a as new content in the current blog: %s.'), '<strong>' . html::escapeHTML($this->core->blog->name) . '</strong>') . '</p>' . '<form action="' . $this->getURL(true) . '" method="post">' . '<fieldset>' . $this->core->formNonce() . form::hidden(array('do'), 1) . '<p><label>' . __('Feed URL:') . ' ' . form::field('feed_url', 40, 300, html::escapeHTML($this->feed_url)) . '</label></p>' . '<p><input type="submit" value="' . __('Send') . '" /></p>' . '</fieldset>' . '</form>';
}
示例8: setFrom
public function setFrom()
{
if (!empty($this->okt->config->email['name'])) {
$this->message->setFrom(array($this->okt->config->email['from'] => html::escapeHTML($this->okt->config->email['name'])));
} else {
$this->message->setFrom($this->okt->config->email['from']);
}
}
示例9: text
public static function text(&$w)
{
global $core;
if ($w->homeonly && $core->url->type != 'default') {
return;
}
$res = '<div class="wikitext ' . $w->class . '">' . ($w->title ? '<h1>' . html::escapeHTML($w->title) . '</h1>' : '') . $core->wikiTransform($w->content) . '</div>';
return $res;
}
示例10: getHTML
/**
* Construit le HTML à partir de la pile d'éléments.
*
* @return string
*/
public function getHTML()
{
if (!$this->hasItem()) {
return null;
}
if (count($this->stack) > 1) {
return '<ul><li>' . implode('</li><li>', array_map(array('html', 'escapeHTML'), $this->stack)) . '</li></ul>';
}
return '<p>' . html::escapeHTML($this->stack[0]) . '</p>';
}
示例11: listImportExportModules
function listImportExportModules($core, $modules)
{
$res = '';
foreach ($modules as $id) {
$o = new $id($core);
$res .= '<dt><a href="' . $o->getURL(true) . '">' . html::escapeHTML($o->name) . '</a></dt>' . '<dd>' . html::escapeHTML($o->description) . '</dd>';
unset($o);
}
return '<dl class="modules">' . $res . '</dl>';
}
示例12: settingLine
function settingLine($id, $s, $ns, $field_name, $strong_label)
{
if ($s['type'] == 'boolean') {
$field = form::combo(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $id), array(__('yes') => 1, __('no') => 0), $s['value']);
} else {
$field = form::field(array($field_name . '[' . $ns . '][' . $id . ']', $field_name . '_' . $id), 40, null, html::escapeHTML($s['value']));
}
$slabel = $strong_label ? '<strong>%s</strong>' : '%s';
return '<tr>' . '<td><label for="s_' . $id . '">' . sprintf($slabel, html::escapeHTML($id)) . '</label></td>' . '<td>' . $field . '</td>' . '<td>' . $s['type'] . '</td>' . '<td>' . html::escapeHTML($s['label']) . '</td>' . '</tr>';
}
示例13: box
/**
Returns an hierarchical categories combo from a category record
@param categories <b>record</b> the category record
@return <b>array</b> the combo box (form::combo -compatible format)
*/
public static function getCategoriesCombo($categories, $include_empty = true, $use_url = false)
{
$categories_combo = array();
if ($include_empty) {
$categories_combo = array(new formSelectOption(__('(No cat)'), ''));
}
while ($categories->fetch()) {
$categories_combo[] = new formSelectOption(html::escapeHTML($categories->cat_title) . ' (' . $categories->nb_post . ')', $use_url ? $categories->cat_url : $categories->cat_id, $categories->level - 1 ? 'sub-option' . ($categories->level - 1) : '');
}
return $categories_combo;
}
示例14: getContent
public static function getContent(&$rs, $absolute_urls = false)
{
# Not very nice hack but it does the job :)
if (isset($GLOBALS['_ctx']) && $GLOBALS['_ctx']->short_feed_items === true) {
$_ctx =& $GLOBALS['_ctx'];
$c = parent::getContent($rs, $absolute_urls);
$c = context::remove_html($c);
$c = context::cut_string($c, 350);
$c = '<p>' . $c . '... ' . '<em><a href="' . $rs->getURL() . '">' . __('Read') . '</em> ' . html::escapeHTML($rs->post_title) . '</a></p>';
return $c;
}
if ($rs->core->blog->settings->use_smilies) {
return self::smilies(parent::getContent($rs, $absolute_urls), $rs->core->blog);
}
return parent::getContent($rs, $absolute_urls);
}
示例15: getDayContent
/**
* Retourne le HTML additionnel d'un jour dans le calendrier.
*
* @return string
*/
protected function getDayContent()
{
# si on as pas d'évènement pour cette date, on passe à la suivante
if (!isset($this->aDatesEvents[$this->iDate])) {
return null;
}
# si on est pas sur un vrai jour on passe à la suivante
if (!$this->bRealDay) {
return null;
}
$aEvents = array();
foreach ($this->aDatesEvents[$this->iDate] as $aEvent) {
$aEvents[] = sprintf($this->aConfig['htmlEventItem'], html::escapeHTML($aEvent['title']), $aEvent['url'], 'disponibility_' . $aEvent['disponibility'], !empty($aEvent['color']) ? ' style="background-color: #' . $aEvent['color'] . ' "' : '');
}
return sprintf($this->aConfig['htmlEventsList'], implode('', $aEvents));
}