File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
vanilla/applications/vanilla/controllers Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,15 @@ public function announceOptions() {
106
106
/**
107
107
* Create or update a discussion.
108
108
*
109
+ * @param string $categoryUrlCode
110
+ * @param bool $announce Used for a new discussion only,
111
+ * https://github.com/topcoder-platform/forums/issues/444
112
+ * @throws Gdn_UserException
109
113
* @since 2.0.0
110
114
* @access public
111
115
*
112
- * @param int $categoryID Unique ID of the category to add the discussion to.
113
116
*/
114
- public function discussion ($ categoryUrlCode = '' ) {
117
+ public function discussion ($ categoryUrlCode = '' , $ announce = '' ) {
115
118
// Override CategoryID if categories are disabled
116
119
$ useCategories = $ this ->ShowCategorySelector = (bool )c ('Vanilla.Categories.Use ' );
117
120
if (!$ useCategories ) {
@@ -185,6 +188,9 @@ public function discussion($categoryUrlCode = '') {
185
188
$ this ->Form ->removeFormValue ('DiscussionID ' );
186
189
// Make sure a group discussion doesn't get announced outside the groups category.
187
190
$ formAnnounce = $ this ->Form ->_FormValues ['Announce ' ];
191
+ if ($ announce && $ announce == 1 ) {
192
+ $ this ->Form ->setFormValue ('Announce ' , '2 ' ); // Announce in a category only
193
+ }
188
194
// if (isset($formAnnounce) && $formAnnounce === '1') {
189
195
// if (isset($this->Data['Group'])) {
190
196
// $this->Form->setFormValue('Announce', '2');
You can’t perform that action at this time.
0 commit comments