mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Enh: Added config option to remove "user profile posts" entry from directory navigation
This commit is contained in:
parent
71306be738
commit
8daedb2b44
@ -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)
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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', '<strong>Directory</strong> 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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user