本文整理汇总了PHP中Gdn_Format::Html方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Format::Html方法的具体用法?PHP Gdn_Format::Html怎么用?PHP Gdn_Format::Html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_Format
的用法示例。
在下文中一共展示了Gdn_Format::Html方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: file_exists
$IconPath = file_exists(PATH_ROOT . $IconPath) ? $IconPath : 'applications/dashboard/design/images/plugin-icon.png';
?>
<tr <?php
echo 'id="' . Gdn_Format::Url(strtolower($PluginName)) . '-plugin"', ' class="More ' . $RowClass . '"';
?>
>
<td rowspan="2" class="Less"><?php
echo Img($IconPath, array('class' => 'PluginIcon'));
?>
</td>
<th><?php
echo $ScreenName;
?>
</th>
<td class="Alt"><?php
echo Gdn_Format::Html(GetValue('Description', $PluginInfo, ''));
?>
</td>
</tr>
<tr class="<?php
echo ($Upgrade ? 'More ' : '') . $RowClass;
?>
">
<td class="Info"><?php
$ToggleText = array_key_exists($PluginName, $this->EnabledPlugins) ? 'Disable' : 'Enable';
echo Anchor(T($ToggleText), '/settings/plugins/' . $this->Filter . '/' . $PluginName . '/' . $Session->TransientKey(), $ToggleText . 'Addon SmallButton');
if ($SettingsUrl != '') {
echo Anchor(T('Settings'), $SettingsUrl, 'SmallButton');
}
if (SettingsModule::IsRemovable(SettingsModule::TYPE_PLUGIN, $PluginName)) {
echo Anchor(T('Remove'), '/settings/removeaddon/' . SettingsModule::TYPE_PLUGIN . '/' . $PluginName . '/' . $Session->TransientKey(), 'RemoveItem SmallButton');
示例2: file_exists
$IconPath = file_exists(PATH_ROOT . $IconPath) ? $IconPath : 'applications/dashboard/design/images/plugin-icon.png';
?>
<tr <?php
echo 'id="' . Gdn_Format::url(strtolower($PluginName)) . '-plugin"', ' class="More ' . $RowClass . '"';
?>
>
<td rowspan="2" class="Less"><?php
echo img($IconPath, array('class' => 'PluginIcon'));
?>
</td>
<th><?php
echo $ScreenName;
?>
</th>
<td class="Alt"><?php
echo Gdn_Format::Html(t(val('Name', $PluginInfo, $PluginName) . ' Description', val('Description', $PluginInfo, '')));
?>
</td>
</tr>
<tr class="<?php
echo ($Upgrade ? 'More ' : '') . $RowClass;
?>
">
<td class="Info"><?php
$ToggleText = array_key_exists($PluginName, $this->EnabledPlugins) ? 'Disable' : 'Enable';
echo anchor(t($ToggleText), '/settings/plugins/' . $this->Filter . '/' . $PluginName . '/' . $Session->TransientKey(), $ToggleText . 'Addon SmallButton');
if ($SettingsUrl != '') {
echo anchor(t('Settings'), $SettingsUrl, 'SmallButton');
}
?>
</td>
示例3: RssHtml
/**
* Format some text in a way suitable for passing into an rss/atom feed.
* @since 2.1
* @param string $Text The text to format.
* @param string $Format The current format of the text.
* @return string
*/
public static function RssHtml($Text, $Format = 'Html')
{
if (!in_array($Text, array('Html', 'Raw'))) {
$Text = Gdn_Format::To($Text, $Format);
}
if (function_exists('FormatRssHtmlCustom')) {
return FormatRssHtmlCustom($Text);
} else {
return Gdn_Format::Html($Text);
}
}
示例4: BBCode
/**
* Takes a mixed variable.
*
* @param mixed $Mixed An object, array, or string to be formatted.
* @return string
*/
public static function BBCode($Mixed)
{
if (!is_string($Mixed)) {
return self::To($Mixed, 'BBCode');
} else {
// See if there is a custom BBCode formatter.
$BBCodeFormatter = Gdn::Factory('BBCodeFormatter');
if (is_object($BBCodeFormatter)) {
$Result = $BBCodeFormatter->Format($Mixed);
$Result = Gdn_Format::Links($Result);
$Result = Gdn_Format::Mentions($Result);
return $Result;
}
$Formatter = Gdn::Factory('HtmlFormatter');
if (is_null($Formatter)) {
return Gdn_Format::Display($Mixed);
} else {
try {
$Mixed2 = $Mixed;
//$Mixed2 = str_replace("\n", '<br />', $Mixed2);
$Mixed2 = preg_replace("#\\[noparse\\](.*?)\\[/noparse\\]#sie", "str_replace(array('[',']',':'), array('[',']',':'), htmlspecialchars('\\1'))", $Mixed2);
$Mixed2 = str_ireplace(array("[php]", "[mysql]", "[css]"), "[code]", $Mixed2);
$Mixed2 = str_ireplace(array("[/php]", "[/mysql]", "[/css]"), "[/code]", $Mixed2);
$Mixed2 = preg_replace("#\\[code\\](.*?)\\[/code\\]#sie", "'<div class=\"PreContainer\"><pre>'.str_replace(array('[',']',':'), array('[',']',':'), htmlspecialchars('\\1')).'</pre></div>'", $Mixed2);
$Mixed2 = preg_replace("#\\[b\\](.*?)\\[/b\\]#si", '<b>\\1</b>', $Mixed2);
$Mixed2 = preg_replace("#\\[i\\](.*?)\\[/i\\]#si", '<i>\\1</i>', $Mixed2);
$Mixed2 = preg_replace("#\\[u\\](.*?)\\[/u\\]#si", '<u>\\1</u>', $Mixed2);
$Mixed2 = preg_replace("#\\[s\\](.*?)\\[/s\\]#si", '<s>\\1</s>', $Mixed2);
$Mixed2 = preg_replace("#\\[strike\\](.*?)\\[/strike\\]#si", '<s>\\1</s>', $Mixed2);
$Mixed2 = preg_replace("#\\[quote=[\"']?(.*?)(;[\\d]+)?[\"']?\\](.*?)\\[/quote\\]#si", '<blockquote class="Quote" rel="\\1"><div class="QuoteAuthor">\\1 said:</div><div class="QuoteText">\\3</div></blockquote>', $Mixed2);
$Mixed2 = preg_replace("#\\[quote\\](.*?)\\[/quote\\]#si", '<blockquote class="Quote"><div class="QuoteText">\\1</div></blockquote>', $Mixed2);
$Mixed2 = preg_replace("#\\[cite\\](.*?)\\[/cite\\]#si", '<blockquote class="Quote">\\1</blockquote>', $Mixed2);
$Mixed2 = preg_replace("#\\[hide\\](.*?)\\[/hide\\]#si", '\\1', $Mixed2);
$Mixed2 = preg_replace("#\\[url\\]((https?|ftp):\\/\\/.*?)\\[/url\\]#si", '<a rel="nofollow" target="_blank" href="\\1">\\1</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[url\\](.*?)\\[/url\\]#si", '\\1', $Mixed2);
$Mixed2 = preg_replace("#\\[url=[\"']?((https?|ftp):\\/\\/.*?)[\"']?\\](.*?)\\[/url\\]#si", '<a rel="nofollow" target="_blank" href="\\1">\\3</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[url=[\"']?(.*?)[\"']?\\](.*?)\\[/url\\]#si", '\\2', $Mixed2);
$Mixed2 = preg_replace("#\\[img\\]((https?|ftp):\\/\\/.*?)\\[/img\\]#si", '<img src="\\1" border="0" />', $Mixed2);
$Mixed2 = preg_replace("#\\[img\\](.*?)\\[/img\\]#si", '\\1', $Mixed2);
$Mixed2 = preg_replace("#\\[img=[\"']?((https?|ftp):\\/\\/.*?)[\"']?\\](.*?)\\[/img\\]#si", '<img src=\\1" border="0" alt="\\3" />', $Mixed2);
$Mixed2 = preg_replace("#\\[img=[\"']?(.*?)[\"']?\\](.*?)\\[/img\\]#si", '\\2', $Mixed2);
$Mixed2 = preg_replace("#\\[thread\\]([\\d]+)\\[/thread\\]#si", '<a href="/discussion/\\1">/discussion/\\1</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[thread=[\"']?([\\d]+)[\"']?\\](.*?)\\[/thread\\]#si", '<a href="/discussion/\\1">\\2</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[post\\]([\\d]+)\\[/post\\]#si", '<a href="/discussion/comment/\\1#Comment_\\1">/discussion/comment/\\1</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[post=[\"']?([\\d]+)[\"']?\\](.*?)\\[/post\\]#si", '<a href="/discussion/comment/\\1#Comment_\\1">\\2</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[size=[\"']?(.*?)[\"']?\\]#si", '<font size="\\1">', $Mixed2);
$Mixed2 = preg_replace("#\\[font=[\"']?(.*?)[\"']?\\]#si", '<font face="\\1">', $Mixed2);
$Mixed2 = preg_replace("#\\[color=[\"']?(.*?)[\"']?\\]#si", '<font color="\\1">', $Mixed2);
$Mixed2 = str_ireplace(array("[/size]", "[/font]", "[/color]"), "</font>", $Mixed2);
$Mixed2 = str_ireplace(array('[indent]', '[/indent]'), array('<div class="Indent">', '</div>'), $Mixed2);
$Mixed2 = str_ireplace(array("[left]", "[/left]"), '', $Mixed2);
$Mixed2 = preg_replace_callback("#\\[list\\](.*?)\\[/list\\]#si", array('Gdn_Format', 'ListCallback'), $Mixed2);
$Result = Gdn_Format::Html($Mixed2);
return $Result;
} catch (Exception $Ex) {
return self::Display($Mixed);
}
}
}
}
示例5: file_exists
$IconPath = file_exists(PATH_ROOT . $IconPath) ? $IconPath : 'applications/dashboard/design/images/plugin-icon.png';
?>
<tr <?php
echo 'id="' . Gdn_Format::Url(strtolower($PluginName)) . '-plugin"', ' class="More ' . $RowClass . '"';
?>
>
<td rowspan="2" class="Less"><?php
echo Img($IconPath, array('class' => 'PluginIcon'));
?>
</td>
<th><?php
echo $ScreenName;
?>
</th>
<td class="Alt"><?php
echo Gdn_Format::Html(T(GetValue('Name', $PluginInfo, $PluginName) . ' Description', GetValue('Description', $PluginInfo, '')));
?>
</td>
</tr>
<tr class="<?php
echo ($Upgrade ? 'More ' : '') . $RowClass;
?>
">
<td class="Info"><?php
$ToggleText = array_key_exists($PluginName, $this->EnabledPlugins) ? 'Disable' : 'Enable';
echo Anchor(T($ToggleText), '/settings/plugins/' . $this->Filter . '/' . $PluginName . '/' . $Session->TransientKey(), $ToggleText . 'Addon SmallButton');
if ($SettingsUrl != '') {
echo Anchor(T('Settings'), $SettingsUrl, 'SmallButton');
}
?>
</td>
示例6: sprintf
// echo ' ', sprintf(T('%s times'), $Row['CountGroup']);
}
$RecordUser = Gdn::UserModel()->GetID($Row['RecordUserID'], DATASET_TYPE_ARRAY);
if ($Row['RecordName']) {
echo ' <span class="Meta">', '<span class="Meta-Label">' . sprintf('%s by', T($RecordLabel)) . '</span> ', UserAnchor($Row, 'Meta-Value', 'Record');
if ($RecordUser['Banned']) {
echo ' <span class="Tag Tag-Ban">' . T('Banned') . '</span>';
}
echo ' <span class="Count">' . Plural($RecordUser['CountDiscussions'] + $RecordUser['CountComments'], '%s post', '%s posts') . '</span>';
echo '</span> ';
}
// Write custom meta information.
$CustomMeta = GetValueR('Data._Meta', $Row, FALSE);
if (is_array($CustomMeta)) {
foreach ($CustomMeta as $Key => $Value) {
echo ' <span class="Meta">', '<span class="Meta-Label">' . T($Key) . '</span> ', Wrap(Gdn_Format::Html($Value), 'span', array('class' => 'Meta-Value')), '</span>';
}
}
echo '</div>';
?>
</td>
<td class="DateCell"><?php
echo Gdn_Format::Date($Row['DateInserted'], 'html');
?>
</td>
</tr>
<?php
}
?>
</tbody>
示例7: UserInfoModule_OnBasicInfo_Handler
/**
* Display custom fields on Profile.
*/
public function UserInfoModule_OnBasicInfo_Handler($Sender)
{
try {
// Get the custom fields
$ProfileFields = Gdn::UserModel()->GetMeta($Sender->User->UserID, 'Profile.%', 'Profile.');
// Import from CustomProfileFields if available
if (!count($ProfileFields) && is_object($Sender->User) && C('Plugins.CustomProfileFields.SuggestedFields', FALSE)) {
$ProfileFields = Gdn::UserModel()->GetAttribute($Sender->User->UserID, 'CustomProfileFields', FALSE);
if ($ProfileFields) {
// Migrate to UserMeta & delete original
Gdn::UserModel()->SetMeta($Sender->User->UserID, $ProfileFields, 'Profile.');
Gdn::UserModel()->SaveAttribute($Sender->User->UserID, 'CustomProfileFields', FALSE);
}
}
// Send them off for magic formatting
$ProfileFields = $this->ParseSpecialFields($ProfileFields);
// Get all field data, error check
$AllFields = $this->GetProfileFields();
if (!is_array($AllFields) || !is_array($ProfileFields)) {
return;
}
// DateOfBirth is special case that core won't handle
// Hack it in here instead
if (C('ProfileExtender.Fields.DateOfBirth.OnProfile')) {
// Do not use Gdn_Format::Date because it shifts to local timezone
$ProfileFields['DateOfBirth'] = date(T('Birthday Format', 'F j, Y'), Gdn_Format::ToTimestamp($Sender->User->DateOfBirth));
$AllFields['DateOfBirth'] = array('Label' => T('Birthday'), 'OnProfile' => TRUE);
}
// Display all non-hidden fields
$ProfileFields = array_reverse($ProfileFields);
foreach ($ProfileFields as $Name => $Value) {
if (!$Value) {
continue;
}
if (!GetValue('OnProfile', $AllFields[$Name])) {
continue;
}
// Non-magic fields must be plain text, but we'll auto-link
if (!in_array($Name, $this->MagicLabels)) {
$Value = Gdn_Format::Links(Gdn_Format::Text($Value));
}
echo ' <dt class="ProfileExtend Profile' . Gdn_Format::AlphaNumeric($Name) . '">' . Gdn_Format::Text($AllFields[$Name]['Label']) . '</dt> ';
echo ' <dd class="ProfileExtend Profile' . Gdn_Format::AlphaNumeric($Name) . '">' . Gdn_Format::Html($Value) . '</dd> ';
}
} catch (Exception $ex) {
// No errors
}
}
示例8: writeGenericAttachment
/**
* Given a parsed attachment, render it in HTML
*
* @param array $Attachment
* @return string
*/
function writeGenericAttachment($Attachment)
{
$Type = val('Type', $Attachment);
$Icon = val('Icon', $Attachment, 'sign-blank');
$Title = val('Title', $Attachment);
$Meta = val('Meta', $Attachment);
$Body = val('Body', $Attachment);
$Fields = val('Fields', $Attachment);
?>
<div class="item-attachment">
<div class="alert<?php
if ($Type) {
echo ' alert-' . strtolower($Type);
}
?>
">
<div class="media item">
<div class="pull-left">
<div class="media-object">
<i class="icon icon-<?php
echo $Icon;
?>
"></i>
</div>
</div>
<div class="media-body">
<?php
if ($Title || $Meta) {
?>
<div class="item-header">
<?php
if ($Title) {
?>
<h4 class="media-heading item-heading"><?php
echo Gdn_Format::Html($Title);
?>
<?php
}
?>
<?php
if ($Meta) {
?>
<div class="item-meta">
<?php
foreach ($Meta as $Item) {
?>
<span><?php
echo Gdn_Format::Html($Item);
?>
</span>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
}
?>
<?php
if ($Body || $Fields) {
?>
<div class="item-body">
<?php
if ($Body) {
?>
<?php
echo Gdn_Format::Html($Body);
?>
<?php
}
?>
<?php
if ($Fields) {
?>
<dl class="dl-columns">
<?php
foreach ($Fields as $Title => $Field) {
?>
<dt><?php
echo t($Title);
?>
</dt>
<dd><?php
echo Gdn_Format::Html($Field);
?>
//.........这里部分代码省略.........
示例9: BBCode
/**
* Takes a mixed variable.
*
* @param mixed $Mixed An object, array, or string to be formatted.
* @return string
*/
public static function BBCode($Mixed)
{
if (!is_string($Mixed)) {
return self::To($Mixed, 'BBCode');
} else {
$Formatter = Gdn::Factory('HtmlFormatter');
if (is_null($Formatter)) {
return Gdn_Format::Display($Mixed);
} else {
try {
$Mixed2 = $Mixed;
$Mixed2 = str_replace("\n", '<br />', $Mixed2);
$Mixed2 = preg_replace("#\\[b\\](.*?)\\[/b\\]#si", '<b>\\1</b>', $Mixed2);
$Mixed2 = preg_replace("#\\[i\\](.*?)\\[/i\\]#si", '<i>\\1</i>', $Mixed2);
$Mixed2 = preg_replace("#\\[u\\](.*?)\\[/u\\]#si", '<u>\\1</u>', $Mixed2);
$Mixed2 = preg_replace("#\\[s\\](.*?)\\[/s\\]#si", '<s>\\1</s>', $Mixed2);
$Mixed2 = preg_replace("#\\[quote=[\"']?(.*?)[\"']?\\](.*?)\\[/quote\\]#si", '<p><cite>\\1</cite>:</p><blockquote>\\2</blockquote>', $Mixed2);
$Mixed2 = preg_replace("#\\[quote\\](.*?)\\[/quote\\]#si", '<blockquote>\\1</blockquote>', $Mixed2);
$Mixed2 = preg_replace("#\\[code\\](.*?)\\[/code\\]#si", '<code>\\1</code>', $Mixed2);
$Mixed2 = preg_replace("#\\[hide\\](.*?)\\[/hide\\]#si", '\\1', $Mixed2);
$Mixed2 = preg_replace("#\\[url\\]([^/]*?)\\[/url\\]#si", '<a href="http://\\1">\\1</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[url\\](.*?)\\[/url\\]#si", '\\1', $Mixed2);
$Mixed2 = preg_replace("#\\[url=[\"']?(.*?)[\"']?\\](.*?)\\[/url\\]#si", '<a href="\\1">\\2</a>', $Mixed2);
$Mixed2 = preg_replace("#\\[php\\](.*?)\\[/php\\]#si", '<code>\\1</code>', $Mixed2);
$Mixed2 = preg_replace("#\\[mysql\\](.*?)\\[/mysql\\]#si", '<code>\\1</code>', $Mixed2);
$Mixed2 = preg_replace("#\\[css\\](.*?)\\[/css\\]#si", '<code>\\1</code>', $Mixed2);
$Mixed2 = preg_replace("#\\[img=[\"']?(.*?)[\"']?\\](.*?)\\[/img\\]#si", '<img src="\\1" alt="\\2" />', $Mixed2);
$Mixed2 = preg_replace("#\\[img\\](.*?)\\[/img\\]#si", '<img src="\\1" border="0" />', $Mixed2);
$Mixed2 = str_ireplace(array('[indent]', '[/indent]'), array('<div class="Indent">', '</div>'), $Mixed2);
$Mixed2 = preg_replace("#\\[font=[\"']?(.*?)[\"']?\\]#i", '<span style="font-family:\\1;">', $Mixed2);
$Mixed2 = preg_replace("#\\[color=[\"']?(.*?)[\"']?\\]#i", '<span style="color:\\1">', $Mixed2);
$Mixed2 = str_ireplace(array("[/size]", "[/font]", "[/color]"), "</span>", $Mixed2);
$Mixed2 = preg_replace("#\\[size=[\"']?(.*?)[\"']?\\]#si", '<font size="\\1">', $Mixed2);
$Mixed2 = str_ireplace('[/font]', '</font>', $Mixed2);
$Mixed2 = preg_replace('#\\[/?left\\]#si', '', $Mixed2);
$Mixed2 = Gdn_Format::Links($Mixed2);
$Mixed2 = Gdn_Format::Mentions($Mixed2);
$Result = Gdn_Format::Html($Mixed2);
return $Result;
} catch (Exception $Ex) {
return self::Display($Mixed);
}
}
}
}
示例10: t
</div>
<h1><?php
echo $this->data('Title');
?>
</h1>
<?php
echo $this->Form->open();
echo $this->Form->errors();
?>
<div class="Info">
<?php
echo t("The Vanilla Statistics plugin turns your forum's dashboard into an analytics reporting tool", "Vanilla Statistics turns your forum's dashboard into an analytics reporting tool, allowing you to review activity on your forum over specific time periods. You can <a href=\"http://vanillaforums.org/docs/vanillastatistics\">read more about Vanilla Statistics</a> in our documentation.");
?>
</div>
<?php
if ($this->data('NotifyMessage') !== FALSE) {
?>
<div class="Info NotifyMessage">
<?php
echo "<strong>" . t("Last time your forum communicated with the statistics server it received the following message:") . "</strong>";
echo "<p><i>" . Gdn_Format::Html($this->data('NotifyMessage')) . "</i></p>";
?>
</div>
<?php
}
if ($this->data('AnalyticsEnabled')) {
echo $this->fetchView('configuration', 'statistics', 'dashboard');
} else {
echo $this->fetchView('disabled', 'statistics', 'dashboard');
}
echo $this->Form->close();
示例11: T
echo $Form->Label('Page', 'Page');
echo '<div class="Info2">', T('Select the location of the pocket.', 'Select the location of the pocket.'), '</div>';
echo $Form->DropDown('Page', $this->Data('Pages'));
?>
</li>
<li>
<?php
echo $Form->Label('Location', 'Location');
echo '<div class="Info2">', T('Select the location of the pocket.', 'Select the location of the pocket.'), '</div>';
echo $Form->DropDown('Location', array_merge(array('' => '(' . sprintf(T('Select a %s'), T('Location')) . ')'), $this->Data('LocationsArray')));
// Write the help for each location type.
foreach ($this->Data('Locations') as $Location => $Options) {
if (!array_key_exists('Description', $Options)) {
continue;
}
echo '<div class="Info LocationInfo ' . $Location . 'Info">', Gdn_Format::Html($Options['Description']), '</div>';
}
?>
</li>
<li class="js-repeat">
<?php
echo $Form->Label('Repeat', 'RepeatType');
//
echo '<div>', $Form->Radio('RepeatType', 'Before', array('Value' => Pocket::REPEAT_BEFORE, 'Default' => true)), '</div>';
//
echo '<div>', $Form->Radio('RepeatType', 'After', array('Value' => Pocket::REPEAT_AFTER)), '</div>';
//
echo '<div>', $Form->Radio('RepeatType', 'Repeat Every', array('Value' => Pocket::REPEAT_EVERY)), '</div>';
// Options for repeat every.
echo '<div class="RepeatOptions RepeatEveryOptions P">', '<div class="Info2">', T('Enter numbers starting at 1.'), '</div>', $Form->Label('Frequency', 'EveryFrequency', array('Class' => 'SubLabel')), $Form->TextBox('EveryFrequency', array('Class' => 'SmallInput')), ' <br /> ' . $Form->Label('Begin At', 'EveryBegin', array('Class' => 'SubLabel')), $Form->TextBox('EveryBegin', array('Class' => 'SmallInput')), '</div>';
echo '<div>', $Form->Radio('RepeatType', 'Given Indexes', array('Value' => Pocket::REPEAT_INDEX)), '</div>';
示例12: _DrawSignature
protected function _DrawSignature(&$Sender)
{
if (!C('Plugins.Signatures.Enabled')) {
return;
}
if ($this->_HideAllSignatures($Sender)) {
return;
}
if (isset($Sender->EventArguments['Discussion'])) {
$Data = $Sender->EventArguments['Discussion'];
}
if (isset($Sender->EventArguments['Comment'])) {
$Data = $Sender->EventArguments['Comment'];
}
$SourceUserID = $Data->InsertUserID;
$UserSignatures =& $Sender->Data('Plugin-Signatures-UserSignatures');
if (isset($UserSignatures[$SourceUserID])) {
$HideImages = ArrayValue('Plugin.Signatures.HideImages', $Sender->Data('Plugin-Signatures-ViewingUserData'), FALSE);
$UserSig = $UserSignatures[$SourceUserID];
if ($HideImages) {
// Strip img tags
$UserSig = $this->_StripOnly($UserSig, array('img'));
// Remove blank lines and spare whitespace
$UserSig = preg_replace('/^\\S*\\n\\S*/m', '', str_replace("\r\n", "\n", $UserSig));
$UserSig = trim($UserSig);
}
// Don't show empty sigs, brah
if ($UserSig == '') {
return;
}
$Sender->UserSignature = Gdn_Format::Html($UserSig);
$Display = $Sender->FetchView($this->GetView('usersig.php'));
unset($Sender->UserSignature);
echo $Display;
}
}
示例13: ArrayValue
if ($this->Filter == 'all' || $this->Filter == $State) {
$Alt = $Alt ? FALSE : TRUE;
$Version = Gdn_Format::Display(GetValue('Version', $PluginInfo, ''));
$ScreenName = Gdn_Format::Display(GetValue('Name', $PluginInfo, $PluginName));
$SettingsUrl = $State == 'enabled' ? ArrayValue('SettingsUrl', $PluginInfo, '') : '';
$PluginUrl = ArrayValue('PluginUrl', $PluginInfo, '');
$Author = ArrayValue('Author', $PluginInfo, '');
$AuthorUrl = ArrayValue('AuthorUrl', $PluginInfo, '');
$NewVersion = ArrayValue('NewVersion', $PluginInfo, '');
$Upgrade = $NewVersion != '' && version_compare($NewVersion, $Version, '>');
$RowClass = $Css;
if ($Alt) $RowClass .= ' Alt';
?>
<tr <?php echo 'id="'.Gdn_Format::Url(strtolower($PluginName)).'-plugin"', ' class="More '.$RowClass.'"'; ?>>
<th><?php echo $ScreenName; ?></th>
<td class="Alt"><?php echo Gdn_Format::Html(GetValue('Description', $PluginInfo, '')); ?></td>
</tr>
<tr class="<?php echo ($Upgrade ? 'More ' : '').$RowClass; ?>">
<td class="Info"><?php
$ToggleText = array_key_exists($PluginName, $this->EnabledPlugins) ? 'Disable' : 'Enable';
echo Anchor(
T($ToggleText),
'/settings/plugins/'.$this->Filter.'/'.$PluginName.'/'.$Session->TransientKey(),
$ToggleText . 'Addon SmallButton'
);
if ($SettingsUrl != '')
echo Anchor(T('Settings'), $SettingsUrl, 'SmallButton');
if (SettingsModule::IsRemovable(SettingsModule::TYPE_PLUGIN, $PluginName))
echo Anchor(T('Remove'), '/settings/removeaddon/'.SettingsModule::TYPE_PLUGIN.'/'.$PluginName.'/'.$Session->TransientKey(), 'RemoveItem SmallButton');