diff --git a/config/vanilla/bootstrap.before.php b/config/vanilla/bootstrap.before.php
index 7b7775a..86082a3 100644
--- a/config/vanilla/bootstrap.before.php
+++ b/config/vanilla/bootstrap.before.php
@@ -819,24 +819,33 @@ function writeInlineDiscussionOptions($discussionRow) {
echo '
';
echo '';
- // Write the items.
- static $items = [];
-
- // $canEdit = DiscussionModel::canEdit($discussionRow, $timeLeft);
- // if($canEdit) {
- // array_push($items, anchor(t('Edit'), '/post/editdiscussion/'.$discussionID));
- // }
-
- Gdn::controller()->EventArguments['Items'] = &$items;
- // Allow addons to work with items
- Gdn::controller()->fireEvent('InlineDiscussionOptionsRight');
- if (!empty($items) && is_array($items)) {
- array_walk($items, function(&$value, $key) {
- $value = ''.$value.'';
+ // Write the items.
+ // DropdownModule
+ $discussionDropdown = getDiscussionOptionsDropdown($discussionRow);
+
+ // Allow plugins to edit the dropdown.
+ $sender = Gdn::controller();
+ $sender->EventArguments['DiscussionOptions'] = &$discussionDropdown ;
+ $sender->EventArguments['Discussion'] = $discussionRow;
+ $sender->fireEvent('InlineDiscussionOptions');
+
+ $discussionDropdownItems = $discussionDropdown->toArray()['items'];
+
+ unset($discussionDropdownItems['announce']);
+ unset($discussionDropdownItems['sink']);
+ unset($discussionDropdownItems['close']);
+ unset($discussionDropdownItems['dismiss']);
+ unset($discussionDropdownItems['move']);
+ unset($discussionDropdownItems['tag']);
+
+ if (!empty($discussionDropdownItems) && is_array($discussionDropdownItems)) {
+ array_walk($discussionDropdownItems, function(&$value, $key) {
+ $anchor = anchor($value['text'], $value['url'], val('cssClass', $value, $key));
+ $value = ''.$anchor.'';
});
- echo implode('·', $items);
- }
+ echo implode('·', $discussionDropdownItems);
+ }
echo '
';
echo '';
@@ -849,31 +858,18 @@ function writeInlineCommentOptions($comment) {
Gdn::controller()->EventArguments['RecordID'] = $iD;
//Gdn_Theme::bulletRow();
echo '';
- echo '
';
-
- $commentOptions = getCommentOptions($comment);
- if (!empty($commentOptions) && is_array($commentOptions)) {
-
- array_walk($commentOptions, function(&$value, $key) {
- $anchor = anchor($value['Label'], $value['Url'], val('Class', $value, $key));
- $value = ''.$anchor.'';
- });
-
- echo implode('·', $commentOptions);
- }
- echo '
';
+ echo '
';
echo '
';
echo '
';
// Write the items.
- $items = null;
- Gdn::controller()->EventArguments['Comment'] = $comment;
- Gdn::controller()->EventArguments['Items'] = &$items;
- // Allow addons to work with items
- Gdn::controller()->fireEvent('InlineCommentOptionsRight');
+ $items = getCommentOptions($comment);
if (!empty($items) && is_array($items)) {
- array_walk($items, function(&$x) {$x = ''.$x.'';});
- echo implode('·', $items);
+ array_walk($items, function(&$value, $key) {
+ $anchor = anchor($value['Label'], $value['Url'], val('Class', $value, $key));
+ $value = ''.$anchor.'';
+ });
+ echo implode('·', $items);
}
echo '
';
echo '
';
diff --git a/vanilla/applications/vanilla/views/discussion/helper_functions.php b/vanilla/applications/vanilla/views/discussion/helper_functions.php
index bcd5394..5e3646b 100644
--- a/vanilla/applications/vanilla/views/discussion/helper_functions.php
+++ b/vanilla/applications/vanilla/views/discussion/helper_functions.php
@@ -121,27 +121,44 @@ function writeComment($comment, $sender, $session, $currentOffset) {
fireEvent('BeforeCommentMeta'); ?>