本文整理汇总了PHP中WT_Filter::expandUrls方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_Filter::expandUrls方法的具体用法?PHP WT_Filter::expandUrls怎么用?PHP WT_Filter::expandUrls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_Filter
的用法示例。
在下文中一共展示了WT_Filter::expandUrls方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBlock
public function getBlock($block_id, $template = true, $cfg = null)
{
global $ctype;
require_once WT_ROOT . 'includes/functions/functions_print_facts.php';
// Block actions
$action = WT_Filter::get('action');
$message_id = WT_Filter::getArray('message_id');
if ($action == 'deletemessage') {
foreach ($message_id as $msg_id) {
deleteMessage($msg_id);
}
}
$block = get_block_setting($block_id, 'block', true);
if ($cfg) {
foreach (array('block') as $name) {
if (array_key_exists($name, $cfg)) {
${$name} = $cfg[$name];
}
}
}
$messages = getUserMessages(WT_USER_ID);
$id = $this->getName() . $block_id;
$class = $this->getName() . '_block';
$title = WT_I18N::plural('%s message', '%s messages', count($messages), WT_I18N::number(count($messages)));
$content = '<form name="messageform" action="index.php?ctype=' . $ctype . '" method="get" onsubmit="return confirm(\'' . WT_I18N::translate('Are you sure you want to delete this message? It cannot be retrieved later.') . '\');">';
if (count(User::all()) > 1) {
$content .= '<br>' . WT_I18N::translate('Send message') . " <select name=\"touser\">";
$content .= '<option value="">' . WT_I18N::translate('<select>') . '</option>';
foreach (User::all() as $user) {
if ($user->getUserId() != WT_USER_ID && $user->getSetting('verified_by_admin') && $user->getSetting('contactmethod') != 'none') {
$content .= '<option value="' . WT_Filter::escapeHtml($user->getUserName()) . '">';
$content .= '<span dir="auto">' . WT_Filter::escapeHtml($user->getRealName()) . '</span> - <span dir="auto">' . WT_Filter::escapeHtml($user->getUserName()) . '</span>';
$content .= '</option>';
}
}
$content .= '</select> <input type="button" value="' . WT_I18N::translate('Send') . '" onclick="message(document.messageform.touser.options[document.messageform.touser.selectedIndex].value, \'messaging2\', \'\'); return false;"><br><br>';
}
if (count($messages) == 0) {
$content .= WT_I18N::translate('You have no pending messages.') . "<br>";
} else {
$content .= '<input type="hidden" name="action" value="deletemessage">';
$content .= '<table class="list_table"><tr>';
$content .= '<td class="list_label">' . WT_I18N::translate('Delete') . '<br><a href="#" onclick="jQuery(\'#' . $this->getName() . $block_id . ' :checkbox\').prop(\'checked\', true); return false;">' . WT_I18N::translate('All') . '</a></td>';
$content .= '<td class="list_label">' . WT_I18N::translate('Subject:') . '</td>';
$content .= '<td class="list_label">' . WT_I18N::translate('Date sent:') . '</td>';
$content .= '<td class="list_label">' . WT_I18N::translate('Email address:') . '</td>';
$content .= '</tr>';
foreach ($messages as $message) {
$content .= '<tr>';
$content .= '<td class="list_value_wrap"><input type="checkbox" id="cb_message' . $message->message_id . '" name="message_id[]" value="' . $message->message_id . '"></td>';
$content .= '<td class="list_value_wrap"><a href="#" onclick="return expand_layer(\'message' . $message->message_id . '\');"><i id="message' . $message->message_id . '_img" class="icon-plus"></i> <b dir="auto">' . WT_Filter::escapeHtml($message->subject) . '</b></a></td>';
$content .= '<td class="list_value_wrap">' . format_timestamp($message->created) . '</td>';
$content .= '<td class="list_value_wrap">';
$user = User::findByIdentifier($message->sender);
if ($user) {
$content .= '<span dir="auto">' . $user->getRealName() . '</span>';
$content .= ' - <span dir="auto">' . $user->getEmail() . '</span>';
} else {
$content .= '<a href="mailto:' . WT_Filter::escapeHtml($message->sender) . '">' . WT_Filter::escapeHtml($message->sender) . '</a>';
}
$content .= '</td>';
$content .= '</tr>';
$content .= '<tr><td class="list_value_wrap" colspan="5"><div id="message' . $message->message_id . '" style="display:none;">';
$content .= '<div dir="auto" style="white-space: pre-wrap;">' . WT_Filter::expandUrls($message->body) . '</div><br>';
if (strpos($message->subject, WT_I18N::translate('RE: ')) !== 0) {
$message->subject = WT_I18N::translate('RE: ') . $message->subject;
}
if ($user) {
$content .= '<a href="#" onclick="reply(\'' . WT_Filter::escapeJs($message->sender) . '\', \'' . WT_Filter::escapeJs($message->subject) . '\'); return false;">' . WT_I18N::translate('Reply') . '</a> | ';
}
$content .= '<a href="index.php?action=deletemessage&message_id[]=' . $message->message_id . '" onclick="return confirm(\'' . WT_I18N::translate('Are you sure you want to delete this message? It cannot be retrieved later.') . '\');">' . WT_I18N::translate('Delete') . '</a></div></td></tr>';
}
$content .= '</table>';
$content .= '<input type="submit" value="' . WT_I18N::translate('Delete selected messages') . '"><br>';
}
$content .= '</form>';
if ($template) {
if ($block) {
require WT_THEME_DIR . 'templates/block_small_temp.php';
} else {
require WT_THEME_DIR . 'templates/block_main_temp.php';
}
} else {
return $content;
}
}
示例2: printSourceStructure
/**
* Print SOUR structure
*
* This function prints the input array of SOUR sub-records built by the
* getSourceStructure() function.
*/
function printSourceStructure($textSOUR)
{
global $WT_TREE;
$html = '';
if ($textSOUR['PAGE']) {
$html .= WT_Gedcom_Tag::getLabelValue('PAGE', WT_Filter::expandUrls($textSOUR['PAGE']));
}
if ($textSOUR['EVEN']) {
$html .= WT_Gedcom_Tag::getLabelValue('EVEN', WT_Filter::escapeHtml($textSOUR['EVEN']));
if ($textSOUR['ROLE']) {
$html .= WT_Gedcom_Tag::getLabelValue('ROLE', WT_Filter::escapeHtml($textSOUR['ROLE']));
}
}
if ($textSOUR['DATE'] || count($textSOUR['TEXT'])) {
if ($textSOUR['DATE']) {
$date = new WT_Date($textSOUR['DATE']);
$html .= WT_Gedcom_Tag::getLabelValue('DATA:DATE', $date->Display(false));
}
foreach ($textSOUR['TEXT'] as $text) {
$html .= WT_Gedcom_Tag::getLabelValue('TEXT', WT_Filter::formatText($text, $WT_TREE));
}
}
if ($textSOUR['QUAY'] != '') {
$html .= WT_Gedcom_Tag::getLabelValue('QUAY', WT_Gedcom_Code_Quay::getValue($textSOUR['QUAY']));
}
return '<div class="indent">' . $html . '</div>';
}
示例3: formatText
public static function formatText($text, WT_Tree $WT_TREE)
{
switch ($WT_TREE->preference('FORMAT_TEXT')) {
case 'markdown':
return '<div class="markdown" dir="auto">' . WT_Filter::markdown($text) . '</div>';
break;
case '':
default:
return '<div style="white-space: pre-wrap;" dir="auto">' . WT_Filter::expandUrls($text) . '</div>';
break;
}
}