Skip to content

Commit 68d67e2

Browse files
authored
Merge pull request #651 from topcoder-platform/issues-648
Issues 648
2 parents afe370e + 5e21789 commit 68d67e2

File tree

7 files changed

+657
-377
lines changed

7 files changed

+657
-377
lines changed

config/vanilla/config.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$Configuration['Garden']['Installed'] = true;
44
//Embed
55
$Configuration['Garden']['Embed']['Allow'] = true;
6-
$Configuration['Garden']['Embed']['ForceForum'] = true;
6+
$Configuration['Garden']['Embed']['ForceForum'] = false;
77

88
$Configuration['Database']['Name'] = getenv('MYSQL_DATABASE');
99
$Configuration['Database']['Host'] = getenv('MYSQL_HOST');
@@ -71,10 +71,8 @@
7171
$Configuration['Garden']['ForceInputFormatter'] = false;
7272
$Configuration['Garden']['Version'] = 'Undefined';
7373
$Configuration['Garden']['CanProcessImages'] = true;
74-
// Default Topcoder Theme
75-
//$Configuration['Garden']['Theme'] = 'topcoder';
76-
// MFE Topcoder Theme
77-
$Configuration['Garden']['Theme'] = 'mfe-topcoder';
74+
// MFE Topcoder Theme 'mfe-topcoder'
75+
$Configuration['Garden']['Theme'] = 'topcoder';
7876
$Configuration['Garden']['MobileTheme'] = 'topcoder';
7977
$Configuration['Garden']['Profile']['EditPhotos'] = false;
8078
$Configuration['Garden']['SystemUserID'] = '1';

vanilla/applications/vanilla/controllers/class.vanillacontroller.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ protected function buildBreadcrumbs($CategoryID) {
9595
$Category = CategoryModel::categories($CategoryID);
9696
$ancestors = CategoryModel::getAncestors($CategoryID);
9797
$parentCategoryID = val('ParentCategoryID', $Category);
98+
// FIX https://github.com/topcoder-platform/forums/issues/648
99+
if(getIncomingValue('embed_type') == 'mfe') {
100+
if(val('GroupID', $Category) > 0) {
101+
$temp = [];
102+
foreach ($ancestors as $id => $ancestor) {
103+
if ($ancestor['GroupID'] > 0) {
104+
$temp[$ancestor['CategoryID']] = $ancestor;
105+
}
106+
}
107+
return $temp;
108+
}
109+
}
110+
98111
if(val('GroupID', $Category) > 0) {
99112
$challenge = $this->data('Challenge');
100113
$track = $challenge ? $challenge['Track']: false;

vanilla/applications/vanilla/views/categories/helper_functions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,13 @@ function writeListItem($category, $depth) {
191191
<div class="CategoryDescription">
192192
<?php echo val('Description', $category) ?>
193193
</div>
194+
<?php if(getIncomingValue('embed_type') != 'mfe') { ?>
194195
<div class="Challenge">
195196
<?php
196197
Gdn::controller()->fireEvent('AfterChallenge', ['Category' =>$category]);
197198
?>
198199
</div>
200+
<?php } ?>
199201
<div class="Meta">
200202
<?php if (val('LastTitle', $category) != '') { ?>
201203
<span class="MItem LastDiscussionTitle">

vanilla/applications/vanilla/views/discussions/index.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
if($this instanceof CategoriesController) {
4949
echo discussionSorts();
5050
}
51-
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
51+
52+
if(getIncomingValue('embed_type') != 'mfe') {
53+
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
54+
}
5255
echo '</div>';
5356
echo '<div class="PageControls Top">';
5457
PagerModule::write($PagerOptions);
@@ -65,7 +68,9 @@
6568

6669
echo '<div class="PageControls Bottom">';
6770
PagerModule::write($PagerOptions);
68-
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
71+
if(getIncomingValue('embed_type') != 'mfe') {
72+
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
73+
}
6974
echo '</div>';
7075

7176
} else {

0 commit comments

Comments
 (0)