diff --git "a/datasets/olds/chameleon_base_dataset20230530-1918.csv.bak" "b/datasets/olds/chameleon_base_dataset20230530-1918.csv.bak" deleted file mode 100644--- "a/datasets/olds/chameleon_base_dataset20230530-1918.csv.bak" +++ /dev/null @@ -1,44984 +0,0 @@ -classname,description,code -TCMSCronjob_ClearAtomicLocks,* @return void,"public function _ExecuteCron() - { - $this->clearTable(); - }" -ChameleonSystemAtomicLockExtension,"* {@inheritDoc} - * - * @return void","public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); - $loader->load('services.xml'); - }" -AtomicLock,"* The AtomicLock Class allows you to acquire a temporary lock bound to an id/key. - * The way you should use it is as follow:. - * - * $oAtomicLock = new AtomicLock(); - * $oLock = $oAtomicLock->acquireLock(""mykey""); - * if(null === $oLock){ - * // already locked from another process - * } else { - * // do lockworthy stuff - * $oLock->release(); - * } - * - * The Lock is being acquired atomically, so there will always be only one lock - * per given id. - * - * There is a CronJob, that currently kills all locks every 10 minutes. - * This should not be the final solution, as it possible, that in a - * very unlikely case, the atomic nature will break because of this.","public function getKeyForObject($oObject) - { - return md5(serialize($oObject)); - }" -AtomicLock,* @var string,"public function acquireLock($key) - { - if (null !== $this->key) { - return null; - }" -AtomicLock,* @var string,"public function release() - { - if (null === $this->key) { - return false; - }" -AutoclassesCacheWarmer,* @var AutoclassesDatabaseAdapterInterface,"public function __construct( - AutoclassesManagerInterface $autoClassManager, - AutoclassesDatabaseAdapterInterface $databaseAdapter, - AutoclassesMapGeneratorInterface $autoclassesMapGenerator, - IPkgCmsFileManager $filemanager, - $cacheDir, - ContainerInterface $container - ) - { - $this->autoClassManager = $autoClassManager; - $this->databaseAdapter = $databaseAdapter; - $this->autoclassesMapGenerator = $autoclassesMapGenerator; - $this->fileManager = $filemanager; - $this->cacheDir = $cacheDir; - \ChameleonSystem\CoreBundle\ServiceLocator::setContainer($container); - }" -AutoclassesCacheWarmer,* @var AutoclassesManagerInterface,"public function warmUp(string $cacheDirectory) - { - $this->updateAllTables(); - - return []; - }" -AutoclassesCacheWarmer,* @var AutoclassesMapGeneratorInterface,"public function isOptional() - { - return false; - }" -AutoclassesCacheWarmer,* @var IPkgCmsFileManager,"public function updateTableById($id) - { - $tablename = $this->databaseAdapter->getTableNameForId($id); - if (null !== $tablename) { - $this->updateTableByName($tablename); - }" -AutoclassesCacheWarmer,* @var string,"public function updateTableByName($tablename) - { - $classesToCreate = $this->getClassListForTableName($tablename); - foreach ($classesToCreate as $classToCreate) { - $this->autoClassManager->create($classToCreate, $this->cacheDir); - }" -AutoclassesCacheWarmer,"* @param AutoclassesManagerInterface $autoClassManager - * @param AutoclassesDatabaseAdapterInterface $databaseAdapter - * @param AutoclassesMapGeneratorInterface $autoclassesMapGenerator - * @param IPkgCmsFileManager $filemanager - * @param string $cacheDir","public function updateAllTables() - { - $targetDir = $this->cacheDir; - $autoclassesExistedBefore = false; - if (file_exists($targetDir)) { - $targetDir = $this->createTempCacheDir(); - $autoclassesExistedBefore = true; - }" -AutoclassesCacheWarmer,"* @param string $id - * - * @return void","public function getTableClassNamesToLoad() - { - // get all table classes - $result = $this->databaseAdapter->getTableClassList(); - - $convertedList = array(); - foreach ($result as $bareClassName) { - $classNames = $this->getClassListForTableName($bareClassName); - $convertedList = array_merge($convertedList, $classNames); - }" -AutoclassesCacheWarmer,"* @param string $tablename - * - * @return void","public function regenerateClassmap($targetDir = null) - { - if (null === $targetDir) { - $targetDir = $this->cacheDir; - }" -AutoclassesDatabaseAdapter,* @var Connection,"public function setConnection(Connection $conn) - { - $this->conn = $conn; - }" -AutoclassesDatabaseAdapter,* {@inheritdoc},"public function getTableClassList() - { - $all = $this->conn->fetchAllAssociative('SELECT `name` from `cms_tbl_conf`'); - - return $this->getNamesArray($all); - }" -AutoclassesDatabaseAdapter,* {@inheritdoc},"public function getVirtualClassList() - { - $all = $this->conn->fetchAllAssociative('SELECT `name_of_entry_point` as \'name\' FROM `pkg_cms_class_manager`'); - - return $this->getNamesArray($all); - }" -AutoclassesDatabaseAdapter,* {@inheritdoc},"public function getTableNameForId($id) - { - $result = $this->conn->fetchAllAssociative('SELECT `name` from `cms_tbl_conf` WHERE id=:id', array('id' => $id)); - if (0 === count($result)) { - return null; - }" -,"* @param Connection $conn - * - * @return void","public function setConnection(Connection $conn); - - /** - * @return string[] - */ - public function getTableClassList(); - - /** - * @return string[] - */ - public function getVirtualClassList(); - - /** - * @param string $id - * @return string|null - */ - public function getTableNameForId($id); -}" -AutoclassesManager,* {@inheritdoc},"public function __construct(Connection $databaseConnection, IPkgCmsFileManager $filemanager, \TPkgCmsVirtualClassManager $virtualClassManager, AutoclassesDataAccessInterface $autoClassDataAccess) - { - $this->registerHandler(new TPkgCoreAutoClassHandler_TableClass($databaseConnection, $filemanager, $autoClassDataAccess)); - $this->registerHandler(new TPkgCoreAutoClassHandler_TPkgCmsClassManager($databaseConnection, $filemanager, $virtualClassManager)); - }" -AutoclassesManager,* @var TPkgCoreAutoClassHandler_AbstractBase[],"public function registerHandler(IPkgCmsCoreAutoClassHandler $handler) - { - $this->handlerList[] = $handler; - }" -AutoclassesManager,"* to prevent infinite recursion we push each class being processed onto the callstack - and pop it back out when it has been generated. - * - * @var array","public function create($classname, $targetDir) - { - $classCreated = false; - if (true === $this->isInCallStack($classname)) { - throw new TPkgCmsCoreAutoClassManagerException_Recursion($classname, $this->callStack, __FILE__, __LINE__); - }" -requested,"* AutoclassesManagerInterface defines a service that manages the creation of Chameleon autoclasses. - * It delegates the actual work to registered handlers.","public function create($classname, $targetDir); - - /** - * Registers a handler that is able to create autoclasses of a certain type. - * - * @param IPkgCmsCoreAutoClassHandler $handler - * - * @return void - */ - public function registerHandler(IPkgCmsCoreAutoClassHandler $handler); -}" -AutoclassesMapGenerator,* {@inheritdoc},"public function generateAutoclassesMap($autoclassesDir) - { - return $this->getClassesFromDirectory($autoclassesDir); - }" -map,* Interface AutoclassesMapGeneratorInterface defines a service that generates a class map for Chameleon autoclasses.,"public function generateAutoclassesMap($autoclassesDir); -}" -GenerateAutoclassesCommand,* Class GenerateAutoclassesCommand Creates autoclasses from the console.,"public function __construct(AutoclassesCacheWarmer $autoclassesCacheWarmer) - { - parent::__construct('chameleon_system:autoclasses:generate'); - $this->autoclassesCacheWarmer = $autoclassesCacheWarmer; - }" -AutoclassesDataAccess,* @var Connection,"public function __construct(Connection $connection) - { - $this->connection = $connection; - }" -AutoclassesDataAccess,* @param Connection $connection,"public function getTableExtensionData() - { - $data = array(); - $query = 'SELECT * - FROM `cms_tbl_extension` - ORDER BY `position` DESC'; - $statement = $this->connection->executeQuery($query); - while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { - $data[$row['cms_tbl_conf_id']][] = $row; - }" -AutoclassesDataAccess,* {@inheritdoc},"public function getFieldData() - { - $data = array(); - $query = 'SELECT `cms_field_conf`.*, `cms_tbl_conf`.`name` AS tablename - FROM `cms_field_conf` - INNER JOIN `cms_tbl_conf` ON `cms_field_conf`.`cms_tbl_conf_id` = `cms_tbl_conf`.`id` - ORDER BY `position` ASC'; - $statement = $this->connection->executeQuery($query); - $fieldTypes = array(); - while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { - $tableConfId = $row['cms_tbl_conf_id']; - if (false === isset($data[$tableConfId])) { - $data[$tableConfId] = new TIterator(); - }" -AutoclassesDataAccess,* {@inheritdoc},"public function getConfig() - { - $cmsConfig = new TCMSConfig(); - $cmsConfig->Load(1); - - return $cmsConfig; - }" -AutoclassesDataAccess,@var $field TCMSField,"public function getTableOrderByData() - { - $data = array(); - - $query = 'SELECT `name`, `sort_order_direction`, `cms_tbl_conf_id` - FROM `cms_tbl_display_orderfields` - ORDER BY `position` ASC'; - $statement = $this->connection->executeQuery($query); - - while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { - $tableConfId = $row['cms_tbl_conf_id']; - if (false === isset($data[$tableConfId])) { - $data[$tableConfId] = array(); - }" -AutoclassesDataAccess,* {@inheritdoc},"public function getTableConfigData() - { - $data = array(); - - $query = 'SELECT * - FROM `cms_tbl_conf`'; - $statement = $this->connection->executeQuery($query); - while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { - $data[$row['id']] = $row; - }" -is,"* Returns contents of the cms_tbl_extension table. - * - * @return array","public function getTableExtensionData(); - - /** - * Returns contents of the cms_field_conf table as well as the table name the respective field. - * - * @return array - */ - public function getFieldData(); - - /** - * Returns a TCMSConfig instance (not a TdbCmsConfig instance because we cannot expect that this class is already - * generated when this method is called). - * - * @return TCMSConfig - */ - public function getConfig(); - - /** - * Returns contents of the cms_tbl_display_orderfields table (some fields only). - * - * @return array - */ - public function getTableOrderByData(); - - /** - * Returns contents of the cms_tbl_conf table. - * - * @return array - */ - public function getTableConfigData(); -}" -AutoclassesRequestCacheDataAccess,* @var AutoclassesDataAccessInterface,"public function __construct(AutoclassesDataAccessInterface $decorated) - { - $this->decorated = $decorated; - }" -AutoclassesRequestCacheDataAccess,* @var array,"public function clearCache() - { - $this->tableExtensionData = null; - $this->fieldData = null; - $this->config = null; - $this->tableOrderByData = null; - $this->tableConfigData = null; - }" -AutoclassesRequestCacheDataAccess,* @var array,"public function getTableExtensionData() - { - if (null === $this->tableExtensionData) { - $this->tableExtensionData = $this->decorated->getTableExtensionData(); - }" -AutoclassesRequestCacheDataAccess,* @var TCMSConfig,"public function getFieldData() - { - if (null === $this->fieldData) { - $this->fieldData = $this->decorated->getFieldData(); - }" -AutoclassesRequestCacheDataAccess,* @var array,"public function getConfig() - { - if (null === $this->config) { - $this->config = $this->decorated->getConfig(); - }" -AutoclassesRequestCacheDataAccess,* @var array,"public function getTableOrderByData() - { - if (null === $this->tableOrderByData) { - $this->tableOrderByData = $this->decorated->getTableOrderByData(); - }" -AutoclassesRequestCacheDataAccess,* @param AutoclassesDataAccessInterface $decorated,"public function getTableConfigData() - { - if (null === $this->tableConfigData) { - $this->tableConfigData = $this->decorated->getTableConfigData(); - }" -ChameleonSystemAutoclassesExtension,* @return void,"public function load(array $config, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); - $loader->load('services.xml'); - }" -TPkgCmsCoreAutoClassManagerException_Recursion,* @var string|null,"public function __construct($sNameOfClassAttemptedToGenerate, $aClassCallStack, $filename, $lineno) - { - $this->sNameOfClassAttemptedToGenerate = $sNameOfClassAttemptedToGenerate; - $this->aClassCallStack = $aClassCallStack; - parent::__construct($this->generateMessageFromCallDetails(), 0, E_USER_ERROR, $filename, $lineno); - }" -definition,"* create the auto class. - * - * @param string $sClassName - * @param string $targetDir - * - * @return void","public function create($sClassName, $targetDir); - - /** - * converts the key under which the auto class definition is stored into the class name which the key stands for. - * - * @param string $sKey - * - * @return string - */ - public function getClassNameFromKey($sKey); - - /** - * returns true if the auto class handler knows how to handle the class name passed. - * - * @param string $sClassName - * - * @return bool - */ - public function canHandleClass($sClassName); - - /** - * return an array holding classes the handler is responsible for. - * - * @return array - */ - public function getClassNameList(); - - /** - * resets the internal cache (e.g. for the glue mapping) - * Call this when recreating classes. - * - * @return void - */ - public function resetInternalCache(); -}" -TPkgCoreAutoClassHandler_AbstractBase,* @var mixed,"public function __construct(Connection $databaseConnection, IPkgCmsFileManager $filemanager) - { - $this->databaseConnection = $databaseConnection; - $this->filemanager = $filemanager; - }" -TPkgCoreAutoClassHandler_AbstractBase,* @var null|array,"public function resetInternalCache() - { - $this->aClassMapping = null; - $this->aClassExtensionList = null; - $this->aClassNameList = null; - }" -TPkgCoreAutoClassHandler_TableClass,* {@inheritdoc},"public function create($sClassName, $targetDir) - { - $tableConfId = $this->getTableConfIdForClassName($sClassName); - if (null === $tableConfId) { - return; - }" -TPkgCoreAutoClassHandler_TableClass,"* @param string $className - * - * @return int|string|null","public function __construct(Connection $databaseConnection, IPkgCmsFileManager $filemanager, AutoclassesDataAccessInterface $autoClassesDataAccess) - { - parent::__construct($databaseConnection, $filemanager); - $this->autoClassesDataAccess = $autoClassesDataAccess; - }" -TPkgCoreAutoClassHandler_TableClass,"* @param string $tableName - * - * @return string|null","public function getClassNameFromKey($sKey) - { - return TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $sKey); - }" -TPkgCoreAutoClassHandler_TableClass,"* converts the key under which the auto class definition is stored into the class name which the key stands for. - * - * @param string $sKey - * - * @return string","public function canHandleClass($sClassName) - { - $bIsTdbObject = (TCMSTableToClass::PREFIX_CLASS == substr( - $sClassName, - 0, - strlen(TCMSTableToClass::PREFIX_CLASS) - )); - if (true === $bIsTdbObject) { - return true; - }" -TPkgCoreAutoClassHandler_TableClass,"* returns true if the auto class handler knows how to handle the class name passed. - * - * @param string $sClassName - * - * @return bool","public function getClassNameList() - { - if (null === $this->aClassNameList) { - $this->aClassNameList = array(); - $query = 'SELECT `name` FROM `cms_tbl_conf` ORDER BY `cmsident`'; - $tRes = $this->getDatabaseConnection()->query($query); - while ($aRow = $tRes->fetch(\PDO::FETCH_NUM)) { - $this->aClassNameList[] = $this->getClassNameFromKey($aRow[0]); - }" -TPkgCoreAutoClassHandler_TPkgCmsClassManager,* {@inheritdoc},"public function __construct(Connection $databaseConnection, IPkgCmsFileManager $filemanager, \TPkgCmsVirtualClassManager $virtualClassManager) - { - parent::__construct($databaseConnection, $filemanager); - $this->virtualClassManager = $virtualClassManager; - }" -TPkgCoreAutoClassHandler_TPkgCmsClassManager,"* converts the key under which the auto class definition is stored into the class name which the key stands for. - * - * @param string $sKey - * - * @return string|false","public function create($sClassName, $targetDir) - { - $virtualClassManager = clone $this->virtualClassManager; - - if (true === $virtualClassManager->load($sClassName)) { - $virtualClassManager->UpdateVirtualClasses($targetDir); - return; - }" -TPkgCoreAutoClassHandler_TPkgCmsClassManager,@psalm-suppress InvalidArrayOffset,"public function getClassNameFromKey($sKey) - { - $sClassName = false; - $query = 'SELECT `name_of_entry_point` FROM `pkg_cms_class_manager` WHERE `id` = :key'; - if ($aClass = $this->getDatabaseConnection()->fetchAssociative($query, array('key' => $sKey))) { - /** @psalm-suppress InvalidArrayOffset */ - $sClassName = $aClass[0]; - }" -TPkgCoreAutoClassHandler_TPkgCmsClassManager,"* returns true if the auto class handler knows how to handle the class name passed. - * - * @param string $sClassName - * - * @return bool","public function canHandleClass($sClassName) - { - $aClassList = $this->getClassNameList(); - $bClassExists = in_array($sClassName, $aClassList); - if ($bClassExists) { - return true; - }" -TPkgCoreAutoClassHandler_TPkgCmsClassManager,* @return array,"public function getClassNameList() - { - if (null === $this->aClassNameList) { - $this->aClassNameList = array(); - $query = 'SELECT `name_of_entry_point` FROM `pkg_cms_class_manager` ORDER BY `cmsident`'; - try { - $tRes = $this->getDatabaseConnection()->query($query); - - while ($aRow = $tRes->fetch(\PDO::FETCH_NUM)) { - $this->aClassNameList[] = $aRow[0]; - }" -RequestListener,* @var string,"public function __construct($autoclassesDir, AutoclassesCacheWarmer $cacheWarmer, RequestInfoServiceInterface $requestInfoService) - { - $this->autoclassesDir = $autoclassesDir; - $this->cacheWarmer = $cacheWarmer; - $this->requestInfoService = $requestInfoService; - }" -RequestListener,* @var \ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesCacheWarmer,"public function checkAutoclasses(RequestEvent $evt) - { - if (HttpKernelInterface::MAIN_REQUEST !== $evt->getRequestType()) { - return; - }" -AutoclassesCacheWarmerTest,@var AutoclassesCacheWarmer,"public function it_updates_single_tables_by_id() - { - /** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ - $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); - /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ - $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); - /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ - $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); - $adapter - ->getTableNameForId('123') - ->willReturn( - 'foo_table' - ) - ; - /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ - $filemanager = $this->prophesize('\IPkgCmsFileManager'); - $cacheDir = __DIR__.'/cache/'; - /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ - $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); - $autoclassesMapGenerator - ->generateAutoclassesMap($cacheDir) - ->willReturn(array( - 'TestClass' => 'TestType', - )); - - $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); - - $this->warmer->updateTableById('123'); - - $manager->create('TdbFooTable', $cacheDir)->shouldHaveBeenCalled(); - $manager->create('TdbFooTableList', $cacheDir)->shouldHaveBeenCalled(); - $manager->create('TAdbFooTable', $cacheDir)->shouldHaveBeenCalled(); - $manager->create('TAdbFooTableList', $cacheDir)->shouldHaveBeenCalled(); - }" -AutoclassesCacheWarmerTest,* @test,"public function it_updates_single_tables_by_name() - { - /** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ - $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); - /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ - $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); - /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ - $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); - /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ - $filemanager = $this->prophesize('\IPkgCmsFileManager'); - - $cacheDir = __DIR__.'/cache/'; - - /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ - $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); - $autoclassesMapGenerator - ->generateAutoclassesMap($cacheDir) - ->willReturn(array( - 'TestClass' => 'TestType', - )); - - $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); - - $this->warmer->updateTableByName('foo_table'); - - $manager->create('TdbFooTable', $cacheDir)->shouldHaveBeenCalled(); - $manager->create('TdbFooTableList', $cacheDir)->shouldHaveBeenCalled(); - $manager->create('TAdbFooTable', $cacheDir)->shouldHaveBeenCalled(); - $manager->create('TAdbFooTableList', $cacheDir)->shouldHaveBeenCalled(); - }" -AutoclassesCacheWarmerTest,@var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container,"public function it_ignores_nonexistant_tables() - { - /** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ - $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); - /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ - $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); - $adapter - ->getTableNameForId('123') - ->willReturn( - null - ); - /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ - $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); - /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ - $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); - /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ - $filemanager = $this->prophesize('\IPkgCmsFileManager'); - $cacheDir = ''; - - $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); - - $this->warmer->updateTableById('123'); - - $manager->create(Argument::any(), $cacheDir)->shouldNotHaveBeenCalled(); - }" -AutoclassesCacheWarmerTest,@var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy,"public function it_converts_underscore_names_to_autoclass_names() - { - /** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ - $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); - /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ - $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); - /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ - $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); - $adapter - ->getTableClassList() - ->willReturn( - array( - 'foo_bar', - 'bar_baz', - 'a_b_cx', - ) - ); - $adapter - ->getVirtualClassList() - ->willReturn( - array( - 'vfoo_bar', - 'vbar_baz', - 'va_b_cx', - ) - ); - /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ - $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); - /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ - $filemanager = $this->prophesize('\IPkgCmsFileManager'); - $cacheDir = ''; - - $expected = array( - 'virtualClasses' => array( - 'vfoo_bar', - 'vbar_baz', - 'va_b_cx', - ), - 'tableClasses' => array( - 'TdbFooBar', - 'TAdbFooBar', - 'TdbFooBarList', - 'TAdbFooBarList', - 'TdbBarBaz', - 'TAdbBarBaz', - 'TdbBarBazList', - 'TAdbBarBazList', - 'TdbABCx', - 'TAdbABCx', - 'TdbABCxList', - 'TAdbABCxList', - ), - ); - - $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); - - $result = $this->warmer->getTableClassNamesToLoad(); - $this->assertEquals($expected, $result); - }" -AutoclassesCacheWarmerTest,@var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy,"public function it_should_warm_the_complete_cache() - { - /** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ - $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); - /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ - $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); - $adapter - ->getTableClassList() - ->willReturn( - array( - 'foo_bar', - ) - ); - $adapter - ->getVirtualClassList() - ->willReturn( - array( - 'vfoo_bar', - ) - ); - /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ - $filemanager = $this->prophesize('\IPkgCmsFileManager'); - $cacheDir = __DIR__.'/cache/'; - $tempCacheDir = __DIR__.'/cach_/'; - /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ - $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); - $autoclassesMapGenerator - ->generateAutoclassesMap($tempCacheDir) - ->willReturn(array( - 'TestClass' => 'TestType', - )); - - /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ - $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); - - $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); - - $this->warmer->updateAllTables(); - - $manager->create('TdbFooBar', $tempCacheDir)->shouldHaveBeenCalled(); - $manager->create('TAdbFooBar', $tempCacheDir)->shouldHaveBeenCalled(); - $manager->create('TdbFooBarList', $tempCacheDir)->shouldHaveBeenCalled(); - $manager->create('TAdbFooBarList', $tempCacheDir)->shouldHaveBeenCalled(); - $manager->create('vfoo_bar', $tempCacheDir)->shouldHaveBeenCalled(); - - rmdir($tempCacheDir); - }" -AutoclassesMapGeneratorTest,* @var AutoclassesMapGenerator,"public function it_should_generate_a_complete_autoclasses_classmap() - { - $cacheDir = __DIR__.'/cache/'; - - $actual = $this->mapGenerator->generateAutoclassesMap($cacheDir); - - $expected = array(); - $expected['TestClass'] = 'TestType'; - - $this->assertEquals($expected, $actual); - }" -RequestListenerTest,* @test,"public function it_generates_autoclasses_if_there_arent_any() - { - $cacheWarmer = $this->getCacheWarmerProphet(); - $evt = $this->getResponseEventProphet(HttpKernelInterface::MAIN_REQUEST, RequestTypeInterface::REQUEST_TYPE_BACKEND); - $infoService = $this->getRequestInfoService(true); - $listener = new RequestListener(__DIR__.'/fixtures/nonexistantdir', $cacheWarmer->reveal(), $infoService); - $listener->checkAutoclasses($evt->reveal()); - $cacheWarmer->updateAllTables()->shouldHaveBeenCalled(); - $this->assertTrue(true); - }" -RequestListenerTest,* @test,"public function it_leaves_existing_autoclasses_alone() - { - $cacheWarmer = $this->getCacheWarmerProphet(); - $evt = $this->getResponseEventProphet(HttpKernelInterface::MAIN_REQUEST, RequestTypeInterface::REQUEST_TYPE_BACKEND); - $infoService = $this->getRequestInfoService(true); - $listener = new RequestListener(__DIR__.'/fixtures/autoclasses', $cacheWarmer->reveal(), $infoService); - $listener->checkAutoclasses($evt->reveal()); - $cacheWarmer->updateAllTables()->shouldNotHaveBeenCalled(); - $this->assertTrue(true); - }" -RequestListenerTest,* @test,"public function it_only_checks_on_master_request() - { - $cacheWarmer = $this->getCacheWarmerProphet(); - $evt = $this->getResponseEventProphet(HttpKernelInterface::SUB_REQUEST, RequestTypeInterface::REQUEST_TYPE_BACKEND); - $infoService = $this->getRequestInfoService(true); - $listener = new RequestListener(__DIR__.'/fixtures/nonexistantdir', $cacheWarmer->reveal(), $infoService); - $listener->checkAutoclasses($evt->reveal()); - $cacheWarmer->updateAllTables()->shouldNotHaveBeenCalled(); - $this->assertTrue(true); - }" -RequestListenerTest,* @test,"public function it_only_runs_on_backend_request() - { - $cacheWarmer = $this->getCacheWarmerProphet(); - $evt = $this->getResponseEventProphet(HttpKernelInterface::MAIN_REQUEST, RequestTypeInterface::REQUEST_TYPE_FRONTEND); - $infoService = $this->getRequestInfoService(false); - $listener = new RequestListener(__DIR__.'/fixtures/nonexistantdir', $cacheWarmer->reveal(), $infoService); - $listener->checkAutoclasses($evt->reveal()); - $cacheWarmer->updateAllTables()->shouldNotHaveBeenCalled(); - $this->assertTrue(true); - }" -TPkgCmsActionPluginManager,"* @var array|null","public function __construct(TCMSActivePage $oActivePage) - { - $this->oActivePage = $oActivePage; - }" -TPkgCmsActionPluginManager,* @var TCMSActivePage|null,"public function actionPluginExists($sPluginName) - { - $aPluginList = $this->getActionPluginList(); - - return isset($aPluginList[$sPluginName]); - }" -TPkgCmsActionPluginManager,"* @param string $sPluginName - * - * @return bool","public function callAction($sPluginName, $sActionName, $aParameter) - { - $oPlugin = $this->getActionPlugin($sPluginName); - - if (false === method_exists($oPlugin, $sActionName) || false === is_callable(array($oPlugin, $sActionName))) { - throw new TPkgCmsActionPluginException_ActionNotPublic('action ""'.$sActionName.'"" does not exists', 0, E_USER_WARNING, __FILE__, __LINE__); - }" -TPkgCmsActionPlugin_ChangeLanguage,"* @param array $data - * - * @return void","public function changeLanguage(array $data) - { - $languageIso = isset($data['l']) ? $data['l'] : ''; - if (empty($languageIso)) { - return; - }" -BackendSession,@var CmsUserModel $user,"public function __construct( - readonly private RequestStack $requestStack, - readonly private Security $security, - readonly private Connection $connection, - readonly private LanguageServiceInterface $languageService - ) { - }" -BackendSession,@var CmsUserModel $user,"public function getCurrentEditLanguageId(): string - { - - $iso = $this->getCurrentEditLanguageIso6391(); - if (null === $iso) { - return $this->languageService->getCmsBaseLanguageId(); - }" -BackendSession,@var CmsUserModel $user,"public function getCurrentEditLanguageIso6391(): ?string - { - $session = $this->getSession(); - if (null === $session) { - return null; - }" -ChameleonSystemCmsBackendExtension,* @return void,"public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../config/')); - $loader->load('services.xml'); - }" -ClearChameleonCacheCommand,* @var CacheInterface,"public function __construct(CacheInterface $cache, $name = null) - { - parent::__construct($name); - - $this->cache = $cache; - }" -ChameleonSystemCmsCacheExtension,* @return void,"public function load(array $configs, ContainerBuilder $container) - { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); - $loader->load('services.xml'); - - $active = $container->getParameter('chameleon_system_core.cache.memcache_activate'); - if ($active) { - $cacheDefinition = $container->getDefinition('chameleon_system_cms_cache.cache'); - $cacheDefinition->replaceArgument(2, $container->getDefinition('chameleon_system_cms_cache.storage.memcache')); - }" -Cache,* @var RequestStack,"public function __construct( - RequestStack $requestStack, - Connection $dbConnection, - StorageInterface $oCacheStorage, - $cacheKeyPrefix, - $cacheAllowed, - HashInterface $hashArray, - RequestStateHashProviderInterface $requestStateHashProvider - ) { - $this->setRequestStack($requestStack); - $this->setDbConnection($dbConnection); - $this->setStorage($oCacheStorage); - $this->cacheKeyPrefix = $cacheKeyPrefix; - $this->cacheAllowed = $cacheAllowed; - $this->hashArray = $hashArray; - $this->requestStateHashProvider = $requestStateHashProvider; - }" -Cache,* @var Connection,"public function setStorage(StorageInterface $oCacheStorage) - { - $this->storage = $oCacheStorage; - }" -Cache,* @var StorageInterface|null,"public function disable() - { - $this->isActive = false; - }" -Cache,* @var bool,"public function enable() - { - $this->isActive = true; - }" -Cache,* @var string,"public function isActive() - { - return $this->cacheAllowed && $this->isActive; - }" -Cache,* @var bool,"public function get($key) - { - if (false === $this->isActive()) { - return null; - }" -Cache,* @var HashInterface,"public function set($key, $content, $trigger, $iMaxLiveInSeconds = null) - { - if (false === $this->isActive()) { - return; - }" -Cache,* @var RequestStateHashProviderInterface,"public function delete($key) - { - if (false === $this->isActive()) { - return false; - }" -Cache,"* @param RequestStack $requestStack - * @param Connection $dbConnection - * @param StorageInterface $oCacheStorage - * @param string $cacheKeyPrefix - * @param bool $cacheAllowed - * @param HashInterface $hashArray - * @param RequestStateHashProviderInterface $requestStateHashProvider","public function clearAll() - { - if (false === $this->isActive()) { - return; - }" -Cache,"* @param StorageInterface $oCacheStorage - * - * @return void","public function callTrigger($table, $id = null) - { - if (CHAMELEON_CACHE_ENABLE_CACHE_INFO === false) { - return; - }" -Cache,* {@inheritdoc},"public function getKey($aParameters, $addStateKey = true) - { - if ($addStateKey) { - $aParameters['__state'] = [ - self::REQUEST_STATE_HASH => $this->requestStateHashProvider->getHash($this->requestStack->getCurrentRequest()), - ]; - }" -Cache,* {@inheritdoc},"public function setRequestStack(RequestStack $requestStack) - { - $this->requestStack = $requestStack; - }" -Cache,* {@inheritdoc},"public function setDbConnection(Connection $dbConnection) - { - $this->dbConnection = $dbConnection; - }" -,"* allows you to disable caching during runtime. - * - * @return void","public function disable(); - - /** - * enable caching during runtime. - * - * @return void - */ - public function enable(); - - /** - * @return bool - */ - public function isActive(); - - /** - * return the contents for the key identified by $key - * returns null if the key is not found. - * - * @param string $key - key generated with GetKey - * - * @return mixed|null - returns the cache object or null if not found - */ - public function get($key); - - /** - * adds or updates a cache object. - * - * @param string $key - the cache key - * @param mixed $content - content to be stored - * @param array $trigger - cache trigger array(array('table'=>'','id'=>''),array('table'=>'','id'=>''),...); - * @param int $iMaxLiveInSeconds - max age in seconds before the cache content expires - default = 30 days - * - * @return void - */ - public function set($key, $content, $trigger, $iMaxLiveInSeconds = null); - - /** - * removes a cache object by key. - * - * @param string $key - * - * @return bool - */ - public function delete($key); - - /** - * Clears the whole cache. Operation is permitted even if caching is disabled. - * - * @return void - */ - public function clearAll(); - - /** - * removes all cached objects based on table and optional record id. - * - * @param string $table - * @param int|string $id - * - * @return void - */ - public function callTrigger($table, $id = null); - - /** - * returns a cache key for given parameter array. - * - * @param array $aParameters - * @param bool $addStateKey - * - * @return string - * - * @throws \InvalidArgumentException if the key cannot be created with the given parameters - */ - public function getKey($aParameters, $addStateKey = true); -}" -,"* @param string $key - * - * @return string|null","public function get($key); - - /** - * @param string $key - * @param mixed $value - * @param int $expireInSeconds - * - * @return bool - */ - public function set($key, $value, $expireInSeconds = 0); - - /** - * @param string $key - * - * @return bool - */ - public function delete($key); - - /** - * @return bool - */ - public function clearAll(); -}" -Memcache,* @var \TCMSMemcache,"public function __construct(\TCMSMemcache $memcache) - { - $this->memcache = $memcache; - }" -Memcache,* {@inheritdoc},"public function get($key) - { - $content = $this->memcache->Get($key); - if (true === $this->memcache->getLastGetRequestReturnedNoMatch()) { - return null; - }" -Memcache,* {@inheritdoc},"public function delete($key) - { - return $this->memcache->Delete($key); - }" -Memcache,* {@inheritdoc},"public function clearAll() - { - return $this->memcache->Flush(); - }" -Memcache,* {@inheritdoc},"public function set($key, $value, $expireInSeconds = 0) - { - return $this->memcache->Set($key, $value, $expireInSeconds); - }" -NullStorage,* {@inheritdoc},"public function get($key) - { - return null; - }" -NullStorage,* {@inheritdoc},"public function delete($key) - { - return true; - }" -NullStorage,* {@inheritdoc},"public function clearAll() - { - return true; - }" -NullStorage,* {@inheritdoc},"public function set($key, $value, $expireInSeconds = 0) - { - return true; - }" -TdbCmsLanguage,* @var Cache,"public function it_creates_cache_key() - { - $this->cache->disable(); - $params = [ - 'foo' => 'bar', - 'foo2' => 'bar2', - ]; - $expectedParams = $params; - $expectedParams['__uniqueIdentity'] = null; - $expected = \md5(\json_encode($expectedParams)); - $result = $this->cache->getKey($params, false); - $this->assertEquals($expected, $result); - }" -TdbCmsLanguage,* @test,"public function it_works_with_special_chars() - { - $this->cache->disable(); - $params = [ - 'foo2' => '中国 农业', - 'foo' => 'bar', - ]; - $expectedParams = $params; - $expectedParams['__uniqueIdentity'] = null; - $expected = \md5(\json_encode($expectedParams)); - $result = $this->cache->getKey($params, false); - $this->assertEquals($expected, $result); - }" -TPkgCmsCaptcha,"* factory creates a new instance and returns it. - * - * @param string|array $sData - either the id of the object to load, or the row with which the instance should be initialized - * @param string $sLanguage - init with the language passed - * - * @return TdbPkgCmsCaptcha","public function GenerateNewCaptchaImage($sIdentifier, $aParameter = array()) - { - $iLength = 6; - $iWidth = 120; - $iHeight = 40; - if (array_key_exists('l', $aParameter)) { - $iLength = intval($aParameter['l']); - }" -TPkgCmsCaptcha,"* returns the path to TTF font file, that is used for the captcha. - * - * @return string","public function CodeIsValid($sIdentifier, $sCode) - { - $sCodeInSession = TdbPkgCmsCaptcha::GetCodeFromSession($sIdentifier); - if (false === $sCodeInSession) { - return false; - }" -TPkgCmsCaptcha,"* generates the captcha image and outputs it. - * - * @param string $sIdentifier - * @param array $aParameter - * - * @return void","public function getHTMLSnippet($sIdentifier) - { - return ''; - }" -TPkgCmsCaptcha,* @return bool,"public function GetRequestURL($sIdentifier, $aParameter = array()) - { - $sURL = '/'.self::URL_IDENTIFIER.'/'.$this->sqlData['cmsident'].'/'.$sIdentifier; - $aParameter['rnd'] = rand(1000000, 9999999); - if (count($aParameter) > 0) { - $sURL .= '?'.TTools::GetArrayAsURL($aParameter); - }" -TPkgCmsCaptcha_TextFieldJavascriptHidden,"* return true if the code in session was submitted in user data AND is empty - * note: the code will be removed from session. - * - * @param string $sIdentifier - * @param string $sCode will be ignored by this type of captcha and shall be passed as empty string - * - * @return bool","public function CodeIsValid($sIdentifier, $sCode) - { - $sCodeFromSession = TdbPkgCmsCaptcha::GetCodeFromSession($sIdentifier); - if (false === $sCodeFromSession) { - return false; - }" -TPkgCmsCaptcha_TextFieldJavascriptHidden,"* generates a code for an identifier only once within one session call. - * - * @param string $sIdentifier - * @param int $iCharacters will be ignored by this type of captcha - * - * @return string","public function getHTMLSnippet($sIdentifier) - { - $sIdentifier = $this->GenerateCode($sIdentifier, 10); - $sHTML = ' - ', $this->global->GetStaticURLToWebLib('/javascript/jsTree/3.3.8/jstree.js')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/navigationTree.js')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jquery/cookie/jquery.cookie.js')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jsTree/3.3.8/themes/default/style.css')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jsTree/customStyles/style.css')); - - return $includes; - }" -NavigationTree,* @var string,"public function _GetCacheParameters() - { - $parameters = parent::_GetCacheParameters(); - - if (false === is_array($parameters)) { - $parameters = []; - }" -NavigationTreeSingleSelect,"* The mysql tablename of the tree. - * - * @var string","public function __construct( - InputFilterUtilInterface $inputFilterUtil, - UrlUtil $urlUtil, - BackendTreeNodeFactory $backendTreeNodeFactory, - TranslatorInterface $translator, - TTools $tools, - TGlobal $global, - FieldTranslationUtil $fieldTranslationUtil, - BackendSessionInterface $backendSession - ) { - $this->inputFilterUtil = $inputFilterUtil; - $this->urlUtil = $urlUtil; - $this->backendTreeNodeFactory = $backendTreeNodeFactory; - $this->translator = $translator; - $this->tools = $tools; - $this->global = $global; - $this->fieldTranslationUtil = $fieldTranslationUtil; - $this->editLanguage = \TdbCmsLanguage::GetNewInstance($backendSession->getCurrentEditLanguageId()); - }" -NavigationTreeSingleSelect,* @var InputFilterUtilInterface,"public function Init() - { - parent::Init(); - - $portalSelectMode = $this->inputFilterUtil->getFilteredGetInput('portalSelectMode', ''); - - // variables are needed in module functions: - $this->isPortalSelectMode = 'portalSelect' === $portalSelectMode; - $this->isPortalHomeNodeSelectMode = 'portalHomePage' === $portalSelectMode; // also 404-page-selection - // NOTE the selection of ""Page not found"" for a portal is handled special (old) with TCMSFieldPortalHomeTreeNode. - // The ""normal"" selection of a tree node anywhere (i. e. for system pages) is handled with TCMSFieldTreeNode. - - $this->isSelectModeForPage = 'true' === $this->inputFilterUtil->getFilteredGetInput('selectModeForPage', 'false'); - }" -NavigationTreeSingleSelect,* @var TranslatorInterface,"public function Accept(\IMapperVisitorRestricted $visitor, $cachingEnabled, \IMapperCacheTriggerRestricted $cacheTriggerManager) - { - $fieldName = $this->inputFilterUtil->getFilteredGetInput('fieldName', ''); - $this->activeNodeId = $this->inputFilterUtil->getFilteredGetInput('id', ''); - $portalSelectMode = $this->inputFilterUtil->getFilteredGetInput('portalSelectMode', ''); - $visitor->SetMappedValue('portalSelectMode', $portalSelectMode); - $isSelectModeForPage = false; - - $pagedef = $this->inputFilterUtil->getFilteredGetInput('pagedef', 'navigationTreeSingleSelect'); - if ('' !== $portalSelectMode) { - $tableNameForUpdate = 'cms_portal'; - $currentRecordId = $this->inputFilterUtil->getFilteredGetInput('portalId', ''); - }" -NavigationTreeSingleSelect,* @var UrlUtil,"public function GetHtmlHeadIncludes() - { - $includes = parent::GetHtmlHeadIncludes(); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jsTree/3.3.8/jstree.js')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/navigationTree.js')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jquery/cookie/jquery.cookie.js')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jsTree/3.3.8/themes/default/style.css')); - $includes[] = sprintf('', $this->global->GetStaticURLToWebLib('/javascript/jsTree/customStyles/style.css')); - - return $includes; - }" -NavigationTreeSingleSelectWysiwyg,* {@inheritdoc},"public function __construct( - InputFilterUtilInterface $inputFilterUtil, - UrlUtil $urlUtil, - BackendTreeNodeFactory $backendTreeNodeFactory, - TranslatorInterface $translator, - TTools $tools, - TGlobal $global, - FieldTranslationUtil $fieldTranslationUtil, - BackendSessionInterface $backendSession, - RequestStack $requestStack - ) { - parent::__construct( - $inputFilterUtil, - $urlUtil, - $backendTreeNodeFactory, - $translator, - $tools, - $global, - $fieldTranslationUtil, - $backendSession - ); - $this->requestStack = $requestStack; - }" -NavigationTreeSingleSelectWysiwyg,* @var RequestStack,"public function Accept(\IMapperVisitorRestricted $visitor, $cachingEnabled, \IMapperCacheTriggerRestricted $cacheTriggerManager) - { - parent::Accept($visitor, $cachingEnabled, $cacheTriggerManager); - $request = $this->requestStack->getCurrentRequest(); - if (null === $request) { - return; - }" -CustomMenuItemProvider,* {@inheritdoc},"public function createMenuItem(\TdbCmsMenuItem $menuItem): ?MenuItem - { - $customItem = new \TdbCmsMenuCustomItem($menuItem->fieldTarget); - - if (false === $this->isItemAccessAllowed($customItem)) { - return null; - }" -MenuCategory,* @var string,"public function __construct(string $id, string $name, string $iconFontCssClass, array $menuItems) - { - $this->id = $id; - $this->name = $name; - $this->iconFontCssClass = $iconFontCssClass; - $this->menuItems = $menuItems; - }" -MenuCategory,* @var string,"public function getId(): string - { - return $this->id; - }" -MenuCategory,* @var string,"public function getName(): string - { - return $this->name; - }" -MenuCategory,* @var MenuItem[],"public function getIconFontCssClass(): string - { - return $this->iconFontCssClass; - }" -MenuCategory,"* @param string $id - * @param string $name - * @param string $iconFontCssClass - * @param MenuItem[] $menuItems","public function getMenuItems(): array - { - return $this->menuItems; - }" -MenuItem,* @var string,"public function __construct(string $id, string $name, string $icon, string $url) - { - $this->name = $name; - $this->icon = $icon; - $this->url = $url; - $this->id = $id; - }" -MenuItem,* @var string,"public function getName(): string - { - return $this->name; - }" -MenuItem,* @var string,"public function getIcon(): string - { - return $this->icon; - }" -MenuItem,* @var string,"public function getUrl(): string - { - return $this->url; - }" -MenuItemFactory,* @var MenuItemProviderInterface[],"public function addMenuItemProvider(string $type, MenuItemProviderInterface $menuItemProvider): void - { - $this->menuItemProviders[$type] = $menuItemProvider; - }" -MenuItemFactory,* {@inheritdoc},"public function createMenuItem(\TdbCmsMenuItem $menuItem): ?MenuItem - { - $targetType = $menuItem->GetFieldTargetObjectType(); - if (false === \array_key_exists($targetType, $this->menuItemProviders)) { - return null; - }" -,"* Creates a new menu item based on the passed database menu item. - * Might return null, e.g. if the current user does not have permission to view this menu item. - * - * @param \TdbCmsMenuItem $menuItem - * - * @return MenuItem|null","public function createMenuItem(\TdbCmsMenuItem $menuItem): ?MenuItem; -}" -,* Provides a shared interface for different types of menu items.,"public function createMenuItem(\TdbCmsMenuItem $menuItem): ?MenuItem; -}" -ModuleMenuItemProvider,* {@inheritdoc},"public function createMenuItem(\TdbCmsMenuItem $menuItem): ?MenuItem - { - $cmsModule = new \TdbCmsModule($menuItem->fieldTarget); - - if (false === $this->isModuleAccessAllowed($cmsModule)) { - return null; - }" -SidebarBackendModule,* @var UrlUtil,"public function __construct( - UrlUtil $urlUtil, - RequestStack $requestStack, - InputFilterUtilInterface $inputFilterUtil, - ResponseVariableReplacerInterface $responseVariableReplacer, - MenuItemFactoryInterface $menuItemFactory, - TranslatorInterface $translator, - UserMenuItemDataAccessInterface $userMenuItemDataAccess - ) { - parent::__construct(); - - $this->urlUtil = $urlUtil; - $this->requestStack = $requestStack; - $this->inputFilterUtil = $inputFilterUtil; - $this->responseVariableReplacer = $responseVariableReplacer; - $this->menuItemFactory = $menuItemFactory; - $this->translator = $translator; - $this->userMenuItemDataAccess = $userMenuItemDataAccess; - }" -SidebarBackendModule,* @var RequestStack,"public function Init() - { - parent::Init(); - $this->restoreDisplayState(); - }" -SidebarBackendModule,* @var InputFilterUtilInterface,"public function Accept(\IMapperVisitorRestricted $visitor, $cachingEnabled, \IMapperCacheTriggerRestricted $cacheTriggerManager) - { - $visitor->SetMappedValue('sidebarToggleCategoryNotificationUrl', $this->getNotificationUrl('toggleCategoryOpenState')); - $visitor->SetMappedValue('sidebarElementClickNotificationUrl', $this->getNotificationUrl('reportElementClick')); - $visitor->SetMappedValue('menuItems', $this->getMenuItems()); - - if (true === $cachingEnabled) { - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $cacheTriggerManager->addTrigger('cms_tbl_conf', null); - $cacheTriggerManager->addTrigger('cms_module', null); - $cacheTriggerManager->addTrigger('cms_user', $securityHelper->getUser()?->getId()); - $cacheTriggerManager->addTrigger('cms_menu_category', null); - $cacheTriggerManager->addTrigger('cms_menu_item', null); - }" -SidebarBackendModule,* @var ResponseVariableReplacerInterface,"public function GetHtmlHeadIncludes() - { - $includes = parent::GetHtmlHeadIncludes(); - $includes[] = sprintf('', - \TGlobal::GetPathTheme()); - - return $includes; - }" -SidebarBackendModule,* @var MenuItemFactoryInterface,"public function GetHtmlFooterIncludes() - { - $includes = parent::GetHtmlFooterIncludes(); - $includes[] = sprintf('', - \TGlobal::GetStaticURLToWebLib('/javascript/modules/sidebar/sidebar.js')); - - return $includes; - }" -SidebarBackendModule,* @var TranslatorInterface,"public function _AllowCache() - { - return true; - }" -SidebarBackendModule,* @var UserMenuItemDataAccessInterface,"public function _GetCacheParameters() - { - $parameters = parent::_GetCacheParameters(); - - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $user = $securityHelper->getUser(); - - if (null !== $user) { - $parameters['cmsUserId'] = $user->getId(); - $parameters['backendLanguageId'] = $user->getCmsLanguageId(); - - $session = $this->getSession(); - if (null !== $session) { - $parameters['sessionId'] = $session->getId(); - }" -TableMenuItemProvider,* {@inheritdoc},"public function createMenuItem(\TdbCmsMenuItem $menuItem): ?MenuItem - { - $tableConf = \TdbCmsTblConf::GetNewInstance(); - $loadSuccess = $tableConf->Load($menuItem->fieldTarget); - - if (false === $loadSuccess) { - return null; - }" -StaticViewModule,"* Can be used to display static information in the backend. The module requires the additional module config parameter - * ""targetView"" containing the path to the view to be displayed (relative to snippets-cms). This path name may contain a - * ""[{language}]"" placeholder. If present, this placeholder will be replaced with the current display language.","public function __construct(LanguageServiceInterface $languageService) - { - parent::__construct(); - $this->languageService = $languageService; - }" -StaticViewModule,* @var LanguageServiceInterface,"public function Accept(\IMapperVisitorRestricted $visitor, $cachingEnabled, \IMapperCacheTriggerRestricted $cacheTriggerManager) - { - $targetView = $this->aModuleConfig['targetView']; - $targetLanguage = $this->languageService->getActiveLanguage()->fieldIso6391; - $targetView = \str_replace('[{language}" -ActivateMaintenanceModeCommand,* @var MaintenanceModeServiceInterface,"public function __construct(MaintenanceModeServiceInterface $maintenanceModeService) - { - parent::__construct('chameleon_system:maintenance_mode:activate'); - - $this->maintenanceModeService = $maintenanceModeService; - }" -CountUpdateCommand,* Console command for counting updates that have not been executed yet.,"public function __construct($name = null) - { - parent::__construct('chameleon_system:update:count'); - }" -DeactivateMaintenanceModeCommand,* @var MaintenanceModeServiceInterface,"public function __construct(MaintenanceModeServiceInterface $maintenanceModeService) - { - parent::__construct('chameleon_system:maintenance_mode:deactivate'); - - $this->maintenanceModeService = $maintenanceModeService; - }" -DisableCronjobsCommand,* @var CronjobEnablingServiceInterface,"public function __construct(CronjobEnablingServiceInterface $cronjobEnablingService) - { - parent::__construct('chameleon_system:cronjobs:disable'); - - $this->cronjobEnablingService = $cronjobEnablingService; - }" -EnableCronjobsCommand,* @var CronjobEnablingServiceInterface,"public function __construct(CronjobEnablingServiceInterface $cronjobEnablingService) - { - parent::__construct('chameleon_system:cronjobs:enable'); - - $this->cronjobEnablingService = $cronjobEnablingService; - }" -GetCronjobsStateCommand,* @var CronjobStateServiceInterface,"public function __construct(CronjobStateServiceInterface $cronjobStateService) - { - parent::__construct('chameleon_system:cronjobs:state_check'); - - $this->cronjobStateService = $cronjobStateService; - }" -ListUpdateCommand,* Console command for listing updates that have not been executed yet.,"public function __construct($name = null) - { - parent::__construct('chameleon_system:update:list'); - }" -RunUpdateCommand,* Console command for executing updates.,"public function __construct(CacheInterface $cache, AutoclassesCacheWarmer $autoclassesCacheWarmer) - { - parent::__construct('chameleon_system:update:run'); - $this->cache = $cache; - $this->autoclassesCacheWarmer = $autoclassesCacheWarmer; - }" -HtmlHelper,* @var OutputInterface,"public function __construct(OutputInterface $output) - { - $style = new OutputFormatterStyle('red', null, array('bold')); - $output->getFormatter()->setStyle('header', $style); - - $this->output = $output; - }" -HtmlHelper,* @var array,"public function render($html = null) - { - if (null !== $html) { - $this->computeHtml($html); - }" -ChameleonBackendController,* @var BackendAccessCheck,"public function getResponse() - { - $request = $this->getRequest(); - $pagedef = $this->getInputFilterUtil()->getFilteredInput('pagedef', $this->homePagedef); - $request->attributes->set('pagedef', $pagedef); - - $this->backendAccessCheck->assertAccess(); - - return $this->GeneratePage($pagedef); - }" -ChameleonBackendController,* @var string,"public function HandleRequest($pagedef) - { - $oCMSConfig = \TdbCmsConfig::GetInstance(); - if (!$oCMSConfig) { // sometimes config comes corrupted from cache then reload config from db - $oCMSConfig = \TdbCmsConfig::GetInstance(true); - }" -ChameleonBackendController,* {@inheritdoc},"public function setBackendAccessCheck($backendAccessCheck) - { - $this->backendAccessCheck = $backendAccessCheck; - }" -ChameleonBackendController,"* check if ip of user is in ip white list of cms config - * but only if a white list or the config constant x is set. - * - * The entry point into the controller. It will render a page given a - * pagedefinition file. If no definition file is passed, it will use - * ""default"" as the active definition file - * - * @param string $pagedef - The name of the page definition file to render. - * Notice that only the name should be passed. The location of - * the definition file is defined in the config.inc.php file loaded - * in TGlobal (PATH_PAGE_DEFINITIONS) - * - * @return void","public function setHomePagedef(string $homePagedef): void - { - $this->homePagedef = $homePagedef; - }" -ChameleonController,* @var AuthenticityTokenManagerInterface,"public function __construct( - RequestStack $requestStack, - EventDispatcherInterface $eventDispatcher, - DataAccessCmsMasterPagedefInterface $dataAccessCmsMasterPagedef, - TModuleLoader $moduleLoader, - IViewPathManager $viewPathManager = null - ) { - $this->requestStack = $requestStack; - $this->moduleLoader = $moduleLoader; - $this->moduleLoader->setController($this); - $this->viewPathManager = $viewPathManager; - $this->eventDispatcher = $eventDispatcher; - $this->dataAccessCmsMasterPagedef = $dataAccessCmsMasterPagedef; - }" -ChameleonController,* @var RequestStack,"public function __invoke() - { - $event = new ChameleonControllerInvokeEvent($this); - $this->eventDispatcher->dispatch($event, ChameleonControllerEvents::INVOKE); - - $pagedef = $this->getRequest()->attributes->get('pagedef'); - $this->handleRequest($pagedef); - - return $this->getResponse(); - }" -ChameleonController,* @var CacheInterface,"public function setGlobal($global) - { - $this->global = $global; - }" -ChameleonController,* @var TGlobal,"public function SetBlockAutoFlushToBrowser($bBlockAutoFlushToBrowser) - { - $this->bBlockAutoFlushToBrowser = $bBlockAutoFlushToBrowser; - }" -ChameleonController,* @var TModuleLoader,"public function getBlockAutoFlushToBrowser() - { - return $this->bBlockAutoFlushToBrowser; - }" -ChameleonController,"* @var array - * - * @deprecated since 6.3.0 - not used anymore","public function setCache(CacheInterface $cache) - { - $this->cache = $cache; - }" -ChameleonController,* @var array,"public function GetPagedefObject($pagedef) - { - /** @var $oPageDefinitionFile TCMSPageDefinitionFile */ - $oPageDefinitionFile = new TCMSPageDefinitionFile(); - $fullPageDefPath = $this->PageDefinitionFile($pagedef); - $pagePath = substr($fullPageDefPath, 0, -strlen($pagedef.'.pagedef.php')); - - if (!$oPageDefinitionFile->Load($pagedef, $pagePath)) { - $oPageDefinitionFile = false; - }" -ChameleonController,* @var array,"public function PreOutputCallbackFunction($sPageContent) - { - static $bHeaderParsed = false; - TPkgCmsEventManager::GetInstance()->NotifyObservers( - TPkgCmsEvent::GetNewInstance($this, TPkgCmsEvent::CONTEXT_CORE, TPkgCmsEvent::NAME_PRE_OUTPUT_CALLBACK_FUNCTION, array('sPageContent' => $sPageContent))); - - if (!$bHeaderParsed) { - // parse and replace header includes, call resource collection - $sPageContent = $this->injectHeaderIncludes($sPageContent); - }" -ChameleonController,"* @var string - * - * @deprecated since 6.3.0 - not used anymore","public function PreOutputCallbackFunctionReplaceCustomVars($sPageContent) - { - return $this->responseVariableReplacer->replaceVariables($sPageContent); - }" -ChameleonController,* @var bool,"public function FlushContentToBrowser($bEnableAutoFlush = false) - { - if (false === CHAMELEON_ENABLE_FLUSHING && !TGlobal::IsCMSMode()) { - return; - }" -ChameleonController,* @var IViewPathManager,"public function AddHTMLFooterLine($sLine) - { - if (!in_array($sLine, $this->aFooterIncludes)) { - $this->aFooterIncludes[] = $sLine; - }" -ChameleonController,@var ActivePageServiceInterface,"public function AddHTMLHeaderLine($sLine) - { - if (!in_array($sLine, $this->aHeaderIncludes)) { - $this->aHeaderIncludes[] = $sLine; - }" -ChameleonController,* @var EventDispatcherInterface,"public function HeaderRedirect($aParameters) - { - $this->redirect->redirectToActivePage($aParameters); - }" -ChameleonController,* @var RequestInfoServiceInterface,"public function HeaderURLRedirect($url = '', $bAllowOnlyRelativeURLs = false) - { - $this->redirect->redirect($url, Response::HTTP_FOUND, $bAllowOnlyRelativeURLs); - }" -ChameleonController,"* @var ICmsCoreRedirect - * - * @deprecated since 6.1.9 - no longer used in this class.","public function __toString() - { - return get_class($this); - }" -ChameleonController,* @var InputFilterUtilInterface,"public function setActivePageService(ActivePageServiceInterface $activePageService) - { - $this->activePageService = $activePageService; - }" -ChameleonController,* @var ResourceCollectorInterface,"public function getHtmlHeaderIncludes() - { - return $this->aHeaderIncludes; - }" -ChameleonController,* @var DataAccessCmsMasterPagedefInterface,"public function getHtmlFooterIncludes() - { - return $this->aFooterIncludes; - }" -ChameleonController,* @var ResponseVariableReplacerInterface,"public function setAuthenticityTokenManager($authenticityTokenManager) - { - $this->authenticityTokenManager = $authenticityTokenManager; - }" -ChameleonController,* {@inheritdoc},"public function setRequestInfoService($requestInfoService) - { - $this->requestInfoService = $requestInfoService; - }" -ChameleonController,* @return Request|null,"public function setRedirect($redirect) - { - $this->redirect = $redirect; - }" -ChameleonController,"* @param TGlobal $global - * - * @return void","public function setInputFilterUtil(InputFilterUtilInterface $inputFilterUtil) - { - $this->inputFilterUtil = $inputFilterUtil; - }" -ChameleonController,"* @param bool $bBlockAutoFlushToBrowser - * - * @return void","public function setResourceCollector(ResourceCollectorInterface $resourceCollector): void - { - $this->resourceCollector = $resourceCollector; - }" -ChameleonController,* @return bool,"public function setResponseVariableReplacer(ResponseVariableReplacerInterface $responseVariableReplacer): void - { - $this->responseVariableReplacer = $responseVariableReplacer; - }" -,"* Interface ChameleonControllerInterface defines a Chameleon controller which is responsible for - * returning a response for the current request.","public function __invoke(); - - /** - * This method implies that you could get the response from it, but this is a lie. - * Call __invoke() instead and wait for the interface to improve. - * - * @return Response - * - * @throws AccessDeniedHttpException - * @throws NotFoundHttpException - */ - public function getResponse(); - - /** - * Setter for a cache service to be used by the controller. - * - * @param CacheInterface $cache - * @return void - */ - public function setCache(CacheInterface $cache); - - /** - * Adds a text line that is to be added to the header of the output page automatically. - * - * @param string $line - * @return void - */ - public function AddHTMLHeaderLine($line); - - /** - * Adds a text line that is to be added to the footer of the output page automatically. - * - * @param string $line - * @return void - */ - public function AddHTMLFooterLine($line); - - /** - * Flushes all buffered content to the browser. If true is passed for $enableAutoFlush, content will - * automatically be flushed for each module from this call on. Note that implementations may decide not to flush or - * disable content buffering altogether, so don't rely too heavily on the assumption that flushing is only - * controlled by this method. - * - * @param bool $enableAutoFlush - * @return void - */ - public function FlushContentToBrowser($enableAutoFlush = false); -}" -ChameleonControllerInvokeEvent,* @var ChameleonControllerInterface,"public function __construct(ChameleonControllerInterface $controller) - { - $this->controller = $controller; - }" -ChameleonControllerInvokeEvent,* @return \ChameleonSystem\CoreBundle\Controller\ChameleonControllerInterface,"public function getController() - { - return $this->controller; - }" -ChameleonControllerInvokeListener,* @var \Symfony\Component\DependencyInjection\ContainerInterface,"public function __construct(ContainerInterface $container) - { - $this->container = $container; - }" -ChameleonControllerInvokeListener,* @return void,"public function onInvoke(ChameleonControllerInvokeEvent $event) - { - $this->container->set('chameleon_system_core.chameleon_controller', $event->getController()); - }" -ChameleonControllerResolver,* Class ChameleonControllerResolver.,"public function __construct(ContainerInterface $container, ControllerResolver $defaultControllerResolver, array $controllerList, $defaultChameleonController) - { - $this->container = $container; - $this->defaultControllerResolver = $defaultControllerResolver; - $this->controllerList = $controllerList; - $this->defaultChameleonController = $defaultChameleonController; - }" -ChameleonControllerResolver,@var ContainerInterface $container,"public function getController(Request $request) - { - $controller = $request->attributes->get('_controller', null); - if (null === $controller) { - return null; - }" -ChameleonFrontendController,* @var ContainerInterface,"public function __construct( - RequestStack $requestStack, - EventDispatcherInterface $eventDispatcher, - DataAccessCmsMasterPagedefInterface $dataAccessCmsMasterPagedef, - TModuleLoader $moduleLoader, - $viewPathManager, - ContainerInterface $container, - TPkgViewRendererConfigToLessMapper $configToLessMapper - ) { - parent::__construct($requestStack, $eventDispatcher, $dataAccessCmsMasterPagedef, $moduleLoader, $viewPathManager); - $this->container = $container; // for ViewRenderer instantiation - $this->configToLessMapper = $configToLessMapper; - }" -ChameleonFrontendController,* @var TPkgViewRendererConfigToLessMapper,"public function getResponse() - { - $this->accessCheckHook(); - $activePage = $this->activePageService->getActivePage(); - - if (null === $activePage) { - throw new NotFoundHttpException('No active page was found. At this point, this is most likely - caused by a missing request attribute named ""pagedef"" specifying a valid page ID. If the caller of this - method does not know which pagedef to set, throw a NotFoundHttpException instead.'); - }" -ChameleonFrontendController,* @param \IViewPathManager $viewPathManager,"public function GetPagedefObject($pagedef) - { - //check if the pagedef exists in the database... if it does, use it. if not, use the file - $oPageDefinitionFile = null; - - $inputFilterUtil = $this->getInputFilterUtil(); - $requestMasterPageDef = $inputFilterUtil->getFilteredInput('__masterPageDef', false); - - if ($requestMasterPageDef && TGlobal::CMSUserDefined()) { - // load master pagedef... - $oPageDefinitionFile = TdbCmsMasterPagedef::GetNewInstance(); - $oPageDefinitionFile->Load($inputFilterUtil->getFilteredInput('id')); - }" -ChameleonNoAutoFlushController,* @var ChameleonController,"public function __construct(ChameleonController $controller) - { - $this->controller = $controller; - }" -ChameleonNoAutoFlushController,* {@inheritdoc},"public function __invoke() - { - $original = $this->controller->getBlockAutoFlushToBrowser(); - $this->controller->SetBlockAutoFlushToBrowser(true); - $response = $this->controller->__invoke(); - $this->controller->SetBlockAutoFlushToBrowser($original); - - return $response; - }" -ChameleonNoAutoFlushController,* {@inheritdoc},"public function getResponse() - { - return $this->controller->getResponse(); - }" -ChameleonNoAutoFlushController,* {@inheritdoc},"public function setCache(CacheInterface $cache) - { - $this->controller->setCache($cache); - }" -ChameleonNoAutoFlushController,* {@inheritdoc},"public function AddHTMLHeaderLine($sLine) - { - $this->controller->AddHTMLHeaderLine($sLine); - }" -ChameleonNoAutoFlushController,* {@inheritdoc},"public function AddHTMLFooterLine($sLine) - { - $this->controller->AddHTMLFooterLine($sLine); - }" -ChameleonNoAutoFlushController,* {@inheritdoc},"public function FlushContentToBrowser($enableAutoFlush = false) - { - $this->controller->FlushContentToBrowser($enableAutoFlush); - }" -ExceptionController,* {@inheritdoc},"public function setMainController(ChameleonControllerInterface $mainController) - { - $this->mainController = $mainController; - }" -ExceptionController,* @var ChameleonControllerInterface,"public function showAction(Request $request, \Throwable $exception): Response - { - $code = null; - if (method_exists($exception, 'getStatusCode')) { - $code = $exception->getStatusCode(); - }" -ExceptionController,* @var PortalDomainServiceInterface,"public function setExtranetConfiguration(ExtranetConfigurationInterface $extranetConfiguration) - { - $this->extranetConfiguration = $extranetConfiguration; - }" -ExceptionController,* @var ExtranetConfigurationInterface,"public function setExtranetUserProvider(ExtranetUserProviderInterface $extranetUserProvider) - { - $this->extranetUserProvider = $extranetUserProvider; - }" -ExceptionController,* @var RequestInfoServiceInterface,"public function setPortalDomainService(PortalDomainServiceInterface $portalDomainService) - { - $this->portalDomainService = $portalDomainService; - }" -ExceptionController,* @var ExtranetUserProviderInterface,"public function setRequestInfoService(RequestInfoServiceInterface $requestInfoService) - { - $this->requestInfoService = $requestInfoService; - }" -ExceptionController,* @var PageServiceInterface,"public function setPageService(PageServiceInterface $pageService) - { - $this->pageService = $pageService; - }" -ImageNotFoundController,* @return BinaryFileResponse|Response,"public function __invoke() - { - $imagePath = PATH_WEB.CHAMELEON_404_IMAGE_PATH_SMALL; - if (file_exists($imagePath)) { - return new BinaryFileResponse($imagePath); - }" -CronjobEnablingService,* @var Connection,"public function __construct(Connection $connection, CacheInterface $cache) - { - $this->connection = $connection; - $this->cache = $cache; - }" -CronjobEnablingService,* @var CacheInterface,"public function isCronjobExecutionEnabled(): bool - { - $config = TdbCmsConfig::GetInstance(); - - return true === $config->fieldCronjobsEnabled; - }" -CronjobEnablingService,* @throws CronjobHandlingException,"public function enableCronjobExecution(): void - { - try { - $this->connection->executeUpdate(""UPDATE `cms_config` SET `cronjobs_enabled` = '1'""); - $this->cache->callTrigger('cms_config'); - }" -CronjobEnablingService,* @throws CronjobHandlingException,"public function disableCronjobExecution(): void - { - try { - $this->connection->executeUpdate(""UPDATE `cms_config` SET `cronjobs_enabled` = '0'""); - $this->cache->callTrigger('cms_config'); - }" -,* Enables or disables all cronjobs.,"public function isCronjobExecutionEnabled(): bool; - - /** - * @throws CronjobHandlingException - */ - public function enableCronjobExecution(): void; - - /** - * @throws CronjobHandlingException - */ - public function disableCronjobExecution(): void; -}" -CronJobFactory,* @var ContainerInterface,"public function __construct(ContainerInterface $container) - { - $this->container = $container; - }" -CronJobFactory,* {@inheritdoc},"public function constructCronJob($identifier, array $data) - { - if (true === $this->container->has($identifier)) { - $cronJob = $this->container->get($identifier); - }" -,"* @param string $identifier - * @param array $data - * - * @return TCMSCronJob - * - * @throws \InvalidArgumentException","public function constructCronJob($identifier, array $data); -}" -CronJobScheduleDataModel,* @var \DateTime|null,"public function __construct(int $executeEveryNMinutes, int $unlockAfterNMinutes, bool $isLocked, ?\DateTime $lastPlannedExecution) - { - $this->lastPlannedExecution = $lastPlannedExecution; - $this->executeEveryNMinutes = $executeEveryNMinutes; - $this->unlockAfterNMinutes = $unlockAfterNMinutes; - $this->isLocked = $isLocked; - }" -CronJobScheduleDataModel,* @var int,"public function getLastPlannedExecution(): ?\DateTime - { - return $this->lastPlannedExecution; - }" -CronJobScheduleDataModel,* @var int,"public function getExecuteEveryNMinutes(): int - { - return $this->executeEveryNMinutes; - }" -CronJobScheduleDataModel,* @var bool,"public function getUnlockAfterNMinutes(): int - { - return $this->unlockAfterNMinutes; - }" -CronJobScheduler,* @var TimeProviderInterface,"public function __construct(TimeProviderInterface $timeProvider) - { - $this->timeProvider = $timeProvider; - }" -CronJobScheduler,* {@inheritdoc},"public function requiresExecution(CronJobScheduleDataModel $schedule): bool - { - $this->validateSchedule($schedule); - - $lastPlannedExecution = $schedule->getLastPlannedExecution(); - if (null === $lastPlannedExecution) { - return true; - }" -CronJobScheduler,* {@inheritdoc},"public function calculateCurrentPlannedExecutionDate(CronJobScheduleDataModel $schedule): \DateTime - { - $this->validateSchedule($schedule); - - $lastPlannedExecution = $schedule->getLastPlannedExecution(); - - if (null === $lastPlannedExecution) { - return $this->timeProvider->getDateTime(); - }" -,"* @param CronJobScheduleDataModel $schedule - * - * @return bool - * @throws \InvalidArgumentException","public function requiresExecution(CronJobScheduleDataModel $schedule): bool; - - /** - * @param CronJobScheduleDataModel $schedule - * - * @return \DateTime - * @throws \InvalidArgumentException - */ - public function calculateCurrentPlannedExecutionDate(CronJobScheduleDataModel $schedule): \DateTime; -}" -CronjobStateService,* @var Connection,"public function __construct(Connection $connection) - { - $this->connection = $connection; - }" -CronjobStateService,* {@inheritdoc},"public function isCronjobRunning(): bool - { - try { - return $this->connection->fetchColumn(""SELECT COUNT(*) FROM `cms_cronjobs` WHERE `lock` = '1'"") > 0; - }" -,* @throws CronjobHandlingException,"public function isCronjobRunning(): bool; -}" -CacheDataAccess,"* @template T extends TCMSRecord - * @implements DataAccessInterface","public function __construct(CacheInterface $cache, LanguageServiceInterface $languageService, DataAccessInterface $decorated) - { - $this->cache = $cache; - $this->languageService = $languageService; - $this->decorated = $decorated; - }" -CacheDataAccess,* @var CacheInterface,"public function loadAll($languageId = null) - { - if (null === $languageId) { - $languageId = $this->languageService->getActiveLanguageId(); - }" -CacheDataAccess,* @var LanguageServiceInterface,"public function getCacheTriggers() - { - return array(); - }" -CmsPortalDomainsDataAccess,* @var Connection,"public function __construct(Connection $connection) - { - $this->connection = $connection; - }" -CmsPortalDomainsDataAccess,* {@inheritdoc},"public function getPrimaryDomain($portalId, $languageId) - { - $query = ""SELECT * - FROM `cms_portal_domains` WHERE `cms_portal_id` = :portalId - AND `is_master_domain` = '1' - AND (`cms_language_id` = :languageId OR `cms_language_id` = '') - ORDER BY `cms_language_id` DESC LIMIT 0,1 - ""; - - $rows = $this->connection->fetchAllAssociative($query, [ - 'portalId' => $portalId, - 'languageId' => $languageId, - ]); - - if (0 === count($rows)) { - return null; - }" -CmsPortalDomainsDataAccess,"* {@inheritDoc} - * - * Copied partly from PortalDomainServiceInterface::getDomainNameList().","public function getAllDomainNames(): array - { - $portalList = \TdbCmsPortalList::GetList(); - - $portalDomainNames = []; - - while (false !== ($portal = $portalList->Next())) { - $domains = $portal->GetFieldCmsPortalDomainsList(); - while ($domain = $domains->Next()) { - $domainName = trim($domain->fieldName); - if ('' !== $domainName) { - $portalDomainNames[$domainName] = true; - }" -CmsPortalDomainsDataAccess,* {@inheritdoc},"public function getPortalPrefixListForDomain(string $domainName): array - { - if ('' === $domainName) { - return []; - }" -CmsPortalDomainsDataAccess,* {@inheritdoc},"public function getActivePortalCandidate(array $idRestrictionList, string $identifierRestriction, bool $allowInactivePortals): ?array - { - $query = ""SELECT * - FROM `cms_portal` - WHERE `id` IN (?) - AND (`identifier` = ? OR `identifier` = '') - ""; - - if (false === $allowInactivePortals) { - $query .= "" AND `cms_portal`.`deactive_portal` != '1' ""; - }" -CmsPortalDomainsDataAccess,* {@inheritdoc},"public function getDomainDataByName(string $domainName): array - { - if ('' === $domainName) { - return []; - }" -CmsPortalDomainsDataAccessCacheDecorator,* @var ContainerInterface,"public function __construct(ContainerInterface $container, CmsPortalDomainsDataAccessInterface $subject) - { - $this->container = $container; // Avoid circular dependency on CacheInterface. - $this->subject = $subject; - }" -CmsPortalDomainsDataAccessCacheDecorator,* @var CmsPortalDomainsDataAccessInterface,"public function getPrimaryDomain($portalId, $languageId) - { - $cache = $this->getCache(); - $cacheKey = $cache->getKey(array( - get_class(), - 'getPrimaryDomain', - get_class($this->subject), - $portalId, - $languageId, - )); - $primaryDomain = $cache->get($cacheKey); - if (null !== $primaryDomain) { - return $primaryDomain; - }" -CmsPortalDomainsDataAccessCacheDecorator,* {@inheritdoc},"public function getPortalPrefixListForDomain(string $domainName): array - { - $cache = $this->getCache(); - $cacheKey = $cache->getKey([ - __METHOD__, - \get_class($this->subject), - $domainName, - ]); - $value = $cache->get($cacheKey); - if (null !== $value) { - return $value; - }" -CmsPortalDomainsDataAccessCacheDecorator,* {@inheritdoc},"public function getActivePortalCandidate(array $idRestrictionList, string $identifierRestriction, bool $allowInactivePortals): ?array - { - return $this->subject->getActivePortalCandidate($idRestrictionList, $identifierRestriction, $allowInactivePortals); - }" -CmsPortalDomainsDataAccessCacheDecorator,* {@inheritdoc},"public function getDomainDataByName(string $domainName): array - { - $cache = $this->getCache(); - $cacheKey = $cache->getKey([ - __METHOD__, - \get_class($this->subject), - $domainName, - ]); - $value = $cache->get($cacheKey); - if (null !== $value) { - return $value; - }" -CmsPortalDomainsDataAccessCacheDecorator,* {@inheritdoc},"public function getAllDomainNames(): array - { - return $this->subject->getAllDomainNames(); - }" -,* CmsPortalDomainsDataAccessInterface defines a service that acts as data access interface for the PortalDomainService.,"public function getPrimaryDomain($portalId, $languageId); - - /** - * @return array - the names of all domains of all portals - * - * NOTE \ChameleonSystem\CoreBundle\Service\PortalDomainServiceInterface::getDomainNameList() is similar but works only for the current portal. - * TODO This should be joined with that code (the service calling a method here). - */ - public function getAllDomainNames(): array; - - /** - * Returns a list of portal prefixes for portals that are available for the passed $domain. - * - * @param string $domainName - * - * @return array - */ - public function getPortalPrefixListForDomain(string $domainName): array; - - /** - * Returns all data for a portal that ""might be"" the currently active portal, given the passed restrictions. - * - * @param array $idRestrictionList - * @param string $identifierRestriction - * @param bool $allowInactivePortals - * - * @return array|null - */ - public function getActivePortalCandidate(array $idRestrictionList, string $identifierRestriction, bool $allowInactivePortals): ?array; - - /** - * Returns domain Tdb objects for a given domain name (either default name or SSL domain matches). - * - * @param string $domainName - * - * @return array - */ - public function getDomainDataByName(string $domainName): array; -}" -CmsPortalDomainsDataAccessRequestLevelCacheDecorator,* @var CmsPortalDomainsDataAccessInterface,"public function __construct(CmsPortalDomainsDataAccessInterface $subject) - { - $this->subject = $subject; - }" -CmsPortalDomainsDataAccessRequestLevelCacheDecorator,"* @var array","public function getPrimaryDomain($portalId, $languageId) - { - $cacheKey = ""$portalId-$languageId""; - if (true === isset($this->cache[$cacheKey])) { - return $this->cache[$cacheKey]; - }" -CmsPortalDomainsDataAccessRequestLevelCacheDecorator,* @var string[],"public function getAllDomainNames(): array - { - if (null === $this->domainNamesCache) { - $this->domainNamesCache = $this->subject->getAllDomainNames(); - }" -CmsPortalDomainsDataAccessRequestLevelCacheDecorator,* @param CmsPortalDomainsDataAccessInterface $subject,"public function getPortalPrefixListForDomain(string $domainName): array - { - return $this->subject->getPortalPrefixListForDomain($domainName); - }" -CmsPortalDomainsDataAccessRequestLevelCacheDecorator,* {@inheritdoc},"public function getActivePortalCandidate(array $idRestrictionList, string $identifierRestriction, bool $allowInactivePortals): ?array - { - return $this->subject->getActivePortalCandidate($idRestrictionList, $identifierRestriction, $allowInactivePortals); - }" -CmsPortalDomainsDataAccessRequestLevelCacheDecorator,* {@inheritdoc},"public function getDomainDataByName(string $domainName): array - { - return $this->subject->getDomainDataByName($domainName); - }" -,"* Fetches field configuration for a table name and a field name. - * - * @param string $tableName - * @param string $fieldName - * - * @return string|null - * - * @throws DataAccessException","public function getFieldClassNameFromDictionaryValues($tableName, $fieldName); -}" -DataAccessClassFromTableTableFieldProvider,* @var Connection,"public function __construct(Connection $databaseConnection) - { - $this->databaseConnection = $databaseConnection; - }" -DataAccessClassFromTableTableFieldProvider,* @param Connection $databaseConnection,"public function getFieldClassNameFromDictionaryValues($tableName, $fieldName) - { - $query = $this->getFieldClassRowQuery(); - - try { - $fieldClassName = $this->databaseConnection->fetchColumn($query, array( - 'tableName' => $tableName, - 'fieldName' => $fieldName, - )); - if (false === $fieldClassName) { - return null; - }" -DataAccessCmsLanguage,"* DataAccessCmsLanguage provides an implementation of DataAccessCmsLanguageInterface for the default database backend. - * Some methods load data manually instead of using existing TCMSRecord loading methods, because there are cases where - * this would lead to endless recursion (loading the language is a special case as the language relies on the language - * which implies an intrinsic potential for deadlocks).","public function __construct(Connection $databaseConnection) - { - $this->databaseConnection = $databaseConnection; - }" -DataAccessCmsLanguage,* @var Connection,"public function getLanguage($id, $targetLanguageId) - { - $language = TdbCmsLanguage::GetNewInstance(); - $languageRaw = $this->getLanguageRaw($id); - if (null === $languageRaw) { - return null; - }" -DataAccessCmsLanguage,* @param Connection $databaseConnection,"public function getLanguageRaw($id) - { - $language = TdbCmsLanguage::GetNewInstance(); - $language->DisablePostLoadHook(true); - if (false === $language->Load($id)) { - return null; - }" -DataAccessCmsLanguage,* {@inheritdoc},"public function getLanguageFromIsoCode($isoCode, $targetLanguageId) - { - $query = 'SELECT * FROM `cms_language` WHERE `iso_6391` = :isoCode'; - $row = $this->databaseConnection->fetchAssociative($query, array( - 'isoCode' => $isoCode, - )); - if (false === $row) { - return null; - }" -,"* Returns a language object. The object will be loaded using the $targetLanguageId for localization of the object - * itself. - * Returns null if the language could not be loaded. - * - * @param string $id - * @param string $targetLanguageId - * - * @return TdbCmsLanguage|null","public function getLanguage($id, $targetLanguageId); - - /** - * Returns the raw language data as an array. - * Returns null if the language data could not be loaded. - * - * @param string $id - * - * @return array|null - */ - public function getLanguageRaw($id); - - /** - * Returns a language object for the passed ISO 639-1 code. - * The object will be loaded using the $targetLanguageId for localization of the object itself. - * Returns null if the language could not be loaded. - * - * @param string $isoCode - * @param string $targetLanguageId - * - * @return TdbCmsLanguage|null - */ - public function getLanguageFromIsoCode($isoCode, $targetLanguageId); -}" -DataAccessCmsLanguageRequestLevelCacheDecorator,* @var DataAccessCmsLanguageInterface,"public function __construct(DataAccessCmsLanguageInterface $subject) - { - $this->subject = $subject; - }" -DataAccessCmsLanguageRequestLevelCacheDecorator,* @var array,"public function getLanguage($id, $targetLanguageId) - { - $key = 'getLanguage-'.$id; - if (false === isset($this->cache[$key])) { - $languageRaw = $this->getLanguageRaw($id); - if (null === $languageRaw) { - return null; - }" -DataAccessCmsLanguageRequestLevelCacheDecorator,* @param DataAccessCmsLanguageInterface $subject,"public function getLanguageRaw($id) - { - $key = 'getLanguageRaw-'.$id; - if (false === isset($this->cache[$key])) { - $this->cache[$key] = $this->subject->getLanguageRaw($id); - }" -DataAccessCmsLanguageRequestLevelCacheDecorator,* {@inheritdoc},"public function getLanguageFromIsoCode($isoCode, $targetLanguageId) - { - $key = 'getLanguageFromIsoCode-'.$isoCode; - if (false === isset($this->cache[$key])) { - $language = $this->subject->getLanguageFromIsoCode($isoCode, $targetLanguageId); - if (null === $language) { - return null; - }" -DataAccessCmsMasterPagedefCacheDecorator,* @var DataAccessCmsMasterPagedefInterface,"public function __construct( - DataAccessCmsMasterPagedefInterface $subject, - InputFilterUtilInterface $inputFilterUtil, - CacheInterface $cache, - RequestInfoServiceInterface $requestInfoService - ) { - $this->subject = $subject; - $this->cache = $cache; - $this->inputFilterUtil = $inputFilterUtil; - $this->requestInfoService = $requestInfoService; - }" -DataAccessCmsMasterPagedefCacheDecorator,* @var CacheInterface,"public function get(string $id): ?CmsMasterPagdef - { - $cacheKeyParameter = $this->getCacheKeyParameters($id); - - $cacheKey = $this->cache->getKey($cacheKeyParameter); - $pagedefData = $this->cache->get($cacheKey); - if (null !== $pagedefData) { - return $pagedefData; - }" -DataAccessCmsMasterPagedefDatabase,* @var DataAccessCmsMasterPagedefInterface,"public function __construct(DataAccessCmsMasterPagedefInterface $fallbackLoader, InputFilterUtilInterface $inputFilterUtil) - { - $this->fallbackLoader = $fallbackLoader; - $this->inputFilterUtil = $inputFilterUtil; - }" -DataAccessCmsMasterPagedefDatabase,* @var InputFilterUtilInterface,"public function get(string $id): ?CmsMasterPagdef - { - //check if the pagedef exists in the database... if it does, use it. if not, use the file - $oPageDefinitionFile = null; - - $requestMasterPageDef = 'true' === $this->inputFilterUtil->getFilteredInput('__masterPageDef'); - - if (true === $requestMasterPageDef && true === TGlobal::CMSUserDefined()) { - // load master pagedef... - $oPageDefinitionFile = TdbCmsMasterPagedef::GetNewInstance(); - $oPageDefinitionFile->Load($this->inputFilterUtil->getFilteredInput('id')); - }" -DataAccessCmsMasterPagedefFile,* @var InputFilterUtilInterface,"public function __construct(InputFilterUtilInterface $inputFilterUtil, \TGlobal $global) - { - $this->inputFilterUtil = $inputFilterUtil; - $this->global = $global; - }" -DataAccessCmsMasterPagedefFile,* @var \TGlobal,"public function get(string $id): ?CmsMasterPagdef - { - $oPageDefinitionFile = new TCMSPageDefinitionFile(); - $fullPageDefPath = $this->PageDefinitionFile($id); - $pagePath = substr($fullPageDefPath, 0, -strlen($id.'.pagedef.php')); - - if (false === $oPageDefinitionFile->Load($id, $pagePath)) { - return null; - }" -DataAccessCmsPortalSystemPage,* @implements DataAccessInterface,"public function __construct(Connection $databaseConnection) - { - $this->databaseConnection = $databaseConnection; - }" -DataAccessCmsPortalSystemPage,* @var Connection,"public function loadAll($languageId = null) - { - $query = 'SELECT `cms_portal_system_page`.* - FROM `cms_portal_system_page` - ORDER BY `cms_portal_system_page`.`cmsident`'; - - $systemPages = $this->databaseConnection->fetchAllAssociative($query); - $systemPageList = array(); - foreach ($systemPages as $systemPage) { - $pageId = $systemPage['id']; - $systemPageList[$pageId] = TdbCmsPortalSystemPage::GetNewInstance($systemPage, $languageId); - }" -DataAccessCmsPortalSystemPage,* @param Connection $databaseConnection,"public function getCacheTriggers() - { - return array( - 'cms_portal_system_page', - 'cms_tree', - ); - }" -,"* returns array with table ids as key, and name as value - * @return array","public function getTableConfigurations(): array; - - public function isTableName(string $tableName): bool; - - /** - * returns the roles assigned to the action - * @param string $action - * @param string $tableName - * @return array - */ - public function getPermittedRoles(string $action, string $tableName): array; - - public function getGroupIdForTable(string $tableName): ?string; -}" -DataAccessCmsTplPage,* @implements DataAccessInterface,"public function __construct(Connection $databaseConnection) - { - $this->databaseConnection = $databaseConnection; - }" -DataAccessCmsTplPage,* @var Connection,"public function loadAll($languageId = null) - { - $query = 'SELECT `cms_tpl_page`.* - FROM `cms_tpl_page` - ORDER BY `cms_tpl_page`.`cmsident`'; - - $pages = $this->databaseConnection->fetchAllAssociative($query); - $pageList = array(); - foreach ($pages as $page) { - $pageId = $page['id']; - $pageList[$pageId] = TdbCmsTplPage::GetNewInstance($page, $languageId); - }" -DataAccessCmsTplPage,* @param Connection $databaseConnection,"public function getCacheTriggers() - { - return array( - 'cms_tpl_page', - 'cms_tree_node', - ); - }" -DataAccessCmsTree,* @var Connection,"public function __construct(Connection $databaseConnection, LanguageServiceInterface $languageService) - { - $this->databaseConnection = $databaseConnection; - $this->languageService = $languageService; - }" -DataAccessCmsTree,* @var LanguageServiceInterface,"public function loadAll($languageId = null) - { - $query = 'SELECT * FROM `cms_tree` ORDER BY `lft`'; - - $result = $this->databaseConnection->fetchAllAssociative($query); - $trees = array(); - if (null === $languageId) { - $languageId = $this->languageService->getActiveLanguageId(); - }" -DataAccessCmsTree,"* @param Connection $databaseConnection - * @param LanguageServiceInterface $languageService","public function getAllInvertedNoFollowRulePageIds() - { - $rows = $this->databaseConnection->fetchAllAssociative('SELECT `source_id`, `target_id` FROM `cms_tree_cms_tpl_page_mlt`'); - - if (false === $rows) { - return array(); - }" -DataAccessCmsTree,* {@inheritdoc},"public function getInvertedNoFollowRulePageIds($cmsTreeId) - { - $query = 'SELECT `target_id` FROM `cms_tree_cms_tpl_page_mlt` WHERE `source_id` = :treeId'; - - return $this->databaseConnection->fetchColumn($query, array('treeId' => $cmsTreeId)); - }" -,"* Loads all entries of the underlying data model. - * - * @param string|null $languageId if null, the currently active language is used - * - * @return TdbCmsTree[]","public function loadAll($languageId = null); - - /** - * an array of all no follow invert rule page ids. key of the array is the tree_id. - * - * @return array - */ - public function getAllInvertedNoFollowRulePageIds(); - - /** - * return the page ids for which the no follow rule should be inverted. - * - * @param string $cmsTreeId - * - * @return array - */ - public function getInvertedNoFollowRulePageIds($cmsTreeId); -}" -DataAccessCmsTreeNode,* @implements DataAccessInterface,"public function __construct(Connection $databaseConnection, LanguageServiceInterface $languageService) - { - $this->databaseConnection = $databaseConnection; - $this->languageService = $languageService; - }" -DataAccessCmsTreeNode,* @var Connection,"public function loadAll($languageId = null) - { - $query = 'SELECT * FROM `cms_tree_node`'; - - $result = $this->databaseConnection->fetchAllAssociative($query); - $treeNodes = array(); - if (null === $languageId) { - $languageId = $this->languageService->getActiveLanguageId(); - }" -DataAccessCmsTreeNode,* @var LanguageServiceInterface,"public function getCacheTriggers() - { - return array( - 'cms_tree_node', - ); - }" -DataAccessCmsTreeRequestLevelCacheDecorator,* @var DataAccessCmsTreeInterface,"public function __construct(DataAccessCmsTreeInterface $subject, LanguageServiceInterface $languageService) - { - $this->subject = $subject; - $this->languageService = $languageService; - }" -DataAccessCmsTreeRequestLevelCacheDecorator,* @var array,"public function loadAll($languageId = null) - { - if (null === $languageId) { - $languageId = $this->languageService->getActiveLanguageId(); - }" -DataAccessCmsTreeRequestLevelCacheDecorator,* @var LanguageServiceInterface,"public function getAllInvertedNoFollowRulePageIds() - { - $cacheKey = 'allInvertedNoFollowRulePageIds'; - - if (false === array_key_exists($cacheKey, $this->cache)) { - $this->cache[$cacheKey] = $this->subject->getAllInvertedNoFollowRulePageIds(); - }" -DataAccessCmsTreeRequestLevelCacheDecorator,"* @param DataAccessCmsTreeInterface $subject - * @param LanguageServiceInterface $languageService","public function getInvertedNoFollowRulePageIds($cmsTreeId) - { - $all = $this->getAllInvertedNoFollowRulePageIds(); - if (false === isset($all[$cmsTreeId])) { - return array(); - }" -,"* DataAccessInterface defines a generic service that reads data from a data source. - * These assumptions were made while designing this interface: - * 1. There are lots of reads on single items, so that bulk reading is more efficient than reading every item independently. - * 2. There is a cache mechanism for the fetched data, to avoid reading rather large datasets from the backend. - * 3. There are higher-level services that operate on the fetched data. The returned values should be quite raw, so more - * sophisticated usage requires additional work. - * - * @template T extends \TCMSRecord","public function loadAll($languageId = null); - - /** - * Returns a list of cache triggers that should be called to invalidate the cache entries for this data model. - * - * @return string[] - */ - public function getCacheTriggers(); -}" -RequestCacheDataAccess,"* @template T extends TCMSRecord - * @implements DataAccessInterface","public function __construct(LanguageServiceInterface $languageService, DataAccessInterface $decorated) - { - $this->languageService = $languageService; - $this->decorated = $decorated; - }" -RequestCacheDataAccess,"* @var array $elements","public function loadAll($languageId = null) - { - if (null === $languageId) { - $languageId = $this->languageService->getActiveLanguageId(); - }" -RequestCacheDataAccess,* @var LanguageServiceInterface,"public function getCacheTriggers() - { - return array(); - }" -UserMenuItemDataAccess,* @var Connection,"public function __construct(Connection $connection, LoggerInterface $logger) - { - $this->connection = $connection; - $this->logger = $logger; - }" -UserMenuItemDataAccess,* @var LoggerInterface,"public function getMenuItemIds(string $userId): array - { - if ('' === $userId) { - return []; - }" -UserMenuItemDataAccess,* {@inheritDoc},"public function trackMenuItem(string $userId, string $menuItemId): void - { - if ('' === $userId || '' === $menuItemId) { - return; - }" -,* Track and retrieve usage statistics in the menu for every user.,"public function getMenuItemIds(string $userId): array; - - public function trackMenuItem(string $userId, string $menuItemId): void; -}" -AbstractDatabaseAccessLayer,* @var Connection,"public function setDatabaseConnection(Connection $connection) - { - $this->databaseConnection = $connection; - }" -DatabaseAccessLayerCmsMasterPagedefSpotAccess,* @var bool,"public function getAccessForSpot($spotId) - { - $this->loadAll(); - - return $this->getFromCache($spotId); - }" -DatabaseAccessLayerCmsMasterPagedefSpotParameter,* @var bool,"public function getParameterForSpot($spotId) - { - $this->loadAllParameters(); - - return $this->getFromCache($spotId); - }" -DatabaseAccessLayerCmsMedia,* @var bool,"public function loadMediaFromId($mediaId) - { - $this->loadAllParameters(); - - $media = $this->getFromCache($mediaId); - if (null !== $media) { - return $media; - }" -DatabaseAccessLayerCmsTPlModule,* @var bool,"public function loadFromClassOrServiceId($classOrId) - { - $this->loadAllModules(); - $keyMappingData = array('classname' => $classOrId); - $mappedKey = $this->getMapLookupKey($keyMappingData); - $data = $this->getFromCacheViaMappedKey($mappedKey); - if (null !== $data) { - return $data; - }" -DatabaseAccessLayerCmsTPlModule,"* @param string $classOrId - * - * @return \TdbCmsTplModule|null","public function loadFromId($id) - { - $this->loadAllModules(); - - return $this->getFromCache($id); - }" -DatabaseAccessLayerCmsTPlModule,"* @param string $id - * - * @return \TdbCmsTplModule|null","public function loadFromField($field, $value) - { - $this->loadAllModules(); - $matches = $this->findDbObjectFromFieldInCache($field, $value); - if (0 === count($matches)) { - return null; - }" -DatabaseAccessLayerCmsTplPage,* @deprecated since 6.1.0 use methods in chameleon_system_core.page_service instead,"public function __construct(PortalDomainServiceInterface $portalDomainService) - { - $this->portalDomainService = $portalDomainService; - }" -DatabaseAccessLayerCmsTplPage,* @var bool,"public function loadFromId($id) - { - $this->loadAllPages(); - - return $this->getFromCache($id); - }" -DatabaseAccessLayerCmsTplPage,* @var PortalDomainServiceInterface,"public function loadForTreeId($treeId, $bPreventFilter = false) - { - $this->loadAllPages(); - - $cacheKeyData = array('cms_tree.id' => $treeId); - $mappedKey = $this->getMapLookupKey($cacheKeyData); - if (null !== $mappedKey) { - $page = $this->getFromCacheViaMappedKey($mappedKey); - if (null !== $page) { - return $page; - }" -,* @deprecated since 6.1.0 use methods in chameleon_system_core.page_service instead,"public function loadFromId($id); - - /** - * @param string $treeId - * @param bool $bPreventFilter - default false - * - * @deprecated since 6.1.0 - use chameleon_system_core.page_service::getByTreeId() instead - * - * @return mixed - */ - public function loadForTreeId($treeId, $bPreventFilter = false); -}" -DatabaseAccessLayerCmsTree,* @deprecated since 6.1.0 use methods in chameleon_system_core.tree_service instead,"public function __construct(PortalDomainServiceInterface $portalDomainService, LanguageServiceInterface $languageService) - { - $this->portalDomainService = $portalDomainService; - $this->languageService = $languageService; - }" -DatabaseAccessLayerCmsTree,* @var bool,"public function loadFromId($id, $languageId = null) - { - $this->loadAllTreeNodes(); - - return $this->getFromObjectCache($id, $languageId); - }" -DatabaseAccessLayerCmsTree,* @var PortalDomainServiceInterface,"public function getChildren($id, $includeHidden, $languageId = null) - { - $this->loadAllTreeNodes(); - /** @var \TdbCmsTree[] $matches */ - $matches = $this->findDbObjectFromFieldInCache('parent_id', $id, $languageId); - - /** - * @psalm-suppress InvalidArgument - * @FIXME returning `null` from a sorting method is not allowed, should probably return `0`. - */ - usort($matches, function (\TdbCmsTree $a, \TdbCmsTree $b) { - if ($a->fieldEntrySort === $b->fieldEntrySort) { - return null; - }" -DatabaseAccessLayerFieldConfig,* @var TCMSField[][],"public function getFieldConfig($tableName, $fieldName, TCMSRecord $dataRow, $loadDefaults = false) - { - $fieldObject = null; - if (!isset($this->cache[$tableName])) { - $this->cache[$tableName] = array(); - }" -DatabaseAccessLayerFieldConfig,"* @param string $tableName - * @param string $fieldName - * @param TCMSRecord $dataRow - * @param bool $loadDefaults - * - * @return TCMSField","public function GetFieldDefinition($tableName, $fieldName) - { - $query = 'SELECT `cms_field_conf`.* - FROM `cms_field_conf` - INNER JOIN `cms_tbl_conf` ON `cms_field_conf`.`cms_tbl_conf_id` = `cms_tbl_conf`.`id` - WHERE `cms_field_conf`.`name`= :fieldName - AND `cms_tbl_conf`.`name` = :tableName'; - $oFieldDefinition = null; - $row = $this->getDatabaseConnection()->fetchAssociative($query, array('fieldName' => $fieldName, 'tableName' => $tableName)); - - if (false !== $row) { - $oFieldDefinition = TdbCmsFieldConf::GetNewInstance($row); - }" -DatabaseAccessLayerFieldTypes,* @var bool,"public function getFieldType($id) - { - $this->loadAll(); - - return $this->getFromCache($id); - }" -DatabaseAccessLayerFileTypes,* @var \TdbCmsFiletype[],"public function getFileType($id) - { - if (isset($this->cache[$id])) { - return $this->cache[$id]; - }" -BackendTreeNodeDataModel,* @var string,"public function __construct(string $id, string $name, int $cmsIdent, string $connectedPageId) - { - $this->id = $id; - $this->name = $name; - $this->cmsIdent = $cmsIdent; - $this->listAttributes = ['cmsIdent' => $cmsIdent]; - $this->connectedPageId = $connectedPageId; - }" -BackendTreeNodeDataModel,* @var string,"public function getId(): string - { - return $this->id; - }" -BackendTreeNodeDataModel,* @var string,"public function getName(): string - { - return $this->name; - }" -BackendTreeNodeDataModel,* @var int,"public function setName(string $name): void - { - $this->name = $name; - }" -BackendTreeNodeDataModel,* @var BackendTreeNodeDataModel[],"public function getFurtherIconsHTML(): string - { - return $this->furtherIconsHTML; - }" -BackendTreeNodeDataModel,* @var bool,"public function setFurtherIconsHTML(string $furtherIconsHTML): void - { - $this->furtherIconsHTML = $furtherIconsHTML; - }" -BackendTreeNodeDataModel,* @var string,"public function addFurtherIconHTML(string $furtherIconHTML): void - { - $this->furtherIconsHTML .= $furtherIconHTML; - }" -BackendTreeNodeDataModel,* @var bool,"public function getCmsIdent(): int - { - return $this->cmsIdent; - }" -BackendTreeNodeDataModel,* @var bool,"public function getChildren(): array - { - return $this->children; - }" -BackendTreeNodeDataModel,* @var bool,"public function addChildren(BackendTreeNodeDataModel $treeNodeDataModel): void - { - $this->children[] = $treeNodeDataModel; - }" -BackendTreeNodeDataModel,"* Key = HTML attribute name. - * - * @var array","public function isChildrenAjaxLoad(): bool - { - return $this->childrenAjaxLoad; - }" -BackendTreeNodeDataModel,"* Key = HTML attribute name. - * - * @var array","public function setChildrenAjaxLoad(bool $childrenAjaxLoad): void - { - $this->childrenAjaxLoad = $childrenAjaxLoad; - }" -BackendTreeNodeDataModel,* @var array,"public function getType(): string - { - return $this->type; - }" -BackendTreeNodeDataModel,* @var array,"public function setType(string $type): void - { - $this->type = $type; - }" -BackendTreeNodeDataModel,* @var string,"public function isSelected(): bool - { - return $this->selected; - }" -BackendTreeNodeDataModel,* @return BackendTreeNodeDataModel[],"public function setSelected(bool $selected): void - { - $this->selected = $selected; - }" -BackendTreeNodeDataModel,* @param BackendTreeNodeDataModel $children,"public function isDisabled(): bool - { - return $this->disabled; - }" -BackendTreeNodeDataModel,* {@inheritDoc},"public function setDisabled(bool $disabled): void - { - $this->disabled = $disabled; - }" -CmsMasterPagdef,* @var string,"public function __construct(string $id, array $moduleList, string $layoutFile) - { - $this->id = $id; - $this->moduleList = $moduleList; - $this->layoutFile = $layoutFile; - }" -CmsMasterPagdef,* @var array,"public function getId(): string - { - return $this->id; - }" -CmsMasterPagdef,* @var string,"public function getModuleList(): array - { - return $this->moduleList; - }" -DownloadLinkDataModel,* @var string|null,"public function __construct( - string $id, - string $downloadUrl, - string $fileName) - { - $this->id = $id; - $this->downloadUrl = $downloadUrl; - $this->fileName = $fileName; - }" -DownloadLinkDataModel,* @var string,"public function getId(): ?string - { - return $this->id; - }" -DownloadLinkDataModel,"* Add internal attribute for wysiwyg editor integration and disable download url. - * - * @var bool","public function getHumanReadableFileSize(): string - { - return $this->humanReadableFileSize; - }" -DownloadLinkDataModel,* @var string,"public function setHumanReadableFileSize(string $humanReadableFileSize): void - { - $this->humanReadableFileSize = $humanReadableFileSize; - }" -DownloadLinkDataModel,* @var bool,"public function isBackendLink(): bool - { - return $this->isBackendLink; - }" -DownloadLinkDataModel,* @var string,"public function setIsBackendLink(bool $isBackendLink): void - { - $this->isBackendLink = $isBackendLink; - }" -DownloadLinkDataModel,* @var string,"public function getFileName(): string - { - return $this->fileName; - }" -DownloadLinkDataModel,* @var string,"public function setFileName(string $fileName): void - { - $this->fileName = $fileName; - }" -DownloadLinkDataModel,* @var bool,"public function showSize(): bool - { - return $this->showSize; - }" -PagePath,* @var string,"public function __construct($pageId, $primaryPath) - { - $this->pageId = $pageId; - $this->primaryPath = $primaryPath; - $this->pathList[] = $primaryPath; - }" -PagePath,* @var string,"public function addPath($path) - { - $this->pathList[] = $path; - }" -PagePath,* @var string[],"public function getPageId() - { - return $this->pageId; - }" -PagePath,"* @param string $pageId - * @param string $primaryPath","public function getPrimaryPath() - { - return $this->primaryPath; - }" -PagePath,"* @param string $path - * - * @return void","public function getPathList() - { - return $this->pathList; - }" -ChameleonSystemCoreExtension,"* {@inheritDoc} - * - * @return void","public function load(array $config, ContainerBuilder $container) - { - $config = $this->processConfiguration(new Configuration(), $config); - - // get standard configs - $aConfigDirs = array( - PATH_CORE_CONFIG, - _CMS_CUSTOM_CORE.'/config/', - _CMS_CUSTOMER_CORE.'/../config/', - ); - foreach ($aConfigDirs as $sConfigDir) { - $this->loadConfigFile($container, $sConfigDir, 'services.xml'); - $this->loadConfigFile($container, $sConfigDir, 'mail.xml'); - $this->loadConfigFile($container, $sConfigDir, 'data_access.xml'); - $this->loadConfigFile($container, $sConfigDir, 'urlnormalization.xml'); - $this->loadConfigFile($container, $sConfigDir, 'universal_uploader.xml'); - $this->loadConfigFile($container, $sConfigDir, 'database_migration.xml'); - $this->loadConfigFile($container, $sConfigDir, 'cronjobs.xml'); - $this->loadConfigFile($container, $sConfigDir, 'mappers.xml'); - $this->loadConfigFile($container, $sConfigDir, 'factory.xml'); - }" -ChameleonSystemCoreExtension,"* @param array $googleApiConfig - * @param ContainerBuilder $container - * - * @return void","public function prepend(ContainerBuilder $container) - { - // Fix for BC break in PDO. See https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.pdo.mysql - // Proposed solution: https://github.com/doctrine/dbal/issues/5228 - $container->prependExtensionConfig('doctrine', [ - 'dbal' => [ - 'options' => [ - \PDO::ATTR_STRINGIFY_FETCHES => true, - ] - ] - ]); - }" -Configuration,"* Generates the configuration tree builder. - * - * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder","public function getConfigTreeBuilder() - { - $treeBuilder = new TreeBuilder('chameleon_system_core'); - $root = $treeBuilder->getRootNode(); - $root->isRequired(); - - $root - ->children() - ->scalarNode('vendor_dir')->end() - ->scalarNode('redirectstrategy') - ->defaultValue('registershutdown') - ->end() - ->scalarNode('query_modifier_order_by_class')->end() - ->arrayNode('pdo') - ->children() - ->scalarNode('mysql_attr_init_command')->end() - ->end() - ->end() - ->append($this->getCronjobConfig()) - ->append($this->getMailTargetTransformationServiceConfig()) - ->append($this->getMailerConfig()) - ->append($this->getGoogleMapsApiConfig()) - ->append($this->getBackendConfig()) - ->append($this->getModuleExecutionConfig()) - ->append($this->getResourceCollectionConfig()) - ; - - return $treeBuilder; - }" -AddBackendMainMenuItemProvidersPass,"* {@inheritDoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $sidebarMenuItemFactoryDefinition = $container->getDefinition('chameleon_system_core.bridge.chameleon.module.sidebar.menu_item_factory'); - $menuItemProviderServiceIds = $container->findTaggedServiceIds('chameleon_system.backend_menu_item_provider'); - - foreach ($menuItemProviderServiceIds as $menuItemProviderServiceId => $tags) { - $databaseClass = null; - foreach ($tags as $tag) { - if (true === \array_key_exists('databaseclass', $tag)) { - $databaseClass = $tag['databaseclass']; - }" -AddCronJobsPass,"* {@inheritDoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $cronJobFactoryDefinition = $container->getDefinition('chameleon_system_core.cronjob.cronjob_factory'); - $cronJobServiceIds = array_keys($container->findTaggedServiceIds('chameleon_system.cronjob')); - $services = []; - - foreach ($cronJobServiceIds as $cronJobServiceId) { - $cronJobDefinition = $container->getDefinition($cronJobServiceId); - if ($cronJobDefinition->isShared()) { - throw new \LogicException('Chameleon cron jobs must not be shared service instances. This cron job is shared: '.$cronJobServiceId); - }" -AddMappersPass,"* {@inheritdoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $mapperServiceIds = $container->findTaggedServiceIds('chameleon_system.mapper'); - $services = []; - - foreach (\array_keys($mapperServiceIds) as $mapperId) { - $mapperDefinition = $container->getDefinition($mapperId); - if (false === \is_subclass_of($mapperDefinition->getClass(), IViewMapper::class)) { - throw new \LogicException('Chameleon mappers must implement IViewMapper. This one doesn\'t: '.$mapperId); - }" -AddUrlNormalizersPass,"* {@inheritDoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $utilServiceDefinition = $container->getDefinition('chameleon_system_core.util.url_normalization'); - $urlNormalizerServices = $container->findTaggedServiceIds('chameleon_system.url_normalizer'); - - $urlNormalizerList = array(); - - foreach ($urlNormalizerServices as $urlNormalizerServiceId => $tags) { - $urlNormalizerDefinition = $container->getDefinition($urlNormalizerServiceId); - foreach ($tags as $tag) { - $priority = isset($tag['priority']) ? $tag['priority'] : 0; - if (!isset($urlNormalizerList[$priority])) { - $urlNormalizerList[$priority] = array(); - }" -ChameleonModulePass,"* You can modify the container here before it is dumped to PHP code. - * - * @param ContainerBuilder $container - * - * @api - * - * @return void","public function process(ContainerBuilder $container) - { - $moduleServiceDefinition = $container->getDefinition('chameleon_system_core.module_resolver'); - $moduleServiceIds = array_keys($container->findTaggedServiceIds('chameleon_system.module')); - $services = []; - - foreach ($moduleServiceIds as $moduleServiceId) { - $moduleDefinition = $container->getDefinition($moduleServiceId); - if (true === $moduleDefinition->isShared()) { - throw new \LogicException('Chameleon modules must not be shared service instances. This module is shared: '.$moduleServiceId); - }" -CollectRequestStateElementProvidersPass,"* {@inheritDoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $hashProvider = $container->getDefinition('chameleon_system_core.request_state_hash_provider'); - $elementProvider = array_keys( - $container->findTaggedServiceIds('chameleon_system_core.request_state_element_provider') - ); - - $clearStateEvents = []; - $elementProviderServiceDefinitions = []; - foreach ($elementProvider as $serviceId) { - $providerDefinition = $container->getDefinition($serviceId); - $providerClass = $providerDefinition->getClass(); - $clearStateEvents = array_merge( - $clearStateEvents, - \call_user_func(array($providerClass, 'getResetStateEvents')) - ); - - $elementProviderServiceDefinitions[] = $providerDefinition; - }" -ControllerResolverPass,* @return void,"public function process(ContainerBuilder $container) - { - $definition = $container->getDefinition('controller_resolver'); - $container->setDefinition('default.controller_resolver', $definition); - - $container->setAlias('controller_resolver', 'chameleon_system_core.controller_resolver'); - - if ($container->getParameter('kernel.debug')) { - $definition = $container->findDefinition('debug.controller_resolver'); - $arguments = $definition->getArguments(); - $arguments[0] = new Reference('chameleon_system_core.controller_resolver'); - $definition->setArguments($arguments); - }" -EmptyRequest,* @return null,"public function getLanguage() - { - return null; - }" -EmptyRequest,* @return null,"public function getActivePage() - { - return null; - }" -MakeLoggerPublicPass,"* {@inheritdoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $container->getAlias('logger')->setPublic(true); - }" -SetChameleonHttpKernelPass,"* {@inheritDoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $container->setAlias('http_kernel', 'chameleon_system_core.http_kernel'); - $container->getAlias('http_kernel')->setPublic(true); - }" -SetCsrfTokenManagerFactoryPass,"* {@inheritDoc} - * - * @return void","public function process(ContainerBuilder $container) - { - $tokenManagerDefinition = $container->getDefinition('security.csrf.token_manager'); - $factoryDefinition = $container->getDefinition('chameleon_system_core.security.authenticity_token.csrf_token_manager_factory'); - $tokenManagerDefinition->setFactory([$factoryDefinition, 'createCsrfTokenManager']); - }" -SetCsrfTokenStoragePass,"* Replace the token storage service of Symfony as that one uses ""session"" directly - which does not work with our own session handling.","public function process(ContainerBuilder $container) - { - $tokenStorageDefinitionSymfony = $container->getDefinition('security.csrf.token_storage'); - $tokenStorageDefinitionChameleon = $container->getDefinition('chameleon_system_core.security.authenticity_token.authenticity_token_storage'); - - $tokenStorageDefinitionSymfony->setClass($tokenStorageDefinitionChameleon->getClass()); - $tokenStorageDefinitionSymfony->setArguments($tokenStorageDefinitionChameleon->getArguments()); - }" -BackendLoginEvent,* @deprecated 7.2 no longer used - use the standard symfony login event,"public function __construct(TCMSUser $user) - { - $this->user = $user; - }" -BackendLoginEvent,* @var TCMSUser,"public function getUser() - { - return $this->user; - }" -BackendLogoutEvent,* @deprecated 7.2 no longer used - use the standard symfony logout event,"public function __construct(TCMSUser $user = null) - { - $this->user = $user; - }" -BackendLogoutEvent,* @var TCMSUser|null,"public function getUser() - { - return $this->user; - }" -ChangeActiveDomainEvent,* @var TCMSPortalDomain|null,"public function getNewActiveDomain() - { - return $this->newActiveDomain; - }" -ChangeActiveDomainEvent,* @var TCMSPortalDomain|null,"public function getOldActiveDomain() - { - return $this->oldActiveDomain; - }" -ChangeActiveDomainEvent,* @return TCMSPortalDomain|null,"public function __construct(?TCMSPortalDomain $oldActiveDomain = null, ?TCMSPortalDomain $newActiveDomain = null) - { - $this->oldActiveDomain = $oldActiveDomain; - $this->newActiveDomain = $newActiveDomain; - }" -ChangeActiveLanguagesForPortalEvent,* @var TCMSPortal,"public function __construct(TCMSPortal $portal, array $oldLanguages, array $newLanguages) - { - $this->portal = $portal; - $this->oldLanguages = $oldLanguages; - $this->newLanguages = $newLanguages; - }" -ChangeActiveLanguagesForPortalEvent,* @var string[],"public function getPortal() - { - return $this->portal; - }" -ChangeActiveLanguagesForPortalEvent,* @var string[],"public function getOldLanguages() - { - return $this->oldLanguages; - }" -ChangeActiveLanguagesForPortalEvent,"* @param TCMSPortal $portal - * @param string[] $oldLanguages list of language IDs for languages that were active before the change - * @param string[] $newLanguages list of language IDs for languages that are active before the change","public function getNewLanguages() - { - return $this->newLanguages; - }" -ChangeActivePageEvent,* @var TCMSActivePage,"public function getNewActivePage() - { - return $this->newActivePage; - }" -ChangeActivePageEvent,* @var TCMSActivePage|null,"public function getOldActivePage() - { - return $this->oldActivePage; - }" -ChangeActivePageEvent,* @return TCMSActivePage,"public function __construct(TCMSActivePage $newActivePage, TCMSActivePage $oldActivePage = null) - { - $this->newActivePage = $newActivePage; - $this->oldActivePage = $oldActivePage; - }" -ChangeActivePortalEvent,* @var TCMSPortal|null,"public function getNewActivePortal() - { - return $this->newActivePortal; - }" -ChangeActivePortalEvent,* @var TCMSPortal|null,"public function getOldActivePortal() - { - return $this->oldActivePortal; - }" -ChangeActivePortalEvent,* @return TCMSPortal|null,"public function __construct(?TCMSPortal $oldActivePortal = null, ?TCMSPortal $newActivePortal = null) - { - $this->oldActivePortal = $oldActivePortal; - $this->newActivePortal = $newActivePortal; - }" -ChangeDomainEvent,* @var TdbCmsPortalDomains[],"public function __construct(array $changedDomains) - { - $this->changedDomains = $changedDomains; - }" -ChangeDomainEvent,* @param TdbCmsPortalDomains[] $changedDomains,"public function getChangedDomains() - { - return $this->changedDomains; - }" -ChangeNavigationTreeConnectionEvent,* @var TdbCmsTreeNode,"public function __construct(TdbCmsTreeNode $changedTreeConnection) - { - $this->changedTreeConnection = $changedTreeConnection; - }" -ChangeNavigationTreeConnectionEvent,* @param TdbCmsTreeNode $changedTreeConnection,"public function getChangedTreeConnection() - { - return $this->changedTreeConnection; - }" -ChangeNavigationTreeNodeEvent,* @var \TdbCmsTree[],"public function __construct(array $changedTreeNodes) - { - $this->changedTreeNodes = $changedTreeNodes; - }" -ChangeNavigationTreeNodeEvent,* @param \TdbCmsTree[] $changedTreeNodes,"public function getChangedTreeNodes() - { - return $this->changedTreeNodes; - }" -ChangeShopOrderStepEvent,* @var TdbShopOrderStep[],"public function __construct(array $changedShopOrderSteps) - { - $this->changedShopOrderSteps = $changedShopOrderSteps; - }" -ChangeShopOrderStepEvent,* @param TdbShopOrderStep[] $changedShopOrderSteps,"public function getChangedShopOrderSteps() - { - return $this->changedShopOrderSteps; - }" -ChangeUseSlashInSeoUrlsForPortalEvent,* @var TCMSPortal,"public function __construct(TCMSPortal $portal, $oldValue, $newValue) - { - $this->portal = $portal; - $this->oldValue = $oldValue; - $this->newValue = $newValue; - }" -ChangeUseSlashInSeoUrlsForPortalEvent,* @var bool,"public function getPortal() - { - return $this->portal; - }" -ChangeUseSlashInSeoUrlsForPortalEvent,* @var bool,"public function isOldValue() - { - return $this->oldValue; - }" -ChangeUseSlashInSeoUrlsForPortalEvent,"* @param TCMSPortal $portal - * @param bool $oldValue - * @param bool $newValue","public function isNewValue() - { - return $this->newValue; - }" -DeleteMediaEvent,* @var string,"public function __construct($deletedMediaId) - { - $this->deletedMediaId = $deletedMediaId; - }" -DeleteMediaEvent,* @param string $deletedMediaId,"public function getDeletedMediaId() - { - return $this->deletedMediaId; - }" -DisplayListmanagerCellEvent,* Holds information on a single backend table cell. This information can be changed to alter display of the cell.,"public function __construct(\TGroupTableField $tableCell, array $rowData, $isHeader) - { - $this->tableCell = $tableCell; - $this->rowData = $rowData; - $this->isHeader = $isHeader; - }" -DisplayListmanagerCellEvent,* @var \TGroupTableField,"public function getTableCell() - { - return $this->tableCell; - }" -DisplayListmanagerCellEvent,* @var array,"public function getRowData() - { - return $this->rowData; - }" -DisplayListmanagerCellEvent,* @var bool,"public function isHeader() - { - return $this->isHeader; - }" -DisplayListmanagerCellEvent,* @var array,"public function getAttributes() - { - return $this->attributes; - }" -DisplayListmanagerCellEvent,* @var string,"public function setAttributes(array $attributes) - { - $this->attributes = $attributes; - }" -DisplayListmanagerCellEvent,* @var array,"public function getOnclickEvent() - { - return $this->onclickEvent; - }" -DisplayListmanagerCellEvent,* @var string,"public function setOnclickEvent($onclickEvent) - { - $this->onclickEvent = $onclickEvent; - }" -DisplayListmanagerCellEvent,"* @param \TGroupTableField $tableCell - * @param array $rowData - * @param bool $isHeader","public function getCssClasses() - { - return $this->cssClasses; - }" -DisplayListmanagerCellEvent,* @return \TGroupTableField,"public function setCssClasses(array $cssClasses) - { - $this->cssClasses = $cssClasses; - }" -DisplayListmanagerCellEvent,* @return array,"public function getCellValue() - { - return $this->cellValue; - }" -DisplayListmanagerCellEvent,* @return bool,"public function setCellValue($cellValue) - { - $this->cellValue = $cellValue; - }" -FilterContentEvent,* @var string,"public function __construct(string $content) - { - $this->content = $content; - }" -HtmlIncludeEvent,* @var array,"public function __construct(array $data = null) - { - if (null !== $data) { - $this->addData($data); - }" -HtmlIncludeEvent,"* only unique entries will be kept. unique will be determine as follows: - * - if an entry in the array has a key, that will be used to ensure uniqueness. - * - if it does not, the md5 sum of the content will be used. - * - * @param array $data - * - * @return void","public function addData(array $data) - { - foreach ($data as $key => $content) { - if ($this->isInteger($key)) { - $key = md5($content); - }" -HtmlIncludeEvent,* @return array,"public function getData() - { - return $this->data; - }" -,"* only unique entries will be kept. unique will be determine as follows: - * - if an entry in the array has a key, that will be used to ensure uniqueness. - * - if it does not, the md5 sum of the content will be used. - * - * @param array $data - * - * @return void","public function addData(array $data); - - /** - * @return array - */ - public function getData(); -}" -LocaleChangedEvent,* @var string|null,"public function __construct($newLocal, $originalLocal = null) - { - $this->newLocal = $newLocal; - $this->originalLocal = $originalLocal; - }" -LocaleChangedEvent,* @var string|null,"public function getNewLocal() - { - return $this->newLocal; - }" -LocaleChangedEvent,"* @param string|null $newLocal - * @param string|null $originalLocal","public function getOriginalLocal() - { - return $this->originalLocal; - }" -RecordChangeEvent,* @var string,"public function __construct($tableId, $recordId) - { - $this->tableId = $tableId; - $this->recordId = $recordId; - }" -RecordChangeEvent,* @var string,"public function getTableId() - { - return $this->tableId; - }" -RecordChangeEvent,"* @param string $tableId - * @param string $recordId","public function getRecordId() - { - return $this->recordId; - }" -expects,"* @psalm-suppress InvalidReturnStatement, InvalidReturnType - * @FIXME Default value of `$content` is an empty array, when everything outside of this class expects `getContent` to return a string.","public function __construct($content = null) - { - if (null !== $content) { - $this->setContent($content); - }" -expects,* @var array|string,"public function setContent($content) - { - $this->content = $content; - }" -expects,* @param string|null $content,"public function getContent() - { - return $this->content; - }" -,"* @param string $content - * - * @return void","public function setContent($content); - - /** - * @return string - */ - public function getContent(); -}" -AddAntispamIncludesListener,* @var RequestInfoServiceInterface,"public function __construct(RequestInfoServiceInterface $requestInfoService) - { - $this->requestInfoService = $requestInfoService; - }" -AddAntispamIncludesListener,* @param RequestInfoServiceInterface $requestInfoService,"public function onGlobalHtmlFooterInclude(HtmlIncludeEventInterface $event) - { - $includes = array(); - - if (!$this->requestInfoService->isCmsTemplateEngineEditMode()) { - $oAntiSpam = new \antiSpam(); - $includes[] = $oAntiSpam->PrintJSCode(); - }" -AddBackendToasterMessageListener,* @var string,"public function __construct($message, $type) - { - $this->message = $message; - $this->type = $type; - }" -AddBackendToasterMessageListener,* @var string,"public function addMessage(ResponseEvent $event) - { - if (!$event->isMainRequest()) { - return; - }" -AddControllerIncludesListener,* @var RequestInfoServiceInterface,"public function __construct(RequestInfoServiceInterface $requestInfoService, ChameleonController $backendController, ChameleonController $frontendController) - { - $this->requestInfoService = $requestInfoService; - $this->backendController = $backendController; - $this->frontendController = $frontendController; - }" -AddControllerIncludesListener,* @var ChameleonController,"public function onGlobalHtmlHeaderInclude(HtmlIncludeEventInterface $event) - { - if ($this->requestInfoService->isBackendMode()) { - $event->addData($this->backendController->getHtmlHeaderIncludes()); - }" -AddControllerIncludesListener,* @var ChameleonController,"public function onGlobalHtmlFooterInclude(HtmlIncludeEventInterface $event) - { - if ($this->requestInfoService->isBackendMode()) { - $event->addData($this->backendController->getHtmlFooterIncludes()); - }" -AddGlobalHeadIncludesListener,"* Class AddJqueryIncludeListener returns the resources configured in the root directory of the snippets. - * Those will be included no matter which modules are being loaded.","public function __construct(\TPkgViewRendererSnippetDirectoryInterface $viewRendererSnippetDirectory) - { - $this->viewRendererSnippetDirectory = $viewRendererSnippetDirectory; - }" -AddGlobalHeadIncludesListener,* @var \TPkgViewRendererSnippetDirectoryInterface,"public function onGlobalHtmlHeaderInclude(HtmlIncludeEventInterface $event) - { - $event->addData($this->viewRendererSnippetDirectory->getResourcesForSnippetPackage('')); - - $event->addData(array( - '', - '', - '', - )); - }" -AddJqueryIncludeListener,"* @param HtmlIncludeEventInterface $event - * - * @return void","public function onGlobalHtmlHeaderInclude(HtmlIncludeEventInterface $event) - { - if (true === TGlobal::IsCMSMode()) { - $jqueryInclude = ''; - $jqueryInclude .= ''; - - $event->addData([$jqueryInclude]); - }" -AddModuleIncludesListener,* @var RequestInfoServiceInterface,"public function __construct(RequestInfoServiceInterface $requestInfoService, \TModuleLoader $moduleLoader, \TUserModuleLoader $userModuleLoader) - { - $this->requestInfoService = $requestInfoService; - $this->moduleLoader = $moduleLoader; - $this->userModuleLoader = $userModuleLoader; - }" -AddModuleIncludesListener,* @var \TModuleLoader,"public function onGlobalHtmlHeaderInclude(HtmlIncludeEventInterface $event) - { - if ($this->requestInfoService->isBackendMode()) { - $event->addData($this->moduleLoader->GetHtmlHeadIncludes()); - }" -AddModuleIncludesListener,* @var \TUserModuleLoader,"public function onGlobalHtmlFooterInclude(HtmlIncludeEventInterface $event) - { - if ($this->requestInfoService->isBackendMode()) { - $event->addData($this->moduleLoader->GetHtmlFooterIncludes()); - }" -AllowEmbeddingForDifferentDomainListener,* Allow the calling domain to see this page (e.g. in an iframe).,"public function __construct(CmsPortalDomainsDataAccessInterface $domainsDataAccess) - { - $this->domainsDataAccess = $domainsDataAccess; - }" -AllowEmbeddingForDifferentDomainListener,* @var CmsPortalDomainsDataAccessInterface,"public function onKernelRequest(RequestEvent $event) - { - $request = $event->getRequest(); - - if (false === $this->isPreviewMode($request)) { - return; - }" -BackendBreadcrumbListener,* @var RequestStack,"public function __construct( - RequestStack $requestStack, - RequestInfoServiceInterface $requestInfoService, - InputFilterUtilInterface $inputFilterUtil, - BackendBreadcrumbServiceInterface $backendBreadcrumbService - ) { - $this->requestStack = $requestStack; - $this->requestInfoService = $requestInfoService; - $this->inputFilterUtil = $inputFilterUtil; - $this->backendBreadcrumbService = $backendBreadcrumbService; - }" -BackendBreadcrumbListener,* @var RequestInfoServiceInterface,"public function onKernelRequest(RequestEvent $event) - { - if (false === $event->isMainRequest()) { - return; - }" -CaseInsensitivePortalExceptionListener,* @var CmsPortalDomainsDataAccessInterface,"public function __construct(CmsPortalDomainsDataAccessInterface $cmsPortalDomainsDataAccess) - { - $this->cmsPortalDomainsDataAccess = $cmsPortalDomainsDataAccess; - }" -CaseInsensitivePortalExceptionListener,"* Returns the path fragment between first and second slash (or everything after the first slash if there is no - * second one) - this might be a portal prefix. - * - * @param string $relativePath - * - * @return string|null","public function onKernelException(ExceptionEvent $event): void - { - $exception = $event->getThrowable(); - - if (false === $exception instanceof NotFoundHttpException) { - return; - }" -ChangeChameleonObjectsLocaleListener,* Class ChangeChameleonObjectsLocaleListener.,"public function __construct(PortalDomainServiceInterface $portalDomainService, LanguageServiceInterface $languageService) - { - $this->portalDomainService = $portalDomainService; - $this->languageService = $languageService; - }" -ChangeChameleonObjectsLocaleListener,* @var PortalDomainServiceInterface,"public function onLocaleChangedEvent(LocaleChangedEvent $event) - { - $portal = $this->portalDomainService->getActivePortal(); - if (null !== $portal) { - $portal->SetLanguage($this->languageService->getActiveLanguageId()); - $portal->LoadFromRow($portal->sqlData); - }" -CheckPortalDomainListener,* @var PortalDomainServiceInterface,"public function __construct(PortalDomainServiceInterface $portalDomainService, RequestInfoServiceInterface $requestInfoService, $forcePrimaryDomain = CHAMELEON_FORCE_PRIMARY_DOMAIN) - { - $this->portalDomainService = $portalDomainService; - $this->requestInfoService = $requestInfoService; - $this->forcePrimaryDomain = $forcePrimaryDomain; - }" -CheckPortalDomainListener,* @var RequestInfoServiceInterface,"public function onKernelRequest(RequestEvent $event) - { - if (!$event->isMainRequest()) { - return; - }" -CleanupBreadcrumbAfterDeleteListener,* @var BackendBreadcrumbServiceInterface,"public function __construct(BackendBreadcrumbServiceInterface $breadcrumbService) - { - $this->breadcrumbService = $breadcrumbService; - }" -ClearRoutingCacheListener,* @var ChameleonBaseRouter,"public function __construct(ChameleonBaseRouter $router) - { - $this->router = $router; - }" -ClearRoutingCacheListener,* @param ChameleonBaseRouter $router,"public function clearRoutingCache(Event $event) - { - $this->router->clearCache(); - }" -InitializeRequestListener,* @var RequestInitializer,"public function __construct( - RequestInitializer $requestInitializer, - MaintenanceModeServiceInterface $maintenanceModeService, - RequestInfoServiceInterface $requestInfoService - ) { - $this->requestInitializer = $requestInitializer; - $this->maintenanceModeService = $maintenanceModeService; - $this->requestInfoService = $requestInfoService; - }" -InitializeRequestListener,* @var MaintenanceModeServiceInterface,"public function onKernelRequest(RequestEvent $event) - { - if (!$event->isMainRequest()) { - return; - }" -mimics,"* Generates a new session ID after login. Note that this class mimics Symfony behavior in deleting session data - * immediately, contradicting the PHP docs (https://secure.php.net/manual/en/features.session.security.management.php).","public function __construct(RequestStack $requestStack) - { - $this->requestStack = $requestStack; - }" -mimics,* @var RequestStack,"public function migrateSession() - { - $mainRequest = $this->requestStack->getMainRequest(); - if (null === $mainRequest || false === $mainRequest->hasSession()) { - return; - }" -NoCacheForSecurePageListener,"* Use a no-cache header for every secure page so that browser ""back"" does not get these pages from the cache. - * - * @see https://redmine.esono.de/issues/33950","public function onChangeActivePage(ChangeActivePageEvent $event): void - { - $pageIsProtected = true === $event->getNewActivePage()->fieldExtranetPage; - - if ($pageIsProtected) { - header('Cache-Control: no-cache, no-store, must-revalidate'); - }" -RedirectToSecurePageListener,* @var RequestStack,"public function __construct( - RequestStack $requestStack, - UrlUtil $urlUtil, - ICmsCoreRedirect $redirect, - RequestInfoServiceInterface $requestInfoService - ) { - $this->requestStack = $requestStack; - $this->urlUtil = $urlUtil; - $this->redirect = $redirect; - $this->requestInfoService = $requestInfoService; - }" -RedirectToSecurePageListener,* @var UrlUtil,"public function onChangeActivePage(ChangeActivePageEvent $event): void - { - $request = $this->requestStack->getCurrentRequest(); - - if (null === $request) { - throw new \RuntimeException('No request present during page change'); - }" -RehashBackendUserPasswordListener,"* RehashBackendUserPasswordListener checks if the backend user's password needs to be re-hashed because and older - * hashing algorithm was still in use when the password was hashed. This listener can only be applied after a successful - * login, because only then will the plaintext password be available.","public function __construct(InputFilterUtilInterface $inputFilterUtil, PasswordHashGeneratorInterface $passwordHashGenerator, Connection $databaseConnection, TGlobal $global) - { - $this->inputFilterUtil = $inputFilterUtil; - $this->passwordHashGenerator = $passwordHashGenerator; - $this->databaseConnection = $databaseConnection; - $this->global = $global; - }" -RehashBackendUserPasswordListener,* @var InputFilterUtilInterface,"public function rehashPassword(BackendLoginEvent $backendLoginEvent) - { - $user = $backendLoginEvent->getUser(); - $existingHashedPassword = $user->sqlData['crypted_pw']; // We need to access sqlData because the user object is - // an instance of TCMSUser, not TAdbCmsUser. - - if (false === $this->passwordHashGenerator->needsRehash($existingHashedPassword)) { - return; - }" -RequestTypeListener,* @var ContainerInterface,"public function __construct(ContainerInterface $container, AbstractRequestType $backendRequestType, AbstractRequestType $frontendRequestType, AbstractRequestType $assetRequestType) - { - $this->container = $container; - $this->backendRequestType = $backendRequestType; - $this->frontendRequestType = $frontendRequestType; - $this->assetRequestType = $assetRequestType; - }" -RequestTypeListener,* @var AbstractRequestType,"public function onKernelRequest(RequestEvent $event) - { - if (false === $event->isMainRequest()) { - return; - }" -RequestTypeListener,* @var AbstractRequestType,"public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - }" -TemplateEngineAccessListener,"* TemplateEngineAccessListener checks if the current user has access to the template engine, which is the case if the - * user is logged in to the backend. In the past, this check was performed quite early in the request processing, but - * now we can check only after the session was started in the InitializeRequestListener.","public function __construct( - readonly private RequestInfoServiceInterface $requestInfoService, - readonly private SecurityHelperAccess $security - ) - {}" -TemplateEngineAccessListener,* @return void,"public function onKernelRequest(RequestEvent $event) - { - if (!$event->isMainRequest()) { - return; - }" -FieldTreeNodePortalSelect,"* Allows the selection of only the portal root tree nodes (level 1 of tree). - * - * {@inheritdoc}","public function GetHTML() - { - $translator = $this->getTranslator(); - $path = $this->_GetTreePath(); - $html = 'name).'"" name=""'.TGlobal::OutHTML($this->name).'"" value=""'.TGlobal::OutHTML($this->data).'"" />'; - $html .= '
name).'_path"">'.$path.'
'; - $html .= '
 
'; - - $html .= \TCMSRender::DrawButton( - $translator->trans('chameleon_system_core.field_tree_node.assign_node'), - ""javascript:loadTreeNodePortalSelection('"".TGlobal::OutJS($this->name).""');"", - 'fas fa-check'); - $html .= \TCMSRender::DrawButton( - $translator->trans('chameleon_system_core.action.reset'), - ""javascript:ResetTreeNodeSelection('"".TGlobal::OutJS($this->name).""');"", - 'fas fa-undo'); - - return $html; - }" -ClassFromTableFieldProvider,* @var DataAccessClassFromTableFieldProviderInterface,"public function __construct(DataAccessClassFromTableFieldProviderInterface $dataAccessClassFromTableFieldProvider) - { - $this->dataAccessClassFromTableFieldProvider = $dataAccessClassFromTableFieldProvider; - }" -ClassFromTableFieldProvider,* {@inheritdoc},"public function getFieldClassNameFromTableField($tableField) - { - if ('id' === $tableField) { - return null; - }" -ClassFromTableFieldProvider,* {@inheritdoc},"public function getDictionaryFromTableField($fieldIdentifier) - { - $fieldIdentifier = str_replace('`', '', $fieldIdentifier); - $tableConfIdSplit = explode('.', $fieldIdentifier); - - if (false === $tableConfIdSplit || 2 !== count($tableConfIdSplit)) { - return null; - }" -information,* Retrieves class information from table field data.,"public function getFieldClassNameFromTableField($tableField); - - /** - * Parses a database field name specification into its base table and field separately. - * Example input data: '`shop_article`.`cmsident`' produces [tableName=>$tableName, fieldName=>fieldName]. - * - * @param string $fieldIdentifier - * - * @return array|null - */ - public function getDictionaryFromTableField($fieldIdentifier); -}" -ClassFromTableFieldProviderRequestLevelCacheDecorator,* @var ClassFromTableFieldProviderInterface,"public function __construct(ClassFromTableFieldProviderInterface $subject) - { - $this->subject = $subject; - }" -ClassFromTableFieldProviderRequestLevelCacheDecorator,* @var array,"public function getFieldClassNameFromTableField($tableField) - { - if (false === \array_key_exists($tableField, $this->fieldClassNameCache)) { - $this->fieldClassNameCache[$tableField] = $this->subject->getFieldClassNameFromTableField($tableField); - }" -ClassFromTableFieldProviderRequestLevelCacheDecorator,* @var array,"public function getDictionaryFromTableField($fieldIdentifier) - { - if (false === \array_key_exists($fieldIdentifier, $this->dictionaryCache)) { - $this->dictionaryCache[$fieldIdentifier] = $this->subject->getDictionaryFromTableField($fieldIdentifier); - }" -chameleon,* @var int,"public function boot() - { - if (!array_key_exists('HTTP_HOST', $_SERVER)) { - echo 'no HTTP_HOST in chameleon.php'; - exit(0); - }" -ActiveCmsUserPermission,* @return bool,"public function hasPermissionToExportTranslationDatabase() - { - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - return $securityHelper->isGranted(CmsUserRoleConstants::CMS_USER); - }" -TranslationExporterJSON,* @var TranslatorBagInterface,"public function __construct(TranslatorBagInterface $translator) - { - $this->translator = $translator; - }" -TranslationExporterJSON,"* @param string $locale - * @param string $domain - * - * @return string","public function export($locale, $domain) - { - $messageArray = $this->getMessages($locale, $domain); - - return json_encode($messageArray); - }" -JsTranslationController,* @var TranslationDomainExportInterface,"public function __construct( - TranslationDomainExportInterface $exporter, - ActiveCmsUserPermissionInterface $activeUserPermission - ) { - $this->exporter = $exporter; - $this->activeUserPermission = $activeUserPermission; - }" -JsTranslationController,* @var ActiveCmsUserPermissionInterface,"public function __invoke($_locale) - { - if (false === $this->activeUserPermission->hasPermissionToExportTranslationDatabase()) { - throw new AccessDeniedException('chameleon_system_core.translation_exporter.error_not_logged_in'); - }" -,* @return bool,"public function hasPermissionToExportTranslationDatabase(); -}" -,"* @param string $locale - * @param string $domain - * - * @return string","public function export($locale, $domain); -}" -,"* @param string $consumer - * @param string $code - * @param array $parameter - * - * @return void","public function addMessage($consumer, $code, array $parameter = array()); - - /** - * @param string $consumer - * @param bool $remove - * @param bool $includeGlobal - * - * @return TIterator - */ - public function consumeMessages($consumer, $remove = true, bool $includeGlobal = true); - - /** - * @param string $sConsumerName - * @param string|null $sViewName - * @param string|null $sViewType - * @param array $aCallTimeVars - * @param bool $bRemove - * - * @return string - */ - public function renderMessages($sConsumerName, $sViewName = null, $sViewType = null, array $aCallTimeVars = array(), $bRemove = true); - - /** - * @param string|null $sConsumerName - * - * @return void - */ - public function clearMessages($sConsumerName = null); - - /** - * @param string $sConsumerName - * @param bool $includeGlobal - * - * @return bool - */ - public function consumerHasMessages($sConsumerName, bool $includeGlobal = true); - - /** - * @param string $sConsumerName - * @param bool $includeGlobal - * - * @return int - */ - public function consumerMessageCount($sConsumerName, bool $includeGlobal = true); - - /** - * @return int - */ - public function totalMessageCount(); - - /** - * @param string $sText - * - * @return string - */ - public function injectMessageIntoString($sText); - - /** - * @return string[] - */ - public function getConsumerListWithMessages(); - - /** - * @param string $sConsumerName - * @param string $sDivider - * - * @return string - */ - public function getClassesForConsumer($sConsumerName, $sDivider = ' '); - - /** - * @param string $id - * @param string $type - * @param array $parameters - * @param string $domain - * - * @return void - */ - public function addBackendToasterMessage($id, $type = 'ERROR', array $parameters = array(), $domain = TranslationConstants::DOMAIN_BACKEND); -}" -,"* @param string $tableName - * @return string - * @throws GuidCreationFailedException","public function findUnusedId(string $tableName): string; -}" -,* Provide URLs to media manager.,"public function getStandaloneMediaManagerUrl(); - - /** - * Return true if media manager should be opened in new window. - * - * @return bool - */ - public function openStandaloneMediaManagerInNewWindow(); - - /** - * Return URL to media manager for picking images. - * - * @param string $javaScriptCallbackFunctionName - * @param bool $canUseCrop - * @param string|null $imageFieldName - legacy - * @param string|null $tableId - legacy - * @param string|null $recordId - legacy - * @param int $position - legacy - * - * @return string - */ - public function getUrlToPickImage( - $javaScriptCallbackFunctionName = 'parent._SetImage', - $canUseCrop = false, - $imageFieldName = null, - $tableId = null, - $recordId = null, - $position = 0 - ); - - /** - * Return URL to media manager for picking images from a WYSIWYG instance. - * - * @param string $javaScriptCallbackFunctionName - * - * @return string - */ - public function getUrlToPickImageForWysiwyg($javaScriptCallbackFunctionName = 'selectImage'); -}" -,"* Checks if system is allowed to use resource collection. - * Was used to disable resource collection in template engine. - * - * @return bool","public function IsAllowed(); - - /** - * Combine multiple resource files into one file. - * - * @param string $pageContent - * - * @return string - the processed page content - */ - public function CollectExternalResources($pageContent); -}" -,"* @param \DateTimeZone|null $timeZone - will use the systems current timezone if null is passed - * - * @return \DateTime","public function getUnixTimestamp(): int; - - /** - * @param \DateTimeZone|null $timeZone - will use the systems current timezone if null is passed - * - * @return \DateTime - */ - public function getDateTime(?\DateTimeZone $timeZone = null): \DateTime; -}" -,"* Returns an alternative email address for the passed email address (this may be the same one). - * - * @param string $mail - * - * @return string","public function transform($mail); - - /** - * Returns a modified email subject. - * - * @param string $subject - * - * @return string - */ - public function transformSubject($subject); -}" -Migrator,"* @param string $version - * - * @return void","public function migrate($version) - { - switch ($version) { - case '6.2': - $migrator = new Migrator62(); - break; - default: - throw new InvalidArgumentException('Unsupported version:'.$version); - }" -,"* MigratorInterface is a common interface for migration helper classes. Migrators should only (!) be used to simplify - * migration to newer Chameleon versions at an early stage of migrating, when the Symfony service container cannot be - * built yet.","public function migrate(); -}" -ComposerData,* @var string,"public function __construct($filePath, array $data) - { - $this->filePath = $filePath; - $this->data = $data; - }" -ComposerData,* @var array,"public function getFilePath() - { - return $this->filePath; - }" -ComposerData,"* @param string $filePath - * @param array $data","public function getData() - { - return $this->data; - }" -ComposerData,* @return string,"public function setData($data) - { - $this->data = $data; - }" -ComposerJsonModifier,"* ComposerJsonModifier A simple tool for modifying composer.json files. - * Note that this file is for internal use only. No backwards compatibility promises are made for this class.","public function getComposerData($path) - { - return new ComposerData($path, json_decode(file_get_contents($path), true)); - }" -ComposerJsonModifier,"* @param string $path - * - * @return ComposerData","public function saveComposerFile(ComposerData $composerData) - { - file_put_contents($composerData->getFilePath(), json_encode($composerData->getData(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * - * @return void","public function addAutoloadClassmap(ComposerData $composerData, array $newElements) - { - if (isset($composerData->getData()['autoload'])) { - $autoload = $composerData->getData()['autoload']; - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function addRequire(ComposerData $composerData, array $newElements) - { - $this->addToSection($composerData, 'require', $newElements); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function addRequireDev(ComposerData $composerData, array $newElements) - { - $this->addToSection($composerData, 'require-dev', $newElements); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function addSuggest(ComposerData $composerData, array $newElements) - { - $this->addToSection($composerData, 'suggest', $newElements); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function addScripts(ComposerData $composerData, array $newElements) - { - $this->addToSection($composerData, 'scripts', $newElements); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function addConfig(ComposerData $composerData, array $newElements) - { - $this->addToSection($composerData, 'config', $newElements); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function addExtra(ComposerData $composerData, array $newElements) - { - $this->addToSection($composerData, 'extra', $newElements); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $newElements - * - * @return void","public function removeRequire(ComposerData $composerData, array $elementsToRemove) - { - $this->removeFromSection($composerData, 'require', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param string $section - * @param array $newElements - * @param bool $forceUpdate - * - * @return void","public function removeRequireDev(ComposerData $composerData, array $elementsToRemove) - { - $this->removeFromSection($composerData, 'require-dev', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function removeSuggest(ComposerData $composerData, array $elementsToRemove) - { - $this->removeFromSection($composerData, 'suggest', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function removeScripts(ComposerData $composerData, array $elementsToRemove) - { - $this->removeFromSection($composerData, 'scripts', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function removeConfig(ComposerData $composerData, array $elementsToRemove) - { - $this->removeFromSection($composerData, 'config', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function removeExtra(ComposerData $composerData, array $elementsToRemove) - { - $this->removeFromSection($composerData, 'extra', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function addPostInstallCommands(ComposerData $composerData, array $elementsToAdd) - { - $this->addScriptCommands($composerData, 'post-install-cmd', $elementsToAdd); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function addPostUpdateCommands(ComposerData $composerData, array $elementsToAdd) - { - $this->addScriptCommands($composerData, 'post-update-cmd', $elementsToAdd); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param string $section - * @param array $elementsToRemove - * - * @return void","public function removePostInstallCommands(ComposerData $composerData, array $elementsToRemove) - { - $this->removeScriptCommands($composerData, 'post-install-cmd', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToAdd - * - * @return void","public function removePostUpdateCommands(ComposerData $composerData, array $elementsToRemove) - { - $this->removeScriptCommands($composerData, 'post-update-cmd', $elementsToRemove); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToAdd - * - * @return void","public function addKey(ComposerData $composerData, $key, $value, $forceOverwrite = false) - { - $data = $composerData->getData(); - if (false === $forceOverwrite && isset($data[$key])) { - return; - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param string $commandType - * @param array $elementsToAdd - * - * @return void","public function removeKey(ComposerData $composerData, $key) - { - $data = $composerData->getData(); - unset($data[$key]); - $composerData->setData($data); - }" -ComposerJsonModifier,"* @param ComposerData $composerData - * @param array $elementsToRemove - * - * @return void","public function removeRepository(ComposerData $composerData, $url) - { - $data = $composerData->getData(); - $repositories = $data['repositories']; - foreach ($repositories as $index => $repository) { - if (isset($repository['url']) && $repository['url'] === $url) { - unset($repositories[$index]); - $repositories = array_values($repositories); - break; - }" -MaintenanceModeService,* @var Connection,"public function __construct(Connection $connection, CacheInterface $cache) - { - $this->connection = $connection; - $this->cache = $cache; - }" -MaintenanceModeService,* @var CacheInterface,"public function isActive(): bool - { - if (true === \TdbCmsConfig::GetInstance()->fieldShutdownWebsites) { - /* - * This location should not have been reached if maintenance mode is on. - * The reason could be that the file/stat cache is outdated. So we refresh it here for the next request / the imminent redirect. - */ - clearstatcache(true, PATH_MAINTENANCE_MODE_MARKER); - - return true; - }" -MaintenanceModeService,* @throws MaintenanceModeErrorException,"public function activate(): void - { - try { - $this->connection->executeUpdate(""UPDATE `cms_config` SET `shutdown_websites` = '1'""); - - $this->cache->callTrigger('cms_config'); - }" -MaintenanceModeService,* @throws MaintenanceModeErrorException,"public function deactivate(): void - { - $this->removeMarkerFile(); - - try { - $this->connection->executeUpdate(""UPDATE `cms_config` SET `shutdown_websites` = '0'""); - - $this->cache->callTrigger('cms_config'); - }" -,* @throws MaintenanceModeErrorException,"public function isActive(): bool; - - /** - * @throws MaintenanceModeErrorException - */ - public function activate(): void; - - /** - * @throws MaintenanceModeErrorException - */ - public function deactivate(): void; -}" -Migrator62,* @var string,"public function __construct() - { - $this->baseDir = realpath(__DIR__.'/../../../../../../..'); - }" -Migrator62,* @return void,"public function migrate() - { - $this->migrate62FileBase(); - $this->migrate62ComposerJson(); - $this->finish(); - }" -MapperLoader,* @var ServiceLocator,"public function __construct(ServiceLocator $serviceLocator) - { - $this->serviceLocator = $serviceLocator; - }" -MapperLoader,* {@inheritdoc},"public function getMapper($identifier) - { - try { - $service = $this->serviceLocator->get($identifier); - }" -name,* MapperLoaderInterface defines a services that loads mapper instances.,"public function getMapper($identifier); -}" -ModuleExecutionStrategyInline,* {@inheritdoc},"public function execute(Request $request, TModelBase $module, $spotName, $isLegacyModule) - { - return $module->__invoke($request, $isLegacyModule); - }" -,"* ModuleExecutionStrategyInterface defines a common interface for different strategies on how to load modules (i.e. - * call TModelBase::__invoke()).","public function execute(Request $request, TModelBase $module, $spotName, $isLegacyModule); -}" -ModuleExecutionStrategySubRequest,* @var CacheInterface,"public function __construct(CacheInterface $cache, KernelInterface $kernel) - { - $this->cache = $cache; - $this->kernel = $kernel; - }" -ModuleExecutionStrategySubRequest,* @var KernelInterface,"public function execute(Request $request, TModelBase $module, $spotName, $isLegacyModule) - { - $esiPath = $this->getModuleESIPath($request, $module, $spotName); - $moduleRequest = $request->duplicate(); - $moduleRequest->server->set('REQUEST_URI', $esiPath); - $moduleRequest->attributes->set('_controller', $module); - $moduleRequest->attributes->set('isLegacyModule', $isLegacyModule); - - return $this->kernel->handle($moduleRequest, HttpKernelInterface::SUB_REQUEST); - }" -ModuleResolver,* @var ContainerInterface,"public function __construct(ContainerInterface $container) - { - $this->container = $container; - }" -ModuleResolver,* {@inheritdoc},"public function getModule($name) - { - if (false === $this->container->has($name)) { - return null; - }" -ModuleResolver,* {@inheritdoc},"public function hasModule($name) - { - return $this->container->has($name); - }" -,"* @param string $name - * - * @return \TModelBase|null","public function getModule($name); - - /** - * @param string $name - * - * @return bool - */ - public function hasModule($name); -}" -TCMSModelBase,"* returns true if the module may add its url to the history object. - * - * @return bool","public function ExecuteAjaxCall() - { - $methodName = $this->global->GetUserData('_fnc'); - if (empty($methodName)) { - trigger_error('Ajax call made, but no function passed via _fnc', E_USER_ERROR); - }" -TCMSModelBase,"* checks if the call was made via ajax. - * - * @return bool","public function Execute() - { - parent::Execute(); - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - - $user = $securityHelper->getUser(); - $userObject = null; - if (null !== $user) { - $userObject = TdbCmsUser::GetNewInstance(); - $userObject->Load($user->getId()); - }" -TCMSModelBase,* {@inheritdoc},"public function GetHtmlHeadIncludes() - { - static $includes = null; - if (null !== $includes) { - return $includes; - }" -TGlobal,"* call it to find out if we are in the cms or on the webpage. - * - * @return bool","public function GetWebuserLoginData() - { - return array('loginName' => 'www', 'password' => 'www'); - }" -TGlobal,"* Translates the given message. - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @throws InvalidArgumentException If the locale contains invalid characters - * - * @return string The translated string - * - * @deprecated deprecated since 6.1.0 - please use the ""translator"" service","public function GetUserData($name = null, $excludeArray = array(), $sFilterClass = TCMSUSERINPUT_DEFAULTFILTER) - { - if (self::MODE_BACKEND === self::$mode) { - $sFilterClass = ''; - }" -TGlobal,"* returns the value of variable $name or if missing the whole array filtered by $excludeArray - * the data is unfiltered. - * - * @param string $name - * @param array $excludeArray - * @param string $sFilterClass - form: classname;path;type|classname;path;type - * - * @return mixed - string or array - * - * @deprecated since 6.2.0 - use InputFilterUtilInterface::getFiltered*Input() instead.","public function GetLanguageIdList() - { - if (self::MODE_BACKEND === self::$mode) { - // get security helper - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $languages = $securityHelper->getUser()?->getAvailableEditLanguages(); - if (null === $languages) { - $languages = []; - }" -provides,"* all global classes used in the framework (ie. for both the cms and the user - * side) should inherit from this. this class provides the basic functionality - * such as class factory, get/post filtering, etc. - * -/*","public function __construct(RequestStack $requestStack, InputFilterUtilInterface $inputFilterUtil, KernelInterface $kernel) - { - $this->requestStack = $requestStack; - $this->inputFilterUtil = $inputFilterUtil; - $this->kernel = $kernel; - }" -provides,"* holds the state of portal based class transformation. - * - * @var bool","public function __get($sParameterName) - { - if ('userData' === $sParameterName) { - $trace = debug_backtrace(); - trigger_error('userData is no longer available - use \ChameleonSystem\CoreBundle\ServiceLocator::get(""request_stack"")->getCurrentRequest() instead in '.$trace[1]['file'].' on line '.$trace[1]['line'], E_USER_ERROR); - - return null; - }" -provides,"* URL path to backend http resources. - * - * @var string","public function SetExecutingModulePointer($oExecutingModuleObject) - { - $this->oExecutingModuleObject = $oExecutingModuleObject; - }" -provides,"* a copy of all rewrite parameter - these parameters will be excluded from the GetRealURL request (since they are part of the url anyway). - * - * @var array","public function GetExecutingModulePointer() - { - return $this->oExecutingModuleObject; - }" -provides,"* used to cache any data that may be needed globally - * (like a list of portals, etc). - * - * @var array","public function GetLanguageIdList() - { - $oCMSConfig = TdbCmsConfig::GetInstance(); - return [$oCMSConfig->fieldTranslationBaseLanguageId]; - }" -provides,"* holds the current executing module object. - * - * @var TModelBase","public function UserDataExists($name = null) - { - $request = $this->getRequest(); - - return null !== $request && null !== $request->get($name, null); - }" -provides,"* config class of the HTMLPurifier XSS filter. - * - * @var HTMLPurifier_Config","public function GetUserData($name = null, $excludeArray = array(), $sFilterClass = TCMSUSERINPUT_DEFAULTFILTER) - { - $outputData = ''; - $request = $this->getRequest(); - if (null !== $request) { - if (null !== $name) { // get value for key - $outputData = $this->inputFilterUtil->getFilteredInput($name, '', false, $sFilterClass); - }" -provides,@var RequestStack,"public function GetRawUserData($name = null, $excludeArray = array()) - { - return $this->GetUserData($name, $excludeArray, TCMSUserInput::FILTER_NONE); - }" -provides,* @var InputFilterUtilInterface,"public function SetUserData($sArrayKeyName, $Value) - { - $request = $this->getRequest(); - $request->query->set($sArrayKeyName, $Value); - }" -provides,* @var KernelInterface,"public function SetPurifierConfig() - { - if (is_null($this->oHTMLPurifyConfig)) { - /** @var $config HTMLPurifier_Config */ - $config = HTMLPurifier_Config::createDefault(); - $config->set('HTML.TidyLevel', 'none'); - $config->set('Core.RemoveInvalidImg', false); - $config->set('Core.AggressivelyFixLt', false); - $config->set('Core.ConvertDocumentToFragment', false); - $config->set('Cache.SerializerPath', PATH_CMS_CUSTOMER_DATA); - $this->oHTMLPurifyConfig = $config; - }" -provides,"* needs to be overwritten in the child class. should return a pointer to - * an instance of the child global class. - * - * @return TGlobalBase - * - * @deprecated Use \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.global') instead","public function OutputUserData($name = null) - { - return htmlspecialchars($this->GetUserData($name), ENT_QUOTES); - }" -provides,"* called by the controller to set the pointer to the currently executing module instance. - * - * @param TModelBase $oExecutingModuleObject","public function getModuleRootPath($type) - { - $bundlePath = self::instance()->resolveBundlePath($type); - if (null !== $bundlePath) { - return $bundlePath.'/objects/BackendModules/'; - }" -provides,"* return pointer to the currently executing module object. - * - * @return TModelBase","public function _GetPagedefRootPath($sType) - { - $bundlePath = $this->resolveBundlePath($sType); - if (null !== $bundlePath) { - return $bundlePath.'/Resources/BackendPageDefs/'; - }" -provides,"* return a pointer to the controller running the show. - * - * @return ChameleonControllerInterface - * - * @deprecated Use \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.chameleon_controller') instead","public function GetPortals() - { - if (!array_key_exists('oPortals', $this->_dataCache)) { - $this->_dataCache['oPortals'] = new TCMSPortalList(); - }" -provides,"* returns the base URL of the current backend theme - * uses GetStaticURL to return optional static domain. - * - * @return string","public function SetRewriteParameter($aParameter) - { - $this->aRewriteParameter = $aParameter; - }" -provides,"* returns the static path to the given file in the blackbox directory. - * - * @param string $sFilePath - the relative url of the file in relation to the blackbox directory - * @param bool $bForceNonSSL - used to force urls to non SSL - * - * @return string","public function GetRewriteParameter() - { - return $this->aRewriteParameter; - }" -provides,* @return string[]|string,"public function __call($name, $arguments) - { - $aBackwardsCompatMethods = array(); - $aBackwardsCompatMethods['GetuserData'] = 'GetUserData'; - $aBackwardsCompatMethods['userDataExists'] = 'UserDataExists'; - - if (array_key_exists($name, $aBackwardsCompatMethods)) { - $sNewMethodName = $aBackwardsCompatMethods[$name]; - $oGlobal = TGlobal::instance(); - $oGlobal->$sNewMethodName(implode(', ', $arguments)); - // we should trigger notices if in development mode - }" -provides,"* @param string $sURL - * - * @return string","public function isFrontendJSDisabled() - { - $bExclude = ($this->UserDataExists('esdisablefrontendjs') && 'true' == $this->GetUserData('esdisablefrontendjs')); - - return $bExclude; - }" -provides,"* returns the config constant URL_STATIC or ""/"" if SSL is active - * overwrite this method if you use a Content Delivery Network and need different - * URLs for different content types (images from CDN, JS library from code.google.com, CSS from local) - * you can check the path or file type to solve this. - * - * @param string $sFilePath - the relative url to get a static server - * @param bool $bForceNonSSL - used to force urls to non SSL - * - * @return string","public function __sleep() - { - // avoid $requestStack being serialized - return array(); - }" -TModelBase,"* the view template path to load (without .view.php ending). - * - * @var string","public function setController($controller) - { - $this->controller = $controller; - }" -TModelBase,"* array of module configuration data from pagedef. - * - * @var array","public function __wakeup() - { - $this->bIsWakingUp = true; - $this->Init(); - $this->bIsWakingUp = false; - }" -TModelBase,"* name of the spot e.g. spota. - * - * @var string","public function __sleep() - { - return array('viewTemplate', 'aModuleConfig', 'sModuleSpotName'); - }" -TModelBase,* @var bool,"public function __construct() - { - }" -TModelBase,"* the data that will be available to module template views. - * - * @var array","public function __get($name) - { - if ('global' === $name) { - @trigger_error('The property TModelBase::$global is deprecated.', E_USER_DEPRECATED); - - return ServiceLocator::get('chameleon_system_core.global'); - }" -TModelBase,"* pointer to the controller. - * - * @var ChameleonControllerInterface - * - * @deprecated Don't use this controller. Retrieve it through \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.chameleon_controller') instead","public function __set($name, $value) - { - if ('global' !== $name) { - throw new \LogicException('Invalid property: '.$name); - }" -TModelBase,* @var $bool,"public function __isset($name) - { - return 'global' === $name; - }" -TModelBase,"* An array of all methods from the class which may be called via http requests. - * - * @var array","public function Init() - { - }" -TModelBase,"* this is set automatically when the class is restored from session. - * - * @var bool","public function Execute() - { - $this->data['sModuleSpotName'] = $this->sModuleSpotName; - $this->data['_oModules'] = $this->getController()->moduleLoader; - $pagedef = $this->global->GetUserData('pagedef'); - $this->data['pagedef'] = $pagedef; - $this->data['_pagedefType'] = 'Core'; - if ($this->global->UserDataExists('_pagedefType')) { - $this->data['_pagedefType'] = $this->global->GetUserData('_pagedefType'); - }" -TModelBase,"* if this is true (and config enables automatically wrapping of div container for spots) - * the module loader will generate a div with id=""spotname"" and class=""moduleclass moduleview"" - * by default its false - you can overwrite this explicit for each module you need. - * - * @var bool","public function AllowAccessWithoutAuthenticityToken($sMethodName) - { - return 'ExecuteAjaxCall' === $sMethodName; - }" -TModelBase,"* this array is filled in TModuleLoader if the module was loaded from cache - * if it is null, you should call $this->_GetCacheTableInfos(). - * - * @var array - null by default","public function ExecuteAjaxCall() - { - $methodName = $this->global->GetUserData('_fnc'); - if (empty($methodName)) { - if (_DEVELOPMENT_MODE) { - trigger_error('Ajax call made, but no function passed via _fnc', E_USER_WARNING); - }" -TModelBase,"* @param ChameleonControllerInterface $controller - * - * @deprecated Don't use this controller. Retrieve it through \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.chameleon_controller') instead","public function GetHtmlHeadIncludes() - { - return array(); - }" -TModelBase,"* returns true if the class is currently waking up from the session. - * - * @return bool","public function GetHtmlFooterIncludes() - { - return array(); - }" -TModelBase,"* @param string $name - * - * @return object","public function _CallMethod($sMethodName, $aMethodParameter = array()) - { - if (true === $this->isMethodCallAllowed($sMethodName)) { - $functionResult = call_user_func_array(array($this, $sMethodName), $aMethodParameter); - - return $functionResult; - }" -TModelBase,"* @param string $name - * @param mixed $value","public function _GetModuleRootPath($sType) - { - $rootPath = PATH_MODULES; - switch ($sType) { - case 'Core': - $rootPath = PATH_MODULES; - break; - case 'Custom-Core': - $rootPath = PATH_MODULES_CUSTOM; - break; - case 'Customer': - $rootPath = PATH_MODULES_CUSTOMER; - break; - default: - break; - }" -TModelBase,"* Called before any external functions get called, but after the constructor. - * @return void","public function GetPostRenderVariables() - { - return array( - 'sModuleSpotName' => TGlobal::OutHTML($this->sModuleSpotName), - ); - }" -TModelBase,"* this function should fill the data array and return a pointer to it - * (pointer because it may contain objects). - * - * @deprecated - use a mapper instead (see getMapper) - * - * @return array","public function _AllowCache() - { - return false; - }" -TModelBase,"* return true if the method is white-listed for access without Authenticity token. Note: you will still need - * to define the permitted methods via DefineInterface. - * - * @param string $sMethodName - * - * @return bool","public function _GetCacheParameters() - { - $parameters = $this->aModuleConfig; - $parameters['_class'] = __CLASS__; - - return $parameters; - }" -TModelBase,* @return void,"public function _GetCacheTableInfos() - { - return array(); - }" -TModelBase,"* Run a method within the module, but as an ajax call (no module will be used - * and the function will output jason encoded data). The method assumes that - * the name of the function that you want to execute is in the parameter _fnc. - * Also note that the function being called needs to be included in $this->methodCallAllowed - * You can control how the data will be encoded using the sOutputMode.","public function IsHTMLDivWrappingAllowed() - { - return $this->bAllowHTMLDivWrapping; - }" -TModelBase,"* returns an array holding the required style, js, and other info for the - * module that needs to be loaded in the document head. each include should - * be one element of the array, and should be formated exactly as it would - * by another module that requires the same data (so it is not loaded twice). - * the function will be called for every module on the page AUTOMATICALLY by - * the controller (the controller will replace the tag """" with - * the results). - * - * @return string[]","public function InjectVirtualModuleSpots($oModuleLoader) - { - }" -TModelBase,"* returns an array holding the required js, html snippets, and other info for the - * module that needs to be loaded in the document footer (before the ending Tag). - * Each include should be one element of the array, and should be formated exactly as it - * would by another module that requires the same data (so it is not loaded twice). - * the function will be called for every module on the page AUTOMATICALLY by - * the controller (the controller will replace the tag """" with - * the results). - * - * @return string[]","public function __invoke(Request $request, $isLegacyModule) - { - $response = new Response(); - if (true === $this->_AllowCache()) { - $cache = $this->getCache(); - $cacheKey = $cache->getKey($this->_GetCacheParameters()); - $cachedContent = $cache->get($cacheKey); - if (null !== $cachedContent) { - $response->setContent($cachedContent); - - return $this->injectPostRenderVariables($response); - }" -TModelBase,"* sends module output as plaintext - * it`s possible to set a callback function via GET/POST 'callback' as wrapper. - * - * @param string $content - * @param bool $bPreventPreOutputInjection - disable the pre output variable injection (messages, vars, authenticity token...)","public function __toString() - { - return get_class($this); - }" -TModuleLoader,"* loads CMS backend modules. -/*","public function __construct( - RequestStack $requestStack, - ModuleResolverInterface $moduleResolver, - IViewPathManager $viewPathManager, - CacheInterface $cache, - TGlobalBase $global, - ModuleExecutionStrategyInterface $moduleExecutionStrategy, - RequestInfoServiceInterface $requestInfoService - ) { - $this->requestStack = $requestStack; - $this->moduleResolver = $moduleResolver; - $this->viewPathManager = $viewPathManager; - $this->cache = $cache; - $this->global = $global; - $this->moduleExecutionStrategy = $moduleExecutionStrategy; - $this->requestInfoService = $requestInfoService; - }" -TModuleLoader,* @var TModelBase[],"public function getModuleCacheKeyDetails($sSpotName) - { - return isset($this->aModuleCacheData[$sSpotName]['aKey']) ? $this->aModuleCacheData[$sSpotName]['aKey'] : null; - }" -TModuleLoader,* @var ChameleonControllerInterface,"public function getModuleCacheTriggerDetails($sSpotName) - { - return isset($this->aModuleCacheData[$sSpotName]['aTrigger']) ? $this->aModuleCacheData[$sSpotName]['aTrigger'] : null; - }" -TModuleLoader,* @var bool,"public function allowCacheForModule($sSpotName) - { - return isset($this->aModuleCacheData[$sSpotName]['bAllowCaching']) ? $this->aModuleCacheData[$sSpotName]['bAllowCaching'] : false; - }" -TModuleLoader,* @var array,"public function SetEnableAutoFlush($bEnableAutoFlush) - { - $this->bEnableAutoFlush = $bEnableAutoFlush; - }" -TModuleLoader,* @var RequestStack,"public function LoadModules($moduleList, $templateLanguage = null) - { - $this->modules = []; - foreach ($moduleList as $name => $config) { - // @TODO: check if the class is a descendant of TModelBase - $this->modules[$name] = $this->_SetModuleConfigData($name, $config, $templateLanguage); - }" -TModuleLoader,* @var ModuleResolverInterface,"public function InitModules($initSpotName = null) - { - reset($this->modules); - foreach ($this->modules as $spotName => $module) { - if (null === $initSpotName || $initSpotName === $spotName) { - $oldModulePointer = $this->global->GetExecutingModulePointer(); - if (false === is_object($this->modules[$spotName]) || false === method_exists($this->modules[$spotName], 'Init')) { - continue; - }" -TModuleLoader,* @var CacheInterface,"public function GetPermittedFunctions() - { - reset($this->modules); - $aFunctions = array(); - foreach ($this->modules as $spotName => $module) { - $aTmpFunctions = $this->modules[$spotName]->methodCallAllowed; - $aFunctions = array_merge($aFunctions, $aTmpFunctions); - }" -TModuleLoader,* @var IViewPathManager,"public function GetHtmlHeadIncludes() - { - $aHeadData = array(); - reset($this->modules); - foreach ($this->modules as $spotName => $module) { - $aModulHeadData = $this->modules[$spotName]->GetHtmlHeadIncludes(); - $aHeadData = array_merge($aHeadData, $aModulHeadData); - }" -TModuleLoader,* @var TGlobalBase,"public function GetHtmlFooterIncludes() - { - reset($this->modules); - $aFooterData = array(); - foreach ($this->modules as $spotName => $module) { - $aModuleFooterData = $this->modules[$spotName]->GetHtmlFooterIncludes(); - $aFooterData = array_merge($aFooterData, $aModuleFooterData); - }" -TModuleLoader,* @var ModuleExecutionStrategyInterface,"public function hasModule($spotName) - { - return array_key_exists($spotName, $this->modules); - }" -TModuleLoader,* @var RequestInfoServiceInterface,"public function GetModule($spotName, $bReturnString = false, $sCustomWrapping = null, $bAllowAutoWrap = true) - { - if (!isset($this->modules[$spotName])) { - $sContent = _DEVELOPMENT_MODE ? ""'; - $oThemeBlock = TdbPkgCmsThemeBlock::GetNewInstance(); - if ($oThemeBlock->LoadFromField('system_name', $sSystemName)) { - $oPortal = $this->getPortalDomainService()->getActivePortal(); - if ($oPortal && !empty($oPortal->fieldPkgCmsThemeId)) { - $sQuery = ""SELECT * FROM `pkg_cms_theme_block_layout` - INNER JOIN `pkg_cms_theme_pkg_cms_theme_block_layout_mlt` ON `pkg_cms_theme_pkg_cms_theme_block_layout_mlt`.`target_id` = `pkg_cms_theme_block_layout`.`id` - WHERE `pkg_cms_theme_pkg_cms_theme_block_layout_mlt`.`source_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($oPortal->fieldPkgCmsThemeId).""' - AND `pkg_cms_theme_block_layout`.`pkg_cms_theme_block_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($oThemeBlock->id).""' - ""; - $oThemeBlockLayoutList = TdbPkgCmsThemeBlockLayoutList::GetList($sQuery); - $oThemeBlockLayout = $oThemeBlockLayoutList->Next(); - if (false === $oThemeBlockLayout) { - $oThemeBlockLayout = $oThemeBlock->GetFieldPkgCmsThemeBlockLayout(); - }" -,"* @param array $aParameter - * - * @return TPkgRunFrontendActionStatus","public function runAction($aParameter); -}" -TPkgRunFrontendAction,@var $oAction IPkgRunFrontendAction*,"public function runAction() - { - $aParams = $this->getParameter(); - $this->AllowEditByAll(true); - $this->Delete(); - $oMessageManager = TCMSMessageManager::GetInstance(); - if ($oMessageManager->ConsumeMessages(TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER)) { - $oMessageManager->ConsumeMessages(TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER); - }" -TPkgRunFrontendAction,* @return array,"public function isValid() - { - return $this->fieldExpireDate > date('Y-m-d H:i:s'); - }" -TPkgRunFrontendAction,* @return bool,"public function onCreateActionHook($aData) - { - }" -TPkgRunFrontendAction,"* @param string $sClass - * @param string $sPortalId - * @param array $aParameter - * @param string $sLanguageId - * - * @return TdbPkgRunFrontendAction|null","public function getUrlToRunAction($forceSecure = null) - { - $portal = $this->GetFieldCmsPortal(); - if (null === $portal) { - return ''; - }" -TCMSSmartURLHandler_PkgRunFrontendAction,"* this method should parse the url and check which page matches - * it should convert url parts to GET parameters by using aCustomURLParameters.","public function GetPageDef() - { - $iPageId = false; - $oURLData = TCMSSmartURLData::GetActive(); - $aParts = explode('/', $oURLData->sRelativeURL); - $aParts = $this->CleanPath($aParts); - if (0 === count($aParts)) { - return $iPageId; - }" -TPkgShopServiceType_Giftcard,"* filter the user data. make sure you overwrite this method for each type to allow the parameter that you want to - * let through. - * - * @param array &$aUserInput","public function FilterUserInput(array &$aUserInput): void - { - $aPermittedData = array('cardtext'); - $aKeys = array_keys($aUserInput); - foreach ($aKeys as $sKey) { - if (!in_array($sKey, $aPermittedData)) { - unset($aUserInput[$sKey]); - }" -TPkgCmsRouteControllerCmsTplPage,* @var ChameleonControllerInterface,"public function getPage(Request $request, $pagePath) - { - if (null === $this->controller) { - throw new BadMethodCallException('No main controller has been set before calling getPage()'); - }" -TPkgCmsRouteControllerCmsTplPage,* @var TreeNodeServiceInterface,"public function setMainController(ChameleonControllerInterface $controller) - { - $this->controller = $controller; - }" -TPkgCmsRouteControllerCmsTplPage,* @var TreeServiceInterface,"public function setTreeNodeService($treeNodeService) - { - $this->treeNodeService = $treeNodeService; - }" -TPkgCmsRouteControllerCmsTplPage,* @var ICmsCoreRedirect,"public function setTreeService($treeService) - { - $this->treeService = $treeService; - }" -TPkgCmsRouteControllerCmsTplPage,* @var RequestStack,"public function setRedirect(ICmsCoreRedirect $redirect) - { - $this->redirect = $redirect; - }" -TPkgCmsRouteControllerCmsTplPage,* @var PageServiceInterface,"public function setRequestStack(RequestStack $requestStack) - { - $this->requestStack = $requestStack; - }" -TPkgCmsRouteControllerCmsTplPage,"* @param Request $request - * @param string $pagePath - * - * @return Response - * - * @throws BadMethodCallException - * @throws NotFoundHttpException","public function setPageService($pageService) - { - $this->pageService = $pageService; - }" -,* @deprecated since 6.2.0 - no longer used.,"public function GetContents($sKey); - - /** - * @param string $key - * @param mixed $oContent - * @param array|null $aTableInfos - * @param bool $isPage - * @param string|null $cleanKey - * @param int|null $iMaxLiveInSeconds - * - * @return bool - */ - public function SetContent($key, $oContent, $aTableInfos = null, $isPage = false, $cleanKey = null, $iMaxLiveInSeconds = null); - - /** - * @param string $key - * @param bool $bIsInternalCall - * - * @return bool - */ - public function DeleteContent($key, $bIsInternalCall = false); - - public function ClearCache(); - - /** - * @param string $sKey - * @param array|null $aTableInfos - * @param bool $isPage - * @param string|null $cleanKey - * @param int|null $iMaxLiveInSeconds - * @param string $sCacheContent - * - * @return mixed - */ - public function WriteMetaData($sKey, $aTableInfos = null, $isPage = false, $cleanKey = null, $iMaxLiveInSeconds = null, $sCacheContent = ''); -}" -TCacheManager,"* stores some result in the database along with information which tables and records - * are connected to the cache. - * - * @deprecated since 5.0.0 - use chameleon_system_core.cache instead. Do not simply exchange the calls, but instead - * think about the cache strategy to use. The problem with this implementation was that caching was used too - * deliberately, leading to way too many cache entries. Instead it is recommended to cache mostly module contents. -/*","public function SetCacheStorage(ICacheManagerStorage $oCacheStorage) - { - $this->oCacheStorage = $oCacheStorage; - }" -TCacheManager,* @var ICacheManagerStorage,"public function GetCacheStorage() - { - return $this->oCacheStorage; - }" -,* @deprecated since 6.2.0 - no longer used.,"public function SetCacheStorage(ICacheManagerStorage $oCacheStorage); - - /** - * @return ICacheManagerStorage - */ - public function GetCacheStorage(); - - /** - * allows you to disable caching during runtime. - * - * @static - * - * @param bool $bDisableCaching - */ - public static function SetDisableCaching($bDisableCaching); - - public static function IsCachingEnabled(); - - /** - * return the contents for the key identified by $key - * returns false if no cache entry exists. - * - * @param string $key - key generated with GetKey - * - * @return mixed - returns the cache object or false if not found - */ - public static function GetContents($key); - - /** - * add or updates a cache object. - * - * @param string $key - the cache key - * @param object $oContent - object to be stored - * @param array $aTableInfos - cache trigger array(array('table'=>'','id'=>''),array('table'=>'','id'=>''),...); - * @param bool $isPage - * @param string $cleanKey - * @param int $iMaxLiveInSeconds - max age in seconds before the cache content expires - default = 30 days - */ - public static function SetContent($key, $oContent, $aTableInfos = null, $isPage = false, $cleanKey = null, $iMaxLiveInSeconds = null); - - public static function CleanKeyExists($cleanKey); - - /** - * removes a cache object by key. - * - * @param string $key - * @param bool $bIsInternalCall - set to true if you only want to trigger the delete for external systems (such as memcache) - * but not for the internal system - * - * @return bool - */ - public static function DeleteContent($key, $bIsInternalCall = false); - - /** - * clears full cached pages only from cache table. - */ - public static function ClearPageCache(); - - public static function SetClassNotFoundFlag($value = null); - - /** - * clears the whole cache. - */ - public static function ClearCache(); - - /** - * removes all cached objects based on table and optional record id. - * - * @param string $table - * @param int|string $id - */ - public static function PerformeTableChange($table, $id = null); - - /** - * returns a cache key for given parameter array. - * - * @param array $aParameters - * - * @return string - */ - public static function GetKey($aParameters); - - /** - * converts the parameters passed to a cache key - will not add any key attributes to the key (such as language, currency, protocol etc). - * - * @static - * - * @param array $aParameters - */ - public static function GetKeyStateless($aParameters); - - /** - * returns the table name for the table that holds the cache data (content) depending on memcache is active or not - * if memcache is active the corresponding table will be used. we need to do that because of performance optimization - * the memcache cache tables are running on MEMORY engine and not innoDB or MyISAM that performs very fast but cannot save text / blob data - * that's the reason why we want to use other tables than for the normal database caching. - * - * @return string - */ - public static function GetCacheTable(); - - /** - * returns the table name for the table that holds the cache keys (info) depending on memcache is active or not - * if memcache is active the corresponding table will be used. we need to do that because of performance optimization - * the memcache cache tables are running on MEMORY engine and not innoDB or MyISAM that performs very fast but cannot save text / blob data - * that's the reason why we want to use other tables than for the normal database caching. - * - * @return string - */ - public static function GetCacheInfoTable(); -}" -TCMSBreadcrumbNavi,"* fetches breadcrumb navi. -/*","public function __construct($pageId, $nodeClass = 'TCMSBreadcrumbNaviItem') - { - $this->pageId = $pageId; - if (!empty($nodeClass)) { - if (class_exists($nodeClass, false)) { - $this->nodeClass = $nodeClass; - }" -TCMSBreadcrumbNavi,"* name of the navigation item class. - * - * @var string","public function Render($oCurrentDivisionObj) - { - $nodeCount = 0; - $breadcrumb = ''; - foreach (array_keys($this->nodes) as $nodeId) { - /* @var $this->nodes[$nodeId] TCMSBreadcrumbNaviItem */ - $breadcrumb .= $this->nodes[$nodeId]->Render($nodeCount, $oCurrentDivisionObj); - ++$nodeCount; - }" -TCMSBreadcrumbNavi,"* page id. - * - * @var string|null","public function GetBreadcrumbNaviIds() - { - $returnArray = array(); - - foreach (array_keys($this->nodes) as $nodeId) { - $returnArray[] = $this->nodes[$nodeId]->id; - }" -TCMSBreadcrumbNavi,"* array of nodes 0=rootNode. - * - * @var array","public function LoadData($stopNodeArray) - { - if (!is_array($stopNodeArray)) { - $stopNodeArray = array($stopNodeArray); - }" -TCMSBreadcrumbNavi,"* return tree ids from breadcrumb. - * - * @return array","public function CreateNode($node) - { - $nodeClass = $this->nodeClass; - $nodeObj = new $nodeClass(); - $nodeObj->name = $node['name']; - $nodeObj->page_id = $node['page_id']; - $nodeObj->id = $node['id']; - $nodeObj->parent_id = $node['parent_id']; - $nodeObj->link = $node['link']; - $nodeObj->linkTarget = $node['linkTarget']; - - return $nodeObj; - }" -TCMSBreadcrumbNaviItem,"* holds the navigation item data. -/*","public function Render($depth, $division) - { - return '
DefineInterface(); - $returnVal = false; - if (in_array($sMethodName, $this->methodCallAllowed)) { - $returnVal = true; - }" -TCMSField,"* value of the field. - * - * @var array|string","public function GetReadOnly() - { - $this->bReadOnlyMode = true; - - $html = $this->_GetHiddenField(); - $html .= '
'; - $html .= '
'.TGlobal::OutHTML($this->data).'
'; - $html .= '
'; - - return $html; - }" -TCMSField,"* the field name. - * - * @var string","public function GetDisplayType() - { - $modifier = $this->oDefinition->sqlData['modifier']; - if ('hidden' !== $modifier && '1' == $this->oDefinition->sqlData['restrict_to_groups']) { - // check if the user is in one of the connected groups - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::ACCESS, $this->oDefinition)) { - $modifier = 'readonly'; - }" -TCMSField,"* the table name. - * - * @var string","public function GetHTML() - { - $this->_GetFieldWidth(); - - $html = $this->_GetHiddenField(); - $html .= 'FIELD TYPE NOT DEFINED'; - - return $html; - }" -TCMSField,"* record id. - * - * @var string","public function GetEditOnClick() - { - if ($this->IsEditOnClickOnEditMode()) { - $sHtml = $this->GetHTML(); - }" -TCMSField,"* length of the field (maxlength). - * - * @var int","public function GetCMSHtmlHeadIncludes() - { - return array(); - }" -TCMSField,"* the width in pixels of the field for CSS styling. - * - * @var int","public function GetCMSHtmlFooterIncludes() - { - return array(); - }" -TCMSField,"* indicates that this field has no title column - * and uses colcount=2 in field edit list.","public function _GetHTMLValue() - { - return $this->_GetFieldValue(); - }" -TCMSField,"* pointer to the Table row. - * - * @var TCMSRecord","public function GetSQL() - { - return $this->ConvertDataToFieldBasedData($this->ConvertPostDataToSQL()); - }" -TCMSField,"* the definition class of the field. - * - * @var TdbCmsFieldConf","public function GetSQLOnCopy() - { - return $this->data; - }" -TCMSField,"* indicates that this is a MLT field. - * - * @var bool","public function ConvertDataToFieldBasedData($sData) - { - return $sData; - }" -TCMSField,"* indicates that this is a Property field. - * - * @var bool","public function GetDatabaseCopySQL() - { - return $this->GetSQL(); - }" -TCMSField,"* indicates if the button for switching to the connected record shows up. - * - * @var bool default true","public function ConvertPostDataToSQL() - { - return $this->data; - }" -TCMSField,"* array of methods that are allowed to be called via URL (ajax call) - * /cms?pagedef=tableeditor&id=30&tableid=239&sRestriction=28&sRestrictionField=module_matrix_id&_rmhist=false&module_fnc[contentmodule]=ExecuteAjaxCall&_fnc=Test&_fieldName=cms_tpl_module_instance_id. - * - * @var array","public function PreGetSQLHook() - { - return true; - }" -TCMSField,"* the current record data (includes workflow data). - * - * @var TCMSRecord","public function PostSaveHook($iRecordId) - { - }" -TCMSField,"* is set if ReadOnly method is called. - * - * @var bool","public function PostInsertHook($iRecordId) - { - }" -TCMSField,* @var \Doctrine\DBAL\Connection,"public function ChangeFieldDefinition($oldName, $newName, $postData = null) - { - if (true === $this->oDefinition->isVirtualField()) { - return; - }" -TCMSField,"* is set if the contained data are encrypted. - * - * @var bool","public function CreateFieldDefinition($returnDDL = false, $oField = null) - { - if (true === $this->oDefinition->isVirtualField()) { - return ''; - }" -TCMSField,* Sets methods that are allowed to be called via URL (ajax calls).,"public function ChangeFieldTypePreHook() - { - }" -TCMSField,"* Checks if method is listed in $this->methodCallAllowed array. - * - * @param string $sMethodName - * - * @return bool","public function ChangeFieldTypePostHook() - { - }" -TCMSField,"* Renders an input field of type ""hidden"", used in readonly mode. - * - * @return string","public function RemoveFieldIndex() - { - $fieldType = $this->oDefinition->GetFieldType(); - - if ('index' !== $fieldType->sqlData['indextype'] && 'unique' !== $fieldType->sqlData['indextype']) { - return; - }" -TCMSField,"* Renders the read only view of the field. - * - * @return string","public function CreateFieldIndex($returnDDL = false) - { - $inputFilterUtil = $this->getInputFilterUtil(); - - $oFieldType = null; - $cmsFieldTypeId = $inputFilterUtil->getFilteredInput('cms_field_type_id'); - - if (empty($cmsFieldTypeId)) { - $oFieldType = $this->oDefinition->GetFieldType(); - }" -TCMSField,"* Returns the modifier (none, hidden, readonly) of the field. - * If the field is restricted, and the modifier is none, then we return readonly instead. - * - * @return string","public function _GetSQLDefinition($fieldDefinition = null) - { - $connection = $this->getDatabaseConnection(); - $inputFilterUtil = $this->getInputFilterUtil(); - - $lengthSet = ''; - $cmsFieldTypeId = ''; - $fieldDefaultValue = ''; - - if (null !== $fieldDefinition) { - if (isset($fieldDefinition['field_default_value'])) { - $fieldDefaultValue = $fieldDefinition['field_default_value']; - }" -TCMSField,@var SecurityHelperAccess $securityHelper,"public function _GetSQLCharset() - { - return ''; - }" -TCMSField,"* renders the html of the field (overwrite this to write your own field type). - * - * @return string","public function DeleteFieldDefinition() - { - if (true === $this->oDefinition->isVirtualField()) { - return; - }" -TCMSField,"* renders the html for the edit-on-click mode that opens a window with a field editor or - * renders the html for editing mode after klick on the edit button. - * - * @return string","public function DeleteRelatedTables() - { - }" -TCMSField,"* renders the html for the edit-on-click mode that opens a window with a field editor. - * - * @return string","public function AllowCreateRelatedTablesAfterFieldSave($aOldFieldData, $aOldFieldTypeRow, $aNewFieldTypeRow) - { - return true; - }" -TCMSField,"* Check if field is in edit-on-click mode. - * - * @return bool","public function AllowDeleteRelatedTablesBeforeFieldSave($aNewFieldData, $aOldFieldTypeRow, $aNewFieldTypeRow) - { - return true; - }" -TCMSField,"* sets the inner width of the dialog window in editOnClick mode. - * - * @return string expression that will evaluate to a number when injected into JavaScript","public function AllowRenameRelatedTablesBeforeFieldSave($aNewFieldData, $aOldFieldTypeRow, $aNewFieldTypeRow) - { - return true; - }" -TCMSField,"* sets the inner height of the dialog window in editOnClick mode. - * - * @return string expression that will evaluate to a number when injected into JavaScript","public function RenameRelatedTables($newFieldData, $returnDDL = false) - { - if ($returnDDL) { - return ''; - }" -TCMSField,"* returns an array of all js, css, or other header includes that are required - * in the cms for this field. each include should be in one line, and they - * should always be typed the same way so that no includes are included more than once. - * - * @return array","public function CreateRelatedTables($returnDDL = false) - { - if ($returnDDL) { - return ''; - }" -TCMSField,"* returns an array of all js includes and html snippets includes that are required - * in the cms for this field. each include should be in one line, and they - * should always be typed the same way so that no includes are included more than once. - * - * @return array","public function _GetFieldValue() - { - $value = ''; - if (false !== $this->data && null !== $this->data) { - $value = $this->data; - }" -TCMSField,"* return the fields value for HTML output. - * - * @return string","public function _GetFieldWidth() - { - // max length - if ('0' != $this->oDefinition->sqlData['field_width']) { - if ($this->oDefinition->sqlData['field_width'] > 60) { - $this->fieldCSSwidth = '100%'; - }" -TCMSField,"* returns the field value for database storage - * overwrite this method to modify data before save. - * - * @return mixed","public function GetHTMLExport() - { - return $this->data; - }" -TCMSField,"* returns the field value for database storage - * overwrite this method to modify data on save. - * - * @return mixed","public function GetRTFExport() - { - return $this->GetHTMLExport(); - }" -TCMSField,"* @param string $sData - * - * @return string","public function RenderFieldPropertyString() - { - $viewParser = new TViewParser(); - $viewParser->bShowTemplatePathAsHTMLHint = false; - $data = $this->GetFieldWriterData(); - $viewParser->AddVarArray($data); - - return $viewParser->RenderObjectView('property', 'TCMSFields/TCMSField'); - }" -TCMSField,"* returns the field value for database storage on database copy state - * use this method to handle copy without post data - * overwrite this method to modify data before save. - * - * @return mixed","public function RenderFieldPostLoadString() - { - $viewParser = new TViewParser(); - $viewParser->bShowTemplatePathAsHTMLHint = false; - $data = $this->GetFieldWriterData(); - $viewParser->AddVarArray($data); - - return $viewParser->RenderObjectView('postload', 'TCMSFields/TCMSField'); - }" -TCMSField,"* this method converts post data like datetime (3 fields with date, hours, minutes in human readable format) - * to sql format. - * - * @return mixed","public function RenderFieldPostWakeupString() - { - return ''; - }" -TCMSField,"* gets called in TCMSTableEditor::_WriteDataToDatabase before GetSQL - * the field will only be written to the database if this function returned true. - * - * - * @return bool","public function RenderFieldMethodsString() - { - return ''; - }" -TCMSField,"* called on each field after the record is saved (NOT on insert, only on save). - * - * @param string $iRecordId - the id of the record - * - * @return void","public function RenderFieldListMethodsString() - { - return ''; - }" -TCMSField,"* called on each field when a record is inserted. - * - * @param string $iRecordId - * - * @return void","public function DataIsValid() - { - $dataIsValid = $this->CheckMandatoryField(); - // check for custom regex rule - $regexRule = $this->oDefinition->sqlData['validation_regex']; - if (!empty($regexRule) && $dataIsValid && $this->HasContent()) { - $sqlData = $this->ConvertPostDataToSQL(); - if (!preg_match('/'.$regexRule.'/u', $sqlData)) { - $dataIsValid = false; - $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER; - $sFieldTitle = $this->oDefinition->GetName(); - $this->getFlashMessageService()->addMessage( - $sConsumerName, - 'TABLEEDITOR_FIELD_NOT_VALID', - array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle) - ); - }" -TCMSField,"* changes an existing field definition (alter table). - * - * @param string $oldName - * @param string $newName - * @param array|null $postData - * - * @return void","public function HasContent() - { - $hasContent = false; - $fieldDisplayType = $this->GetDisplayType(); - if ('readonly-if-filled' === $fieldDisplayType) { - $this->LoadCurrentDataFromDatabase(); - if (!empty($this->oRecordFromDB->sqlData[$this->name])) { - $hasContent = true; - }" -TCMSField,"* update default value of the field. - * - * @param string $fieldDefaultValue - * @param string $fieldName - * @param bool $updateExistingRecords - * - * @throws \Doctrine\DBAL\DBALException","public function HasDBContent() - { - $hasContent = false; - $this->LoadCurrentDataFromDatabase(); - if (!empty($this->oRecordFromDB->sqlData[$this->name])) { - $hasContent = true; - }" -TCMSField,"* update default value of a field with associated workflow. - * - * @param string $fieldDefaultValue - * @param string $fieldName - * @param bool $updateExistingRecords","public function IsMandatoryField() - { - $isMandatoryField = false; - if ('1' == $this->oDefinition->sqlData['isrequired']) { - $isMandatoryField = true; - }" -TCMSField,"* create a new field definition (alter table). - * - * @param bool $returnDDL - * @param TCMSField $oField - * - * @return string","public function GetContent($displayType = '') - { - $fieldDisplayType = $this->GetDisplayType(); - if ('readonly' === $fieldDisplayType || 'readonly' === $displayType) { - $content = $this->GetReadOnly(); - }" -TCMSField,* called on the OLD field if the field type is changed (before deleting related tables or droping the index).,"public function PkgCmsFormDataIsValid() - { - return $this->DataIsValid(); - }" -TCMSField,* called on the NEW field if the field type is changed (BEFORE anything else is done).,"public function PkgCmsFormPreGetSQLHook() - { - }" -TCMSField,* drops the field index.,"public function PkgCmsFormPostSaveHook($id, $form) - { - }" -TCMSField,"* sets field index if the field type is indexable. - * - * @param bool $returnDDL - if true the SQL alter statement will be returned - * - * @return string|null","public function PkgCmsFormTransformFormDataBeforeSave($form) - { - return $this->data; - }" -TCMSField,"* generate the field definition part of the sql statement - * we assume that $oFieldDefinition holds the correct default value. - * - * @param array $fieldDefinition - * - * @return string","public function Render( - $bFieldHasError = false, - $bWrapFieldClassDiv = false, - $sViewName = 'standard', - $sViewType = 'Core', - $aAdditionalVars = array(), - $sViewSubType = null - ) { - $oView = new TViewParser(); - $oView->AddVar('oField', $this); - $oView->AddVar('bFieldHasError', $bFieldHasError); - $aAdditionalViewData = $this->GetAdditionalViewData(); - if (is_array($aAdditionalViewData) && count($aAdditionalViewData) > 0) { - $aAdditionalVars = array_merge($aAdditionalViewData, $aAdditionalVars); - }" -TCMSField,"* tries to fetch the length_set value of the field type. - * - * @param TCMSRecord $oFieldType - * @param array|null $aPostData - * - * @return string","public function getHtmlHeadIncludes() - { - return array(); - }" -TCMSField,"* by default we return an empty string - for each field that contains an Id - * that is Char(36) we return the new charset latin1 so that we get more memory - * size for a record. - * - * @return string","public function getFrontendJavascriptInitMethodOnSubRecordLoad() - { - return ''; - }" -TCMSField,* drop a field definition (alter table).,"public function getOnSaveViaAjaxHookMethod() - { - }" -TCMSField,"* removes any related tables (like mlt tables). the function will be called - * from the outside whenever there is a change of type FROM this type of field.","public function setDatabaseConnection(Connection $connection) - { - $this->databaseConnection = $connection; - }" -TCMSField,"* Checks if is allowed to create related tables for the field after the field was saved. - * Overwrite this for your field if your field has own CreateRelatedTables function. - * - * @param array $aOldFieldData contains old field data - * @param array $aOldFieldTypeRow contains old field definition - * @param array $aNewFieldTypeRow contains new field definition - * - * @return bool","public function accept($visitor) - { - return $visitor->visit($this); - }" -TCMSField,"* Checks if is allowed to delete related tables for the field before the field will be saved. - * Overwrite this for your field if your field has own CreateRelatedTables function. - * - * @param array $aNewFieldData contains old field data - * @param array $aOldFieldTypeRow contains old field definition - * @param array $aNewFieldTypeRow contains new field definition - * - * @return bool","public function toString() - { - return $this->data; - }" -TCMSField,"* Checks if is allowed to rename related tables for the field before the field will be saved. - * Overwrite this for your field if your field has own CreateRelatedTables function. - * - * @param array $aNewFieldData contains old field data - * @param array $aOldFieldTypeRow contains old field definition - * @param array $aNewFieldTypeRow contains new field definition - * - * @return bool","public function setBEncryptedData($bEncryptedData) - { - $this->bEncryptedData = $bEncryptedData; - }" -TCMSField,"* Renames existing related table. - * - * @param array $newFieldData - * @param bool $returnDDL - * - * @return string|null","public function getBEncryptedData() - { - return $this->bEncryptedData; - }" -TCMSField,"* creates any related tables (like mlt tables). the function will be called - * from the outside whenever there is a change of type TO this type of field. - * - * @param bool $returnDDL - * - * @return string|null","public function getMenuButtonsForFieldEditor() - { - $menuButtonItems = new TIterator(); - - $saveButton = $this->getSaveButton(); - if (null !== $saveButton) { - $menuButtonItems->AddItem($saveButton); - }" -takes,"* The class takes data and serializes it to db. - * -/*","public function ConvertDataToFieldBasedData($sData) - { - $sData = parent::ConvertDataToFieldBasedData($sData); - $sData = serialize($sData); - - return $sData; - }" -takes,"* this method converts post data like datetime (3 fields with date, hours, minutes in human readable format) - * to sql format. - * - * @return mixed","public function ConvertPostDataToSQL() - { - $sData = parent::ConvertPostDataToSQL(); - $sData = unserialize($sData); - - return $sData; - }" -takes,@var $oViewParser TViewParser,"public function GetHTML() - { - $sOriginal = $this->data; - $this->data = print_r($this->data, true); - $sResponse = $this->GetReadOnly(); - $this->data = $sOriginal; - - return $sResponse; - }" -TCMSFieldBoolean,* {inheritdoc}.,"public function GetOptions() - { - parent::GetOptions(); - - $translator = $this->getTranslator(); - // translate points - $this->options['0'] = $translator->trans('chameleon_system_core.field_boolean.no', array(), 'admin'); - $this->options['1'] = $translator->trans('chameleon_system_core.field_boolean.yes', array(), 'admin'); - }" -TCMSFieldBoolean,* {@inheritdoc},"public function GetHTML() - { - $this->GetOptions(); - - $checked = ''; - $disabled = ''; - if (true === $this->isChecked()) { - $checked = ' checked'; - $disabled = ' disabled'; - }" -TCMSFieldBoolean,* {@inheritdoc},"public function GetReadOnly() - { - $checked = ''; - if (true === $this->isChecked()) { - $checked = ' checked'; - }" -TCMSFieldBoolean,* {@inheritdoc},"public function RenderFieldPostLoadString() - { - $viewParser = new TViewParser(); - $viewParser->bShowTemplatePathAsHTMLHint = false; - $aData = $this->GetFieldWriterData(); - $viewParser->AddVarArray($aData); - - return $viewParser->RenderObjectView('postload', 'TCMSFields/TCMSFieldBoolean'); - }" -TCMSFieldBoolean,* {@inheritdoc},"public function DataIsValid() - { - if (false === parent::DataIsValid()) { - return false; - }" -TCMSFieldBoolean,* {@inheritdoc},"public function HasContent() - { - return '0' == $this->data || false === empty($this->data); - }" -TCMSFieldBoolean,* {@inheritdoc},"public function _GetSQLDefinition($fieldDefinition = null) - { - // never allow an empty default value for boolean fields - if (isset($fieldDefinition['field_default_value']) && '' === $fieldDefinition['field_default_value']) { - $fieldDefinition['field_default_value'] = '0'; - }" -TCMSFieldBoolean,* {@inheritdoc},"public function toString() - { - $this->GetOptions(); - - return $this->options[$this->data]; - }" -TCMSFieldClassParams,"* this field type loads a class, that is set via field config params - * (sFieldDBObject, sFieldDBObjectType, sFieldDBObjectSubType) and prints an - * input field for every public variable of the referenced class - * the values are stored as key=val pairs (one per line). - * -/*","public function GetHTML() - { - parent::GetHTML(); - - $html = '\n""; - - return $html; - }" -TCMSFieldExternalVideoCode,"* returns the modifier (none, hidden, readonly) of the field. if the field - * is restricted, and the modifier is none, then we return readonly instead. - * - * @return string","public function GetDisplayType() - { - return 'hidden'; - }" -TCMSFieldExternalVideoID,* {@inheritdoc},"public function GetDisplayType() - { - return 'hidden'; - }" -TCMSFieldGenderSelector,"* male or female. -/*","public function GetOptions() - { - parent::GetOptions(); - - $translator = $this->getTranslationService(); - $this->options['m'] = $translator->trans('chameleon_system_core.field_gender.male', array(), 'admin'); - $this->options['f'] = $translator->trans('chameleon_system_core.field_gender.female', array(), 'admin'); - }" -TCMSFieldGenderSelector,* {@inheritdoc},"public function DataIsValid() - { - $dataIsValid = $this->CheckMandatoryField(); - if (false === $dataIsValid) { - return $dataIsValid; - }" -TCMSFieldGMapCoordinate,* {@inheritdoc},"public function GetSQL() - { - $returnVal = false; - $bLatitudePassed = trim(false !== $this->oTableRow->sqlData && array_key_exists($this->name.'_lat', $this->oTableRow->sqlData) && !empty($this->oTableRow->sqlData[$this->name.'_lat'])); - $bLongitudePassed = trim(false !== $this->oTableRow->sqlData && array_key_exists($this->name.'_lng', $this->oTableRow->sqlData) && !empty($this->oTableRow->sqlData[$this->name.'_lng'])); - if (!empty($bLatitudePassed) && !empty($bLongitudePassed)) { - $returnVal = $this->oTableRow->sqlData[$this->name.'_lat'].'|'.$this->oTableRow->sqlData[$this->name.'_lng']; - }" -TCMSFieldGMapCoordinate,* {@inheritdoc},"public function GetHTML() - { - parent::GetHTML(); - - $this->fieldCSSwidth = 200; - - $aCoordinates = explode('|', $this->_GetFieldValue()); - $lat = ''; - $lng = ''; - - if (2 === count($aCoordinates)) { - $lat = $aCoordinates[0]; - $lng = $aCoordinates[1]; - }" -TCMSFieldGMapCoordinate,* {@inheritdoc},"public function _GetHTMLValue() - { - $html = parent::_GetHTMLValue(); - $html = TGlobal::OutHTML($html); - - return $html; - }" -TCMSFieldGMapCoordinate,* {@inheritdoc},"public function DataIsValid() - { - $bDataIsValid = parent::DataIsValid(); - if ($bDataIsValid) { - $sSQLData = $this->ConvertPostDataToSQL(); - - if (!$this->IsMandatoryField() && ('|' == $sSQLData || '' == $sSQLData)) { - $bDataIsValid = true; - }" -TCMSFieldGMapCoordinate,* {@inheritdoc},"public function HasContent() - { - $bHasContent = false; - $sContent = $this->ConvertPostDataToSQL(); - if (!empty($sContent) || '|' == $sContent) { - $bHasContent = true; - }" -TCMSFieldGMapCoordinate,* {@inheritdoc},"public function RenderFieldMethodsString() - { - $aMethodData = $this->GetFieldMethodBaseDataArray(); - $aMethodData['sMethodName'] = $this->GetFieldMethodName('GoogleMap'); - $aMethodData['sReturnType'] = 'TGoogleMap'; - $aMethodData['sClassName'] = 'TGoogleMap'; - $aMethodData['sClassSubType'] = 'TGoogleMap'; - $aMethodData['sClassType'] = 'Core'; - $aMethodData['aParameters']['sWidth'] = self::GetMethodParameterArray('string', ""'300'"", 'width of the google map'); - $aMethodData['aParameters']['sHeight'] = self::GetMethodParameterArray('string', ""'300'"", 'height of the google map'); - $aMethodData['aParameters']['sMapType'] = self::GetMethodParameterArray('string', ""'ROADMAP'"", 'Map type of the google map'); - $aMethodData['aParameters']['iZoom'] = self::GetMethodParameterArray('string', '6', 'Zoom level of the map'); - $aMethodData['aParameters']['bShowResizeBar'] = self::GetMethodParameterArray('boolean', 'false', 'show resize bar on map'); - $aMethodData['aParameters']['bShowStreetViewControl'] = self::GetMethodParameterArray('boolean', 'true', 'show street view control on map'); - $aMethodData['aParameters']['bHookMenuLinks'] = self::GetMethodParameterArray('boolean', 'false', 'hook menu links on map'); - $aMethodData['aParameters']['apiKey'] = self::GetMethodParameterArray('string', ""'"".$this->getGoogleMapsApiKey().""'"", ''); - $oViewParser = new TViewParser(); - /** @var $oViewParser TViewParser */ - $oViewParser->bShowTemplatePathAsHTMLHint = false; - $oViewParser->AddVarArray($aMethodData); - - $sMethodCode = $oViewParser->RenderObjectView('getobject', 'TCMSFields/TCMSFieldGMapCoordinate'); - $oViewParser->AddVar('sMethodCode', $sMethodCode); - $sCode = $oViewParser->RenderObjectView('method', 'TCMSFields/TCMSField'); - - return $sCode; - }" -TCMSFieldGMapCoordinate,@var $oViewParser TViewParser,"public function GetCMSHtmlFooterIncludes() - { - $includes = parent::GetCMSHtmlFooterIncludes(); - $includes[] = ''; - $includes[] = ''; - - return $includes; - }" -TCMSFieldLookup,"* tries to load the connected record, returns record object or false if no record is connected or record is missing. - * - * @return bool|TCMSRecord","public function toString() - { - if (!$this->data) { - return ''; - }" -TCMSFieldLookupDirectory,"* lists the entries for a directory (not recursive at the moment) - * - needs a directory parameter in the field config like:. - * - * @example directory=%PATH_CUSTOMER_FRAMEWORK%/modules/ - * - you can use any constant from advanced_config.inc.php - * - optional you can set a comma seperated list of file extensions that you want to list via param: ""filetypes=jpg,png,gif"" - * - if no filetypes are set it will list only directories - * -/*","public function GetHTML() - { - $this->GetOptions(); - - $html = 'getInputFilterUtil(); - - $aStateURL = array( - 'pagedef' => $inputFilterUtil->getFilteredInput('pagedef'), - 'tableid' => $inputFilterUtil->getFilteredInput('tableid'), - 'id' => $inputFilterUtil->getFilteredInput('id'), - 'fieldname' => $this->name, - 'module_fnc' => array('contentmodule' => 'ExecuteAjaxCall'), - '_fnc' => 'changeListFieldState', - ); - $sStateURL = '?'.TTools::GetArrayAsURLForJavascript($aStateURL); - - $sEscapedName = TGlobal::OutHTML($this->name); - - $html = ''; - $html .= '
-
-
getState($this->sTableName, $this->name)).'"" - id=""mltListControllButton'.$sEscapedName.'"" - onClick=""setTableEditorListFieldState(this, \''.$sStateURL.'\'); CHAMELEON.CORE.MTTableEditor.switchMultiSelectListState(\''.$sEscapedName.'_iframe\',\''.$this->GetSelectListURL().'\');""> - '.TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.field_lookup_multi_select.open_or_close_list')).' -
-
-
-
- -
-
-
'; - - if ('true' === $this->oDefinition->GetFieldtypeConfigKey('bOpenOnLoad') || $stateContainer->getState($this->sTableName, $this->name) === $stateContainer::STATE_OPEN) { - $html .= "" - '; - $aIncludes[] = ''; - $aIncludes[] = ''; - - return $aIncludes; - }" -TCMSFieldModuleInstance,* sets methods that are allowed to be called via URL (ajax call).,"public function ChangeFieldDefinition($sOldName, $sNewName, $postData = null) - { - parent::ChangeFieldDefinition($sOldName, $sNewName, $postData); - - $sComment = ''; - if (!is_null($postData) && is_array($postData)) { - $sComment = substr($postData['translation'].': '.$postData['049_helptext'], 0, 255); - }" -TCMSFieldModuleInstance,* loads the module instance data.,"public function _GetSQLCharset() - { - return ' CHARACTER SET latin1 COLLATE latin1_general_ci'; - }" -TCMSFieldModuleInstance,@var $this->oModuleInstance TCMSTPLModuleInstance,"public function DeleteFieldDefinition() - { - parent::DeleteFieldDefinition(); - - $this->RemoveFieldIndex(); - $query = 'ALTER TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sTableName).'` - DROP `'.MySqlLegacySupport::getInstance()->real_escape_string($this->name.'_view').'` '; - - MySqlLegacySupport::getInstance()->query($query); - $aQuery = array(new LogChangeDataModel($query)); - TCMSLogChange::WriteTransaction($aQuery); - }" -TCMSFieldModuleInstance,@var $oModule TCMSTPLModule,"public function ChangeFieldTypePreHook() - { - $query = 'ALTER TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sTableName).'` - DROP `'.MySqlLegacySupport::getInstance()->real_escape_string($this->name.'_view').'` '; - - MySqlLegacySupport::getInstance()->query($query); - $aQuery = array(new LogChangeDataModel($query)); - TCMSLogChange::WriteTransaction($aQuery); - }" -TCMSFieldModuleInstance,"* return an array of all js, css, or other header includes that are required - * in the cms for this field. each include should be in one line, and they - * should always be typed the same way so that no includes are included mor than once. - * - * @return array","public function ChangeFieldTypePostHook() - { - $query = 'ALTER TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sTableName).'` - ADD `'.MySqlLegacySupport::getInstance()->real_escape_string($this->name).""_view` VARCHAR(255) NOT NULL DEFAULT 'standard'""; - $aQuery = array(new LogChangeDataModel($query)); - - TCMSLogChange::WriteTransaction($aQuery); - MySqlLegacySupport::getInstance()->query($query); - }" -TCMSFieldModuleInstance,"* changes an existing field definition (alter table). - * - * @param string $sOldName - * @param string $sNewName - * @param array $postData","public function RenameInstance() - { - $oTdbCmsTplModuleInstance = TdbCmsTplModuleInstance::GetNewInstance(); - $oTableConf = $oTdbCmsTplModuleInstance->GetTableConf(); - - $oTableEditor = new TCMSTableEditorModuleInstance(); - $oTableEditor->Init($oTableConf->id, $this->data); - - return $oTableEditor->RenameInstance(); - }" -TCMSFieldModuleInstance,"* return the new charset latin1 so that we get more memory - * size for a record. - * - * @return string","public function CreateNewInstance() - { - $returnVal = false; - $oGlobal = TGlobal::instance(); - if ($oGlobal->UserDataExists('moduleID') && $oGlobal->UserDataExists('sView') && $oGlobal->UserDataExists('sName')) { - $oTdbCmsTplModuleInstance = TdbCmsTplModuleInstance::GetNewInstance(); - /** @var $oTdbCmsTplModuleInstance TdbCmsTplModuleInstance */ - $oTableConf = $oTdbCmsTplModuleInstance->GetTableConf(); - - $oTableEditor = new TCMSTableEditorModuleInstance(); - /** @var $oTableEditor TCMSTableEditorModuleInstance */ - $oTableEditor->Init($oTableConf->id); - - $postData = array(); - $postData['name'] = $oGlobal->GetUserData('sName'); - $postData['cms_tpl_module_id'] = $oGlobal->GetUserData('moduleID'); - $postData['template'] = $oGlobal->GetUserData('sView'); - - $returnVal = $oTableEditor->Save($postData); - }" -TCMSFieldModuleInstance,* drop a field definition (alter table).,"public function DeleteInstance() - { - $returnVal = false; - - $oGlobal = TGlobal::instance(); - if ($oGlobal->UserDataExists('moduleInstanceId')) { - $moduleInstanceId = $oGlobal->GetUserData('moduleInstanceId'); - $query = ""SELECT * FROM `cms_tpl_page_cms_master_pagedef_spot` WHERE `cms_tpl_module_instance_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($moduleInstanceId).""'""; - $result = MySqlLegacySupport::getInstance()->query($query); - if (MySqlLegacySupport::getInstance()->num_rows($result) > 0) { - $returnVal = array(); - - while ($row = MySqlLegacySupport::getInstance()->fetch_assoc($result)) { - $oTdbCmsTplPage = TdbCmsTplPage::GetNewInstance(); - /** @var $oTdbCmsTplPage TdbCmsTplPage */ - $oTdbCmsTplPage->Load($row['cms_tpl_page_id']); - - $oRecordData = new TCMSstdClass(); - /** @var $oReturnData TCMSstdClass */ - $oRecordData->id = $row['cms_tpl_page_id']; - $oRecordData->name = $oTdbCmsTplPage->GetName(); - $oRecordData->tree = $oTdbCmsTplPage->fieldTreePathSearchString; - - $returnVal[] = $oRecordData; - }" -TCMSFieldModuleInstance,* called on the OLD field if the field type is changed (before deleting related tables or droping the index).,"public function PostSaveHook($iRecordId) - { - $oGlobal = TGlobal::instance(); - $sView = $oGlobal->GetUserData($this->name.'_view'); - $query = 'UPDATE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sTableName).'` - SET `'.MySqlLegacySupport::getInstance()->real_escape_string($this->name).""_view` = '"".MySqlLegacySupport::getInstance()->real_escape_string($sView).""' - WHERE `id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($this->recordId).""'""; - MySqlLegacySupport::getInstance()->query($query); - - $editLanguage = $this->getLanguageService()->getActiveEditLanguage(); - $migrationQueryData = new MigrationQueryData($this->sTableName, $editLanguage->fieldIso6391); - $migrationQueryData - ->setFields(array( - $this->name.'_view' => $sView, - )) - ->setWhereEquals(array( - 'id' => $this->recordId, - )) - ; - $aQuery = array(new LogChangeDataModel($migrationQueryData, LogChangeDataModel::TYPE_UPDATE)); - TCMSLogChange::WriteTransaction($aQuery); - }" -TCMSFieldModuleInstance,* called on the NEW field if the field type is changed (BEFORE anything else is done).,"public function RenderFieldMethodsString() - { - $aMethodData = $this->GetFieldMethodBaseDataArray(); - $aMethodData['sMethodName'] = $this->GetFieldMethodName(); - $aMethodData['sReturnType'] = TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $this->GetConnectedTableName()); - - $sCode = ''; - - if (!empty($aMethodData['sReturnType'])) { - $aMethodData['sClassName'] = $aMethodData['sReturnType']; - $aMethodData['sClassSubType'] = 'CMSDataObjects'; - - $query = ""SELECT * FROM cms_tbl_conf where `name` = '"".MySqlLegacySupport::getInstance()->real_escape_string($this->GetConnectedTableName()).""'""; - $aTargetTable = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query)); - - $aMethodData['sClassType'] = $aTargetTable['dbobject_type'] ?? ''; - - $oViewParser = new TViewParser(); - $oViewParser->bShowTemplatePathAsHTMLHint = false; - $oViewParser->AddVarArray($aMethodData); - - $sMethodCode = $oViewParser->RenderObjectView('getobject', 'TCMSFields/TCMSFieldModuleInstance'); - $oViewParser->AddVar('sMethodCode', $sMethodCode); - - $sCode = $oViewParser->RenderObjectView('method', 'TCMSFields/TCMSField'); - }" -TCMSFieldNavigationTreeNode,"* picks a node from a tree, adds cms_portal_id to tree. -/*","public function _GetOpenWindowJS() - { - $url = PATH_CMS_CONTROLLER.'?pagedef=treenodeselect&fieldName='.urlencode($this->name).'&id='.urlencode($this->data).'&portalID='.$this->oTableRow->sqlData['cms_portal_id']; - $js = ""CreateModalIFrameDialogCloseButton('"".TGlobal::OutHTML($url).""')""; - - return $js; - }" -TCMSFieldNumber,"* a number (int). -/*","public function GetHTML() - { - $html = 'name).'"" name=""'.TGlobal::OutHTML($this->name).'"" value=""'.TGlobal::OutHTML($this->data).'"" />'; - - return $html; - }" -TCMSFieldNumber,"* checks if field is mandatory and if field content is valid - * overwrite this method to add your field based validation - * you need to add a message to TCMSMessageManager for handling error messages - * - * AddMessage($sConsumerName,'TABLEEDITOR_FIELD_IS_MANDATORY'); - * ?> - * . - * - * @return bool - returns false if field is mandatory and field content is empty or data is not valid","public function DataIsValid() - { - $bDataIsValid = parent::DataIsValid(); - if ($bDataIsValid) { - $iMaxFieldLength = $this->_GetFieldWidth(); - if (is_null($iMaxFieldLength) || empty($iMaxFieldLength)) { - $iMaxFieldLength = 20; - }" -TCMSFieldNumber,"* returns true if field data is not empty - * overwrite this method for mlt and property fields. - * - * @return bool","public function HasContent() - { - $bHasContent = false; - if ('' !== $this->data) { - $bHasContent = true; - }" -TCMSFieldNumber,"* returns the length of a field - * sets field max-width and field CSS width. - * - * @return int","public function _GetFieldWidth() - { - $iFieldMaxLength = parent::_GetFieldWidth(); - - if (is_null($iFieldMaxLength) || empty($iFieldMaxLength)) { - $query = 'DESCRIBE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sTableName).'`'; - $result = MySqlLegacySupport::getInstance()->query($query); - if (MySqlLegacySupport::getInstance()->num_rows($result) > 0) { - while ($aField = MySqlLegacySupport::getInstance()->fetch_assoc($result)) { - if ($aField['Field'] == $this->name) { - $sFieldType = $aField['Type']; - if ('int' == substr($sFieldType, 0, 3)) { - $iFieldMaxLengthTmp = intval(substr($sFieldType, 4, -1)); - if (!empty($iFieldMaxLengthTmp)) { - $iFieldMaxLength = $iFieldMaxLengthTmp; - }" -TCMSFieldOption,"* an enum field. -/*","public function GetHTML() - { - $this->GetOptions(); - - if (count($this->options) >= 3) { - // show as select box - $html = '
'; - $html .= ' -
-
- '; - - if (!$this->bReadOnlyMode) { - $html .= 'name).'\');"" class=""checkBoxHeaderActionLink"">'.TGlobal::Translate('chameleon_system_core.field_lookup_multi_select_checkboxes.select_deselect_all').' - name).'\');"" class=""checkBoxHeaderActionLink ml-2"">'.TGlobal::Translate('chameleon_system_core.field_lookup_multi_select_checkboxes.invert_selection').' - '; - }" -TCMSFieldPortalLanguageMatrix,"* indicates if GetHTML should render the form in read only mode. - * - * @var bool","public function CreateRelatedTables($returnDDL = false) - { - $sReturnVal = ''; - if (!TGlobal::TableExists($this->sMatrixTableName)) { - $query = 'CREATE TABLE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).'` ( - `record_id` CHAR( 36 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL , - `cms_tbl_conf_id` char(36) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, - `cms_portal_id` char(36) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, - `cms_language_id` char(36) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, - PRIMARY KEY (`record_id`, `cms_tbl_conf_id`, `cms_portal_id` , `cms_language_id`) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8'; - - if (!$returnDDL) { - MySqlLegacySupport::getInstance()->query($query); - $aQuery = array(new LogChangeDataModel($query)); - - TCMSLogChange::WriteTransaction($aQuery); - }" -TCMSFieldPortalLanguageMatrix,"* SQL name of matrix table. - * - * @var string","public function DeleteRelatedTables() - { - // drop table is disabled because we need to check if the field type is used in another table - $oTableConfig = $this->oTableRow->GetTableConf(); - $sQuery = ""DELETE FROM `cms_portal_language_matrix` WHERE `cms_portal_language_matrix`.`cms_tbl_conf_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($oTableConfig->id).""'""; - MySqlLegacySupport::getInstance()->query($sQuery); - - $editLanguage = $this->getLanguageService()->getActiveEditLanguage(); - $migrationQueryData = new MigrationQueryData('cms_portal_language_matrix', $editLanguage->fieldIso6391); - $migrationQueryData - ->setWhereEquals(array( - 'cms_tbl_conf_id' => $oTableConfig->id, - )) - ; - $aQuery = array(new LogChangeDataModel($migrationQueryData, LogChangeDataModel::TYPE_DELETE)); - TCMSLogChange::WriteTransaction($aQuery); - }" -TCMSFieldPortalLanguageMatrix,"* creates any related tables (like mlt tables). the function will be called - * from the outside whenever there is a change of type TO this type of field. - * - * @param bool $returnDDL - * - * @return string","public function GetSQL() - { - $oTableConfig = $this->oTableRow->GetTableConf(); - - $bReadOnly = ('readonly' == $this->GetDisplayType()); - if (!$bReadOnly && ('readonly-if-filled' == $this->GetDisplayType())) { - // empty? allow edit.. - - $sQuery = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).'` WHERE - `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).""`.`record_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($this->recordId).""' - AND `"".MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).""`.`cms_tbl_conf_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($oTableConfig->id).""' - ""; - - $result = MySqlLegacySupport::getInstance()->query($sQuery); - - if (MySqlLegacySupport::getInstance()->num_rows($result) > 0) { - $bReadOnly = true; - }" -TCMSFieldPortalLanguageMatrix,"* removes any related tables (like mlt tables). the function will be called - * from the outside whenever there is a change of type FROM this type of field.","public function GetReadOnly() - { - $this->bReadOnlyMode = true; - $html = $this->GetHTML(); - - return $html; - }" -TCMSFieldPortalLanguageMatrix,"* render any methods for the auto list class for this field. - * - * @return string","public function _GetHiddenField() - { - return ''; - }" -TCMSFieldPortalLanguageMatrix,"* changes an existing field definition (alter table). - * - * @param string $sOldName - * @param string $sNewName - * @param array|null $postData","public function RenderFieldListMethodsString() - { - $sCode = parent::RenderFieldListMethodsString(); - - $sTableForMethodParameterDocumentation = 'Portal Language'; - - $aMethodData = $this->GetFieldMethodBaseDataArray(); - $sMethodName = 'GetListForPortalLanguage'; - - $aMethodData['sMethodName'] = $sMethodName; - $aMethodData['sReturnType'] = TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $this->sTableName).'List'; - - $aMethodData['sClassName'] = $aMethodData['sReturnType']; - $aMethodData['sClassSubType'] = 'CMSDataObjects'; - $aMethodData['sVisibility'] = 'static public'; - $aMethodData['sTableDatabaseName'] = $this->sTableName; - $aMethodData['sTableConfId'] = TTools::GetCMSTableId($this->sTableName); - $aMethodData['aFieldData']['sFieldFullName'] = 'Return all records belonging to the '.$sTableForMethodParameterDocumentation; - - $oViewParser = new TViewParser(); - $oViewParser->bShowTemplatePathAsHTMLHint = false; - $oViewParser->AddVarArray($aMethodData); - - $sMethodCode = $oViewParser->RenderObjectView('listmethodcode', 'TCMSFields/TCMSFieldPortalLanguageMatrix'); - $oViewParser->AddVar('sMethodCode', $sMethodCode); - $sCode .= $oViewParser->RenderObjectView('method', 'TCMSFields/TCMSField'); - - return $sCode; - }" -TCMSFieldPortalLanguageMatrix,"* update default value of the field. - * - * @param string $sFieldDefaultValue - * @param string $sFieldName - * @param bool $bUpdateExistingRecords","public function ChangeFieldDefinition($sOldName, $sNewName, $postData = null) - { - }" -TCMSFieldPortalLanguageMatrix,"* create a new field definition (alter table). - * - * @param bool $returnDDL - * @param TCMSField $oField - * - * @return string","public function CreateFieldDefinition($returnDDL = false, $oField = null) - { - return ''; - }" -TCMSFieldPortalLanguageMatrix,* drops the field index.,"public function RemoveFieldIndex() - { - }" -TCMSFieldPortalLanguageMatrix,"* sets field index if the field type is indexable. - * - * @param bool $returnDDL - if tre the SQL alter statement will be returned - * - * @return string","public function CreateFieldIndex($returnDDL = false) - { - if ($returnDDL) { - return ''; - }" -TCMSFieldPortalLanguageMatrix,"* generate the field definition part of the sql statement - * we assume that $oFieldDefinition holds the correct default value. - * - * @param array $fieldDefinition - * - * @return string","public function _GetSQLDefinition($fieldDefinition = null) - { - return ''; - }" -TCMSFieldPortalLanguageMatrix,"* returns true if field data is not empty - * overwrite this method for mlt and property fields. - * - * @return bool","public function HasContent() - { - $bHasContent = false; - - $oTableConfig = $this->oTableRow->GetTableConf(); - $sRecordID = $this->oTableRow->sqlData['id']; - - $sAlreadyConnectedQuery = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).'` - WHERE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).""`.`record_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($sRecordID).""' - AND `"".MySqlLegacySupport::getInstance()->real_escape_string($this->sMatrixTableName).""`.`cms_tbl_conf_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($oTableConfig->id).""'""; - $tRes = MySqlLegacySupport::getInstance()->query($sAlreadyConnectedQuery); - if (MySqlLegacySupport::getInstance()->num_rows($tRes) > 0) { - $bHasContent = true; - }" -TCMSFieldPosition,"* std varchar text field (max 255 chars). -/*","public function GetHTML() - { - $this->GetTableConf(); - $oGlobal = TGlobal::instance(); - - // check for custom restriction in fieldtype config - $restrictionField = $this->oDefinition->GetFieldtypeConfigKey('restrictionfield'); - - if (!isset($restrictionField) || is_null($restrictionField) || empty($restrictionField) || false == $restrictionField) { - $restrictionField = $oGlobal->GetUserData('sRestrictionField'); - $restrictionValue = $oGlobal->GetUserData('sRestriction'); - }" -TCMSFieldPosition,"* conf of the table holding the position field. - * - * @var TCMSTableConf","public function GetSQL() - { - $returnVal = false; - if ($this->data < 1) { - $this->GetTableConf(); - // force position = max pos +1. even if this is a property table then this should work... - $databaseConnection = $this->getDatabaseConnection(); - $quotedName = $databaseConnection->quoteIdentifier($this->name); - $quotedSqlDataName = $databaseConnection->quoteIdentifier($this->oTableConf->sqlData['name']); - $query = ""SELECT MAX($quotedName) AS maxpos FROM $quotedSqlDataName""; - $result = MySqlLegacySupport::getInstance()->query($query); - if ($tmp = MySqlLegacySupport::getInstance()->fetch_assoc($result)) { - $this->data = $tmp['maxpos'] + 1; - }" -TCMSFieldPosition,"* checks if field is mandatory and if field content is valid - * overwrite this method to add your field based validation - * you need to add a message to TCMSMessageManager for handling error messages - * - * AddMessage($sConsumerName,'TABLEEDITOR_FIELD_IS_MANDATORY'); - * ?> - * . - * - * @return bool - returns false if field is mandatory and field content is empty or data is not valid","public function DataIsValid() - { - $bDataIsValid = parent::DataIsValid(); - if ($bDataIsValid) { - $pattern = ""/^\d+$/""; - if ($this->HasContent() && !preg_match($pattern, $this->data)) { - $bDataIsValid = false; - $oMessageManager = TCMSMessageManager::GetInstance(); - $sConsumerName = TCMSTableEditorManager::MESSAGE_MANAGER_CONSUMER; - $sFieldTitle = $this->oDefinition->GetName(); - $oMessageManager->AddMessage($sConsumerName, 'TABLEEDITOR_FIELD_SORT_NOT_VALID', array('sFieldName' => $this->name, 'sFieldTitle' => $sFieldTitle)); - }" -TCMSFieldPosition,"* returns true if field data is not empty - * overwrite this method for mlt and property fields. - * - * @return bool","public function HasContent() - { - $bHasContent = false; - if ('' != $this->data) { - $bHasContent = true; - }" -TCMSFieldPropertyTable,"* presents a 1:n table (ie n records for the current table) - * in this case $this->data contains the name of the foreign table. the foreign table - * must always contain an id of the form current_table_name_id - * you can also define what field to use as a match in the target table by using: fieldNameInConnectedTable=fieldname - * we can show the subtable as a standard liste.. - * you can open the field on load via bOpenOnLoad=true (field config) - * you can open the field as a 1:1 relation via bOnlyOneRecord=true (field config).","public function __construct() - { - $this->isPropertyField = true; - }" -TCMSFieldPropertyTable,* view path for frontend.,"public function GetHTML() - { - /** @var TTableEditorListFieldState $stateContainer */ - $stateContainer = \ChameleonSystem\CoreBundle\ServiceLocator::get('cmsPkgCore.tableEditorListFieldState'); - - $inputFilterUtil = $this->getInputFilterUtil(); - - $aStateURL = array( - 'pagedef' => $inputFilterUtil->getFilteredInput('pagedef'), - 'tableid' => $inputFilterUtil->getFilteredInput('tableid'), - 'id' => $inputFilterUtil->getFilteredInput('id'), - 'fieldname' => $this->name, - 'module_fnc' => array('contentmodule' => 'ExecuteAjaxCall'), - '_fnc' => 'changeListFieldState', - ); - $sStateURL = '?'.TTools::GetArrayAsURLForJavascript($aStateURL); - - $html = ''; - $sPropertyTableName = $this->GetPropertyTableName(); - if (empty($sPropertyTableName) || !TGlobal::TableExists($sPropertyTableName)) { - $html = 'Die Property Tabelle ['.TGlobal::OutHTML($sPropertyTableName).'] ist entweder nicht angegeben, oder existiert nicht!'; - if (empty($sPropertyTableName)) { - $html .= '
Das Feld '.TGlobal::OutHTML($this->name).' sollte den Namen der Property Tabelle enthalten'; - }" -TCMSFieldPropertyTable,@var TTableEditorListFieldState $stateContainer,"public function GetPropertyTableName() - { - $sTableName = $this->data; - if (empty($this->data)) { - $sTableName = $this->oDefinition->GetFieldtypeConfigKey('connectedTableName'); - if (empty($sTableName)) { - if (!empty($this->oDefinition->sqlData['field_default_value'])) { - $sTableName = $this->oDefinition->sqlData['field_default_value']; - }" -TCMSFieldPropertyTable,"* generates the URL for the MLT iFrame List and returns the javascript method to open the iframe. - * - * @return string","public function DeleteFieldDefinition() - { - $tableName = $this->data; - if (!empty($tableName)) { - $targetField = $tableName.'_id'; - - $query = 'DELETE FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($tableName).'` - WHERE `'.MySqlLegacySupport::getInstance()->real_escape_string($targetField).""` = '"".MySqlLegacySupport::getInstance()->real_escape_string($this->recordId).""'""; - MySqlLegacySupport::getInstance()->query($query); - - $editLanguage = $this->getLanguageService()->getActiveEditLanguage(); - $migrationQueryData = new MigrationQueryData($tableName, $editLanguage->fieldIso6391); - $migrationQueryData - ->setWhereEquals(array( - $targetField => $this->recordId, - )); - $aQuery = array(new LogChangeDataModel($migrationQueryData, LogChangeDataModel::TYPE_DELETE)); - TCMSLogChange::WriteTransaction($aQuery); - }" -TCMSFieldPropertyTable,@var $oForeignTableConf TCMSTableConf,"public function RenderFieldMethodsString() - { - $sHTML = ''; - - $sOwningField = $this->GetMatchingParentFieldName(); - - if (!empty($sOwningField)) { - $aMethodData = $this->GetFieldMethodBaseDataArray(); - $aMethodData['sMethodName'] = $this->GetFieldMethodName(); - $aMethodData['sReturnType'] = TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $this->GetPropertyTableName()).'List'; - - $aMethodData['sCallMethodName'] = 'GetListFor'.TCMSTableToClass::GetClassName('', $sOwningField); - - $oViewParser = new TViewParser(); - /** @var $oViewParser TViewParser */ - $oViewParser->bShowTemplatePathAsHTMLHint = false; - $oViewParser->AddVarArray($aMethodData); - - $sMethodCode = $oViewParser->RenderObjectView('getproperties', 'TCMSFields/TCMSFieldPropertyTable'); - $oViewParser->AddVar('sMethodCode', $sMethodCode); - - $sHTML = $oViewParser->RenderObjectView('method', 'TCMSFields/TCMSField'); - }" -TCMSFieldPropertyTable,"* returns the connected proprty table name. - * - * @return string","public function GetMatchingParentFieldName() - { - $sOwningField = $this->oDefinition->GetFieldtypeConfigKey('fieldNameInConnectedTable'); - if (null !== $sOwningField) { - return $sOwningField; - }" -TCMSFieldPropertyTable,"* overwrite to delete the related items in the target table - * here we assume that $this->data is set!","public function GetReadOnly() - { - return $this->GetHTML(); - }" -TCMSFieldPropertyTable,@var $oViewParser TViewParser,"public function GetDisplayType() - { - $modifier = parent::GetDisplayType(); - $oGlobal = TGlobal::instance(); - if ('1' == $this->oDefinition->sqlData['restrict_to_groups']) { - // check if the user is in one of the connected groups - - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - if (!$securityHelper->isGranted(CmsPermissionAttributeConstants::ACCESS, $this->oDefinition)) { - $modifier = 'hidden'; - }" -TCMSFieldPropertyTable,"* return the name of the matching parent field name in the target table. - * - * @return string","public function GetFieldNameForFieldFrontend($oField) - { - return TGlobal::OutHTML($oField->fieldTranslation); - }" -TCMSFieldPropertyTable,"* returns the modifier (none, hidden, readonly) of the field. if the field - * is restricted, and the modifier is none, then we return readonly instead. - * - * @return string","public function PkgCmsFormPostSaveHook($sId, $oForm) - { - // ----------------------------------------------------------------------- - if (is_array($this->data) && array_key_exists('x', $this->data)) { - unset($this->data['x']); - }" -TCMSFieldPropertyTable,@var SecurityHelperAccess $securityHelper,"public function GetPropertyTableNameFrontend() - { - $sTableName = $this->oDefinition->GetFieldtypeConfigKey('connectedTableName'); - if (empty($sTableName)) { - if (!empty($this->oDefinition->sqlData['field_default_value'])) { - $sTableName = $this->oDefinition->sqlData['field_default_value']; - }" -TCMSFieldPropertyTable,@var SecurityHelperAccess $securityHelper,"public function allowDeleteRecordReferences() - { - $sPreventReferenceDeletion = $this->oDefinition->GetFieldtypeConfigKey('preventReferenceDeletion'); - $bAllowDeleteRecordReferences = true; - if ('true' === $sPreventReferenceDeletion) { - $bAllowDeleteRecordReferences = false; - }" -TCMSFieldPropertyTable_CmsMedia,* {@inheritdoc},"public function GetHTML() - { - $sImageControl = $this->GetImageControlButtons(); - - return $sImageControl.parent::GetHTML(); - }" -TCMSFieldPropertyTable_CmsMedia,"* access via ConfigGetFieldMapping. - * - * @var array","public function ConfigShowCategorySelector() - { - $showCategorySelector = $this->oDefinition->GetFieldtypeConfigKey('bShowCategorySelector'); - - return '0' !== $showCategorySelector; - }" -TCMSFieldPropertyTable_CmsMedia,"* access via GetDefaultValue. - * - * @var array","public function ConfigGetDefaultCategoryId() - { - return $this->oDefinition->GetFieldtypeConfigKey('sDefaultCategoryId'); - }" -TCMSFieldPropertyTable_CmsMedia,* max height of images uploaded in frontend.,"public function _GetOpenUploadWindowJS() - { - $js = ""saveCMSRegistryEntry('_currentFieldName','"".TGlobal::OutHTML($this->name).""');TCMSFieldPropertyTableCmsMediaOpenUploadWindow_"".TGlobal::OutJS($this->name).'(document.cmseditform.'.TGlobal::OutHTML($this->name).'__cms_media_tree_id.value);'; - - return $js; - }" -TCMSFieldPropertyTable_CmsMedia,* max width of images uploaded in frontend.,"public function GetCMSHtmlHeadIncludes() - { - $aIncludes = parent::GetCMSHtmlHeadIncludes(); - $aRequest = array( - 'pagedef' => 'CMSUniversalUploader', - 'mode' => 'media', - 'callback' => 'CMSFieldPropertyTableCmsMediaPostUploadHook_'.$this->name, - 'queueCompleteCallback' => 'CMSFieldPropertyTableCmsMediaQueueCompleteHook_'.$this->name, - ); - $singleMode = $this->oDefinition->GetFieldtypeConfigKey('singleMode'); - if (!empty($singleMode)) { - $aRequest['singleMode'] = '1'; - }" -TCMSFieldPropertyTable_CmsMedia,* view path for frontend.,"public function ConnectImageObject() - { - $oGlobal = TGlobal::instance(); - $sMediaId = $oGlobal->GetUserData('cms_media_id'); - $aData = array( - $this->GetMatchingParentFieldName() => $this->recordId, - $this->ConfigGetMediaFieldName() => $sMediaId, - ); - - // now set defaults - $aDefaults = $this->ConfigGetTargetDefaults(); - foreach ($aDefaults as $sField => $sValue) { - $aData[$sField] = $sValue; - }" -TCMSFieldPropertyTable_CmsMedia,* @return string,"public function PkgCmsFormPostSaveHook($sId, $oForm) - { - if (is_array($this->data) && array_key_exists('x', $this->data)) { - unset($this->data['x']); - }" -TCMSFieldPropertyTable_CmsMedia,"* return true if the category selector should be shown. - * - * @return bool","public function PkgCmsFormDataIsValid() - { - static $bIsValid = null; - if (is_null($bIsValid)) { - if (is_array($this->data) && array_key_exists('x', $this->data)) { - unset($this->data['x']); - }" -TCMSFieldPropertyTable_CmsMedia,"* return array mapping media fields to target table fields. - * - * @param string $sSourceField - * - * @return string|bool","public function PkgCmsFormTransformFormDataBeforeSave($oForm) - { - $this->PkgCmsFormDataIsValid(); - if (is_array($this->data) && array_key_exists('x', $this->data)) { - unset($this->data['x']); - }" -TCMSFieldPropertyTable_CmsMedia,"* @param string $sSourceField - * @param TCMSRecord $oSourceRecord - * - * @return string","public function UploadImage($sKey) - { - if (is_array($this->data) && array_key_exists($sKey, $this->data)) { - $oFile = TCMSFile::GetInstance($_FILES[$this->name.'image']['tmp_name'][$sKey]); - if ($oFile) { - $oFile->sExtension = strtolower( - substr( - $_FILES[$this->name.'image']['name'][$sKey], - strpos($_FILES[$this->name.'image']['name'][$sKey], '.') + 1 - ) - ); - if ($oFile->IsValidCMSImage()) { - $aSizeOfImage = getimagesize($oFile->sPath); - $oFile->Load($oFile->sPath); - $sContentType = image_type_to_mime_type($aSizeOfImage[2]); - $aImageFileData = array( - 'name' => $_FILES[$this->name.'image']['name'][$sKey], - 'type' => $sContentType, - 'size' => $oFile->dSizeByte, - 'tmp_name' => $oFile->sPath, - 'error' => 0, - ); - $oMediaTableConf = new TCMSTableConf(); - $oMediaTableConf->LoadFromField('name', 'cms_media'); - $oMediaManagerEditor = new TCMSTableEditorMedia(); - $oMediaManagerEditor->AllowEditByAll(true); - $oMediaManagerEditor->Init($oMediaTableConf->id); - $oMediaManagerEditor->SetUploadData($aImageFileData, true); - $aImage = array( - 'description' => $_FILES[$this->name.'image']['name'][$sKey], - $this->ConfigGetMediaFieldName() => 1, - ); - $sMediaTreeId = $this->ConfigGetDefaultCategoryId(); - if (!empty($sMediaTreeId)) { - $aImage['cms_media_tree_id'] = $sMediaTreeId; - }" -TCMSFieldSEOURLTitle,"* varchar field with javascript to set the navigation url. -/*","public function GetHTML() - { - parent::GetHTML(); - - $sourceFieldName = $this->oDefinition->GetFieldtypeConfigKey('sourcefieldname'); - - $html = parent::GetHTML(); - - if (!empty($sourceFieldName)) { - $html .= "" - '; - - return $aIncludes; - }" -TCMSFieldVarchar,* view path for frontend.,"public function HasContent() - { - $bHasContent = false; - if ('' != trim($this->data)) { - $bHasContent = true; - }" -TCMSFieldVarcharUnique,"* std varchar text field (max 255 chars and index unique). -/*","public function GetSQLOnCopy() - { - $sData = parent::GetSQLOnCopy().'_COPY'; - - return $sData; - }" -,"* @param TCMSFieldVisitorInterface $visitor - * - * @return mixed","public function accept($visitor); -}" -,"* @param TCMSField $oField - * - * @return mixed","public function visit(TCMSField $oField); -}" -TCMSFieldWYSIWYG,"* WYSIWYG text field. - * - * you may set the field config variable ""disableButtons"" in CMS field configuration - * or global via constant: CHAMELEON_WYSIWYG_DISABLED_BUTTONS - * - * @see http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar for detailed list - * - * it`s possible to overwrite the CSS URL by setting: css=[{portalurl}]/pathtowysiwyg.css - * in field configuration - * - * /*","public function GetHTML() - { - parent::GetHTML(); - $oViewRenderer = new ViewRenderer(); - $oViewRenderer->AddSourceObject('sEditorName', 'fieldcontent_'.$this->sTableName.'_'.$this->name); - $oViewRenderer->AddSourceObject('sFieldName', $this->name); - $oViewRenderer->AddSourceObject('extraPluginsConfiguration', $this->getExtraPluginsConfiguration()); - $oViewRenderer->AddSourceObject('aEditorSettings', $this->getEditorSettings()); - $sUserCssUrl = $this->getEditorCSSUrl(); - if ('' !== $sUserCssUrl) { - $aStyles = array(); - try { - $aStyles = $this->getJSStylesSet($sUserCssUrl); - }" -TCMSFieldWYSIWYG,"* renders the read only view of the field. - * - * @return string","public function GetReadOnly() - { - parent::GetReadOnly(); - $html = $this->GetHTML(); - - return $html; - }" -TCMSFieldWYSIWYG,* @return array,"public function GetCMSHtmlHeadIncludes() - { - $aIncludes = parent::GetCMSHtmlHeadIncludes(); - if (!is_array($aIncludes)) { - $aIncludes = array(); - }" -TCMSFieldWYSIWYG,* @return string,"public function _GetFieldWidth() - { - if (0 != $this->oDefinition->sqlData['field_width']) { - // max length - $this->fieldCSSwidth = ($this->oDefinition->sqlData['field_width'] + 30).'px'; - $this->fieldWidth = $this->oDefinition->sqlData['field_width']; - }" -TCMSMLTField,* @return string,"public function __construct() - { - $this->isMLTField = true; - }" -TCMSMLTField,* @return TCMSRecordList,"public function getMltValues() - { - $sMltTableName = $this->GetMLTTableName(); - $oFieldTableRow = $this->oTableRow; - $aConnectedIds = array(); - - if (is_array($oFieldTableRow->sqlData) && array_key_exists('id', $oFieldTableRow->sqlData) && !empty($oFieldTableRow->sqlData['id'])) { - $recordId = $oFieldTableRow->sqlData['id']; - - $oTableConf = new TCMSTableConf(); - $oTableConf->LoadFromField('name', $this->sTableName); - - $sAlreadyConnectedQuery = 'SELECT * FROM `'.\MySqlLegacySupport::getInstance()->real_escape_string($sMltTableName).""` WHERE `source_id` = '"".\MySqlLegacySupport::getInstance()->real_escape_string($recordId).""'""; - $tRes = \MySqlLegacySupport::getInstance()->query($sAlreadyConnectedQuery); - while ($aRow = \MySqlLegacySupport::getInstance()->fetch_assoc($tRes)) { - $aConnectedIds[] = $aRow['target_id']; - }" -TCMSMLTField,* {@inheritdoc},"public function GetMLTTableName(); - - /** - * @return TCMSRecordList - */ - abstract public function FetchMLTRecords(); - - /** - * {@inheritdoc}" -TCMSMLTField,"* @param string $tableName - * @param string $nameColumn - * - * @return string - * - * @throws ErrorException - * @throws TPkgCmsException_Log","public function toString() - { - if (!$this->data) { - return ''; - }" -TCMSMLTField,"* returns the name of the connected table. - * Get connected table name form field or from field configuration (connectedTableName) - * If table name comes from field name _mlt and field counts will be filtered. - * - * @return string","public function GetConnectedTableName($bExistingCount = true) - { - $sTableName = $this->oDefinition->GetFieldtypeConfigKey('connectedTableName'); - $sTableName = $this->GetClearedTableName($sTableName); - $sFieldLastCharacter = substr($sTableName, -1); - if (is_numeric($sFieldLastCharacter) && 'mp3' != $sFieldLastCharacter && $bExistingCount) { - $sTableName = substr($sTableName, 0, -1); - }" -TCMSFile,"* full image path. - * - * @var string","public function Rename($sNewName) - { - $sTarget = realpath($this->sDir.'/'.$sNewName); - - return $this->getFileManager()->move($this->sDir.'/'.$this->sFileName, $sTarget); - }" -TCMSFile,"* set to true if the file is on a remote server (ie http:// url is given). - * - * @var bool","public function GetURL() - { - $sURL = false; - $oURLData = TCMSSmartURLData::GetActive(); - $sBase = $_SERVER['DOCUMENT_ROOT']; - if (substr($this->sPath, 0, strlen($sBase)) == $sBase) { - $sURL = REQUEST_PROTOCOL.'/'.$oURLData->sDomainName.'/'.substr($this->sPath, strlen($sBase)); - }" -TCMSFile,"* return instance for file. - * - * @param string $sPath - * - * @return TCMSFile","public function Load($sPath) - { - $bLoaded = false; - if ('http://' == substr($sPath, 0, 7)) { - $this->bIsHTTPResource = true; - $this->sPath = $sPath; - $this->sDir = dirname($sPath); - $this->sFileName = basename($sPath); - $iExtensionPos = strrpos($this->sFileName, '.'); - if (false !== $iExtensionPos) { - $this->sExtension = strtolower(substr($this->sFileName, $iExtensionPos + 1)); - if ('jpeg' == $this->sExtension) { - $this->sExtension = 'jpg'; - }" -TCMSFile,@var $oItem TCMSFile,"public function IsValidCMSImage() - { - $allowedFileTypes = TCMSImage::GetAllowedMediaTypes(); - $bValidType = (in_array($this->sExtension, $allowedFileTypes)); - - if ($this->bIsHTTPResource) { - $bIsRGB = true; - }" -TCMSFile,"* rename the file. - * - * @param string $sNewName - * - * @return bool","public function __construct() - { - }" -TCMSFileList,"* get file list for a dir and a file pattern. - * - * @param string $sDir - * @param string $sPattern - regex - * @param bool $bUseRegexPattern - set to false if you want a standard file mask as used in glob - * - * @return TCMSFileList","public function Load($sDir, $sPattern = null, $bUseRegexPattern = true) - { - $this->Destroy(); - $sDir = realpath($sDir); - if ($bUseRegexPattern) { - $d = dir($sDir); - while (false !== ($entry = $d->read())) { - if (is_file($sDir.'/'.$entry) && (is_null($sPattern) || $this->StringMatchesPattern($entry, $sPattern))) { - $oItem = TCMSFile::GetInstance($sDir.'/'.$entry); - $this->AddItem($oItem); - }" -TCMSFileList,"* load the files in the dir. - * - * @param string $sDir - * @param bool $bUseRegexPattern - set to false if you want a standard file mask as used in glob - * @param string $sPattern - regex","public function current(): TCMSFile|bool - { - return parent::Current(); - }" -TCMSFileList,"* return true if the string matches the pattern. - * - * @param string $sString - * @param string $sPattern - regex - * - * @return array|false","public function next():TCMSFile|bool - { - return parent::Next(); - }" -TCMSFileList,"* returns current item without moving the item pointer. - * - * @return TCMSFile","public function Previous() - { - return parent::Previous(); - }" -TCMSFileList,"* returns the current item in the list and advances the list pointer by 1. - * - * @return TCMSFile|false","public function Random() - { - return parent::Random(); - }" -TCMSGroupedStatistics,"* used to generate grouped statistics. -/*","public function AddBlock($sBlockName, $sQuery, $aSubGroups = array()) - { - $tRes = MySqlLegacySupport::getInstance()->query($sQuery); - $sMySqlError = MySqlLegacySupport::getInstance()->error(); - if (!empty($sMySqlError)) { - trigger_error('SQL Error: '.$sMySqlError, E_USER_WARNING); - }" -TCMSGroupedStatistics,@var $oView TViewParser,"public function Render($sViewName, $sType = 'Core') - { - $oView = new TViewParser(); - /** @var $oView TViewParser */ - $oView->AddVar('oStats', $this); - $oView->AddVar('aBlocks', $this->aBlocks); - $oView->AddVar('sBlockName', $this->sBlockName); - $aNameColumns = $this->GetNameColumns(); - $oView->AddVar('aNameColumns', $aNameColumns); - $oView->AddVar('bShowDiffColumn', $this->bShowDiffColumn); - - $sSeparator = ';'; - $oView->AddVar('sSeparator', $sSeparator); - - $iMaxGroupCount = $this->GetMaxGroupColumnCount(); - $oView->AddVar('iMaxGroupCount', $iMaxGroupCount); - - return $oView->RenderObjectView($sViewName, self::VIEW_SUBTYPE, $sType); - }" -TCMSGroupedStatisticsGroup,@var $oView TViewParser,"public function GetColumnNames() - { - $aNames = $this->aColumnNames; - if (count($this->aSubGroups) > 0) { - reset($this->aSubGroups); - foreach (array_keys($this->aSubGroups) as $sGroupIndex) { - $aTmpNames = $this->aSubGroups[$sGroupIndex]->GetColumnNames(); - foreach ($aTmpNames as $sName) { - if (!in_array($sName, $aNames)) { - $aNames[] = $sName; - }" -TCMSGroupedStatisticsGroup,"* init the object. - * - * @param string $sGroupTitle - name of the group - * @param string $sSubGroupColumn","public function GetTotalFor($sColumnName) - { - if (array_key_exists($sColumnName, $this->aGroupTotals)) { - return $this->aGroupTotals[$sColumnName]; - }" -TCMSGroupedStatisticsGroup,"* update the totals for the group. - * - * @param array $aDataRow","public function GetGroupName() - { - return $this->sGroupTitle; - }" -TCMSGroupedStatisticsGroup,"* add a column of data. - * - * @param array $aDataRow","public function ReturnValueFor($sColumnName) - { - if (array_key_exists($sColumnName, $this->aDataColumns)) { - return $this->aDataColumns[$sColumnName]; - }" -TCMSGroupedStatisticsGroup,"* returns the data columsn in the form array(array(field->val,field->val),array()..).","public function GetMaxValue() - { - return max($this->aGroupTotals); - }" -TCMSListManagerCMSUser,* manages the webpage list (links to the template engine interface).,"public function GetUserRestriction() - { - $query = parent::GetUserRestriction(); - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - - if ($securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) { - return $query; - }" -TCMSListManagerCMSUser,* show only records that belong to the user (if the table contains the user id).,"public function CallBackFunctionBlockDeleteButton($id, $row) - { - if (!$row['is_system']) { - return parent::CallBackFunctionBlockDeleteButton($id, $row); - }" -TCMSListManagerCMSUser,@var SecurityHelperAccess $securityHelper,"public function callbackCmsUserWithImage(string $name, array $row): string - { - $name = $name.', '.$row['firstname']; - - $imageTag = ''; - - $imageId = $row['images']; - if (false === is_numeric($imageId) || (int) $imageId >= 1000) { - $image = new TCMSImage(); - if (null !== $image) { - $image->Load($imageId); - $oThumbnail = $image->GetThumbnail(16, 16); - if (!is_null($oThumbnail)) { - $oBigThumbnail = $image->GetThumbnail(400, 400); - $imageTag = 'GetFullURL()).'"" width=""'.TGlobal::OutHTML($oThumbnail->aData['width']).'"" height=""'.TGlobal::OutHTML($oThumbnail->aData['height']).""\"" hspace=\""0\"" vspace=\""0\"" border=\""0\"" onclick=\""CreateMediaZoomDialogFromImageURL('"".$oBigThumbnail->GetFullURL().""','"".TGlobal::OutHTML($oBigThumbnail->aData['width']).""','"".TGlobal::OutHTML($oBigThumbnail->aData['height']).""')\"" style=\""cursor: hand; cursor: pointer; margin-right:10px\"" align=\""left\"" />""; - }" -TCMSListManagerDocumentChooser,* add custom filter section.,"public function _AddFunctionColumn() - { - }" -TCMSListManagerDocumentChooser,@var Request $request,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'parent._SetDocument'; - }" -TCMSListManagerDocumentChooser,* we need this to overwrite the standard function column.,"public function AddFields() - { - parent::AddFields(); - - $jsParas = array('id'); - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('id' => '#'), 'left', null, 1, false); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackMediaSelectBox'), null, 1); - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('cms_filetype_id' => TGlobal::Translate('chameleon_system_core.list_document.file_type')), 'left', null, 1, false); - $this->tableObj->AddColumn('cms_filetype_id', 'left', array($this, 'CallBackDocumentFileType'), $jsParas, 1); - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('name' => TGlobal::Translate('chameleon_system_core.list_document.title')), 'left', null, 1, false); - $this->tableObj->AddColumn('name', 'left', null, $jsParas, 1); - $this->tableObj->searchFields['`cms_document`.`name`'] = 'full'; - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('filename' => TGlobal::Translate('chameleon_system_core.list_document.file_name')), 'left', null, 1, false); - $this->tableObj->AddColumn('filename', 'left', array($this, 'CallBackFilenameShort'), $jsParas, 1); - $this->tableObj->searchFields['`cms_document`.`filename`'] = 'full'; - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('filesize' => TGlobal::Translate('chameleon_system_core.list_document.file_size')), 'left', null, 1, false); - $this->tableObj->AddColumn('filesize', 'left', array($this, 'CallBackHumanRedableFileSize'), $jsParas, 1); - }" -TCMSListManagerDocumentChooser,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function GetCustomRestriction() - { - $query = parent::GetCustomRestriction(); - - $oGlobal = TGlobal::instance(); - $cms_document_tree_id = $oGlobal->GetUserData('cms_document_tree_id'); - - if (!empty($cms_document_tree_id) || !empty($this->tableObj->_postData['cms_document_tree_id'])) { - if (!empty($query)) { - $query .= ' AND '; - }" -TCMSListManagerDocumentChooser,* add additional fields.,"public function AddTableGrouping($columnCount = '') - { - $groupField = '`cms_document_tree`.`name`'; - - $list_group_field_column = 'category'; - - $this->tableObj->showGroupSelector = false; - $this->tableObj->AddGroupField(array($list_group_field_column => $groupField), 'left', null, null, $this->columnCount); - // $this->tableObj->showGroupSelectorText = 'Verzeichnis'; - $this->tableObj->showAllGroupsText = '['.TGlobal::Translate('chameleon_system_core.list.group_show_all').']'; - $tmpArray = array($list_group_field_column => 'ASC'); - $this->tableObj->orderList = array_merge($tmpArray, $this->tableObj->orderList); - }" -TCMSListManagerDocumentChooser,* restrict the list to show only images with given dimensions.,"public function CallBackDocumentFileType($id, $row) - { - $oFileDownload = new TCMSDownloadFile(); - /** @var $oFileDownload TCMSDownloadFile */ - $oFileDownload->Load($row['id']); - - $html = $oFileDownload->GetPlainFileTypeIcon(); - - return $html; - }" -is,"* extends the standard listing so that a preview image is shown, and if the - * class is called with the right parameters it will show an assign button to - * assign an image from the list to the calling record. -/*","public function CreateTableObj() - { - parent::CreateTableObj(); - $this->tableObj->showRecordCount = 20; - }" -is,* overwrite table config.,"public function _AddFunctionColumn() - { - }" -is,* we need this to overwrite the standard function column.,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'parent.editFileDetails'; - }" -is,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function AddFields() - { - parent::AddFields(); - - $sLanguageIdent = ''; - /** @var BackendSessionInterface $backendSession */ - $backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session'); - - $oCmsConfig = TdbCmsConfig::GetInstance(); - $oDefaultLang = $oCmsConfig->GetFieldTranslationBaseLanguage(); - if ($oDefaultLang && $oDefaultLang->fieldIso6391 != $backendSession->getCurrentEditLanguageIso6391()) { - $sLanguageIdent = $backendSession->getCurrentEditLanguageIso6391(); - }" -is,* add additional fields.,"public function GetCustomRestriction() - { - $query = parent::GetCustomRestriction(); - - $oGlobal = TGlobal::instance(); - - if ($oGlobal->UserDataExists('mltTable') && $oGlobal->UserDataExists('recordID')) { - $mltTable = $oGlobal->GetUserData('mltTable'); - $recordID = $oGlobal->GetUserData('recordID'); - - $MLTquery = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($mltTable).""` WHERE `source_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($recordID).""'""; - $MLTResult = MySqlLegacySupport::getInstance()->query($MLTquery); - $aIDList = array(); - - if (MySqlLegacySupport::getInstance()->num_rows($MLTResult) > 0) { - if (!empty($query)) { - $query .= ' AND '; - }" -is,@var BackendSessionInterface $backendSession,"public function GetHtmlHeadIncludes() - { - $aIncludes = parent::GetHtmlHeadIncludes(); - $aIncludes[] = ''; - - return $aIncludes; - }" -is,"* any custom restrictions can be added to the query by overwriting this function. - * - * @param string $query","public function CallBackGenerateDownloadLink($id, $row) - { - $oFile = new TCMSDownloadFile(); - /** @var $oFile TCMSDownloadFile */ - $oFile->Load($row['id']); - $sDownloadLink = $oFile->getDownloadHtmlTag(false, true, true); - - return $sDownloadLink; - }" -is,"* returns a filetype icon that is linked with the download file. - * - * @param string $id - * @param array $row - * - * @return string","public function CallBackDocumentSelectBox($id, $row) - { - return ""tableObj->showRecordCount = 20; - }" -is,* overwrite table config.,"public function _AddFunctionColumn() - { - }" -is,* we need this to overwrite the standard function column.,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'parent.editFileDetails'; - }" -is,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function GetCustomRestriction() - { - $query = ''; - - $oGlobal = TGlobal::instance(); - - if (!is_null($this->sRestrictionField) && !is_null($this->sRestriction) && $oGlobal->UserDataExists('fieldName')) { - if ('_mlt' == substr($this->sRestrictionField, -4)) { - $fieldName = $oGlobal->GetUserData('fieldName'); - if (!is_null($this->fieldCount)) { - $mltTable = substr($this->sRestrictionField, 0, -4).'_'.$fieldName.'_'.$this->oTableConf->sqlData['name'].$this->fieldCount.'_mlt'; - }" -is,"* add MLT connection check. - * - * @param string $query","public function AddFields() - { - parent::AddFields(); - - $sNameSQL = $this->oTableConf->GetNameColumn(); - $this->tableObj->RemoveHeaderField($sNameSQL); - $this->tableObj->RemoveColumn('title'); - - $this->tableObj->RemoveHeaderField('cmsident'); - $this->tableObj->RemoveColumn('cmsident'); - - $jsParas = array('id'); - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('id' => '#'), 'left', null, 1, false); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackDocumentAssignedSelectBox'), null, 1); - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('cms_filetype_id' => TGlobal::Translate('chameleon_system_core.list_document.file_type')), 'left', null, 1, false); - $this->tableObj->AddColumn('cms_filetype_id', 'left', array($this, 'CallBackGenerateDownloadLink'), null, 1); - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('name' => TGlobal::Translate('chameleon_system_core.list_document.title')), 'left', null, 1, false); - $this->tableObj->AddColumn('name', 'left', null, $jsParas, 1); - $this->tableObj->searchFields['`cms_document`.`name`'] = 'full'; - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('filename' => TGlobal::Translate('chameleon_system_core.list_document.file_name')), 'left', null, 1, false); - $this->tableObj->AddColumn('filename', 'left', array($this, 'CallBackFilenameShort'), $jsParas, 1); - $this->tableObj->searchFields['`cms_document`.`filename`'] = 'full'; - - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('filesize' => TGlobal::Translate('chameleon_system_core.list_document.file_size')), 'left', null, 1, false); - $this->tableObj->AddColumn('filesize', 'left', array($this, 'CallBackHumanRedableFileSize'), $jsParas, 1); - }" -is,* add additional fields.,"public function GetHtmlHeadIncludes() - { - $aIncludes = parent::GetHtmlHeadIncludes(); - $aIncludes[] = ''; - - return $aIncludes; - }" -is,"* returns a checkbox field for assigned document file selection with javascript onlick. - * - * @param string $id - * @param array $row - * - * @return string","public function CallBackDocumentAssignedSelectBox($id, $row) - { - return ""Load($row['id']); - $sDownloadLink = $oFile->getDownloadHtmlTag(false, true, true); - - return $sDownloadLink; - }" -used,"* class used to display a list of a table. all list views must inherit from - * this class.","public function Init($oTableConf) - { - $this->oTableConf = $oTableConf; - }" -used,"* table definition object. - * - * @var TdbCmsTblConf","public function IsMethodCallAllowed($sMethodName) - { - $this->DefineInterface(); - $returnVal = false; - if (in_array($sMethodName, $this->methodCallAllowed)) { - $returnVal = true; - }" -used,"* an iterator of the menu items for the table (new, export, etc). - * - * @var TIterator","public function GetList() - { - return 'table'; - }" -used,"* set this to false if you want to prevent table list caching (session). - * - * @var bool","public function CheckTableRights() - { - $tableRights = false; - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $tableInUserGroup = $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_ACCESS, $this->oTableConf->fieldName); - if ($tableInUserGroup) { - $tableRights = true; - }" -used,"* array of methods that are allowed to be called via URL (ajax call) - * /cms?module_fnc[contentmodule]=ExecuteAjaxCall&_noModuleFunction=true&_fnc=FunctionToCall&pagedef=tablemanager&id=7ab61897-3cf5-de32-a8f1-b926c650d756&callListManagerMethod=1. - * - * @var array","public function FilterQuery() - { - // the table query comes either from the field designated for it, - // or we need to generate the query by hand. - $filterQuery = ''; - - if (is_array($this->oTableConf->sqlData) && array_key_exists('list_query', $this->oTableConf->sqlData)) { - $recordquery = trim($this->oTableConf->sqlData['list_query']); - $portalRestriction = $this->GetPortalRestriction(); - $userRestriction = $this->GetUserRestriction(); - $userRestrictionJoin = ''; - if (!empty($userRestriction) && false !== strpos($userRestriction, '_cms_usergroup_mlt')) { - $userRestrictionJoin = $this->GetUserRestrictionJoin($recordquery); - }" -used,"* init the list class. - * - * @param TdbCmsTblConf $oTableConf","public function ShowNewEntryButton() - { - return true; - }" -used,* sets methods that are allowed to be called via URL (ajax calls).,"public function GetPortalRestriction() - { - $query = ''; - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - if (false === $securityHelper->isGranted(CmsUserRoleConstants::CMS_USER)) { - return false; - }" -used,"* checks if method is listed in $this->methodCallAllowed array. - * - * @param string $sMethodName - * - * @return bool","public function CreateRestriction($fieldname, $operatorAndValue) - { - return ""`{$this->oTableConf->sqlData['name']}" -used,"* returns the table as a string. it would be better to return an object, - * but the old way of handling the tables does not allow this. - * - * @return string","public function GetUserRestriction() - { - $query = ''; - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $userId = $securityHelper->getUser()?->getId(); - $userGroupIds = $securityHelper->getUser()?->getGroups(); - if (null === $userGroupIds) { - $userGroupIds = []; - }" -used,"* checks if the user has the right to see the table list. - * - * @return bool","public function GetCustomRestriction() - { - $query = ''; - - if (!empty($this->sRestrictionField) && !is_null($this->sRestriction)) { - $sourceID = $this->sRestriction; - $query .= $this->CreateRestriction($this->sRestrictionField, ""= '"".MySqlLegacySupport::getInstance()->real_escape_string($sourceID).""'""); - }" -used,@var SecurityHelperAccess $securityHelper,"public function GetTableAlias($query) - { - $databaseConnection = $this->getDatabaseConnection(); - $parentTableAlias = $databaseConnection->quoteIdentifier($this->oTableConf->sqlData['name']); - - $query = str_replace(""\n"", ' ', $query); - - // get parent table alias - if (stristr($query, ""FROM $parentTableAlias AS "")) { // we have an alias - $aQuery = explode(""FROM $parentTableAlias AS "", $query); - $aQuery2 = explode(' ', $aQuery[1]); - $parentTableAlias = trim($aQuery2[0]); - }" -used,"* generate the query for the current view. - * - * @return string","public function GetMenuItems() - { - if (is_null($this->oMenuItems)) { - $this->oMenuItems = new TIterator(); - // std menuitems... - - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $allowTableAccess = $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_ACCESS, $this->oTableConf->fieldName); - if ($allowTableAccess) { - if ($securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_NEW, $this->oTableConf->fieldName)) { - // new - $oMenuItem = new TCMSTableEditorMenuItem(); - $oMenuItem->sDisplayName = TGlobal::Translate('chameleon_system_core.action.new'); - $oMenuItem->sIcon = 'fas fa-plus'; - $oMenuItem->sItemKey = 'new'; - $oMenuItem->sOnClick = ""document.cmsform.elements['module_fnc[contentmodule]'].value='Insert';document.cmsform.submit();""; - $this->oMenuItems->AddItem($oMenuItem); - }" -used,@var $oCustomRestriction TCMSTableConfRestriction,"public function GetHtmlHeadIncludes() - { - $aIncludes = array(); - - return $aIncludes; - }" -used,"* Add Group By to the end of the query. - * - * @return string","public function GetHiddenFieldsHook() - { - $oGlobal = TGlobal::instance(); - $aAdditionalParameterData = array(); - $aAdditionalParameters = array('sRestrictionField', 'sRestriction', 'bIsLoadedFromIFrame'); - foreach ($aAdditionalParameters as $sKey) { - if ($oGlobal->UserDataExists($sKey)) { - $aAdditionalParameterData[$sKey] = $oGlobal->GetUserData($sKey); - }" -TCMSListManagerExtendedLookup,"* uses the TFullGroupTable to manage the list. -/*","public function _AddFunctionColumn() - { - }" -TCMSListManagerExtendedLookup,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function _GetRecordClickJavaScriptFunctionName() - { - $sReturnValue = 'selectExtendedLookupRecord'; - $oGlobal = TGlobal::instance(); - if ($oGlobal->UserDataExists('fieldName')) { - $oCmsFieldConf = TdbCmsFieldConf::GetNewInstance(); - $oCmsFieldConf->LoadFromFields(array('name' => $oGlobal->GetUserData('fieldName'), 'cms_tbl_conf_id' => $oGlobal->GetUserData('sourceTblConfId'))); - - $oCmsFieldType = $oCmsFieldConf->GetFieldCmsFieldType(); - if ('CMSFIELD_EXTENDEDMULTITABLELIST' == $oCmsFieldType->fieldConstname) { - $sReturnValue = 'selectExtendedLookupMultiTableRecord'; - }" -TCMSListManagerExtendedLookup,"* by returning false the ""new entry"" button in the list can be supressed. - * - * @return bool","public function ShowNewEntryButton() - { - return true; - }" -TCMSListManagerExtendedLookupModuleInstance,"* return an array of all js, css, or other header includes that are required - * in the cms for this field. each include should be in one line, and they - * should always be typed the same way so that no includes are included mor than once. - * - * @return array","public function _GetRecordClickJavaScriptFunctionName() - { - return 'selectModuleInstanceRecord'; - }" -TCMSListManagerFullGroupTable,"* Uses the TFullGroupTable to manage the list. - * - * Saves the current table object in the `_listObjCache` session variable in order to - * support stateful lists (e.g. for sorting). {@see getTableFromSessionCache} {@see saveTableInSessionCache}","public function Init($oTableConf) - { - parent::Init($oTableConf); - - $this->tableObj = null; - $this->columnCount = 0; - $_SESSION['_tmpCurrentTableName'] = $this->oTableConf->sqlData['name']; // needed for the callback functions... - $_SESSION['_tmpCurrentTableID'] = $this->oTableConf->sqlData['id']; // needed for the callback functions... - - $listCacheKey = $this->GetListCacheKey(); - $cachedTableObj = null; - if (true === $this->isTableCachingEnabled()) { - $cachedTableObj = $this->getTableFromSessionCache($listCacheKey); - }" -TCMSListManagerFullGroupTable,"* holds the full group table object. - * - * @var TFullGroupTable","public function GetListCacheKey() - { - return TCacheManager::GetKey($this->GetCacheParameters()); - }" -TCMSListManagerFullGroupTable,"* Number of columns. - * - * @var int","public function GetList() - { - $table = ''; - $table .= $this->tableObj->Display(); - - return $table; - }" -TCMSListManagerFullGroupTable,* {@inheritdoc},"public function CreateTableObj() - { - $oGlobal = TGlobal::instance(); - /** @var BackendSessionInterface $backendSession */ - $backendSession = ServiceLocator::get('chameleon_system_cms_backend.backend_session'); - - $postData = $oGlobal->GetUserData(); - $this->tableObj = new TFullGroupTable(); - $this->tableObj->Init($postData); - $this->tableObj->setLanguageId($backendSession->getCurrentEditLanguageId()); - $this->tableObj->sTableName = $this->oTableConf->sqlData['name']; - $this->tableObj->orderList = array(); - $this->tableObj->formActionType = 'GET'; - $this->tableObj->listName = 'cmstablelistObj'.$this->oTableConf->sqlData['cmsident']; - $this->tableObj->onClick = $this->_GetRecordClickJavaScriptFunctionName(); - $this->tableObj->showSearchBox = true; - - $this->tableObj->sql = $this->FilterQuery(); - $this->tableObj->hasCondition = true; // indicates whether the sql has a WHERE condition (default = false) - $oCMSConfig = TdbCmsConfig::GetInstance(); - $this->tableObj->showRecordCount = $oCMSConfig->sqlData['entry_per_page']; - - // style of every field - $this->tableObj->style->group = 'bg-secondary'; - $this->tableObj->style->groupSpacer = 'groupSpacer'; - $this->tableObj->style->header = 'bg-primary'; - $this->tableObj->style->navigation = 'tblNav'; - $this->tableObj->style->filter = 'tblfilter'; - $this->tableObj->style->search = 'tblsearch'; - $this->tableObj->style->notFoundText = 'error'; - $this->tableObj->style->groupSelector = 'tblGroupSelector'; - $this->tableObj->style->searchButtonTDstyle = 'tblSearchButtonTDstyle'; - $this->tableObj->style->searchFieldTDstyle = 'tblSearchFieldTDstyle'; - - $this->tableObj->hitText = TGlobal::Translate('chameleon_system_core.list.current_page_details'); - $this->tableObj->searchFieldText = TGlobal::Translate('chameleon_system_core.list.search_term'); - $this->tableObj->searchButtonText = TGlobal::Translate('chameleon_system_core.list.perform_search'); - $this->tableObj->notFoundText = TGlobal::Translate('chameleon_system_core.list.no_entries'); - $this->tableObj->pageingLocation = 'bottom'; - - $this->tableObj->_postData = $postData; - if (isset($postData['_startRecord']) && (!empty($postData['_startRecord']) || '0' == $postData['_startRecord'])) { // we need to check the 0 condition because 0 is treated as empty - $this->tableObj->startRecord = $postData['_startRecord']; // set current start record - }" -TCMSListManagerFullGroupTable,* @return \Symfony\Component\HttpFoundation\Request,"public function getDisplayListFieldsConfig($tableConfigurationId) - { - $connection = $this->getDatabaseConnection(); - $query = 'SELECT * FROM `cms_tbl_display_list_fields` - WHERE `cms_tbl_conf_id` = :id - ORDER BY `position` - '; - - return $connection->fetchAllAssociative($query, array( - 'id' => $tableConfigurationId, - )); - }" -TCMSListManagerFullGroupTable,"* returns a key that combines the different cache parameters to a unique key. - * - * @return string","public function getDisplayListFieldConfig($tableConfigurationId, $field) - { - $connection = $this->getDatabaseConnection(); - $query = 'SELECT * FROM `cms_tbl_display_list_fields` - WHERE `cms_tbl_conf_id` = :id - AND `name` = :field - ORDER BY `position` - '; - try { - return $connection->fetchAllAssociative($query, array( - 'id' => $tableConfigurationId, - 'field' => $field, - )); - }" -TCMSListManagerFullGroupTable,"* returns the cache parameters needed for identification of the right cache object. - * - * @return array","public function AddFields() - { - $this->AddRowPrefixFields(); - $allowSort = $this->AllowSortForAllStandardFields(); - $jsParas = $this->_GetRecordClickJavaScriptParameters(); - - $listFieldsConfig = $this->getDisplayListFieldsConfig($this->oTableConf->id); - - $this->tableObj->searchFields = array(); - - // add locking column if locking is active - if ('1' == $this->oTableConf->sqlData['locking_active']) { - $this->tableObj->AddHeaderField(array('Locking' => TGlobal::Translate('chameleon_system_core.list.column_name_lock')), 'left', null, 1, false, 30); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackLockingStatus'), $jsParas, 1); - ++$this->columnCount; - }" -TCMSListManagerFullGroupTable,@var SecurityHelperAccess $securityHelper,"public function _AddFunctionColumn() - { - ++$this->columnCount; - $sTranslatedField = TGlobal::Translate('chameleon_system_core.list.column_name_actions'); - $this->tableObj->AddHeaderField(array('id' => $sTranslatedField.'  '), 'right', null, 1, false, false); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackFunctionBlock'), null, 1); - }" -TCMSListManagerFullGroupTable,@var BackendSessionInterface $backendSession,"public function AddTableGrouping($columnCount = '') - { - if (false === \property_exists($this->oTableConf, 'fieldListGroupField')) { - return; - }" -TCMSListManagerFullGroupTable,"* returns the table as a HTML String. - * - * @return string","public function AddSortInformation() - { - $oGlobal = TGlobal::instance(); - $postdata = $oGlobal->GetUserData(); - - $sListCacheKey = $this->GetListCacheKey(); - if (!array_key_exists('_listObjCache', $_SESSION)) { - $_SESSION['_listObjCache'] = array(); - }" -TCMSListManagerFullGroupTable,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"public function GetSortInfoAsString() - { - $sSortOrder = ''; - $aOrderData = $this->tableObj->orderList; - foreach ($aOrderData as $field => $direction) { - if (!empty($sSortOrder)) { - $sSortOrder .= ', '; - }" -TCMSListManagerFullGroupTable,@var SecurityHelperAccess $securityHelper,"public function CallBackLockingStatus($field, $row, $name) - { - $userLock = TTools::IsRecordLocked($_SESSION['_tmpCurrentTableID'], $row['id']); - if (false === $userLock) { - return ''; - }" -TCMSListManagerFullGroupTable,* generates the tableobject assumes that all parameters are in post.,"public function CallBackFunctionBlock($id, $row) - { - $aFunctionItems = $this->getRowFunctionItems($id, $row); - - if (count($aFunctionItems) > 0) { - $returnValue = ' -
-
    - '; - - foreach ($aFunctionItems as $key => $item) { - if ('' === $item) { - continue; - }" -TCMSListManagerFullGroupTable,@var BackendSessionInterface $backendSession,"public function CallBackFunctionBlockEditButton($id, $row) - { - $label = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.action.edit')); - - return ''; - }" -TCMSListManagerFullGroupTable,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function CallBackFunctionBlockCopyButton($id, $row) - { - $label = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.action.copy')); - - if ((array_key_exists('cms_translation_parent_id', $row) && array_key_exists('cms_translationparentid', $row) && '' == $row['cms_translationparentid']) || !array_key_exists('cms_translation_parent_id', $row)) { - return ''; - }" -TCMSListManagerFullGroupTable,"* Retrieves the list field configuration for all fields for a given table configuration id. - * - * @param int $tableConfigurationId Table configuration id - * - * @return array|null Field configuration records","public function CallBackFunctionBlockDeleteButton($id, $row) - { - $label = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.action.delete')); - - return ''; - }" -TCMSListManagerFullGroupTable,"* Retrieves the list field configuration for a single field in a given table configuration by id. - * - * @param int $tableConfigurationId Table configuration id - * @param string $field Field query string (e.g. `cms_tbl_conf`.`translation`) - * - * @return array|null Field configuration records","public function CallBackImageWithZoom($path, $row) - { - $oImage = new TCMSImage(); - /** @var $oImage TCMSImage */ - $oImage->Load($row['id']); - $image = ''; - - if ($oImage->IsExternalMovie()) { - $image = $oImage->renderImage(100, 75); - }" -TCMSListManagerFullGroupTable,* adds the field information of the table obj.,"public function CallBackMediaSelectBox($id, $row) - { - $html = "" 25) { - $shortFilename = mb_substr($shortFilename, 0, 25).'...'; - }" -TCMSListManagerFullGroupTable,* @var TCMSRecord $recordObject,"public function CallBackHumanRedableFileSize($fileSize, $row) - { - $fileSize = TCMSDownloadFile::GetHumanReadableFileSize($fileSize); - - return $fileSize; - }" -TCMSListManagerFullGroupTable,* use this method to add field columns between the standard columns and the function column.,"public function CallBackDrawListItemSelectbox($id, $row, $sFieldName) - { - $html = ''; - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - if ($securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->sqlData['name'])) { - $html = ''; - }" -TCMSListManagerFullGroupTable,"* if field based translation is active, then this will change the data in aField to - * match the current language. - * - * @param array $aField - array of a list field (cms_tbl_display_list_fields -> name and db_alias are relevant) - * - * @return array","public function CallBackRowStyling($sRecordID, $row) - { - return ''; - }" -is,"* extends the standard listing so that a preview image is shown, and if the - * class is called with the right parameters it will show an assign button to - * assign an image from the list to the calling record. -/*","public function AddFields() - { - $jsParas = array('id'); - ++$this->columnCount; - $sTranslatedField = TGlobal::Translate('chameleon_system_core.list_image_database.column_name_preview'); - $this->tableObj->AddHeaderField(array('path' => $sTranslatedField), 'left', null, 1, false); - $this->tableObj->AddColumn('path', 'left', array($this, 'CallBackImageWithZoom'), $jsParas, 1); - parent::AddFields(); - }" -is,* add the preview image.,"public function GetCustomRestriction() - { - $query = ''; - $query .= parent::GetCustomRestriction(); - if (!empty($query)) { - $query .= ' AND '; - }" -is,"* extends the standard listing so that a preview image is shown, and if the - * class is called with the right parameters it will show an assign button to - * assign an image from the list to the calling record. -/*","public function AddFields() - { - $jsParas = array('id'); - ++$this->columnCount; - $sTranslatedField = TGlobal::Translate('chameleon_system_core.list_image_database.column_name_preview'); - $this->tableObj->AddHeaderField(array('path' => $sTranslatedField), 'left', null, 1, false); - $this->tableObj->AddColumn('path', 'left', array($this, 'CallBackImageWithZoom'), $jsParas, 1); - parent::AddFields(); - }" -is,* add the preview image.,"public function GetCustomRestriction() - { - $query = parent::GetCustomRestriction(); - - if ('' !== $query) { - $query .= ' AND '; - }" -is,"* extends the standard listing so that a preview image is shown, and if the - * class is called with the right parameters it will show an assign button to - * assign an image from the list to the calling record. -/*","public function AddFields() - { - $jsParas = array('id'); - ++$this->columnCount; - $sTranslatedField = TGlobal::Translate('chameleon_system_core.list_image_database.column_name_preview'); - $this->tableObj->AddHeaderField(array('path' => $sTranslatedField), 'left', null, 1, false); - $this->tableObj->AddColumn('path', 'left', array($this, 'CallBackImageWithZoom'), $jsParas, 1); - parent::AddFields(); - }" -is,* add the preview image.,"public function GetCustomRestriction() - { - $query = parent::GetCustomRestriction(); - if (!empty($query)) { - $query .= ' AND '; - }" -is,"* extends the standard listing so that a preview image is shown, and if the - * class is called with the right parameters it will show an assign button to - * assign an image from the list to the calling record. -/*","public function _AddFunctionColumn() - { - }" -is,* we need this to overwrite the standard function column.,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'parent.editFileDetails'; - }" -is,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function AddFields() - { - ++$this->columnCount; - $this->tableObj->AddHeaderField(array('id' => '#'), 'left', null, 1, false); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackMediaSelectBox'), null, 1); - parent::AddFields(); - }" -TCMSListManagerMediaSelector,"* default image for current position. - * - * @var TCMSImage","public function Init($oImage) - { - $this->oGlobal = TGlobal::instance(); - $this->oDefaultImage = $oImage; - - $tableConf = TdbCmsTblConf::GetNewInstance(); - $tableConf->LoadFromField('name', 'cms_media'); - - parent::Init($tableConf); - }" -TCMSListManagerMediaSelector,"* TGlobal object. - * - * @var TGlobal","public function CreateTableObj() - { - parent::CreateTableObj(); - - $this->tableObj->searchBoxContent = ''; - }" -TCMSListManagerMediaSelector,* @param TCMSImage $oImage - the default image for the current selected position,"public function _AddFunctionColumn() - { - }" -TCMSListManagerMediaSelector,* {@inheritdoc},"public function _GetRecordClickJavaScriptFunctionName() - { - return 'parent._SetImage'; - }" -TCMSListManagerMediaSelector,* {@inheritdoc},"public function GetCacheParameters() - { - $aCacheParameters = parent::GetCacheParameters(); - - if (!is_null($this->sRestriction)) { - $oImage = new TCMSImage(); - /** @var $oImage TCMSImage */ - $oImage->Load($this->sRestriction); - if (!empty($oImage->aData['width']) && $oImage->aData['width'] > 0) { - $aCacheParameters['width'] = $oImage->aData['width']; - }" -TCMSListManagerMediaSelector,* {@inheritdoc},"public function GetCustomRestriction() - { - $query = parent::GetCustomRestriction(); - - $cms_media_tree_id = $this->oGlobal->GetUserData('cms_media_tree_id'); - - if (!empty($cms_media_tree_id)) { - if (!empty($query)) { - $query .= ' AND '; - }" -TCMSListManagerMediaSelector,"* returns the cache parameters needed for identification of the right cache object. - * - * @return array","public function AddTableGrouping($columnCount = '') - { - $groupField = '`cms_media_tree`.`name`'; - $list_group_field_column = 'category'; - - $this->tableObj->showGroupSelector = false; - $this->tableObj->AddGroupField(array($list_group_field_column => $groupField), 'left', null, null, $this->columnCount); - $this->tableObj->showAllGroupsText = '['.TGlobal::Translate('chameleon_system_core.list.group_show_all').']'; - $tmpArray = array($list_group_field_column => 'ASC'); - $this->tableObj->orderList = array_merge($tmpArray, $this->tableObj->orderList); - }" -TCMSListManagerMLT,"* uses the TFullGroupTable to manage the list. -/*","public function CreateTableObj() - { - parent::CreateTableObj(); - $this->tableObj->showRecordCount = 10; - }" -TCMSListManagerMLT,"* Returns the name of the MLt field without source table name. - * Postfix _mlt was filtered. - * - * @return string","public function _AddFunctionColumn() - { - ++$this->columnCount; - $sTranslatedField = TGlobal::Translate('chameleon_system_core.list.column_name_actions'); - $this->tableObj->AddHeaderField(array('id' => $sTranslatedField.'  '), 'right', null, 1, false, 100); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackMLTFunctionBlock'), null, 1); - }" -TCMSListManagerMLT,"* Returns the mlt table name. - * - * @return string","public function GetCustomRestriction() - { - $query = ''; - if (!is_null($this->sRestrictionField) && !is_null($this->sRestriction)) { - if ('_mlt' == substr($this->sRestrictionField, -4) && array_key_exists('table', $this->tableObj->_postData)) { - $mltTable = $this->GetMLTTableName(); - if ($this->IsCustomSort()) { - $query .= "" `{$mltTable}" -TCMSListManagerMLT,"* any custom restrictions can be added to the query by overwriting this function. - * - * @param string $query","public function CallBackMLTFunctionBlock($id, $row) - { - return ''; - }" -TCMSListManagerMLT,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"public function AddSortInformation() - { - if ($this->IsCustomSort()) { - $sMLTTableName = $this->GetMLTTableName(); - - $databaseConnection = $this->getDatabaseConnection(); - $quotedMltTableName = $databaseConnection->quoteIdentifier($sMLTTableName); - - $sMltField = ""$quotedMltTableName.`entry_sort`""; - $aTmpField = $this->TransformFieldForTranslations(array('name' => $sMltField, 'db_alias' => '')); - $this->tableObj->orderList[$aTmpField['name']] = 'ASC'; - }" -TCMSListManagerMLT,"* displays the function icons (delete, copy, etc) for MLT table lists - * returns HTML. - * - * @param string $id - * @param array $row - * - * @return string","public function IsCustomSort() - { - static $bIsCustomSort = null; - if (is_null($bIsCustomSort)) { - $bIsCustomSort = false; - if (array_key_exists('table', $this->tableObj->_postData)) { - $oTableConf = TdbCmsTblConf::GetNewInstance(); - $oTableConf->LoadFromField('name', $this->tableObj->_postData['table']); - $oMltField = $oTableConf->GetFieldDefinition($this->tableObj->_postData['field']); - $bShowCustomsort = $oMltField->GetFieldtypeConfigKey('bAllowCustomSortOrder'); - if (true == $bShowCustomsort) { - $bIsCustomSort = true; - }" -TCMSListManagerMLTList,"* uses the TFullGroupTable to manage the list. -/*","public function CreateTableObj() - { - parent::CreateTableObj(); - $this->tableObj->showRecordCount = 20; - }" -TCMSListManagerMLTList,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function _AddFunctionColumn() - { - }" -TCMSListManagerMLTList,"* any custom restrictions can be added to the query by overwriting this function. - * - * @param string $query","public function _GetRecordClickJavaScriptFunctionName() - { - return 'addMLTConnectionPassThrough'; - }" -TCMSListManagerMLTList,"* Returns the name of the MLt field without source table name. - * Postfix _mlt was filtered. - * - * @return string","public function GetCustomRestriction() - { - $query = ''; - - // because one table may be connected more than once with the source table, we need - // to use the parameter ""name"" instead of the tableconf - $oGlobal = TGlobal::instance(); - $sFieldMltName = $this->GetFieldMltName(); - $mltTable = substr($this->sRestrictionField, 0, -4).'_'.$sFieldMltName.'_mlt'; - //echo $mltTable; - //echo ""
    "";var_dump($this); echo ""
    ""; - - $MLTquery = 'SELECT * FROM `'.MySqlLegacySupport::getInstance()->real_escape_string($mltTable).""` WHERE `source_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($this->sRestriction).""'""; - $MLTResult = MySqlLegacySupport::getInstance()->query($MLTquery); - $aIDList = array(); - while ($row = MySqlLegacySupport::getInstance()->fetch_assoc($MLTResult)) { - $aIDList[] = $row['target_id']; - }" -TCMSListManagerModuleInstanceEndPoint,"* array of allowed modules for the current spot. - * - * @var array","public function Init($oTableConf) - { - $tableConf = TdbCmsTblConf::GetNewInstance(); - $tableConf->LoadFromField('name', 'cms_tpl_module_instance'); - parent::Init($tableConf); - }" -TCMSListManagerModuleInstanceEndPoint,* {@inheritdoc},"public function _AddFunctionColumn() - { - }" -TCMSListManagerModuleInstanceEndPoint,"* by returning false the ""new entry"" button in the list can be supressed. - * - * @return bool","public function AddFields() - { - parent::AddFields(); - $jsParas = $this->_GetRecordClickJavaScriptParameters(); - - ++$this->columnCount; - - $siteText = TGlobal::Translate('chameleon_system_core.list_module_instance.column_name_pages'); - $this->tableObj->AddHeaderField(array('id' => $siteText.'  '), 'left', null, 1, false); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackTemplateEngineInstancePages'), $jsParas, 1); - }" -TCMSListManagerModuleInstanceEndPoint,"* Add custom joins to the query. - * - * @return string","public function ShowNewEntryButton() - { - return false; - }" -TCMSListManagerModuleInstanceEndPoint,* any custom restrictions can be added to the query by overwriting this function.,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'LoadCMSInstance'; - }" -TCMSListManagerModuleInstanceEndPoint,@var SecurityHelperAccess $securityHelper,"public function GetCustomRestriction() - { - $query = parent::GetCustomRestriction(); - - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - - if (!empty($query)) { - $query .= ' AND '; - }" -TCMSListManagerModuleInstanceEndPoint,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"public function CallBackTemplateEngineInstancePages($id, $row) - { - $query = ""SELECT `cms_tpl_page`.* - FROM `cms_tpl_page_cms_master_pagedef_spot` - INNER JOIN `cms_tpl_page` ON `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_page_id` = `cms_tpl_page`.`id` - WHERE `cms_tpl_page_cms_master_pagedef_spot`.`cms_tpl_module_instance_id` = '"".MySqlLegacySupport::getInstance()->real_escape_string($id).""' - ORDER BY `cms_tpl_page`.`tree_path_search_string` - ""; - $pageString = ''; - - $oCmsTplPageList = TdbCmsTplPageList::GetList($query); - while ($oCmsTplPage = $oCmsTplPageList->Next()) { - $path = $this->getBreadcrumbsFromPaths($oCmsTplPage->fieldTreePathSearchString); - if (empty($path)) { - $path = TGlobal::Translate('chameleon_system_core.list_module_instance.no_usages_found_in_navigation_node'); - }" -TCMSListManagerPagedefinitions,"* manages the webpage list (links to the template engine interface). -/*","public function GetPortalRestriction() - { - /** @var SecurityHelperAccess $securityHelper */ - $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); - $portals = $securityHelper->getUser()?->getPortals(); - if (null === $portals) { - $portals = array(); - }" -TCMSListManagerPortalDomains,"* Allows deletion only if the domain is not the primary domain. - * - * @param string $id - * @param array $row - * - * @return string","public function CallBackFunctionBlockDeleteButton($id, $row) - { - if (false === $row['is_master_domain'] || '1' !== $row['is_master_domain']) { - return parent::CallBackFunctionBlockDeleteButton($id, $row); - }" -TCMSListManagerTreeNode,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function _GetRecordClickJavaScriptFunctionName() - { - return 'openTreeNodeConnectionEditor'; - }" -TCMSListManagerTreeNode,"* return an array of all js, css, or other header includes that are required - * in the cms for this field. each include should be in one line, and they - * should always be typed the same way so that no includes are included mor than once. - * - * @return array","public function GetHtmlHeadIncludes() - { - $aIncludes = parent::GetHtmlHeadIncludes(); - - if (is_null($this->sTreeNodeTableID)) { - $this->sTreeNodeTableID = TTools::GetCMSTableId('cms_tree_node'); - }" -TCMSListManagerTreeNode,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"public function CallBackActivationStatus($id, $row) - { - $oTree = TdbCmsTree::GetNewInstance(); - $oTree->Load($row['cms_tree_id']); - $oCurrentActiveTreeConnection = $oTree->GetActivePageTreeConnectionForTree(); - - $html = ' '.TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.list_tree_node.state_disabled')); - if (false !== $oCurrentActiveTreeConnection && $oCurrentActiveTreeConnection->id == $row['id']) { - if ('1' == $row['active']) { - $html = ''; - }" -TCMSListManagerTreeNode,@var SecurityHelperAccess $securityHelper,"public function AddSortInformation() - { - parent::AddSortInformation(); - $this->tableObj->orderList['active'] = 'DESC'; - $this->tableObj->orderList['start_date'] = 'ASC'; - }" -TCMSListManagerWebpages,"* manages the webpage list (links to the template engine interface). -/*","public function _AddFunctionColumn() - { - ++$this->columnCount; - $sTranslatedField = TGlobal::Translate('chameleon_system_core.list.column_name_actions'); - $this->tableObj->AddHeaderField(array('id' => $sTranslatedField.'  '), 'right', null, 1, false, 100); - $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackFunctionBlock'), null, 1); - }" -TCMSListManagerWebpages,* overwrite the function column to use a class specific callback.,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'OpenTemplateEngine'; - }" -is,"* extends the standard listing so that a preview image is shown, and if the - * class is called with the right parameters it will show an assign button to - * assign an image from the list to the calling record. -/*","public function _AddFunctionColumn() - { - }" -is,* we need this to overwrite the standard function column.,"public function _GetRecordClickJavaScriptFunctionName() - { - return 'parent.selectImage'; - }" -is,"* returns the name of the javascript function to be called when the user clicks on a - * record within the table. - * - * @return string","public function GetCustomRestriction() - { - $query = ''; - $query .= parent::GetCustomRestriction(); - - $oGlobal = TGlobal::instance(); - $cms_media_tree_id = $oGlobal->GetUserData('cms_media_tree_id'); - - if (!empty($cms_media_tree_id)) { - if (!empty($query)) { - $query .= ' AND '; - }" -is,* add custom filter section.,"public function AddTableGrouping($columnCount = '') - { - $groupField = '`cms_media_tree`.`name`'; - $list_group_field_column = 'category'; - - $this->tableObj->showGroupSelector = false; - $this->tableObj->AddGroupField(array($list_group_field_column => $groupField), 'left', null, null, $this->columnCount); - // $this->tableObj->showGroupSelectorText = 'Verzeichnis'; - $this->tableObj->showAllGroupsText = '['.TGlobal::Translate('chameleon_system_core.list.group_show_all').']'; - $tmpArray = array($list_group_field_column => 'ASC'); - $this->tableObj->orderList = array_merge($tmpArray, $this->tableObj->orderList); - }" -TCMSMemcache,"* holds memcache instance depending on what is available - for now only memcached. - * - * @var Memcached|null","public function __construct($memcacheClass, $timeout, array $serverList) - { - $this->timeout = $timeout; - - $this->Init($memcacheClass); - - $serversToUseList = array(); - foreach ($serverList as $server) { - if (false !== $server['host']) { - $serversToUseList[] = $server; - }" -TCMSMemcache,"* enable or disable logging - log messages are written into normal log file (e.g. chameleon.log by default). - * - * @var bool","public function Init($memcacheClass = 'auto') - { - }" -TCMSMemcache,"* this array describes what we want to log - * possible values are: - * 'set', - * 'replace', - * 'get', - * 'delete', - * 'flush' - * by default you only should enable flush - believe me ... only enable other methods for debugging purposes - * otherwise you chameleon.log will be spammed. - * - * @var array","public function PostInit() - { - if (null === $this->oMemcache) { - trigger_error(""couldn't get memcached instance"", E_USER_ERROR); - }" -TCMSMemcache,* @var bool,"public function Set($sKey, $mValue, $iExpire = 0) - { - $mValue = $this->processBeforeWrite($mValue); - $bIsSet = $this->oMemcache->set($sKey, $mValue, $iExpire); - - if (false == $bIsSet && $this->bLogging && in_array('set', $this->aLoggingMethods)) { - TTools::WriteLogEntry('memcached set for key: '.$sKey.' with expire: '.$iExpire.' failed - memcached result code was: '.$this->oMemcache->getResultCode().' result message: '.$this->oMemcache->getResultMessage(), 2, __FILE__, __LINE__); - }" -TCMSMemcache,* @var int,"public function setMulti($aItems, $iExpire = 0) - { - foreach ($aItems as $key => $item) { - $aItems[$key] = $this->processBeforeWrite($item); - }" -TCMSMemcache,"* @param string $memcacheClass @deprecated since 6.2.0 - only Memcached is supported. - * @param int $timeout - * @param array $serverList","public function Replace($sKey, $mValue, $iExpire = 0) - { - $mValue = $this->processBeforeWrite($mValue); - $bIsSet = $this->oMemcache->replace($sKey, $mValue, $iExpire); - - if (false == $bIsSet && $this->bLogging && in_array('set', $this->aLoggingMethods)) { - TTools::WriteLogEntry('memcached set for key: '.$sKey.' with expire: '.$iExpire.' failed - memcached result code was: '.$this->oMemcache->getResultCode().' result message: '.$this->oMemcache->getResultMessage(), 2, __FILE__, __LINE__); - }" -TCMSMemcache,"* searches for the memcache class that should be used. - * - * if you think you have connection issues when using memcached lib - * use some of the following methods for debugging after the addServer method was executed - * $this->oMemcache->getResultCode(); - should be 0 - * $this->oMemcache->getResultMessage(); - should be success - * $this->oMemcache->getStats(); - should be an array with server information - * - * @param string $memcacheClass @deprecated since 6.2.0 - only Memcached is supported.","public function Get($sKey) - { - $mValue = $this->oMemcache->get($sKey); - $mValue = $this->processPostRead($mValue); - if (true === $this->getLastGetRequestReturnedNoMatch() && $this->bLogging && in_array('get', $this->aLoggingMethods)) { - TTools::WriteLogEntry('memcached get for key: '.$sKey.' failed - memcached result code was: '.$this->oMemcache->getResultCode().' result message: '.$this->oMemcache->getResultMessage(), 2, __FILE__, __LINE__); - }" -TCMSMemcache,"* will be executed after Init() and SetServer() method to check some stuff that possibly go wrong - * so here you can write logs or throw errors or do whatever you want after initialization is done - * by default triggers an error if no memcache could be instantiated.","public function Delete($sKey) - { - $bDeleted = $this->oMemcache->delete($sKey); - $bDeleted = ($bDeleted || (16 == $this->oMemcache->getResultCode())); // delete is ok if key was not found - - if (false === $bDeleted && $this->bLogging && in_array('delete', $this->aLoggingMethods)) { - $iResultCode = $this->oMemcache->getResultCode(); - TTools::WriteLogEntry('memcached delete for key: '.$sKey.' failed - memcached result code was: '.$iResultCode.' result message: '.$this->oMemcache->getResultMessage(), 2, __FILE__, __LINE__); - }" -TCMSMemcache,"* initializes the memcache object $this->oMemcache. - * - * @param array $aServer - server array can hold as much servers as you want (as array) each server array must have the keys 'host' and 'port'","public function Flush() - { - if (!$this->oMemcache->flush()) { - if ($this->bLogging && in_array('flush', $this->aLoggingMethods)) { - $iResultCode = $this->oMemcache->getResultCode(); - TTools::WriteLogEntry('memcached flush failed - memcached result code was: '.$iResultCode.' result message: '.$this->oMemcache->getResultMessage(), 2, __FILE__, __LINE__); - }" -TCMSMemcache,"* returns a initialized TCMSMemcache object. - * - * @return TCMSMemcache - * - * @deprecated inject chameleon_system_cms_cache.memcache_cache instead","public function getDriver() - { - return $this->oMemcache; - }" -TCMSMemcache,"* returns a initialized TCMSMemcache object. - * - * @return TCMSMemcache - * - * @deprecated inject chameleon_system_cms_cache.memcache_session instead","public function getLastGetRequestReturnedNoMatch() - { - return $this->lastGetRequestReturnedNoMatch; - }" -manages,"* the class manages messages. any module can place messages into it. they are kept there until they are consumed - * note that the system will store message codes and translate them using the connected database table. messages - * in the database may hold placeholders for variables: - * variables need to be marked as follows: [{varname:type}]. - * - type must be one of: string, date, or number. - * - if type is a number, then the number of decimal places to show may be added as follows: - * - number:N (N = number of decimal places). - * - * since messages may be in different languages, the system will try to fetch the language from tcmsactivepage - * - * the object maintains its contents via session until the data is consumed - * - * NOTE: InjectMessageIntoString is called on the COMPLETE RENDERED PAGE. so you can add messages to your page - * without having to worry about caching. just use the format described in the method InjectMessageIntoString - * -/*","public function AddMessage($sConsumerName, $sMessageCode, $aMessageCodeParameters = array()) - { - if (!array_key_exists($sConsumerName, $this->aMessages)) { - $this->aMessages[$sConsumerName] = new TIterator(); - }" -manages,"* array of all messages. - * - * @var array","public function ConsumeMessages($sConsumerName, $bRemove = true, bool $includeGlobal = true) - { - $oMessages = null; - if (array_key_exists($sConsumerName, $this->aMessages)) { - $oMessages = $this->aMessages[$sConsumerName]; - if ($bRemove) { - unset($this->aMessages[$sConsumerName]); - }" -manages,"* @param bool $bReload - * - * @return TCMSMessageManager - * - * @deprecated use the service chameleon_system_core.flash_messages instead","public function RenderMessages($sConsumerName, $sViewName = null, $sViewType = null, $aCallTimeVars = array(), $bRemove = true) - { - $sMsg = ''; - $oMessages = $this->ConsumeMessages($sConsumerName, $bRemove); - if (!is_null($oMessages)) { - $oMessages->GoToStart(); - /** @var TdbCmsMessageManagerMessage $oMessage */ - while ($oMessage = $oMessages->Next()) { - $sMsg .= $oMessage->Render($sViewName, $sViewType, $aCallTimeVars); - }" -manages,"* add a message code to the queue. - * - * @param string $sConsumerName - * @param string $sMessageCode - * @param array $aMessageCodeParameters","public function ClearMessages($sConsumerName = null) - { - if (is_null($sConsumerName)) { - $this->aMessages = array(); - }" -manages,@var $oMessage TdbCmsMessageManagerMessage,"public function ConsumerHasMessages($sConsumerName, bool $includeGlobal = true) - { - $bHasMessages = false; - if ($this->ConsumerMessageCount($sConsumerName, $includeGlobal) > 0) { - $bHasMessages = true; - }" -manages,@var $oTmpTable TCMSRecordWritable,"public function ConsumerMessageCount($sConsumerName, bool $includeGlobal = true) - { - $iMessageCount = 0; - if (true === $includeGlobal && array_key_exists(self::GLOBAL_CONSUMER_NAME, $this->aMessages)) { - $iMessageCount = $this->aMessages[self::GLOBAL_CONSUMER_NAME]->Length(); - }" -manages,"* get description text for new created messages in the database. - * - * @param string $sConsumerName - * @param array $aMessageCodeParameters - * - * @return string","public function TotalMessageCount() - { - $iMessageCount = 0; - reset($this->aMessages); - foreach (array_keys($this->aMessages) as $sConsumer) { - $iMessageCount = $iMessageCount + $this->aMessages[$sConsumer]->Length(); - }" -manages,"* get message text for new created messages in the database. - * - * @param string $sMessageCode - * - * @return string","public function InjectMessageIntoString($sText) - { - // find out which items will be replaced - if (false === stripos($sText, '[{CMSMSG-')) { - return $sText; - }" -manages,"* add a message code to the queue of the backend message manager. - * - * @param string $sConsumerName - * @param string $sMessageCode - * @param array $aMessageCodeParameters","public function GetConsumerListWithMessages() - { - return array_keys($this->aMessages); - }" -manages,@var $oMessage TdbCmsMessageManagerBackendMessage,"public function GetClassesForConsumer($sConsumerName, $sDivider = ' ') - { - $aFieldClasses = array(); - if ($this->ConsumerHasMessages($sConsumerName)) { - $oMessages = $this->ConsumeMessages($sConsumerName, false); - while ($oMessage = $oMessages->Next()) { - $oMessageType = TdbCmsMessageManagerMessageType::GetNewInstance(); - if (!$oMessageType->Load($oMessage->fieldCmsMessageManagerMessageTypeId)) { - $oMessageType = null; - }" -manages,@var $oTmpTable TCMSRecordWritable,"public function addBackendToasterMessage($id, $type = 'ERROR', array $parameters = array(), $domain = TranslationConstants::DOMAIN_BACKEND) - { - $translator = $this->getTranslator(); - $message = $translator->trans($id, $parameters, $domain); - $listener = new AddBackendToasterMessageListener($message, $type); - $dispatcher = $this->getEventDispatcher(); - $dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'addMessage')); - }" -TCMSMessageManagerBackendMessage,"* render the message. - * - * @param string $sViewName - the view to use - * @param string $sViewType - where the view is located (Core, Custom-Core, Customer) - * @param array $aCallTimeVars - place any custom vars that you want to pass through the call here - * - * @return string","public function Render($sViewName = 'standard', $sViewType = 'Core', $aCallTimeVars = array()) - { - $oView = new TViewParser(); - - $sMessage = $this->GetMessageString(); - $oMessageType = TdbCmsMessageManagerMessageType::GetNewInstance(); - /** @var $oMessageType TdbCmsMessageManagerMessageType */ - if (!$oMessageType->Load($this->fieldCmsMessageManagerMessageTypeId)) { - $oMessageType = null; - }" -TCMSMessageManagerBackendMessage,@var $oMessageType TdbCmsMessageManagerMessageType,"public function GetMessageString() - { - $matchString = '/\[\{(.*?)(:(string|number|date))*(:(.*?))*\}" -TCMSMessageManagerBackendMessage,"* use this method to add any variables to the render method that you may - * require for some view. - * - * @param string $sViewName - the view being requested - * @param string $sViewType - the location of the view (Core, Custom-Core, Customer) - * - * @return array","public function SetMessageParameters($aParameters) - { - $this->aMessageParameters = $aParameters; - }" -TCMSMessageManagerBackendMessage,"* return message string. - * - * @return string","public function GetMessageParameters() - { - return $this->aMessageParameters; - }" -TCMSMessageManagerBackendMessage,"* method called by the regex to replace the variables in the message string. - * - * @param unknown_type $aMatches - * - * @return unknown","public function __sleep() - { - return array('table', 'id', 'iLanguageId', 'aMessageParameters'); - }" -TCMSMessageManagerBackendMessage,"* an assoc array with parameters to be placed into the message. - * - * @param array $aParameters","public function __wakeup() - { - $this->Load($this->id); - }" -TCMSMessageManagerMessage,"* optional variables that will be replaced in the message. - * - * @var array","public function Render($sViewName = null, $sViewType = null, $aCallTimeVars = array()) - { - $oView = new TViewParser(); - - $sMessage = $this->GetMessageString(); - $oMessageType = TdbCmsMessageManagerMessageType::GetNewInstance(); - /** @var $oMessageType TdbCmsMessageManagerMessageType */ - if (!$oMessageType->Load($this->fieldCmsMessageManagerMessageTypeId)) { - $oMessageType = null; - }" -TCMSMessageManagerMessage,"* render the message. - * - * @param string $sViewName - the view to use - * @param string $sViewType - where the view is located (Core, Custom-Core, Customer) - * @param array $aCallTimeVars - place any custom vars that you want to pass through the call here - * - * @return string","public function GetMessageString() - { - $sMessage = $this->fieldMessage; - $sMessage = nl2br($sMessage); - $matchString = '/\[\{(.*?)(:(string|number|date))*(:(.*?))*\}" -TCMSMessageManagerMessage,@var $oMessageType TdbCmsMessageManagerMessageType,"public function SetMessageParameters($aParameters) - { - $this->aMessageParameters = $aParameters; - }" -TCMSMessageManagerMessage,"* use this method to add any variables to the render method that you may - * require for some view. - * - * @param string $sViewName - the view being requested - * @param string $sViewType - the location of the view (Core, Custom-Core, Customer) - * - * @return array","public function GetMessageParameters() - { - return $this->aMessageParameters; - }" -TCMSMessageManagerMessage,"* return message string. - * - * @return string","public function __sleep() - { - return array('table', 'id', 'iLanguageId', 'aMessageParameters'); - }" -TCMSMessageManagerMessage,"* method called by the regex to replace the variables in the message string. - * - * @param array $aMatches - * - * @return string","public function __wakeup() - { - $this->Load($this->id); - }" -AbstractTCMSMessageManagerMapper,* {@inheritdoc},"public function GetRequirements(IMapperRequirementsRestricted $oRequirements) - { - $oRequirements->NeedsSourceObject('oMessageType', 'TdbCmsMessageManagerMessageType'); - $oRequirements->NeedsSourceObject('sMessage'); - }" -TCMSMessageManagerMapper,* {@inheritdoc},"public function Accept(IMapperVisitorRestricted $oVisitor, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager) - { - /** @var $oMessageType TdbCmsMessageManagerMessageType */ - $oMessageType = $oVisitor->GetSourceObject('oMessageType'); - if ($oMessageType && $bCachingEnabled) { - $oCacheTriggerManager->addTrigger($oMessageType->table, $oMessageType->id); - }" -TCMSMessageManagerMapper_Overlay,* {@inheritdoc},"public function Accept(IMapperVisitorRestricted $oVisitor, $bCachingEnabled, IMapperCacheTriggerRestricted $oCacheTriggerManager) - { - $oVisitor->SetMappedValue('bShowAsOverlay', true); - }" -TCMSSmartURLData,"* @deprecated use \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest() instead - * - * Lots of magic properties through `__get` in this class: - * @property string $sRelativeURL - * @property string $sOriginalURL - * @property TdbCmsPortalDomains|null $oActiveDomain - * @property string $sDomainName - * @property string $sOriginalDomainName - * @property bool $bIsSSLCall - * @property string $sRelativeURLPortalIdentifier - * @property string $sRelativeFullURL - * @property array $aParameters - * @property int $iPortalId - * @property bool $bPagedefFound - * @property bool $bDomainNotFound - * @property bool $bPortalNotFound - * @property string $sLanguageId - * @property string $sLanguageIdentifier - * @property bool $bDomainBasedLanguage","public function __isset($var) - { - $availableProperties = array('sRelativeURL', - 'sOriginalURL', - 'oActiveDomain', - 'sDomainName', - 'sOriginalDomainName', - 'bIsSSLCall', - 'sRelativeURLPortalIdentifier', - 'sRelativeFullURL', - 'aParameters', - 'iPortalId', - 'bPagedefFound', - 'bDomainNotFound', - 'bPortalNotFound', - 'sLanguageId', - 'sLanguageIdentifier', - 'bDomainBasedLanguage', ); - - if (in_array($var, $availableProperties)) { - return true; - }" -TCMSSmartURLData,"* set to true when the object is completely loaded (seo handler processed etc.) after this, all parameters of the object have been set to the data from the request. - * - * @var bool","public function __get($var) - { - $request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest(); - $activePortal = $this->getPortalDomainService()->getActivePortal(); - $activeDomain = $this->getPortalDomainService()->getActiveDomain(); - $activeLanguage = $this->getLanguageService()->getActiveLanguage(); - - switch ($var) { - case 'sRelativeURL': - return $this->getRequestInfoService()->getPathInfoWithoutPortalAndLanguagePrefix(); - case 'sOriginalURL': - return $request->getPathInfo(); - case 'oActiveDomain': - return $activeDomain; - case 'sDomainName': - return (null !== $activeDomain) ? $activeDomain->GetActiveDomainName() : null; - case 'sOriginalDomainName': - return $request->getHost(); - case 'bIsSSLCall': - if (null === $request) { - return false; - }" -TCMSSmartURLData,"* all parameters generated via seo handler from the original url. - * - * @var array","public function GetCacheKeyParameters() - { - $aData = array('class' => __CLASS__, 'sRelativeURL' => $this->sRelativeURL, 'sDomainName' => $this->sDomainName, 'bIsSSLCall' => $this->bIsSSLCall, 'iPortalId' => $this->iPortalId, 'sOriginalDomainName' => $this->sOriginalDomainName, 'sLanguageId' => $this->sLanguageId); - - return $aData; - }" -TCMSSmartURLData,"* get active instance of data object. - * - * @return TCMSSmartURLData - * - * @deprecated - you should use the request object instead: $request = \ChameleonSystem\CoreBundle\ServiceLocator::get('request_stack')->getCurrentRequest(); // @var Request $request","public function GetCacheTableInfos() - { - $aData = array(); - - $oPortal = $this->GetPortal(); - /** @var $oPortal TdbCmsPortal */ - if (!is_null($oPortal)) { - $aData[] = array('table' => 'cms_portal', 'id' => $oPortal->id); - }" -TCMSSmartURLData,"* returns an array of cache parameters to identify the object in cache. - * - * @return array","public function Init() - { - }" -TCMSSmartURLData,"* returns multidimensional array of tables and ids to use as cache delete triggers. - * - * @return array","public function GetPortal() - { - return $this->getPortalDomainService()->getActivePortal(); - }" -TCMSSmartURLData,@var $oPortal TdbCmsPortal,"public function SetObjectInitializationCompleted($bObjectInitializationCompleted) - { - $this->bObjectInitializationCompleted = $bObjectInitializationCompleted; - }" -TCMSSmartURLData,"* get Portal or load Portal with portal id. - * - * return TdbCmsPortal|null - * - * @deprecated use chameleon_system_core.portal_domain_service::getActivePortal() instead","public function IsObjectInitializationCompleted() - { - return $this->bObjectInitializationCompleted; - }" -TCMSSmartURLData,"* return the user ip... (takes proxy forwarding into consideration). - * - * @return string - * - * @deprecated since 6.2.0 - use Request::getClientIp() instead.","public function getSeoURLParameters() - { - return $this->seoURLParameters; - }" -TCMSSmartURLData,"* set to true if all request processing has completed (ie. page is set, portal ist defined, language is defined, etc). - * - * @param bool $bObjectInitializationCompleted","public function setSeoURLParameters($seoURLParameters) - { - $this->seoURLParameters = $seoURLParameters; - }" -TCMSSmartURLHandler,"* any parameters dumped into this array will be added to oGlobal->userData - * the caching system will make sure that they are recoved when fetching a page from - * cache. so make sure you never write into oGlobal->userData from within this - * class, or any of its children. - * - * @var array","public function GetPageDef(); - - /** - * @var Request - */ - private $request = null; - - /** - * @return Request - */ - protected function getRequest() - { - return $this->request; - }" -TCMSSmartURLHandler,"* Set custom cache triggers for URL handler like array('table'=>'tablename','id'=>'record_id'). - * TCMSSmartURL will add these cache triggers to his own cache triggers if the URL handler had found a valid page. - * - * @var array","public function setRequest(Request $request) - { - $this->request = $request; - }" -TCMSSmartURLHandler,"* this method should parse the url and check which page matches - * it should convert url parts to GET parameters by using aCustomURLParameters. - * - * @return string|bool","public function __construct() - { - }" -TCMSSmartURLHandler_Document,@var TdbCmsDocument $oDocument,"public function GetPageDef() - { - $sDocumentSeoName = false; - $sDocumentId = false; - $oDocument = null; - $iPageId = false; - $bAllowDeliver = false; - $bLoaded = false; - $oSecurityToken = null; - $sDownloadOutboxPath = $this->getPathURLMatchDownloadPath(); - $bLocalFileMissing = false; - if (false != $sDownloadOutboxPath) { - if ('symlink' == $this->getDownloadType($sDownloadOutboxPath)) { - $sDocumentSeoName = $this->getDocumentSEONameFromURL($sDownloadOutboxPath); - }" -TCMSSmartURLHandler_robots,* @return PortalDomainServiceInterface,"public function GetPageDef() - { - $requestInfoService = \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.request_info_service'); - - $requestURI = strtolower($requestInfoService->getPathInfoWithoutPortalAndLanguagePrefix()); - if ('/robots.txt' !== $requestURI) { - return false; - }" -TCMSSpellcheck,"* language object to us. - * - * @var TdbCmsLanguage","public function Init($iLanguageId) - { - $this->oLanguage = self::getLanguageService()->getLanguage($iLanguageId); - }" -TCMSSpellcheck,"* return instance of spellchecker. - * - * @return TCMSSpellcheck","public function SuggestCorrection($sString, $sCorrectionSelectCallback = null) - { - $aResult = array('string' => '', 'corrections' => array()); - - $sString = strip_tags($sString); - $aErrors = $this->GetMisspelled($sString); - if (count($aErrors) > 0) { - $aResult['corrections'] = $this->Correct($aErrors, $sCorrectionSelectCallback); - $aResult['string'] = str_replace(array_keys($aResult['corrections']), array_values($aResult['corrections']), $sString); - }" -TCMSTableEditorCMSConfig,* set public methods here that may be called from outside.,"public function DefineInterface() - { - parent::DefineInterface(); - $this->methodCallAllowed[] = 'UpdateTranslationFields'; - }" -TCMSTableEditorCMSConfig,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"public function UpdateTranslationFields() - { - // get language list - $oConfig = TdbCmsConfig::GetInstance(true); - /** @var $oConfig TdbCmsConfig */ - if (!empty($oConfig->sqlData['translation_base_language_id'])) { - // ok, we have a list of ""other"" languages (in addition to the base language) - $sQuery = ""SELECT `cms_field_conf`.* - FROM `cms_field_conf` - WHERE `cms_field_conf`.`is_translatable` = '1' - ""; - $oDefList = TdbCmsFieldConfList::GetList($sQuery); - $oDefList->GoToStart(); - while ($oDef = $oDefList->Next()) { - $oDef->UpdateFieldTranslationKeys(); - }" -TCMSTableEditorCMSUser,"* add a menu item to switch to any user if the current user has that right. -/*","public function DefineInterface() - { - parent::DefineInterface(); - $externalFunctions = array('CopyUserRights', 'ActivateUser'); - $this->methodCallAllowed = array_merge($this->methodCallAllowed, $externalFunctions); - }" -TCMSTableEditorCMSUser,* change method so that the user name is not duplicated...,"public function AllowEdit($postData = null) - { - // owner can always edit - if ($this->IsOwner($postData)) { - return true; - }" -TCMSTableEditorCMSUser,* {@inheritdoc},"public function CopyUserRights() - { - if (false === $this->isCopyPermissionsAllowed()) { - return; - }" -TCMSTableEditorCMSUser,* @return bool,"public function ActivateUser() - { - if (false === $this->isActivateUserAllowed()) { - return; - }" -TCMSTableEditorCMSUser,@var SecurityHelperAccess $securityHelper,"public function GetHtmlHeadIncludes() - { - $aIncludes = parent::GetHtmlHeadIncludes(); - $this->translator = $this->getTranslator(); - - $aIncludes[] = ""'; - $aIncludes[] = ''; - - $aIncludes[] = '