diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index d472e1d003..4345a5c770 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -10,6 +10,7 @@ HumHub Change Log - Enh: Add less options for mail font url/family (@rekollekt) - Fix: Fixed typo in space (un-)archived activities - Enh: Removed ErrorEvent which will be removed in yii-queue 3.0 (@acs-ferreira) +- Enh: Added config option to remove "user profile posts" entry from directory navigation 1.3.6 (October 11, 2018) diff --git a/protected/humhub/modules/directory/Module.php b/protected/humhub/modules/directory/Module.php index ad92fa1876..f9f89b1399 100644 --- a/protected/humhub/modules/directory/Module.php +++ b/protected/humhub/modules/directory/Module.php @@ -50,6 +50,12 @@ class Module extends \humhub\components\Module */ public $guestAccess = true; + /** + * @var bool show menu entry for user profile posts on directory + */ + public $showUserProfilePosts = true; + + /** * @return bool checks if the current user can access the directory */ diff --git a/protected/humhub/modules/directory/widgets/Menu.php b/protected/humhub/modules/directory/widgets/Menu.php index de2af285ed..c03ba1d7ca 100644 --- a/protected/humhub/modules/directory/widgets/Menu.php +++ b/protected/humhub/modules/directory/widgets/Menu.php @@ -8,6 +8,7 @@ namespace humhub\modules\directory\widgets; +use humhub\modules\directory\Module; use Yii; use yii\helpers\Url; @@ -26,6 +27,9 @@ class Menu extends \humhub\widgets\BaseMenu public function init() { + /** @var Module $module */ + $module = Yii::$app->getModule('directory'); + $this->addItemGroup([ 'id' => 'directory', 'label' => Yii::t('DirectoryModule.base', 'Directory menu'), @@ -58,13 +62,15 @@ class Menu extends \humhub\widgets\BaseMenu 'isActive' => (Yii::$app->controller->action->id == "spaces"), ]); - $this->addItem([ - 'label' => Yii::t('DirectoryModule.base', 'User profile posts'), - 'group' => 'directory', - 'url' => Url::to(['/directory/directory/user-posts']), - 'sortOrder' => 400, - 'isActive' => (Yii::$app->controller->action->id == "user-posts"), - ]); + if ($module->showUserProfilePosts) { + $this->addItem([ + 'label' => Yii::t('DirectoryModule.base', 'User profile posts'), + 'group' => 'directory', + 'url' => Url::to(['/directory/directory/user-posts']), + 'sortOrder' => 400, + 'isActive' => (Yii::$app->controller->action->id == "user-posts"), + ]); + } parent::init(); }