Skip to content

Commit

Permalink
Merge branch 'release-12.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Dec 4, 2024
2 parents dc7f814 + ebd60bf commit 3fb5208
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use oat\taoItems\scripts\install\RegisterAssetTreeBuilder;
use oat\taoItems\scripts\install\RegisterItemPreviewerRegistryService;
use oat\taoItems\scripts\install\SetupEventListeners;
use oat\taoItems\scripts\install\SetupSectionVisibilityFilters;

/*
* @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
Expand Down Expand Up @@ -70,6 +71,7 @@
RegisterAssetTreeBuilder::class,
SetRolesPermissions::class,
SetupEventListeners::class,
SetupSectionVisibilityFilters::class
],
],
'update' => taoItems_scripts_update_Updater::class,
Expand Down
45 changes: 45 additions & 0 deletions scripts/install/SetupSectionVisibilityFilters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2024 (original work) Open Assessment Technologies SA.
*/

declare(strict_types=1);

namespace oat\taoItems\scripts\install;

use oat\oatbox\extension\InstallAction;
use oat\tao\model\menu\SectionVisibilityFilter;

class SetupSectionVisibilityFilters extends InstallAction
{
public function __invoke($params)
{
/** @var SectionVisibilityFilter $sectionVisibilityFilter */
$sectionVisibilityFilter = $this->getServiceManager()->get(SectionVisibilityFilter::SERVICE_ID);
$sectionVisibilityFilter->showSectionByFeatureFlag(
$sectionVisibilityFilter->createSectionPath(
[
'manage_items',
'item-translate'
]
),
'FEATURE_FLAG_TRANSLATION_ENABLED'
);
$this->getServiceManager()->register(SectionVisibilityFilter::SERVICE_ID, $sectionVisibilityFilter);
}
}

0 comments on commit 3fb5208

Please sign in to comment.