Enh: Added configuration option to hide Activity sidebar widget on dashboard

This commit is contained in:
Lucas Bartholemy 2019-06-26 11:50:39 +02:00
parent 73f02ddb8b
commit fbf2659960
3 changed files with 34 additions and 4 deletions

View File

@ -13,6 +13,7 @@ HumHub Change Log
- Fix #3533: Responsive design issues
- Fix #3471: Display of Date Time Column in excel with empty/false value
- Fix #3581: Search form with GET causes repeated sticking of url parameters (@Bhoft)
- Enh: Added configuration option to hide Activity sidebar widget on dashboard
1.3.13 (May 3, 2019)

View File

@ -10,7 +10,7 @@ namespace humhub\modules\dashboard;
/**
* Dashboard Module
*
*
* @author Luke
*/
class Module extends \humhub\components\Module
@ -18,7 +18,7 @@ class Module extends \humhub\components\Module
/**
* Possible options to include profile posts into the dashboard stream
*
*
* Default/Null: Default, only include profile posts when user is followed
* Always: Always include all user profile posts into dashboards
* Admin Only: For admin users, always include all profile posts (without following)
@ -33,8 +33,15 @@ class Module extends \humhub\components\Module
/**
* @since 1.2.4
* @var string profile
* @var string profile
*/
public $autoIncludeProfilePosts = null;
/**
* @since 1.3.14
* @var boolean hides the activities sidebar widget
*/
public $hideActivitySidebarWidget = true;
}

View File

@ -8,12 +8,34 @@
namespace humhub\modules\dashboard\widgets;
use humhub\modules\activity\widgets\ActivityStreamViewer;
use humhub\modules\dashboard\Module;
use humhub\widgets\BaseSidebar;
use Yii;
/**
* Sidebar implements the dashboards sidebar
*/
class Sidebar extends BaseSidebar
{
/**
* @inheritDoc
*/
public function init()
{
parent::init();
/** @var Module $module */
$module = Yii::$app->getModule('dashboard');
if ($module->hideActivitySidebarWidget) {
foreach ($this->widgets as $k => $widget) {
if (isset($widget[0]) && $widget[0] === ActivityStreamViewer::class) {
unset($this->widgets[$k]);
}
}
}
}
}