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() {
106106 /**
107107 * Create or update a discussion.
108108 *
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
109113 * @since 2.0.0
110114 * @access public
111115 *
112- * @param int $categoryID Unique ID of the category to add the discussion to.
113116 */
114- public function discussion ($ categoryUrlCode = '' ) {
117+ public function discussion ($ categoryUrlCode = '' , $ announce = '' ) {
115118 // Override CategoryID if categories are disabled
116119 $ useCategories = $ this ->ShowCategorySelector = (bool )c ('Vanilla.Categories.Use ' );
117120 if (!$ useCategories ) {
@@ -185,6 +188,9 @@ public function discussion($categoryUrlCode = '') {
185188 $ this ->Form ->removeFormValue ('DiscussionID ' );
186189 // Make sure a group discussion doesn't get announced outside the groups category.
187190 $ formAnnounce = $ this ->Form ->_FormValues ['Announce ' ];
191+ if ($ announce && $ announce == 1 ) {
192+ $ this ->Form ->setFormValue ('Announce ' , '2 ' ); // Announce in a category only
193+ }
188194 // if (isset($formAnnounce) && $formAnnounce === '1') {
189195 // if (isset($this->Data['Group'])) {
190196 // $this->Form->setFormValue('Announce', '2');
You can’t perform that action at this time.
0 commit comments