diff --git a/config/vanilla/bootstrap.before.php b/config/vanilla/bootstrap.before.php
index 807402d..ba8da80 100644
--- a/config/vanilla/bootstrap.before.php
+++ b/config/vanilla/bootstrap.before.php
@@ -374,6 +374,10 @@ function watchIcon($hasWatched = false, $title='') {
* @return string
*/
function watchButton($category, $isHijackButton = true) {
+ if(hideInMFE()){
+ return '';
+ }
+
$output = ' ';
$userID = Gdn::session()->UserID;
if(is_numeric($category)) {
diff --git a/vanilla/applications/vanilla/controllers/class.vanillacontroller.php b/vanilla/applications/vanilla/controllers/class.vanillacontroller.php
index fe8be00..1ffa42a 100644
--- a/vanilla/applications/vanilla/controllers/class.vanillacontroller.php
+++ b/vanilla/applications/vanilla/controllers/class.vanillacontroller.php
@@ -96,7 +96,12 @@ protected function buildBreadcrumbs($CategoryID) {
$ancestors = CategoryModel::getAncestors($CategoryID);
$parentCategoryID = val('ParentCategoryID', $Category);
// FIX https://github.com/topcoder-platform/forums/issues/648
- if(getIncomingValue('embed_type') == 'mfe') {
+
+ $showFullBreadcrumbs = true;
+ $this->EventArguments['ShowFullBreadcrumbs'] = & $showFullBreadcrumbs;
+ $this->fireEvent('BeforeBuildBreadcrumbs');
+ // getIncomingValue('embed_type') == 'mfe'
+ if(!$showFullBreadcrumbs) {
if(val('GroupID', $Category) > 0) {
$temp = [];
foreach ($ancestors as $id => $ancestor) {
diff --git a/vanilla/applications/vanilla/views/categories/helper_functions.php b/vanilla/applications/vanilla/views/categories/helper_functions.php
index 50476c8..8648128 100644
--- a/vanilla/applications/vanilla/views/categories/helper_functions.php
+++ b/vanilla/applications/vanilla/views/categories/helper_functions.php
@@ -178,7 +178,9 @@ function writeListItem($category, $depth) {
@@ -191,13 +193,9 @@ function writeListItem($category, $depth) {
-
-
fireEvent('AfterChallenge', ['Category' =>$category]);
?>
-
-
@@ -537,6 +535,11 @@ function getWriteChildrenMethod($category, $depth) {
*/
function followButton($categoryID) {
$output = ' ';
+
+ if(hideInMFE()) {
+ return $output;
+ }
+
$userID = Gdn::session()->UserID;
$category = CategoryModel::categories($categoryID);
diff --git a/vanilla/applications/vanilla/views/discussion/helper_functions.php b/vanilla/applications/vanilla/views/discussion/helper_functions.php
index 7b622a7..dae4be8 100644
--- a/vanilla/applications/vanilla/views/discussion/helper_functions.php
+++ b/vanilla/applications/vanilla/views/discussion/helper_functions.php
@@ -502,11 +502,13 @@ function getCommentOptions($comment) {
);
$canSelfDelete = ($canEdit && $session->UserID == $comment->InsertUserID && c('Vanilla.Comments.AllowSelfDelete'));
if ($canDelete || $canSelfDelete) {
- $options['DeleteComment'] = [
- 'Label' => t('Delete'),
- 'Url' => '/discussion/deletecomment/'.$comment->CommentID.'/'.$session->transientKey().'/?Target='.urlencode("/discussion/{$comment->DiscussionID}/x"),
- 'Class' => 'DeleteComment'
- ];
+ if(!hideInMFE()) {
+ $options['DeleteComment'] = [
+ 'Label' => t('Delete'),
+ 'Url' => '/discussion/deletecomment/' . $comment->CommentID . '/' . $session->transientKey() . '/?Target=' . urlencode("/discussion/{$comment->DiscussionID}/x"),
+ 'Class' => 'DeleteComment'
+ ];
+ }
}
// DEPRECATED (as of 2.1)
diff --git a/vanilla/applications/vanilla/views/discussions/helper_functions.php b/vanilla/applications/vanilla/views/discussions/helper_functions.php
index 435346a..a0150eb 100644
--- a/vanilla/applications/vanilla/views/discussions/helper_functions.php
+++ b/vanilla/applications/vanilla/views/discussions/helper_functions.php
@@ -70,6 +70,10 @@ function bookmarkButton($discussion) {
return '';
}
+ if(hideInMFE()) {
+ return '';
+ }
+
// Bookmark link
// FIX : https://github.com/topcoder-platform/forums/issues/577
// If User is watching a category then show it as bookmarked
diff --git a/vanilla/applications/vanilla/views/discussions/index.php b/vanilla/applications/vanilla/views/discussions/index.php
index 68bddae..9c8c8ba 100644
--- a/vanilla/applications/vanilla/views/discussions/index.php
+++ b/vanilla/applications/vanilla/views/discussions/index.php
@@ -49,7 +49,7 @@
echo discussionSorts();
}
-if(getIncomingValue('embed_type') != 'mfe') {
+if(!hideInMFE()) {
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
}
echo '
';
@@ -68,7 +68,7 @@
echo '
';
PagerModule::write($PagerOptions);
- if(getIncomingValue('embed_type') != 'mfe') {
+ if(!hideInMFE()) {
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
}
echo '
';
diff --git a/vanilla/library/core/class.theme.php b/vanilla/library/core/class.theme.php
index 3d0991f..d882355 100644
--- a/vanilla/library/core/class.theme.php
+++ b/vanilla/library/core/class.theme.php
@@ -59,7 +59,7 @@ public static function assetEnd() {
*/
public static function breadcrumbs($data, $homeLink = true, $options = []) {
// FIX https://github.com/topcoder-platform/forums/issues/648
- if(getIncomingValue('embed_type') == 'mfe') {
+ if(hideInMFE()) {
$homeLink = false;
}
$format = '
{Name,html}';