本文整理汇总了PHP中CssClass函数的典型用法代码示例。如果您正苦于以下问题:PHP CssClass函数的具体用法?PHP CssClass怎么用?PHP CssClass使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CssClass函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: WriteModuleDiscussion
function WriteModuleDiscussion($Discussion, $Px = 'Bookmark')
{
?>
<li id="<?php
echo "{$Px}_{$Discussion->DiscussionID}";
?>
" class="<?php
echo CssClass($Discussion);
?>
">
<span class="Options">
<?php
// echo OptionsList($Discussion);
echo BookmarkButton($Discussion);
?>
</span>
<div class="Title"><?php
echo Anchor(Gdn_Format::Text($Discussion->Name, FALSE), DiscussionUrl($Discussion) . ($Discussion->CountCommentWatch > 0 ? '#Item_' . $Discussion->CountCommentWatch : ''), 'DiscussionLink');
?>
</div>
<div class="Meta">
<?php
$Last = new stdClass();
$Last->UserID = $Discussion->LastUserID;
$Last->Name = $Discussion->LastName;
echo NewComments($Discussion);
echo '<span class="MItem">' . Gdn_Format::Date($Discussion->LastDate, 'html') . UserAnchor($Last) . '</span>';
?>
</div>
</li>
<?php
}
示例2: WriteDiscussionEvent
function WriteDiscussionEvent($Discussion, $Prefix = null)
{
?>
<li class="<?php
echo CssClass($Discussion);
?>
">
<div class="Title">
<?php
echo Anchor(Gdn_Format::Text($Discussion->Name, false), DiscussionUrl($Discussion) . ($Discussion->CountCommentWatch > 0 ? '#Item_' . $Discussion->CountCommentWatch : ''), 'DiscussionLink');
?>
</div><div class="Meta"><span class="MItem">
<?php
echo Gdn_Format::Date($Discussion->DiscussionEventDate, 'html');
?>
</span></div>
</li>
<?php
}
示例3: writePromotedContent
/**
* Generates html output of $Content array
*
* @param array|object $Content
* @param PromotedContentModule $Sender
*/
function writePromotedContent($Content, $Sender)
{
static $UserPhotoFirst = NULL;
if ($UserPhotoFirst === null) {
$UserPhotoFirst = c('Vanilla.Comment.UserPhotoFirst', true);
}
$ContentType = val('RecordType', $Content);
$ContentID = val("{$ContentType}ID", $Content);
$Author = val('Author', $Content);
$ContentURL = val('Url', $Content);
$Sender->EventArguments['Content'] =& $Content;
$Sender->EventArguments['ContentUrl'] =& $ContentURL;
?>
<div id="<?php
echo "Promoted_{$ContentType}_{$ContentID}";
?>
" class="<?php
echo CssClass($Content);
?>
">
<div class="AuthorWrap">
<span class="Author">
<?php
if ($UserPhotoFirst) {
echo userPhoto($Author);
echo userAnchor($Author, 'Username');
} else {
echo userAnchor($Author, 'Username');
echo userPhoto($Author);
}
$Sender->fireEvent('AuthorPhoto');
?>
</span>
<span class="AuthorInfo">
<?php
echo ' ' . WrapIf(htmlspecialchars(val('Title', $Author)), 'span', array('class' => 'MItem AuthorTitle'));
echo ' ' . WrapIf(htmlspecialchars(val('Location', $Author)), 'span', array('class' => 'MItem AuthorLocation'));
$Sender->fireEvent('AuthorInfo');
?>
</span>
</div>
<div class="Meta CommentMeta CommentInfo">
<span class="MItem DateCreated">
<?php
echo anchor(Gdn_Format::date($Content['DateInserted'], 'html'), $ContentURL, 'Permalink', array('rel' => 'nofollow'));
?>
</span>
<?php
// Include source if one was set
if ($Source = val('Source', $Content)) {
echo wrap(sprintf(t('via %s'), t($Source . ' Source', $Source)), 'span', array('class' => 'MItem Source'));
}
$Sender->fireEvent('ContentInfo');
?>
</div>
<div
class="Title"><?php
echo anchor(Gdn_Format::text(sliceString($Content['Name'], $Sender->TitleLimit), false), $ContentURL, 'DiscussionLink');
?>
</div>
<div class="Body">
<?php
echo anchor(htmlspecialchars(sliceString(Gdn_Format::plainText($Content['Body'], $Content['Format']), $Sender->BodyLimit)), $ContentURL, 'BodyLink');
$Sender->fireEvent('AfterPromotedBody');
// separate event to account for less space.
?>
</div>
</div>
<?php
}
示例4: writeDiscussionRow
/**
* Writes a discussion in table row format.
*/
function writeDiscussionRow($Discussion, $Sender, $Session)
{
if (!property_exists($Sender, 'CanEditDiscussions')) {
$Sender->CanEditDiscussions = val('PermsDiscussionsEdit', CategoryModel::categories($Discussion->CategoryID)) && c('Vanilla.AdminCheckboxes.Use');
}
$CssClass = CssClass($Discussion);
$DiscussionUrl = $Discussion->Url;
if ($Session->UserID) {
$DiscussionUrl .= '#latest';
}
$Sender->EventArguments['DiscussionUrl'] =& $DiscussionUrl;
$Sender->EventArguments['Discussion'] =& $Discussion;
$Sender->EventArguments['CssClass'] =& $CssClass;
$First = UserBuilder($Discussion, 'First');
if ($Discussion->LastUserID) {
$Last = UserBuilder($Discussion, 'Last');
} else {
$Last = $First;
}
$Sender->EventArguments['FirstUser'] =& $First;
$Sender->EventArguments['LastUser'] =& $Last;
$Sender->fireEvent('BeforeDiscussionName');
$DiscussionName = $Discussion->Name;
// If there are no word character detected in the title treat it as if it is blank.
if (!preg_match('/\\w/u', $DiscussionName)) {
$DiscussionName = t('Blank Discussion Topic');
}
$Sender->EventArguments['DiscussionName'] =& $DiscussionName;
static $FirstDiscussion = true;
if (!$FirstDiscussion) {
$Sender->fireEvent('BetweenDiscussion');
} else {
$FirstDiscussion = false;
}
$Discussion->CountPages = ceil($Discussion->CountComments / $Sender->CountCommentsPerPage);
$FirstPageUrl = DiscussionUrl($Discussion, 1);
$LastPageUrl = DiscussionUrl($Discussion, val('CountPages', $Discussion)) . '#latest';
?>
<tr id="Discussion_<?php
echo $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
<?php
$Sender->fireEvent('BeforeDiscussionContent');
?>
<?php
echo AdminCheck($Discussion, array('<td class="CheckBoxColumn"><div class="Wrap">', '</div></td>'));
?>
<td class="DiscussionName">
<div class="Wrap">
<span class="Options">
<?php
echo OptionsList($Discussion);
echo BookmarkButton($Discussion);
?>
</span>
<?php
$Sender->fireEvent('BeforeDiscussionTitle');
echo anchor($DiscussionName, $DiscussionUrl, 'Title') . ' ';
$Sender->fireEvent('AfterDiscussionTitle');
WriteMiniPager($Discussion);
echo NewComments($Discussion);
if ($Sender->data('_ShowCategoryLink', true)) {
echo CategoryLink($Discussion, ' ' . t('in') . ' ');
}
// Other stuff that was in the standard view that you may want to display:
echo '<div class="Meta Meta-Discussion">';
WriteTags($Discussion);
echo '</div>';
// if ($Source = val('Source', $Discussion))
// echo ' '.sprintf(t('via %s'), t($Source.' Source', $Source));
//
?>
</div>
</td>
<td class="BlockColumn BlockColumn-User FirstUser">
<div class="Block Wrap">
<?php
echo userPhoto($First, array('Size' => 'Small'));
echo userAnchor($First, 'UserLink BlockTitle');
echo '<div class="Meta">';
echo anchor(Gdn_Format::date($Discussion->FirstDate, 'html'), $FirstPageUrl, 'CommentDate MItem');
echo '</div>';
?>
</div>
</td>
<td class="BigCount CountComments">
<div class="Wrap">
<?php
// Exact Number
// echo number_format($Discussion->CountComments);
// Round Number
echo BigPlural($Discussion->CountComments, '%s comment');
?>
//.........这里部分代码省略.........
示例5: writeTableRow
function writeTableRow($Row, $Depth = 1)
{
$Children = $Row['Children'];
$WriteChildren = FALSE;
if (!empty($Children)) {
if ($Depth + 1 >= c('Vanilla.Categories.MaxDisplayDepth')) {
$WriteChildren = 'list';
} else {
$WriteChildren = 'rows';
}
}
$H = 'h' . ($Depth + 1);
?>
<tr class="<?php
echo CssClass($Row);
?>
">
<td class="CategoryName">
<div class="Wrap">
<?php
echo GetOptions($Row);
echo CategoryPhoto($Row);
echo "<{$H}>";
echo anchor(htmlspecialchars($Row['Name']), $Row['Url']);
Gdn::controller()->EventArguments['Category'] = $Row;
Gdn::controller()->fireEvent('AfterCategoryTitle');
echo "</{$H}>";
?>
<div class="CategoryDescription">
<?php
echo $Row['Description'];
?>
</div>
<?php
if ($WriteChildren === 'list') {
?>
<div class="ChildCategories">
<?php
echo wrap(t('Child Categories') . ': ', 'b');
echo CategoryString($Children, $Depth + 1);
?>
</div>
<?php
}
?>
</div>
</td>
<td class="BigCount CountDiscussions">
<div class="Wrap">
<?php
// echo "({$Row['CountDiscussions']})";
echo BigPlural($Row['CountAllDiscussions'], '%s discussion');
?>
</div>
</td>
<td class="BigCount CountComments">
<div class="Wrap">
<?php
// echo "({$Row['CountComments']})";
echo BigPlural($Row['CountAllComments'], '%s comment');
?>
</div>
</td>
<td class="BlockColumn LatestPost">
<div class="Block Wrap">
<?php
if ($Row['LastTitle']) {
?>
<?php
echo userPhoto($Row, array('Size' => 'Small', 'Px' => 'Last'));
echo anchor(SliceString(Gdn_Format::text($Row['LastTitle']), 100), $Row['LastUrl'], 'BlockTitle LatestPostTitle', array('title' => html_entity_decode($Row['LastTitle'])));
?>
<div class="Meta">
<?php
echo userAnchor($Row, 'UserLink MItem', 'Last');
?>
<span class="Bullet">•</span>
<?php
echo anchor(Gdn_Format::date($Row['LastDateInserted'], 'html'), $Row['LastUrl'], 'CommentDate MItem');
if (isset($Row['LastCategoryID'])) {
$LastCategory = CategoryModel::categories($Row['LastCategoryID']);
echo ' <span>', sprintf('in %s', anchor($LastCategory['Name'], CategoryUrl($LastCategory, '', '//'))), '</span>';
}
?>
</div>
<?php
}
?>
</div>
</td>
</tr>
<?php
if ($WriteChildren === 'rows') {
foreach ($Children as $ChildRow) {
WriteTableRow($ChildRow, $Depth + 1);
}
}
}
示例6: C
<?php
/**
* @copyright 2009-2014 Vanilla Forums Inc.
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
*/
if (!defined('APPLICATION')) {
exit;
}
$UserPhotoFirst = C('Vanilla.Comment.UserPhotoFirst', TRUE);
$Discussion = $this->Data('Discussion');
$Author = Gdn::UserModel()->GetID($Discussion->InsertUserID);
// UserBuilder($Discussion, 'Insert');
// Prep event args.
$CssClass = CssClass($Discussion, FALSE);
$this->EventArguments['Discussion'] =& $Discussion;
$this->EventArguments['Author'] =& $Author;
$this->EventArguments['CssClass'] =& $CssClass;
// DEPRECATED ARGUMENTS (as of 2.1)
$this->EventArguments['Object'] =& $Discussion;
$this->EventArguments['Type'] = 'Discussion';
// Discussion template event
$this->FireEvent('BeforeDiscussionDisplay');
?>
<div id="<?php
echo 'Discussion_' . $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
示例7: WriteComment
function WriteComment($Comment, $Sender, $Session, $CurrentOffset)
{
static $UserPhotoFirst = NULL;
if ($UserPhotoFirst === NULL) {
$UserPhotoFirst = C('Vanilla.Comment.UserPhotoFirst', TRUE);
}
$Author = Gdn::UserModel()->GetID($Comment->InsertUserID);
//UserBuilder($Comment, 'Insert');
$Permalink = GetValue('Url', $Comment, '/discussion/comment/' . $Comment->CommentID . '/#Comment_' . $Comment->CommentID);
// Set CanEditComments (whether to show checkboxes)
if (!property_exists($Sender, 'CanEditComments')) {
$Sender->CanEditComments = $Session->CheckPermission('Vanilla.Comments.Edit', TRUE, 'Category', 'any') && C('Vanilla.AdminCheckboxes.Use');
}
// Prep event args
$CssClass = CssClass($Comment, $CurrentOffset);
$Sender->EventArguments['Comment'] =& $Comment;
$Sender->EventArguments['Author'] =& $Author;
$Sender->EventArguments['CssClass'] =& $CssClass;
// DEPRECATED ARGUMENTS (as of 2.1)
$Sender->EventArguments['Object'] =& $Comment;
$Sender->EventArguments['Type'] = 'Comment';
// First comment template event
$Sender->FireEvent('BeforeCommentDisplay');
?>
<li class="<?php
echo $CssClass;
?>
" id="<?php
echo 'Comment_' . $Comment->CommentID;
?>
">
<div class="Comment">
<?php
// Write a stub for the latest comment so it's easy to link to it from outside.
if ($CurrentOffset == Gdn::Controller()->Data('_LatestItem')) {
echo '<span id="latest"></span>';
}
?>
<div class="Options">
<?php
WriteCommentOptions($Comment);
?>
</div>
<?php
$Sender->FireEvent('BeforeCommentMeta');
?>
<div class="Item-Header CommentHeader">
<div class="AuthorWrap">
<span class="Author">
<?php
if ($UserPhotoFirst) {
echo UserPhoto($Author);
echo UserAnchor($Author, 'Username');
} else {
echo UserAnchor($Author, 'Username');
echo UserPhoto($Author);
}
echo FormatMeAction($Comment);
?>
</span>
<span class="AuthorInfo">
<?php
echo ' ' . WrapIf(htmlspecialchars(GetValue('Title', $Author)), 'span', array('class' => 'MItem AuthorTitle'));
$Sender->FireEvent('AuthorInfo');
?>
</span>
</div>
<div class="Meta CommentMeta CommentInfo">
<span class="MItem DateCreated">
<?php
echo Anchor(Gdn_Format::Date($Comment->DateInserted, 'html'), $Permalink, 'Permalink', array('name' => 'Item_' . $CurrentOffset, 'rel' => 'nofollow'));
?>
</span>
<?php
// Include source if one was set
if ($Source = GetValue('Source', $Comment)) {
echo Wrap(sprintf(T('via %s'), T($Source . ' Source', $Source)), 'span', array('class' => 'MItem Source'));
}
$Sender->FireEvent('CommentInfo');
$Sender->FireEvent('InsideCommentMeta');
// DEPRECATED
$Sender->FireEvent('AfterCommentMeta');
// DEPRECATED
// Include IP Address if we have permission
if ($Session->CheckPermission('Garden.Moderation.Manage')) {
echo Wrap(IPAnchor($Comment->InsertIPAddress), 'span', array('class' => 'MItem IPAddress'));
}
?>
</div>
</div>
<div class="Item-BodyWrap">
<div class="Item-Body">
<div class="Message">
<?php
echo FormatBody($Comment);
?>
</div>
<?php
$Sender->FireEvent('AfterCommentBody');
WriteReactions($Comment);
//.........这里部分代码省略.........
示例8: WriteDiscussionRow
/**
* Writes a discussion in table row format.
*/
function WriteDiscussionRow($Discussion, &$Sender, &$Session, $Alt2)
{
if (!property_exists($Sender, 'CanEditDiscussions')) {
$Sender->CanEditDiscussions = GetValue('PermsDiscussionsEdit', CategoryModel::Categories($Discussion->CategoryID)) && C('Vanilla.AdminCheckboxes.Use');
}
$CssClass = CssClass($Discussion);
$DiscussionUrl = $Discussion->Url;
if ($Session->UserID) {
$DiscussionUrl .= '#latest';
}
$Sender->EventArguments['DiscussionUrl'] =& $DiscussionUrl;
$Sender->EventArguments['Discussion'] =& $Discussion;
$Sender->EventArguments['CssClass'] =& $CssClass;
$First = UserBuilder($Discussion, 'First');
if ($Discussion->LastUserID) {
$Last = UserBuilder($Discussion, 'Last');
} else {
$Last = $First;
}
// $Sender->EventArguments['FirstUser'] = &$First;
// $Sender->EventArguments['LastUser'] = &$Last;
//
// $Sender->FireEvent('BeforeDiscussionName');
$DiscussionName = $Discussion->Name;
if ($DiscussionName == '') {
$DiscussionName = T('Blank Discussion Topic');
}
$Sender->EventArguments['DiscussionName'] =& $DiscussionName;
$Discussion->CountPages = ceil($Discussion->CountComments / $Sender->CountCommentsPerPage);
$FirstPageUrl = DiscussionUrl($Discussion, 1);
$LastPageUrl = DiscussionUrl($Discussion, FALSE) . '#latest';
?>
<tr id="Discussion_<?php
echo $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
<?php
echo AdminCheck($Discussion, array('<td class="CheckBoxColumn"><div class="Wrap">', '</div></td>'));
?>
<td class="DiscussionName">
<div class="Wrap">
<span class="Options">
<?php
echo OptionsList($Discussion);
echo BookmarkButton($Discussion);
?>
</span>
<?php
echo Anchor($DiscussionName, $DiscussionUrl, 'Title') . ' ';
$Sender->FireEvent('AfterDiscussionTitle');
WriteMiniPager($Discussion);
echo NewComments($Discussion);
if ($Sender->Data('_ShowCategoryLink', TRUE)) {
echo CategoryLink($Discussion, ' ' . T('in') . ' ');
}
// Other stuff that was in the standard view that you may want to display:
echo '<div class="Meta Meta-Discussion">';
WriteTags($Discussion);
echo '</div>';
// if ($Source = GetValue('Source', $Discussion))
// echo ' '.sprintf(T('via %s'), T($Source.' Source', $Source));
//
?>
</div>
</td>
<td class="BlockColumn BlockColumn-User FirstUser">
<div class="Block Wrap">
<?php
echo UserPhoto($First, array('Size' => 'Small'));
echo UserAnchor($First, 'UserLink BlockTitle');
echo '<div class="Meta">';
echo Anchor(Gdn_Format::Date($Discussion->FirstDate, 'html'), $FirstPageUrl, 'CommentDate MItem');
echo '</div>';
?>
</div>
</td>
<td class="BigCount CountComments">
<div class="Wrap">
<?php
// Exact Number
// echo number_format($Discussion->CountComments);
// Round Number
echo BigPlural($Discussion->CountComments, '%s comment');
?>
</div>
</td>
<td class="BigCount CountViews">
<div class="Wrap">
<?php
// Exact Number
// echo number_format($Discussion->CountViews);
// Round Number
echo BigPlural($Discussion->CountViews, '%s view');
?>
//.........这里部分代码省略.........
示例9: writeDiscussion
function writeDiscussion($Discussion, &$Sender, &$Session)
{
$CssClass = CssClass($Discussion);
$DiscussionUrl = $Discussion->Url;
$Category = CategoryModel::categories($Discussion->CategoryID);
if ($Session->UserID) {
$DiscussionUrl .= '#latest';
}
$Sender->EventArguments['DiscussionUrl'] =& $DiscussionUrl;
$Sender->EventArguments['Discussion'] =& $Discussion;
$Sender->EventArguments['CssClass'] =& $CssClass;
$First = UserBuilder($Discussion, 'First');
$Last = UserBuilder($Discussion, 'Last');
$Sender->EventArguments['FirstUser'] =& $First;
$Sender->EventArguments['LastUser'] =& $Last;
$Sender->fireEvent('BeforeDiscussionName');
$DiscussionName = $Discussion->Name;
if ($DiscussionName == '') {
$DiscussionName = t('Blank Discussion Topic');
}
$Sender->EventArguments['DiscussionName'] =& $DiscussionName;
static $FirstDiscussion = TRUE;
if (!$FirstDiscussion) {
$Sender->fireEvent('BetweenDiscussion');
} else {
$FirstDiscussion = FALSE;
}
$Discussion->CountPages = ceil($Discussion->CountComments / $Sender->CountCommentsPerPage);
?>
<li id="Discussion_<?php
echo $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
<?php
if (!property_exists($Sender, 'CanEditDiscussions')) {
$Sender->CanEditDiscussions = val('PermsDiscussionsEdit', CategoryModel::categories($Discussion->CategoryID)) && c('Vanilla.AdminCheckboxes.Use');
}
$Sender->fireEvent('BeforeDiscussionContent');
// WriteOptions($Discussion, $Sender, $Session);
?>
<span class="Options">
<?php
echo OptionsList($Discussion);
echo BookmarkButton($Discussion);
?>
</span>
<div class="ItemContent Discussion">
<div class="Title">
<?php
echo AdminCheck($Discussion, array('', ' ')) . anchor($DiscussionName, $DiscussionUrl);
$Sender->fireEvent('AfterDiscussionTitle');
?>
</div>
<div class="Meta Meta-Discussion">
<?php
WriteTags($Discussion);
?>
<span class="MItem MCount ViewCount"><?php
printf(PluralTranslate($Discussion->CountViews, '%s view html', '%s views html', t('%s view'), t('%s views')), BigPlural($Discussion->CountViews, '%s view'));
?>
</span>
<span class="MItem MCount CommentCount"><?php
printf(PluralTranslate($Discussion->CountComments, '%s comment html', '%s comments html', t('%s comment'), t('%s comments')), BigPlural($Discussion->CountComments, '%s comment'));
?>
</span>
<span class="MItem MCount DiscussionScore Hidden"><?php
$Score = $Discussion->Score;
if ($Score == '') {
$Score = 0;
}
printf(Plural($Score, '%s point', '%s points', BigPlural($Score, '%s point')));
?>
</span>
<?php
echo NewComments($Discussion);
$Sender->fireEvent('AfterCountMeta');
if ($Discussion->LastCommentID != '') {
echo ' <span class="MItem LastCommentBy">' . sprintf(t('Most recent by %1$s'), userAnchor($Last)) . '</span> ';
echo ' <span class="MItem LastCommentDate">' . Gdn_Format::date($Discussion->LastDate, 'html') . '</span>';
} else {
echo ' <span class="MItem LastCommentBy">' . sprintf(t('Started by %1$s'), userAnchor($First)) . '</span> ';
echo ' <span class="MItem LastCommentDate">' . Gdn_Format::date($Discussion->FirstDate, 'html');
if ($Source = val('Source', $Discussion)) {
echo ' ' . sprintf(t('via %s'), t($Source . ' Source', $Source));
}
echo '</span> ';
}
if ($Sender->data('_ShowCategoryLink', true) && c('Vanilla.Categories.Use') && $Category) {
echo wrap(Anchor(htmlspecialchars($Discussion->Category), CategoryUrl($Discussion->CategoryUrlCode)), 'span', array('class' => 'MItem Category ' . $Category['CssClass']));
}
$Sender->fireEvent('DiscussionMeta');
?>
</div>
</div>
<?php
$Sender->fireEvent('AfterDiscussionContent');
//.........这里部分代码省略.........
示例10: count
$this->EventArguments['NumRows'] = count($this->data('Categories'));
//if (c('Vanilla.Categories.ShowTabs')) {
//// $ViewLocation = Gdn::controller()->fetchViewLocation('helper_functions', 'Discussions', 'vanilla');
//// include_once $ViewLocation;
//// WriteFilterTabs($this);
// echo Gdn_Theme::Module('DiscussionFilterModule');
//}
echo '<ul class="DataList CategoryList' . ($DoHeadings ? ' CategoryListWithHeadings' : '') . '">';
$Alt = FALSE;
foreach ($this->data('Categories') as $CategoryRow) {
$Category = (object) $CategoryRow;
$this->EventArguments['CatList'] =& $CatList;
$this->EventArguments['ChildCategories'] =& $ChildCategories;
$this->EventArguments['Category'] =& $Category;
$this->fireEvent('BeforeCategoryItem');
$CssClass = CssClass($CategoryRow);
$CategoryID = val('CategoryID', $Category);
if ($Category->CategoryID > 0) {
// If we are below the max depth, and there are some child categories
// in the $ChildCategories variable, do the replacement.
if ($Category->Depth < $MaxDisplayDepth && $ChildCategories != '') {
$CatList = str_replace('{ChildCategories}', '<span class="ChildCategories">' . Wrap(t('Child Categories:'), 'b') . ' ' . $ChildCategories . '</span>', $CatList);
$ChildCategories = '';
}
if ($Category->Depth >= $MaxDisplayDepth && $MaxDisplayDepth > 0) {
if ($ChildCategories != '') {
$ChildCategories .= ', ';
}
$ChildCategories .= anchor(Gdn_Format::text($Category->Name), CategoryUrl($Category));
} else {
if ($Category->DisplayAs === 'Heading') {
示例11: c
<?php
/**
* @copyright 2009-2014 Vanilla Forums Inc.
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
*/
if (!defined('APPLICATION')) {
exit;
}
$UserPhotoFirst = c('Vanilla.Comment.UserPhotoFirst', true);
$Discussion = $this->data('Discussion');
$Author = Gdn::userModel()->getID($Discussion->InsertUserID);
// UserBuilder($Discussion, 'Insert');
// Prep event args.
$CssClass = CssClass($Discussion, false);
$this->EventArguments['Discussion'] =& $Discussion;
$this->EventArguments['Author'] =& $Author;
$this->EventArguments['CssClass'] =& $CssClass;
// DEPRECATED ARGUMENTS (as of 2.1)
$this->EventArguments['Object'] =& $Discussion;
$this->EventArguments['Type'] = 'Discussion';
// Discussion template event
$this->fireEvent('BeforeDiscussionDisplay');
?>
<div id="<?php
echo 'Discussion_' . $Discussion->DiscussionID;
?>
" class="<?php
echo $CssClass;
?>
">
示例12: WritePromotedContent
function WritePromotedContent($Content, $Sender)
{
static $UserPhotoFirst = NULL;
if ($UserPhotoFirst === NULL) {
$UserPhotoFirst = C('Vanilla.Comment.UserPhotoFirst', TRUE);
}
$ContentType = GetValue('ItemType', $Content);
$ContentID = GetValue("{$ContentType}ID", $Content);
$Author = GetValue('Author', $Content);
switch (strtolower($ContentType)) {
case 'comment':
$ContentURL = CommentUrl($Content);
break;
case 'discussion':
$ContentURL = DiscussionUrl($Content);
break;
}
?>
<div id="<?php
echo "Promoted_{$ContentType}_{$ContentID}";
?>
" class="<?php
echo CssClass($Content);
?>
">
<div class="AuthorWrap">
<span class="Author">
<?php
if ($UserPhotoFirst) {
echo UserPhoto($Author);
echo UserAnchor($Author, 'Username');
} else {
echo UserAnchor($Author, 'Username');
echo UserPhoto($Author);
}
$Sender->FireEvent('AuthorPhoto');
?>
</span>
<span class="AuthorInfo">
<?php
echo ' ' . WrapIf(htmlspecialchars(GetValue('Title', $Author)), 'span', array('class' => 'MItem AuthorTitle'));
echo ' ' . WrapIf(htmlspecialchars(GetValue('Location', $Author)), 'span', array('class' => 'MItem AuthorLocation'));
$Sender->FireEvent('AuthorInfo');
?>
</span>
</div>
<div class="Meta CommentMeta CommentInfo">
<span class="MItem DateCreated">
<?php
echo Anchor(Gdn_Format::Date($Content['DateInserted'], 'html'), $Permalink, 'Permalink', array('rel' => 'nofollow'));
?>
</span>
<?php
// Include source if one was set
if ($Source = GetValue('Source', $Content)) {
echo Wrap(sprintf(T('via %s'), T($Source . ' Source', $Source)), 'span', array('class' => 'MItem Source'));
}
$Sender->FireEvent('ContentInfo');
?>
</div>
<div class="Title"><?php
echo Anchor(Gdn_Format::Text($Content['Name'], FALSE), $ContentURL, 'DiscussionLink');
?>
</div>
<div class="Body"><?php
echo Anchor(strip_tags(Gdn_Format::To($Content['Body'], $Content['Format'])), $ContentURL, 'BodyLink');
?>
</div>
</div>
<?php
}
示例13: C
$UserPhotoFirst = C('Vanilla.Comment.UserPhotoFirst', TRUE);
$Discussion = $this->Data('Discussion');
$Author = Gdn::UserModel()->GetID($Discussion->InsertUserID);
// UserBuilder($Discussion, 'Insert');
// Prep event args
$this->EventArguments['Discussion'] =& $Discussion;
$this->EventArguments['Author'] =& $Author;
// DEPRECATED ARGUMENTS (as of 2.1)
$this->EventArguments['Object'] =& $Discussion;
$this->EventArguments['Type'] = 'Discussion';
?>
<div id="<?php
echo 'Discussion_' . $Discussion->DiscussionID;
?>
" class="<?php
echo CssClass($Discussion);
?>
">
<div class="Discussion">
<div class="Item-Header DiscussionHeader">
<div class="AuthorWrap">
<span class="Author">
<?php
if ($UserPhotoFirst) {
echo UserPhoto($Author);
echo UserAnchor($Author, 'Username');
} else {
echo UserAnchor($Author, 'Username');
echo UserPhoto($Author);
}
?>