Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Delegate Request (Search Results Rendering)

edited September 2008 in Vanilla 1.0 Help
I am adding some functionality to my CommunityModeration extension that requires two delegates to be added. These both end up in the SearchForm class. Here is a patch against r741: Index: themes/search_results_comments.php =================================================================== --- themes/search_results_comments.php (revision 741) +++ themes/search_results_comments.php (working copy) @@ -22,7 +22,11 @@ <li class="CommentAdded"> <span>'.$this->Context->GetDefinition('Added').'</span> '.TimeDiff($this->Context, $Comment->DateCreated,mktime()).' - </li> + </li>'; +$this->DelegateParameters['Comment'] = &$Comment; +$this->DelegateParameters['CommentList'] = &$CommentList; +$this->CallDelegate('PostCommentOptionsRender'); +$CommentList .= ' </ul> </li> '; Index: themes/search_results_users.php =================================================================== --- themes/search_results_users.php (revision 741) +++ themes/search_results_users.php (working copy) @@ -23,7 +23,12 @@ </li> <li class="User CommentsAdded"> <span>'.$this->Context->GetDefinition('CommentsAdded').'</span> '.$u->CountComments.' - </li> + </li>'; +$this->DelegateParameters['User'] = &$u; +$this->DelegateParameters['UserList'] = &$UserList; +$this->CallDelegate('PostUserOptionsRender'); + +$UserList .= ' </ul> </li>';

Comments

  • I could not use your patch (I wish we add a way to get user's patches):

    Index: themes/search_results_comments.php =================================================================== --- themes/search_results_comments.php (revision 741) +++ themes/search_results_comments.php (working copy) @@ -22,7 +22,12 @@ <li class="CommentAdded"> <span>'.$this->Context->GetDefinition('Added').'</span> '.TimeDiff($this->Context, $Comment->DateCreated,mktime()).' - </li> + </li>'; +$this->DelegateParameters['Comment'] = &$Comment; +$this->DelegateParameters['CommentList'] = &$CommentList; +$this->CallDelegate('PostCommentOptionsRender'); + +$CommentList .= ' </ul> </li> '; Index: themes/search_results_users.php =================================================================== --- themes/search_results_users.php (revision 741) +++ themes/search_results_users.php (working copy) @@ -23,7 +23,12 @@ </li> <li class="User CommentsAdded"> <span>'.$this->Context->GetDefinition('CommentsAdded').'</span> '.$u->CountComments.' - </li> + </li>'; +$this->DelegateParameters['User'] = &$u; +$this->DelegateParameters['UserList'] = &$UserList; +$this->CallDelegate('PostUserOptionsRender'); + +$UserList .= ' </ul> </li>';

    Is it what you wanted?
  • I should have quotified it to get the indentation right. Yes, that is what I wanted. Thank you. :)
  • Of course, a Pre*OptionsRender on both of those could also make sense for others. I only happened to need the Post*OptionsRender for each.
  • added Vanilla r742
  • Thank you!
This discussion has been closed.