35 lines
923 B
PHP
Executable File
35 lines
923 B
PHP
Executable File
<?php
|
|
|
|
namespace Evoweb\EwBase\Hooks;
|
|
|
|
/*
|
|
* This file is developed by evoWeb.
|
|
*
|
|
* It is free software; you can redistribute it and/or modify it under
|
|
* the terms of the GNU General Public License, either version 2
|
|
* of the License, or any later version.
|
|
*
|
|
* For the full copyright and license information, please read the
|
|
* LICENSE.txt file that was distributed with this source code.
|
|
*/
|
|
|
|
class PageLayoutView
|
|
{
|
|
public function contentIsUsed(array $params): bool
|
|
{
|
|
return $params['used'] || $this->findCTypeBegin($params['record']['CType']);
|
|
}
|
|
|
|
public function findCTypeBegin($cType): bool
|
|
{
|
|
$found = false;
|
|
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['ew_base']['ContentUsedStrings'] ?? [] as $search) {
|
|
if (str_contains($cType, $search)) {
|
|
$found = true;
|
|
break;
|
|
}
|
|
}
|
|
return $found;
|
|
}
|
|
}
|