XOOPS  2.6.0
CommentsCommentRenderer Class Reference

Public Member Functions

 __construct (XoopsTpl $tpl, $use_icons=true, $do_iconcheck=false)
 
 renderFlatView ($admin_view=false)
 
 renderNestView ($comment_id=0, $admin_view=false)
 
 renderThreadView ($comment_id=0, $admin_view=false, $show_nav=true)
 
 setComments (&$comments_arr)
 

Static Public Member Functions

static getInstance (XoopsTpl $tpl, $use_icons=true, $do_iconcheck=false)
 

Private Member Functions

 _getPosterArray ($poster_id)
 
 _getPosterName ($poster_id)
 
 _getTitleIcon ($icon_image)
 
 _renderNestReplies (&$thread, $key, &$replies, $prefix, $admin_view, $depth=0)
 
 _renderThreadReplies (&$thread, $key, &$replies, $prefix, $admin_view, $depth=0, $current_prefix= '')
 

Private Attributes

 $_comments = array()
 
 $_doIconCheck = false
 
 $_statusText
 
 $_tpl
 
 $_useIcons = true
 

Detailed Description

Definition at line 27 of file commentrenderer.php.

Constructor & Destructor Documentation

CommentsCommentRenderer::__construct ( XoopsTpl  $tpl,
  $use_icons = true,
  $do_iconcheck = false 
)

Constructor

Parameters
XoopsTpl$tpl
boolean$use_icons
boolean$do_iconcheck

Definition at line 61 of file commentrenderer.php.

References $tpl, _MD_COMMENTS_ACTIVE, _MD_COMMENTS_HIDDEN, and _MD_COMMENTS_PENDING.

Member Function Documentation

CommentsCommentRenderer::_getPosterArray (   $poster_id)
private

Get an array with info about the poster

Parameters
int$poster_id
Returns
array private

Definition at line 383 of file commentrenderer.php.

References $avatar, $member_handler, $response, $user, $xoops, _MD_COMMENTS_ONLINE, Xoops_Locale_Abstract\formatTimestamp(), Xoops\getInstance(), and XoopsUserUtility\getUnameFromId().

Referenced by _renderNestReplies(), renderFlatView(), renderNestView(), and renderThreadView().

Here is the call graph for this function:

Here is the caller graph for this function:

CommentsCommentRenderer::_getPosterName (   $poster_id)
private

Get the name of the poster

Parameters
int$poster_id
Returns
array private

Definition at line 362 of file commentrenderer.php.

References $user, Xoops\getInstance(), and XoopsUserUtility\getUnameFromId().

Referenced by _renderThreadReplies().

Here is the call graph for this function:

Here is the caller graph for this function:

CommentsCommentRenderer::_getTitleIcon (   $icon_image)
private

Get the IMG tag for the title icon

Parameters
string$icon_image
Returns
string HTML IMG tag private

Definition at line 427 of file commentrenderer.php.

References XoopsLoad\fileExists(), XoopsBaseConfig\get(), and Xoops\getInstance().

Referenced by _renderNestReplies(), _renderThreadReplies(), renderFlatView(), renderNestView(), and renderThreadView().

Here is the call graph for this function:

Here is the caller graph for this function:

CommentsCommentRenderer::_renderNestReplies ( $thread,
  $key,
$replies,
  $prefix,
  $admin_view,
  $depth = 0 
)
private

Render replies in nested view

Parameters
array$thread
int$key
array$replies
string$prefix
bool$admin_view
integer$depthprivate

Definition at line 313 of file commentrenderer.php.

References $text, _getPosterArray(), _getTitleIcon(), _MD_COMMENTS_STATUS, and Xoops_Locale_Abstract\formatTimestamp().

Referenced by renderNestView().

Here is the call graph for this function:

Here is the caller graph for this function:

CommentsCommentRenderer::_renderThreadReplies ( $thread,
  $key,
$replies,
  $prefix,
  $admin_view,
  $depth = 0,
  $current_prefix = '' 
)
private

Render replies to a thread

Parameters
array$thread
int$key
array$replies
string$prefix
bool$admin_view
integer$depth
string$current_prefixprivate

Definition at line 216 of file commentrenderer.php.

References _getPosterName(), _getTitleIcon(), and Xoops_Locale_Abstract\formatTimestamp().

Referenced by renderThreadView().

Here is the call graph for this function:

Here is the caller graph for this function:

static CommentsCommentRenderer::getInstance ( XoopsTpl  $tpl,
  $use_icons = true,
  $do_iconcheck = false 
)
static

Access the only instance of this class

Parameters
XoopsTpl$tplreference to a XoopsTpl object
boolean$use_icons
boolean$do_iconcheck
Returns
CommentsCommentRenderer

Definition at line 82 of file commentrenderer.php.

Referenced by Comments\renderView().

Here is the caller graph for this function:

CommentsCommentRenderer::renderFlatView (   $admin_view = false)

Render the comments in flat view

Parameters
boolean$admin_view

Definition at line 110 of file commentrenderer.php.

References $i, $text, _getPosterArray(), _getTitleIcon(), _MD_COMMENTS_STATUS, and Xoops_Locale_Abstract\formatTimestamp().

Here is the call graph for this function:

CommentsCommentRenderer::renderNestView (   $comment_id = 0,
  $admin_view = false 
)

Render comments in nested view Danger: Recursive!

Parameters
integer$comment_idAlways "0" when called by client.
boolean$admin_view

Definition at line 260 of file commentrenderer.php.

References $text, _getPosterArray(), _getTitleIcon(), _MD_COMMENTS_STATUS, _renderNestReplies(), and Xoops_Locale_Abstract\formatTimestamp().

Here is the call graph for this function:

CommentsCommentRenderer::renderThreadView (   $comment_id = 0,
  $admin_view = false,
  $show_nav = true 
)

Render the comments in thread view This method calls itself recursively

Parameters
integer$comment_idShould be "0" when called by client
boolean$admin_view
boolean$show_nav

Definition at line 150 of file commentrenderer.php.

References $text, _getPosterArray(), _getTitleIcon(), _MD_COMMENTS_PARENT, _MD_COMMENTS_STATUS, _MD_COMMENTS_TOP, _renderThreadReplies(), and Xoops_Locale_Abstract\formatTimestamp().

Here is the call graph for this function:

CommentsCommentRenderer::setComments ( $comments_arr)

Accessor

Parameters
array$comments_arrarray of XoopsComment objects

Definition at line 97 of file commentrenderer.php.

Member Data Documentation

CommentsCommentRenderer::$_comments = array()
private

Definition at line 37 of file commentrenderer.php.

CommentsCommentRenderer::$_doIconCheck = false
private

Definition at line 47 of file commentrenderer.php.

CommentsCommentRenderer::$_statusText
private

Definition at line 52 of file commentrenderer.php.

CommentsCommentRenderer::$_tpl
private

Definition at line 32 of file commentrenderer.php.

CommentsCommentRenderer::$_useIcons = true
private

Definition at line 42 of file commentrenderer.php.


The documentation for this class was generated from the following file: