diff --git "a/datasets/chameleon_base_dataset20230605-2051.csv" "b/datasets/chameleon_base_dataset20230605-2051.csv" new file mode 100644--- /dev/null +++ "b/datasets/chameleon_base_dataset20230605-2051.csv" @@ -0,0 +1,28264 @@ +classname,method_name,description,method_code,explanation +TCMSCronjob_ClearAtomicLocks,_ExecuteCron,* @return void,$this->clearTable();,- +ChameleonSystemAtomicLockExtension,load,"* {@inheritDoc} + * + * @return void","$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); + $loader->load('services.xml');",- +AtomicLock,getKeyForObject,"* 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.",return md5(serialize($oObject));,- +AtomicLock,acquireLock,* @var string,"if (null !== $this->key) { + return null;",- +AtomicLock,release,* @var string,"if (null === $this->key) { + return false;",- +AutoclassesCacheWarmer,"__construct( + AutoclassesManagerInterface $autoClassManager, + AutoclassesDatabaseAdapterInterface $databaseAdapter, + AutoclassesMapGeneratorInterface $autoclassesMapGenerator, + IPkgCmsFileManager $filemanager, + $cacheDir, + ContainerInterface $container + )",* @var AutoclassesDatabaseAdapterInterface,"$this->autoClassManager = $autoClassManager; + $this->databaseAdapter = $databaseAdapter; + $this->autoclassesMapGenerator = $autoclassesMapGenerator; + $this->fileManager = $filemanager; + $this->cacheDir = $cacheDir; + \ChameleonSystem\CoreBundle\ServiceLocator::setContainer($container);",- +AutoclassesCacheWarmer,warmUp,* @var AutoclassesManagerInterface,"$this->updateAllTables(); + + return [];",- +AutoclassesCacheWarmer,isOptional,* @var AutoclassesMapGeneratorInterface,return false;,- +AutoclassesCacheWarmer,updateTableById,* @var IPkgCmsFileManager,"$tablename = $this->databaseAdapter->getTableNameForId($id); + if (null !== $tablename) { + $this->updateTableByName($tablename);",- +AutoclassesCacheWarmer,updateTableByName,* @var string,"$classesToCreate = $this->getClassListForTableName($tablename); + foreach ($classesToCreate as $classToCreate) { + $this->autoClassManager->create($classToCreate, $this->cacheDir);",- +AutoclassesCacheWarmer,updateAllTables,"* @param AutoclassesManagerInterface $autoClassManager + * @param AutoclassesDatabaseAdapterInterface $databaseAdapter + * @param AutoclassesMapGeneratorInterface $autoclassesMapGenerator + * @param IPkgCmsFileManager $filemanager + * @param string $cacheDir","$targetDir = $this->cacheDir; + $autoclassesExistedBefore = false; + if (file_exists($targetDir)) { + $targetDir = $this->createTempCacheDir(); + $autoclassesExistedBefore = true;",- +AutoclassesCacheWarmer,getTableClassNamesToLoad,"* @param string $id + * + * @return void","// get all table classes + $result = $this->databaseAdapter->getTableClassList(); + + $convertedList = array(); + foreach ($result as $bareClassName) { + $classNames = $this->getClassListForTableName($bareClassName); + $convertedList = array_merge($convertedList, $classNames);",- +AutoclassesCacheWarmer,regenerateClassmap,"* @param string $tablename + * + * @return void","if (null === $targetDir) { + $targetDir = $this->cacheDir;",- +AutoclassesDatabaseAdapter,setConnection,* @var Connection,$this->conn = $conn;,- +AutoclassesDatabaseAdapter,getTableClassList,* {@inheritdoc},"$all = $this->conn->fetchAllAssociative('SELECT `name` from `cms_tbl_conf`'); + + return $this->getNamesArray($all);",- +AutoclassesDatabaseAdapter,getVirtualClassList,* {@inheritdoc},"$all = $this->conn->fetchAllAssociative('SELECT `name_of_entry_point` as \'name\' FROM `pkg_cms_class_manager`'); + + return $this->getNamesArray($all);",- +AutoclassesDatabaseAdapter,getTableNameForId,* {@inheritdoc},"$result = $this->conn->fetchAllAssociative('SELECT `name` from `cms_tbl_conf` WHERE id=:id', array('id' => $id)); + if (0 === count($result)) { + return null;",- +AutoclassesManager,__construct,* {@inheritdoc},"$this->registerHandler(new TPkgCoreAutoClassHandler_TableClass($databaseConnection, $filemanager, $autoClassDataAccess)); + $this->registerHandler(new TPkgCoreAutoClassHandler_TPkgCmsClassManager($databaseConnection, $filemanager, $virtualClassManager));",- +AutoclassesManager,registerHandler,* @var TPkgCoreAutoClassHandler_AbstractBase[],$this->handlerList[] = $handler;,- +AutoclassesManager,create,"* 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","$classCreated = false; + if (true === $this->isInCallStack($classname)) { + throw new TPkgCmsCoreAutoClassManagerException_Recursion($classname, $this->callStack, __FILE__, __LINE__);",- +AutoclassesMapGenerator,generateAutoclassesMap,* {@inheritdoc},return $this->getClassesFromDirectory($autoclassesDir);,- +GenerateAutoclassesCommand,__construct,* Class GenerateAutoclassesCommand Creates autoclasses from the console.,"parent::__construct('chameleon_system:autoclasses:generate'); + $this->autoclassesCacheWarmer = $autoclassesCacheWarmer;",- +AutoclassesDataAccess,__construct,* @var Connection,$this->connection = $connection;,- +AutoclassesDataAccess,getTableExtensionData,* @param Connection $connection,"$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,getFieldData,* {@inheritdoc},"$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,getConfig,* {@inheritdoc},"$cmsConfig = new TCMSConfig(); + $cmsConfig->Load(1); + + return $cmsConfig;",- +AutoclassesDataAccess,getTableOrderByData,@var $field TCMSField,"$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,getTableConfigData,* {@inheritdoc},"$data = array(); + + $query = 'SELECT * + FROM `cms_tbl_conf`'; + $statement = $this->connection->executeQuery($query); + while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { + $data[$row['id']] = $row;",- +AutoclassesRequestCacheDataAccess,__construct,* @var AutoclassesDataAccessInterface,$this->decorated = $decorated;,- +AutoclassesRequestCacheDataAccess,clearCache,* @var array,"$this->tableExtensionData = null; + $this->fieldData = null; + $this->config = null; + $this->tableOrderByData = null; + $this->tableConfigData = null;",- +AutoclassesRequestCacheDataAccess,getTableExtensionData,* @var array,"if (null === $this->tableExtensionData) { + $this->tableExtensionData = $this->decorated->getTableExtensionData();",- +AutoclassesRequestCacheDataAccess,getFieldData,* @var TCMSConfig,"if (null === $this->fieldData) { + $this->fieldData = $this->decorated->getFieldData();",- +AutoclassesRequestCacheDataAccess,getConfig,* @var array,"if (null === $this->config) { + $this->config = $this->decorated->getConfig();",- +AutoclassesRequestCacheDataAccess,getTableOrderByData,* @var array,"if (null === $this->tableOrderByData) { + $this->tableOrderByData = $this->decorated->getTableOrderByData();",- +AutoclassesRequestCacheDataAccess,getTableConfigData,* @param AutoclassesDataAccessInterface $decorated,"if (null === $this->tableConfigData) { + $this->tableConfigData = $this->decorated->getTableConfigData();",- +ChameleonSystemAutoclassesExtension,load,* @return void,"$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); + $loader->load('services.xml');",- +TPkgCmsCoreAutoClassManagerException_Recursion,__construct,* @var string|null,"$this->sNameOfClassAttemptedToGenerate = $sNameOfClassAttemptedToGenerate; + $this->aClassCallStack = $aClassCallStack; + parent::__construct($this->generateMessageFromCallDetails(), 0, E_USER_ERROR, $filename, $lineno);",- +TPkgCoreAutoClassHandler_AbstractBase,__construct,* @var mixed,"$this->databaseConnection = $databaseConnection; + $this->filemanager = $filemanager;",- +TPkgCoreAutoClassHandler_AbstractBase,resetInternalCache,* @var null|array,"$this->aClassMapping = null; + $this->aClassExtensionList = null; + $this->aClassNameList = null;",- +TPkgCoreAutoClassHandler_TableClass,create,* {@inheritdoc},"$tableConfId = $this->getTableConfIdForClassName($sClassName); + if (null === $tableConfId) { + return;",- +TPkgCoreAutoClassHandler_TableClass,__construct,"* @param string $className + * + * @return int|string|null","parent::__construct($databaseConnection, $filemanager); + $this->autoClassesDataAccess = $autoClassesDataAccess;",- +TPkgCoreAutoClassHandler_TableClass,getClassNameFromKey,"* @param string $tableName + * + * @return string|null","return TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $sKey);",- +TPkgCoreAutoClassHandler_TableClass,canHandleClass,"* 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","$bIsTdbObject = (TCMSTableToClass::PREFIX_CLASS == substr( + $sClassName, + 0, + strlen(TCMSTableToClass::PREFIX_CLASS) + )); + if (true === $bIsTdbObject) { + return true;",- +TPkgCoreAutoClassHandler_TableClass,getClassNameList,"* returns true if the auto class handler knows how to handle the class name passed. + * + * @param string $sClassName + * + * @return bool","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,__construct,* {@inheritdoc},"parent::__construct($databaseConnection, $filemanager); + $this->virtualClassManager = $virtualClassManager;",- +TPkgCoreAutoClassHandler_TPkgCmsClassManager,create,"* 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","$virtualClassManager = clone $this->virtualClassManager; + + if (true === $virtualClassManager->load($sClassName)) { + $virtualClassManager->UpdateVirtualClasses($targetDir); + return;",- +TPkgCoreAutoClassHandler_TPkgCmsClassManager,getClassNameFromKey,@psalm-suppress InvalidArrayOffset,"$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,canHandleClass,"* returns true if the auto class handler knows how to handle the class name passed. + * + * @param string $sClassName + * + * @return bool","$aClassList = $this->getClassNameList(); + $bClassExists = in_array($sClassName, $aClassList); + if ($bClassExists) { + return true;",- +TPkgCoreAutoClassHandler_TPkgCmsClassManager,getClassNameList,* @return array,"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,__construct,* @var string,"$this->autoclassesDir = $autoclassesDir; + $this->cacheWarmer = $cacheWarmer; + $this->requestInfoService = $requestInfoService;",- +RequestListener,checkAutoclasses,* @var \ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesCacheWarmer,"if (HttpKernelInterface::MAIN_REQUEST !== $evt->getRequestType()) { + return;",- +AutoclassesCacheWarmerTest,it_updates_single_tables_by_id,@var AutoclassesCacheWarmer,"/** @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,it_updates_single_tables_by_name,* @test,"/** @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,it_ignores_nonexistant_tables,@var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container,"/** @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,it_converts_underscore_names_to_autoclass_names,@var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy,"/** @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,it_should_warm_the_complete_cache,@var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy,"/** @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,it_should_generate_a_complete_autoclasses_classmap,* @var AutoclassesMapGenerator,"$cacheDir = __DIR__.'/cache/'; + + $actual = $this->mapGenerator->generateAutoclassesMap($cacheDir); + + $expected = array(); + $expected['TestClass'] = 'TestType'; + + $this->assertEquals($expected, $actual);",- +RequestListenerTest,it_generates_autoclasses_if_there_arent_any,* @test,"$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,it_leaves_existing_autoclasses_alone,* @test,"$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,it_only_checks_on_master_request,* @test,"$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,it_only_runs_on_backend_request,* @test,"$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,__construct,"* @var array|null",$this->oActivePage = $oActivePage;,- +TPkgCmsActionPluginManager,actionPluginExists,* @var TCMSActivePage|null,"$aPluginList = $this->getActionPluginList(); + + return isset($aPluginList[$sPluginName]);",- +TPkgCmsActionPluginManager,callAction,"* @param string $sPluginName + * + * @return bool","$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,changeLanguage,"* @param array $data + * + * @return void","$languageIso = isset($data['l']) ? $data['l'] : ''; + if (empty($languageIso)) { + return;",- +BackendSession,"__construct( + readonly private RequestStack $requestStack, + readonly private Security $security, + readonly private Connection $connection, + readonly private LanguageServiceInterface $languageService + )",@var CmsUserModel $user,,- +BackendSession,getCurrentEditLanguageId: string,@var CmsUserModel $user,"$iso = $this->getCurrentEditLanguageIso6391(); + if (null === $iso) { + return $this->languageService->getCmsBaseLanguageId();",- +BackendSession,getCurrentEditLanguageIso6391: ?string,@var CmsUserModel $user,"$session = $this->getSession(); + if (null === $session) { + return null;",- +ChameleonSystemCmsBackendExtension,load,* @return void,"$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../config/')); + $loader->load('services.xml');",- +ClearChameleonCacheCommand,__construct,* @var CacheInterface,"parent::__construct($name); + + $this->cache = $cache;",- +ChameleonSystemCmsCacheExtension,load,* @return void,"$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,"__construct( + RequestStack $requestStack, + Connection $dbConnection, + StorageInterface $oCacheStorage, + $cacheKeyPrefix, + $cacheAllowed, + HashInterface $hashArray, + RequestStateHashProviderInterface $requestStateHashProvider + )",* @var RequestStack,"$this->setRequestStack($requestStack); + $this->setDbConnection($dbConnection); + $this->setStorage($oCacheStorage); + $this->cacheKeyPrefix = $cacheKeyPrefix; + $this->cacheAllowed = $cacheAllowed; + $this->hashArray = $hashArray; + $this->requestStateHashProvider = $requestStateHashProvider;",- +Cache,setStorage,* @var Connection,$this->storage = $oCacheStorage;,- +Cache,disable,* @var StorageInterface|null,$this->isActive = false;,- +Cache,enable,* @var bool,$this->isActive = true;,- +Cache,isActive,* @var string,return $this->cacheAllowed && $this->isActive;,- +Cache,get,* @var bool,"if (false === $this->isActive()) { + return null;",- +Cache,set,* @var HashInterface,"if (false === $this->isActive()) { + return;",- +Cache,delete,* @var RequestStateHashProviderInterface,"if (false === $this->isActive()) { + return false;",- +Cache,clearAll,"* @param RequestStack $requestStack + * @param Connection $dbConnection + * @param StorageInterface $oCacheStorage + * @param string $cacheKeyPrefix + * @param bool $cacheAllowed + * @param HashInterface $hashArray + * @param RequestStateHashProviderInterface $requestStateHashProvider","if (false === $this->isActive()) { + return;",- +Cache,callTrigger,"* @param StorageInterface $oCacheStorage + * + * @return void","if (CHAMELEON_CACHE_ENABLE_CACHE_INFO === false) { + return;",- +Cache,getKey,* {@inheritdoc},"if ($addStateKey) { + $aParameters['__state'] = [ + self::REQUEST_STATE_HASH => $this->requestStateHashProvider->getHash($this->requestStack->getCurrentRequest()), + ];",- +Cache,setRequestStack,* {@inheritdoc},$this->requestStack = $requestStack;,- +Cache,setDbConnection,* {@inheritdoc},$this->dbConnection = $dbConnection;,- +Memcache,__construct,* @var \TCMSMemcache,$this->memcache = $memcache;,- +Memcache,get,* {@inheritdoc},"$content = $this->memcache->Get($key); + if (true === $this->memcache->getLastGetRequestReturnedNoMatch()) { + return null;",- +Memcache,delete,* {@inheritdoc},return $this->memcache->Delete($key);,- +Memcache,clearAll,* {@inheritdoc},return $this->memcache->Flush();,- +Memcache,set,* {@inheritdoc},"return $this->memcache->Set($key, $value, $expireInSeconds);",- +NullStorage,get,* {@inheritdoc},return null;,- +NullStorage,delete,* {@inheritdoc},return true;,- +NullStorage,clearAll,* {@inheritdoc},return true;,- +NullStorage,set,* {@inheritdoc},return true;,- +TdbCmsLanguage,it_creates_cache_key,* @var Cache,"$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,it_works_with_special_chars,* @test,"$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,GenerateNewCaptchaImage,"* 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","$iLength = 6; + $iWidth = 120; + $iHeight = 40; + if (array_key_exists('l', $aParameter)) { + $iLength = intval($aParameter['l']);",- +TPkgCmsCaptcha,CodeIsValid,"* returns the path to TTF font file, that is used for the captcha. + * + * @return string","$sCodeInSession = TdbPkgCmsCaptcha::GetCodeFromSession($sIdentifier); + if (false === $sCodeInSession) { + return false;",- +TPkgCmsCaptcha,getHTMLSnippet,"* generates the captcha image and outputs it. + * + * @param string $sIdentifier + * @param array $aParameter + * + * @return void","return '';",- +TPkgCmsCaptcha,GetRequestURL,* @return bool,"$sURL = '/'.self::URL_IDENTIFIER.'/'.$this->sqlData['cmsident'].'/'.$sIdentifier; + $aParameter['rnd'] = rand(1000000, 9999999); + if (count($aParameter) > 0) { + $sURL .= '?'.TTools::GetArrayAsURL($aParameter);",- +TPkgCmsCaptcha_TextFieldJavascriptHidden,CodeIsValid,"* 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","$sCodeFromSession = TdbPkgCmsCaptcha::GetCodeFromSession($sIdentifier); + if (false === $sCodeFromSession) { + return false;",- +TPkgCmsCaptcha_TextFieldJavascriptHidden,getHTMLSnippet,"* 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","$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,_GetCacheParameters,* @var string,"$parameters = parent::_GetCacheParameters(); + + if (false === is_array($parameters)) { + $parameters = [];",- +NavigationTreeSingleSelect,"__construct( + InputFilterUtilInterface $inputFilterUtil, + UrlUtil $urlUtil, + BackendTreeNodeFactory $backendTreeNodeFactory, + TranslatorInterface $translator, + TTools $tools, + TGlobal $global, + FieldTranslationUtil $fieldTranslationUtil, + BackendSessionInterface $backendSession + )","* The mysql tablename of the tree. + * + * @var string","$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,Init,* @var InputFilterUtilInterface,"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,Accept,* @var TranslatorInterface,"$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,GetHtmlHeadIncludes,* @var UrlUtil,"$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,"__construct( + InputFilterUtilInterface $inputFilterUtil, + UrlUtil $urlUtil, + BackendTreeNodeFactory $backendTreeNodeFactory, + TranslatorInterface $translator, + TTools $tools, + TGlobal $global, + FieldTranslationUtil $fieldTranslationUtil, + BackendSessionInterface $backendSession, + RequestStack $requestStack + )",* {@inheritdoc},"parent::__construct( + $inputFilterUtil, + $urlUtil, + $backendTreeNodeFactory, + $translator, + $tools, + $global, + $fieldTranslationUtil, + $backendSession + ); + $this->requestStack = $requestStack;",- +NavigationTreeSingleSelectWysiwyg,Accept,* @var RequestStack,"parent::Accept($visitor, $cachingEnabled, $cacheTriggerManager); + $request = $this->requestStack->getCurrentRequest(); + if (null === $request) { + return;",- +CustomMenuItemProvider,createMenuItem: ?MenuItem,* {@inheritdoc},"$customItem = new \TdbCmsMenuCustomItem($menuItem->fieldTarget); + + if (false === $this->isItemAccessAllowed($customItem)) { + return null;",- +MenuCategory,__construct,* @var string,"$this->id = $id; + $this->name = $name; + $this->iconFontCssClass = $iconFontCssClass; + $this->menuItems = $menuItems;",- +MenuCategory,getId: string,* @var string,return $this->id;,- +MenuCategory,getName: string,* @var string,return $this->name;,- +MenuCategory,getIconFontCssClass: string,* @var MenuItem[],return $this->iconFontCssClass;,- +MenuCategory,getMenuItems: array,"* @param string $id + * @param string $name + * @param string $iconFontCssClass + * @param MenuItem[] $menuItems",return $this->menuItems;,- +MenuItem,__construct,* @var string,"$this->name = $name; + $this->icon = $icon; + $this->url = $url; + $this->id = $id;",- +MenuItem,getName: string,* @var string,return $this->name;,- +MenuItem,getIcon: string,* @var string,return $this->icon;,- +MenuItem,getUrl: string,* @var string,return $this->url;,- +MenuItemFactory,addMenuItemProvider: void,* @var MenuItemProviderInterface[],$this->menuItemProviders[$type] = $menuItemProvider;,- +MenuItemFactory,createMenuItem: ?MenuItem,* {@inheritdoc},"$targetType = $menuItem->GetFieldTargetObjectType(); + if (false === \array_key_exists($targetType, $this->menuItemProviders)) { + return null;",- +ModuleMenuItemProvider,createMenuItem: ?MenuItem,* {@inheritdoc},"$cmsModule = new \TdbCmsModule($menuItem->fieldTarget); + + if (false === $this->isModuleAccessAllowed($cmsModule)) { + return null;",- +SidebarBackendModule,"__construct( + UrlUtil $urlUtil, + RequestStack $requestStack, + InputFilterUtilInterface $inputFilterUtil, + ResponseVariableReplacerInterface $responseVariableReplacer, + MenuItemFactoryInterface $menuItemFactory, + TranslatorInterface $translator, + UserMenuItemDataAccessInterface $userMenuItemDataAccess + )",* @var UrlUtil,"parent::__construct(); + + $this->urlUtil = $urlUtil; + $this->requestStack = $requestStack; + $this->inputFilterUtil = $inputFilterUtil; + $this->responseVariableReplacer = $responseVariableReplacer; + $this->menuItemFactory = $menuItemFactory; + $this->translator = $translator; + $this->userMenuItemDataAccess = $userMenuItemDataAccess;",- +SidebarBackendModule,Init,* @var RequestStack,"parent::Init(); + $this->restoreDisplayState();",- +SidebarBackendModule,Accept,* @var InputFilterUtilInterface,"$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,GetHtmlHeadIncludes,* @var ResponseVariableReplacerInterface,"$includes = parent::GetHtmlHeadIncludes(); + $includes[] = sprintf('', + \TGlobal::GetPathTheme()); + + return $includes;",- +SidebarBackendModule,GetHtmlFooterIncludes,* @var MenuItemFactoryInterface,"$includes = parent::GetHtmlFooterIncludes(); + $includes[] = sprintf('', + \TGlobal::GetStaticURLToWebLib('/javascript/modules/sidebar/sidebar.js')); + + return $includes;",- +SidebarBackendModule,_AllowCache,* @var TranslatorInterface,return true;,- +SidebarBackendModule,_GetCacheParameters,* @var UserMenuItemDataAccessInterface,"$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,createMenuItem: ?MenuItem,* {@inheritdoc},"$tableConf = \TdbCmsTblConf::GetNewInstance(); + $loadSuccess = $tableConf->Load($menuItem->fieldTarget); + + if (false === $loadSuccess) { + return null;",- +StaticViewModule,__construct,"* 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.","parent::__construct(); + $this->languageService = $languageService;",- +StaticViewModule,Accept,* @var LanguageServiceInterface,"$targetView = $this->aModuleConfig['targetView']; + $targetLanguage = $this->languageService->getActiveLanguage()->fieldIso6391; + $targetView = \str_replace('[{language",- +ActivateMaintenanceModeCommand,__construct,* @var MaintenanceModeServiceInterface,"parent::__construct('chameleon_system:maintenance_mode:activate'); + + $this->maintenanceModeService = $maintenanceModeService;",- +CountUpdateCommand,__construct,* Console command for counting updates that have not been executed yet.,parent::__construct('chameleon_system:update:count');,- +DeactivateMaintenanceModeCommand,__construct,* @var MaintenanceModeServiceInterface,"parent::__construct('chameleon_system:maintenance_mode:deactivate'); + + $this->maintenanceModeService = $maintenanceModeService;",- +DisableCronjobsCommand,__construct,* @var CronjobEnablingServiceInterface,"parent::__construct('chameleon_system:cronjobs:disable'); + + $this->cronjobEnablingService = $cronjobEnablingService;",- +EnableCronjobsCommand,__construct,* @var CronjobEnablingServiceInterface,"parent::__construct('chameleon_system:cronjobs:enable'); + + $this->cronjobEnablingService = $cronjobEnablingService;",- +GetCronjobsStateCommand,__construct,* @var CronjobStateServiceInterface,"parent::__construct('chameleon_system:cronjobs:state_check'); + + $this->cronjobStateService = $cronjobStateService;",- +ListUpdateCommand,__construct,* Console command for listing updates that have not been executed yet.,parent::__construct('chameleon_system:update:list');,- +RunUpdateCommand,__construct,* Console command for executing updates.,"parent::__construct('chameleon_system:update:run'); + $this->cache = $cache; + $this->autoclassesCacheWarmer = $autoclassesCacheWarmer;",- +HtmlHelper,__construct,* @var OutputInterface,"$style = new OutputFormatterStyle('red', null, array('bold')); + $output->getFormatter()->setStyle('header', $style); + + $this->output = $output;",- +HtmlHelper,render,* @var array,"if (null !== $html) { + $this->computeHtml($html);",- +ChameleonBackendController,getResponse,* @var BackendAccessCheck,"$request = $this->getRequest(); + $pagedef = $this->getInputFilterUtil()->getFilteredInput('pagedef', $this->homePagedef); + $request->attributes->set('pagedef', $pagedef); + + $this->backendAccessCheck->assertAccess(); + + return $this->GeneratePage($pagedef);",- +ChameleonBackendController,HandleRequest,* @var string,"$oCMSConfig = \TdbCmsConfig::GetInstance(); + if (!$oCMSConfig) { // sometimes config comes corrupted from cache then reload config from db + $oCMSConfig = \TdbCmsConfig::GetInstance(true);",- +ChameleonBackendController,setBackendAccessCheck,* {@inheritdoc},$this->backendAccessCheck = $backendAccessCheck;,- +ChameleonBackendController,setHomePagedef: void,"* 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",$this->homePagedef = $homePagedef;,- +ChameleonController,"__construct( + RequestStack $requestStack, + EventDispatcherInterface $eventDispatcher, + DataAccessCmsMasterPagedefInterface $dataAccessCmsMasterPagedef, + TModuleLoader $moduleLoader, + IViewPathManager $viewPathManager = null + )",* @var AuthenticityTokenManagerInterface,"$this->requestStack = $requestStack; + $this->moduleLoader = $moduleLoader; + $this->moduleLoader->setController($this); + $this->viewPathManager = $viewPathManager; + $this->eventDispatcher = $eventDispatcher; + $this->dataAccessCmsMasterPagedef = $dataAccessCmsMasterPagedef;",- +ChameleonController,__invoke,* @var RequestStack,"$event = new ChameleonControllerInvokeEvent($this); + $this->eventDispatcher->dispatch($event, ChameleonControllerEvents::INVOKE); + + $pagedef = $this->getRequest()->attributes->get('pagedef'); + $this->handleRequest($pagedef); + + return $this->getResponse();",- +ChameleonController,setGlobal,* @var CacheInterface,$this->global = $global;,- +ChameleonController,SetBlockAutoFlushToBrowser,* @var TGlobal,$this->bBlockAutoFlushToBrowser = $bBlockAutoFlushToBrowser;,- +ChameleonController,getBlockAutoFlushToBrowser,* @var TModuleLoader,return $this->bBlockAutoFlushToBrowser;,- +ChameleonController,setCache,"* @var array + * + * @deprecated since 6.3.0 - not used anymore",$this->cache = $cache;,- +ChameleonController,GetPagedefObject,* @var array,"/** @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,PreOutputCallbackFunction,* @var array,"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,PreOutputCallbackFunctionReplaceCustomVars,"* @var string + * + * @deprecated since 6.3.0 - not used anymore",return $this->responseVariableReplacer->replaceVariables($sPageContent);,- +ChameleonController,FlushContentToBrowser,* @var bool,"if (false === CHAMELEON_ENABLE_FLUSHING && !TGlobal::IsCMSMode()) { + return;",- +ChameleonController,AddHTMLFooterLine,* @var IViewPathManager,"if (!in_array($sLine, $this->aFooterIncludes)) { + $this->aFooterIncludes[] = $sLine;",- +ChameleonController,AddHTMLHeaderLine,@var ActivePageServiceInterface,"if (!in_array($sLine, $this->aHeaderIncludes)) { + $this->aHeaderIncludes[] = $sLine;",- +ChameleonController,HeaderRedirect,* @var EventDispatcherInterface,$this->redirect->redirectToActivePage($aParameters);,- +ChameleonController,HeaderURLRedirect,* @var RequestInfoServiceInterface,"$this->redirect->redirect($url, Response::HTTP_FOUND, $bAllowOnlyRelativeURLs);",- +ChameleonController,__toString,"* @var ICmsCoreRedirect + * + * @deprecated since 6.1.9 - no longer used in this class.",return get_class($this);,- +ChameleonController,setActivePageService,* @var InputFilterUtilInterface,$this->activePageService = $activePageService;,- +ChameleonController,getHtmlHeaderIncludes,* @var ResourceCollectorInterface,return $this->aHeaderIncludes;,- +ChameleonController,getHtmlFooterIncludes,* @var DataAccessCmsMasterPagedefInterface,return $this->aFooterIncludes;,- +ChameleonController,setAuthenticityTokenManager,* @var ResponseVariableReplacerInterface,$this->authenticityTokenManager = $authenticityTokenManager;,- +ChameleonController,setRequestInfoService,* {@inheritdoc},$this->requestInfoService = $requestInfoService;,- +ChameleonController,setRedirect,* @return Request|null,$this->redirect = $redirect;,- +ChameleonController,setInputFilterUtil,"* @param TGlobal $global + * + * @return void",$this->inputFilterUtil = $inputFilterUtil;,- +ChameleonController,setResourceCollector: void,"* @param bool $bBlockAutoFlushToBrowser + * + * @return void",$this->resourceCollector = $resourceCollector;,- +ChameleonController,setResponseVariableReplacer: void,* @return bool,$this->responseVariableReplacer = $responseVariableReplacer;,- +ChameleonControllerInvokeEvent,__construct,* @var ChameleonControllerInterface,$this->controller = $controller;,- +ChameleonControllerInvokeEvent,getController,* @return \ChameleonSystem\CoreBundle\Controller\ChameleonControllerInterface,return $this->controller;,- +ChameleonControllerInvokeListener,__construct,* @var \Symfony\Component\DependencyInjection\ContainerInterface,$this->container = $container;,- +ChameleonControllerInvokeListener,onInvoke,* @return void,"$this->container->set('chameleon_system_core.chameleon_controller', $event->getController());",- +ChameleonControllerResolver,__construct,* Class ChameleonControllerResolver.,"$this->container = $container; + $this->defaultControllerResolver = $defaultControllerResolver; + $this->controllerList = $controllerList; + $this->defaultChameleonController = $defaultChameleonController;",- +ChameleonControllerResolver,getController,@var ContainerInterface $container,"$controller = $request->attributes->get('_controller', null); + if (null === $controller) { + return null;",- +ChameleonFrontendController,"__construct( + RequestStack $requestStack, + EventDispatcherInterface $eventDispatcher, + DataAccessCmsMasterPagedefInterface $dataAccessCmsMasterPagedef, + TModuleLoader $moduleLoader, + $viewPathManager, + ContainerInterface $container, + TPkgViewRendererConfigToLessMapper $configToLessMapper + )",* @var ContainerInterface,"parent::__construct($requestStack, $eventDispatcher, $dataAccessCmsMasterPagedef, $moduleLoader, $viewPathManager); + $this->container = $container; // for ViewRenderer instantiation + $this->configToLessMapper = $configToLessMapper;",- +ChameleonFrontendController,getResponse,* @var TPkgViewRendererConfigToLessMapper,"$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,GetPagedefObject,* @param \IViewPathManager $viewPathManager,"//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,__construct,* @var ChameleonController,$this->controller = $controller;,- +ChameleonNoAutoFlushController,__invoke,* {@inheritdoc},"$original = $this->controller->getBlockAutoFlushToBrowser(); + $this->controller->SetBlockAutoFlushToBrowser(true); + $response = $this->controller->__invoke(); + $this->controller->SetBlockAutoFlushToBrowser($original); + + return $response;",- +ChameleonNoAutoFlushController,getResponse,* {@inheritdoc},return $this->controller->getResponse();,- +ChameleonNoAutoFlushController,setCache,* {@inheritdoc},$this->controller->setCache($cache);,- +ChameleonNoAutoFlushController,AddHTMLHeaderLine,* {@inheritdoc},$this->controller->AddHTMLHeaderLine($sLine);,- +ChameleonNoAutoFlushController,AddHTMLFooterLine,* {@inheritdoc},$this->controller->AddHTMLFooterLine($sLine);,- +ChameleonNoAutoFlushController,FlushContentToBrowser,* {@inheritdoc},$this->controller->FlushContentToBrowser($enableAutoFlush);,- +ExceptionController,setMainController,* {@inheritdoc},$this->mainController = $mainController;,- +ExceptionController,showAction: Response,* @var ChameleonControllerInterface,"$code = null; + if (method_exists($exception, 'getStatusCode')) { + $code = $exception->getStatusCode();",- +ExceptionController,setExtranetConfiguration,* @var PortalDomainServiceInterface,$this->extranetConfiguration = $extranetConfiguration;,- +ExceptionController,setExtranetUserProvider,* @var ExtranetConfigurationInterface,$this->extranetUserProvider = $extranetUserProvider;,- +ExceptionController,setPortalDomainService,* @var RequestInfoServiceInterface,$this->portalDomainService = $portalDomainService;,- +ExceptionController,setRequestInfoService,* @var ExtranetUserProviderInterface,$this->requestInfoService = $requestInfoService;,- +ExceptionController,setPageService,* @var PageServiceInterface,$this->pageService = $pageService;,- +ImageNotFoundController,__invoke,* @return BinaryFileResponse|Response,"$imagePath = PATH_WEB.CHAMELEON_404_IMAGE_PATH_SMALL; + if (file_exists($imagePath)) { + return new BinaryFileResponse($imagePath);",- +CronjobEnablingService,__construct,* @var Connection,"$this->connection = $connection; + $this->cache = $cache;",- +CronjobEnablingService,isCronjobExecutionEnabled: bool,* @var CacheInterface,"$config = TdbCmsConfig::GetInstance(); + + return true === $config->fieldCronjobsEnabled;",- +CronjobEnablingService,enableCronjobExecution: void,* @throws CronjobHandlingException,"try { + $this->connection->executeUpdate(""UPDATE `cms_config` SET `cronjobs_enabled` = '1'""); + $this->cache->callTrigger('cms_config');",- +CronjobEnablingService,disableCronjobExecution: void,* @throws CronjobHandlingException,"try { + $this->connection->executeUpdate(""UPDATE `cms_config` SET `cronjobs_enabled` = '0'""); + $this->cache->callTrigger('cms_config');",- +CronJobFactory,__construct,* @var ContainerInterface,$this->container = $container;,- +CronJobFactory,constructCronJob,* {@inheritdoc},"if (true === $this->container->has($identifier)) { + $cronJob = $this->container->get($identifier);",- +CronJobScheduleDataModel,__construct,* @var \DateTime|null,"$this->lastPlannedExecution = $lastPlannedExecution; + $this->executeEveryNMinutes = $executeEveryNMinutes; + $this->unlockAfterNMinutes = $unlockAfterNMinutes; + $this->isLocked = $isLocked;",- +CronJobScheduleDataModel,getLastPlannedExecution: ?\DateTime,* @var int,return $this->lastPlannedExecution;,- +CronJobScheduleDataModel,getExecuteEveryNMinutes: int,* @var int,return $this->executeEveryNMinutes;,- +CronJobScheduleDataModel,getUnlockAfterNMinutes: int,* @var bool,return $this->unlockAfterNMinutes;,- +CronJobScheduler,__construct,* @var TimeProviderInterface,$this->timeProvider = $timeProvider;,- +CronJobScheduler,requiresExecution: bool,* {@inheritdoc},"$this->validateSchedule($schedule); + + $lastPlannedExecution = $schedule->getLastPlannedExecution(); + if (null === $lastPlannedExecution) { + return true;",- +CronJobScheduler,calculateCurrentPlannedExecutionDate: \DateTime,* {@inheritdoc},"$this->validateSchedule($schedule); + + $lastPlannedExecution = $schedule->getLastPlannedExecution(); + + if (null === $lastPlannedExecution) { + return $this->timeProvider->getDateTime();",- +CronjobStateService,__construct,* @var Connection,$this->connection = $connection;,- +CronjobStateService,isCronjobRunning: bool,* {@inheritdoc},"try { + return $this->connection->fetchColumn(""SELECT COUNT(*) FROM `cms_cronjobs` WHERE `lock` = '1'"") > 0;",- +CacheDataAccess,__construct,"* @template T extends TCMSRecord + * @implements DataAccessInterface","$this->cache = $cache; + $this->languageService = $languageService; + $this->decorated = $decorated;",- +CacheDataAccess,loadAll,* @var CacheInterface,"if (null === $languageId) { + $languageId = $this->languageService->getActiveLanguageId();",- +CacheDataAccess,getCacheTriggers,* @var LanguageServiceInterface,return array();,- +CmsPortalDomainsDataAccess,__construct,* @var Connection,$this->connection = $connection;,- +CmsPortalDomainsDataAccess,getPrimaryDomain,* {@inheritdoc},"$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,getAllDomainNames: array,"* {@inheritDoc} + * + * Copied partly from PortalDomainServiceInterface::getDomainNameList().","$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,getPortalPrefixListForDomain: array,* {@inheritdoc},"if ('' === $domainName) { + return [];",- +CmsPortalDomainsDataAccess,getActivePortalCandidate: ?array,* {@inheritdoc},"$query = ""SELECT * + FROM `cms_portal` + WHERE `id` IN (?) + AND (`identifier` = ? OR `identifier` = '') + ""; + + if (false === $allowInactivePortals) { + $query .= "" AND `cms_portal`.`deactive_portal` != '1' "";",- +CmsPortalDomainsDataAccess,getDomainDataByName: array,* {@inheritdoc},"if ('' === $domainName) { + return [];",- +CmsPortalDomainsDataAccessCacheDecorator,__construct,* @var ContainerInterface,"$this->container = $container; // Avoid circular dependency on CacheInterface. + $this->subject = $subject;",- +CmsPortalDomainsDataAccessCacheDecorator,getPrimaryDomain,* @var CmsPortalDomainsDataAccessInterface,"$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,getPortalPrefixListForDomain: array,* {@inheritdoc},"$cache = $this->getCache(); + $cacheKey = $cache->getKey([ + __METHOD__, + \get_class($this->subject), + $domainName, + ]); + $value = $cache->get($cacheKey); + if (null !== $value) { + return $value;",- +CmsPortalDomainsDataAccessCacheDecorator,getActivePortalCandidate: ?array,* {@inheritdoc},"return $this->subject->getActivePortalCandidate($idRestrictionList, $identifierRestriction, $allowInactivePortals);",- +CmsPortalDomainsDataAccessCacheDecorator,getDomainDataByName: array,* {@inheritdoc},"$cache = $this->getCache(); + $cacheKey = $cache->getKey([ + __METHOD__, + \get_class($this->subject), + $domainName, + ]); + $value = $cache->get($cacheKey); + if (null !== $value) { + return $value;",- +CmsPortalDomainsDataAccessCacheDecorator,getAllDomainNames: array,* {@inheritdoc},return $this->subject->getAllDomainNames();,- +CmsPortalDomainsDataAccessRequestLevelCacheDecorator,__construct,* @var CmsPortalDomainsDataAccessInterface,$this->subject = $subject;,- +CmsPortalDomainsDataAccessRequestLevelCacheDecorator,getPrimaryDomain,"* @var array","$cacheKey = ""$portalId-$languageId""; + if (true === isset($this->cache[$cacheKey])) { + return $this->cache[$cacheKey];",- +CmsPortalDomainsDataAccessRequestLevelCacheDecorator,getAllDomainNames: array,* @var string[],"if (null === $this->domainNamesCache) { + $this->domainNamesCache = $this->subject->getAllDomainNames();",- +CmsPortalDomainsDataAccessRequestLevelCacheDecorator,getPortalPrefixListForDomain: array,* @param CmsPortalDomainsDataAccessInterface $subject,return $this->subject->getPortalPrefixListForDomain($domainName);,- +CmsPortalDomainsDataAccessRequestLevelCacheDecorator,getActivePortalCandidate: ?array,* {@inheritdoc},"return $this->subject->getActivePortalCandidate($idRestrictionList, $identifierRestriction, $allowInactivePortals);",- +CmsPortalDomainsDataAccessRequestLevelCacheDecorator,getDomainDataByName: array,* {@inheritdoc},return $this->subject->getDomainDataByName($domainName);,- +DataAccessClassFromTableTableFieldProvider,__construct,* @var Connection,$this->databaseConnection = $databaseConnection;,- +DataAccessClassFromTableTableFieldProvider,getFieldClassNameFromDictionaryValues,* @param Connection $databaseConnection,"$query = $this->getFieldClassRowQuery(); + + try { + $fieldClassName = $this->databaseConnection->fetchColumn($query, array( + 'tableName' => $tableName, + 'fieldName' => $fieldName, + )); + if (false === $fieldClassName) { + return null;",- +DataAccessCmsLanguage,__construct,"* 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).",$this->databaseConnection = $databaseConnection;,- +DataAccessCmsLanguage,getLanguage,* @var Connection,"$language = TdbCmsLanguage::GetNewInstance(); + $languageRaw = $this->getLanguageRaw($id); + if (null === $languageRaw) { + return null;",- +DataAccessCmsLanguage,getLanguageRaw,* @param Connection $databaseConnection,"$language = TdbCmsLanguage::GetNewInstance(); + $language->DisablePostLoadHook(true); + if (false === $language->Load($id)) { + return null;",- +DataAccessCmsLanguage,getLanguageFromIsoCode,* {@inheritdoc},"$query = 'SELECT * FROM `cms_language` WHERE `iso_6391` = :isoCode'; + $row = $this->databaseConnection->fetchAssociative($query, array( + 'isoCode' => $isoCode, + )); + if (false === $row) { + return null;",- +DataAccessCmsLanguageRequestLevelCacheDecorator,__construct,* @var DataAccessCmsLanguageInterface,$this->subject = $subject;,- +DataAccessCmsLanguageRequestLevelCacheDecorator,getLanguage,* @var array,"$key = 'getLanguage-'.$id; + if (false === isset($this->cache[$key])) { + $languageRaw = $this->getLanguageRaw($id); + if (null === $languageRaw) { + return null;",- +DataAccessCmsLanguageRequestLevelCacheDecorator,getLanguageRaw,* @param DataAccessCmsLanguageInterface $subject,"$key = 'getLanguageRaw-'.$id; + if (false === isset($this->cache[$key])) { + $this->cache[$key] = $this->subject->getLanguageRaw($id);",- +DataAccessCmsLanguageRequestLevelCacheDecorator,getLanguageFromIsoCode,* {@inheritdoc},"$key = 'getLanguageFromIsoCode-'.$isoCode; + if (false === isset($this->cache[$key])) { + $language = $this->subject->getLanguageFromIsoCode($isoCode, $targetLanguageId); + if (null === $language) { + return null;",- +DataAccessCmsMasterPagedefCacheDecorator,"__construct( + DataAccessCmsMasterPagedefInterface $subject, + InputFilterUtilInterface $inputFilterUtil, + CacheInterface $cache, + RequestInfoServiceInterface $requestInfoService + )",* @var DataAccessCmsMasterPagedefInterface,"$this->subject = $subject; + $this->cache = $cache; + $this->inputFilterUtil = $inputFilterUtil; + $this->requestInfoService = $requestInfoService;",- +DataAccessCmsMasterPagedefCacheDecorator,get: ?CmsMasterPagdef,* @var CacheInterface,"$cacheKeyParameter = $this->getCacheKeyParameters($id); + + $cacheKey = $this->cache->getKey($cacheKeyParameter); + $pagedefData = $this->cache->get($cacheKey); + if (null !== $pagedefData) { + return $pagedefData;",- +DataAccessCmsMasterPagedefDatabase,__construct,* @var DataAccessCmsMasterPagedefInterface,"$this->fallbackLoader = $fallbackLoader; + $this->inputFilterUtil = $inputFilterUtil;",- +DataAccessCmsMasterPagedefDatabase,get: ?CmsMasterPagdef,* @var InputFilterUtilInterface,"//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,__construct,* @var InputFilterUtilInterface,"$this->inputFilterUtil = $inputFilterUtil; + $this->global = $global;",- +DataAccessCmsMasterPagedefFile,get: ?CmsMasterPagdef,* @var \TGlobal,"$oPageDefinitionFile = new TCMSPageDefinitionFile(); + $fullPageDefPath = $this->PageDefinitionFile($id); + $pagePath = substr($fullPageDefPath, 0, -strlen($id.'.pagedef.php')); + + if (false === $oPageDefinitionFile->Load($id, $pagePath)) { + return null;",- +DataAccessCmsPortalSystemPage,__construct,* @implements DataAccessInterface,$this->databaseConnection = $databaseConnection;,- +DataAccessCmsPortalSystemPage,loadAll,* @var Connection,"$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,getCacheTriggers,* @param Connection $databaseConnection,"return array( + 'cms_portal_system_page', + 'cms_tree', + );",- +DataAccessCmsTplPage,__construct,* @implements DataAccessInterface,$this->databaseConnection = $databaseConnection;,- +DataAccessCmsTplPage,loadAll,* @var Connection,"$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,getCacheTriggers,* @param Connection $databaseConnection,"return array( + 'cms_tpl_page', + 'cms_tree_node', + );",- +DataAccessCmsTree,__construct,* @var Connection,"$this->databaseConnection = $databaseConnection; + $this->languageService = $languageService;",- +DataAccessCmsTree,loadAll,* @var LanguageServiceInterface,"$query = 'SELECT * FROM `cms_tree` ORDER BY `lft`'; + + $result = $this->databaseConnection->fetchAllAssociative($query); + $trees = array(); + if (null === $languageId) { + $languageId = $this->languageService->getActiveLanguageId();",- +DataAccessCmsTree,getAllInvertedNoFollowRulePageIds,"* @param Connection $databaseConnection + * @param LanguageServiceInterface $languageService","$rows = $this->databaseConnection->fetchAllAssociative('SELECT `source_id`, `target_id` FROM `cms_tree_cms_tpl_page_mlt`'); + + if (false === $rows) { + return array();",- +DataAccessCmsTree,getInvertedNoFollowRulePageIds,* {@inheritdoc},"$query = 'SELECT `target_id` FROM `cms_tree_cms_tpl_page_mlt` WHERE `source_id` = :treeId'; + + return $this->databaseConnection->fetchColumn($query, array('treeId' => $cmsTreeId));",- +DataAccessCmsTreeNode,__construct,* @implements DataAccessInterface,"$this->databaseConnection = $databaseConnection; + $this->languageService = $languageService;",- +DataAccessCmsTreeNode,loadAll,* @var Connection,"$query = 'SELECT * FROM `cms_tree_node`'; + + $result = $this->databaseConnection->fetchAllAssociative($query); + $treeNodes = array(); + if (null === $languageId) { + $languageId = $this->languageService->getActiveLanguageId();",- +DataAccessCmsTreeNode,getCacheTriggers,* @var LanguageServiceInterface,"return array( + 'cms_tree_node', + );",- +DataAccessCmsTreeRequestLevelCacheDecorator,__construct,* @var DataAccessCmsTreeInterface,"$this->subject = $subject; + $this->languageService = $languageService;",- +DataAccessCmsTreeRequestLevelCacheDecorator,loadAll,* @var array,"if (null === $languageId) { + $languageId = $this->languageService->getActiveLanguageId();",- +DataAccessCmsTreeRequestLevelCacheDecorator,getAllInvertedNoFollowRulePageIds,* @var LanguageServiceInterface,"$cacheKey = 'allInvertedNoFollowRulePageIds'; + + if (false === array_key_exists($cacheKey, $this->cache)) { + $this->cache[$cacheKey] = $this->subject->getAllInvertedNoFollowRulePageIds();",- +DataAccessCmsTreeRequestLevelCacheDecorator,getInvertedNoFollowRulePageIds,"* @param DataAccessCmsTreeInterface $subject + * @param LanguageServiceInterface $languageService","$all = $this->getAllInvertedNoFollowRulePageIds(); + if (false === isset($all[$cmsTreeId])) { + return array();",- +RequestCacheDataAccess,__construct,"* @template T extends TCMSRecord + * @implements DataAccessInterface","$this->languageService = $languageService; + $this->decorated = $decorated;",- +RequestCacheDataAccess,loadAll,"* @var array $elements","if (null === $languageId) { + $languageId = $this->languageService->getActiveLanguageId();",- +RequestCacheDataAccess,getCacheTriggers,* @var LanguageServiceInterface,return array();,- +UserMenuItemDataAccess,__construct,* @var Connection,"$this->connection = $connection; + $this->logger = $logger;",- +UserMenuItemDataAccess,getMenuItemIds: array,* @var LoggerInterface,"if ('' === $userId) { + return [];",- +UserMenuItemDataAccess,trackMenuItem: void,* {@inheritDoc},"if ('' === $userId || '' === $menuItemId) { + return;",- +AbstractDatabaseAccessLayer,setDatabaseConnection,* @var Connection,$this->databaseConnection = $connection;,- +DatabaseAccessLayerCmsMasterPagedefSpotAccess,getAccessForSpot,* @var bool,"$this->loadAll(); + + return $this->getFromCache($spotId);",- +DatabaseAccessLayerCmsMasterPagedefSpotParameter,getParameterForSpot,* @var bool,"$this->loadAllParameters(); + + return $this->getFromCache($spotId);",- +DatabaseAccessLayerCmsMedia,loadMediaFromId,* @var bool,"$this->loadAllParameters(); + + $media = $this->getFromCache($mediaId); + if (null !== $media) { + return $media;",- +DatabaseAccessLayerCmsTPlModule,loadFromClassOrServiceId,* @var bool,"$this->loadAllModules(); + $keyMappingData = array('classname' => $classOrId); + $mappedKey = $this->getMapLookupKey($keyMappingData); + $data = $this->getFromCacheViaMappedKey($mappedKey); + if (null !== $data) { + return $data;",- +DatabaseAccessLayerCmsTPlModule,loadFromId,"* @param string $classOrId + * + * @return \TdbCmsTplModule|null","$this->loadAllModules(); + + return $this->getFromCache($id);",- +DatabaseAccessLayerCmsTPlModule,loadFromField,"* @param string $id + * + * @return \TdbCmsTplModule|null","$this->loadAllModules(); + $matches = $this->findDbObjectFromFieldInCache($field, $value); + if (0 === count($matches)) { + return null;",- +DatabaseAccessLayerCmsTplPage,__construct,* @deprecated since 6.1.0 use methods in chameleon_system_core.page_service instead,$this->portalDomainService = $portalDomainService;,- +DatabaseAccessLayerCmsTplPage,loadFromId,* @var bool,"$this->loadAllPages(); + + return $this->getFromCache($id);",- +DatabaseAccessLayerCmsTplPage,loadForTreeId,* @var PortalDomainServiceInterface,"$this->loadAllPages(); + + $cacheKeyData = array('cms_tree.id' => $treeId); + $mappedKey = $this->getMapLookupKey($cacheKeyData); + if (null !== $mappedKey) { + $page = $this->getFromCacheViaMappedKey($mappedKey); + if (null !== $page) { + return $page;",- +DatabaseAccessLayerCmsTree,__construct,* @deprecated since 6.1.0 use methods in chameleon_system_core.tree_service instead,"$this->portalDomainService = $portalDomainService; + $this->languageService = $languageService;",- +DatabaseAccessLayerCmsTree,loadFromId,* @var bool,"$this->loadAllTreeNodes(); + + return $this->getFromObjectCache($id, $languageId);",- +DatabaseAccessLayerCmsTree,getChildren,* @var PortalDomainServiceInterface,"$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,getFieldConfig,* @var TCMSField[][],"$fieldObject = null; + if (!isset($this->cache[$tableName])) { + $this->cache[$tableName] = array();",- +DatabaseAccessLayerFieldConfig,GetFieldDefinition,"* @param string $tableName + * @param string $fieldName + * @param TCMSRecord $dataRow + * @param bool $loadDefaults + * + * @return TCMSField","$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,getFieldType,* @var bool,"$this->loadAll(); + + return $this->getFromCache($id);",- +DatabaseAccessLayerFileTypes,getFileType,* @var \TdbCmsFiletype[],"if (isset($this->cache[$id])) { + return $this->cache[$id];",- +BackendTreeNodeDataModel,__construct,* @var string,"$this->id = $id; + $this->name = $name; + $this->cmsIdent = $cmsIdent; + $this->listAttributes = ['cmsIdent' => $cmsIdent]; + $this->connectedPageId = $connectedPageId;",- +BackendTreeNodeDataModel,getId: string,* @var string,return $this->id;,- +BackendTreeNodeDataModel,getName: string,* @var string,return $this->name;,- +BackendTreeNodeDataModel,setName: void,* @var int,$this->name = $name;,- +BackendTreeNodeDataModel,getFurtherIconsHTML: string,* @var BackendTreeNodeDataModel[],return $this->furtherIconsHTML;,- +BackendTreeNodeDataModel,setFurtherIconsHTML: void,* @var bool,$this->furtherIconsHTML = $furtherIconsHTML;,- +BackendTreeNodeDataModel,addFurtherIconHTML: void,* @var string,$this->furtherIconsHTML .= $furtherIconHTML;,- +BackendTreeNodeDataModel,getCmsIdent: int,* @var bool,return $this->cmsIdent;,- +BackendTreeNodeDataModel,getChildren: array,* @var bool,return $this->children;,- +BackendTreeNodeDataModel,addChildren: void,* @var bool,$this->children[] = $treeNodeDataModel;,- +BackendTreeNodeDataModel,isChildrenAjaxLoad: bool,"* Key = HTML attribute name. + * + * @var array",return $this->childrenAjaxLoad;,- +BackendTreeNodeDataModel,setChildrenAjaxLoad: void,"* Key = HTML attribute name. + * + * @var array",$this->childrenAjaxLoad = $childrenAjaxLoad;,- +BackendTreeNodeDataModel,getType: string,* @var array,return $this->type;,- +BackendTreeNodeDataModel,setType: void,* @var array,$this->type = $type;,- +BackendTreeNodeDataModel,isSelected: bool,* @var string,return $this->selected;,- +BackendTreeNodeDataModel,setSelected: void,* @return BackendTreeNodeDataModel[],$this->selected = $selected;,- +BackendTreeNodeDataModel,isDisabled: bool,* @param BackendTreeNodeDataModel $children,return $this->disabled;,- +BackendTreeNodeDataModel,setDisabled: void,* {@inheritDoc},$this->disabled = $disabled;,- +CmsMasterPagdef,__construct,* @var string,"$this->id = $id; + $this->moduleList = $moduleList; + $this->layoutFile = $layoutFile;",- +CmsMasterPagdef,getId: string,* @var array,return $this->id;,- +CmsMasterPagdef,getModuleList: array,* @var string,return $this->moduleList;,- +DownloadLinkDataModel,"__construct( + string $id, + string $downloadUrl, + string $fileName)",* @var string|null,"$this->id = $id; + $this->downloadUrl = $downloadUrl; + $this->fileName = $fileName;",- +DownloadLinkDataModel,getId: ?string,* @var string,return $this->id;,- +DownloadLinkDataModel,getHumanReadableFileSize: string,"* Add internal attribute for wysiwyg editor integration and disable download url. + * + * @var bool",return $this->humanReadableFileSize;,- +DownloadLinkDataModel,setHumanReadableFileSize: void,* @var string,$this->humanReadableFileSize = $humanReadableFileSize;,- +DownloadLinkDataModel,isBackendLink: bool,* @var bool,return $this->isBackendLink;,- +DownloadLinkDataModel,setIsBackendLink: void,* @var string,$this->isBackendLink = $isBackendLink;,- +DownloadLinkDataModel,getFileName: string,* @var string,return $this->fileName;,- +DownloadLinkDataModel,setFileName: void,* @var string,$this->fileName = $fileName;,- +DownloadLinkDataModel,showSize: bool,* @var bool,return $this->showSize;,- +PagePath,__construct,* @var string,"$this->pageId = $pageId; + $this->primaryPath = $primaryPath; + $this->pathList[] = $primaryPath;",- +PagePath,addPath,* @var string,$this->pathList[] = $path;,- +PagePath,getPageId,* @var string[],return $this->pageId;,- +PagePath,getPrimaryPath,"* @param string $pageId + * @param string $primaryPath",return $this->primaryPath;,- +PagePath,getPathList,"* @param string $path + * + * @return void",return $this->pathList;,- +ChameleonSystemCoreExtension,load,"* {@inheritDoc} + * + * @return void","$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,prepend,"* @param array $googleApiConfig + * @param ContainerBuilder $container + * + * @return void","// 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,getConfigTreeBuilder,"* Generates the configuration tree builder. + * + * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder","$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,process,"* {@inheritDoc} + * + * @return void","$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,process,"* {@inheritDoc} + * + * @return void","$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,process,"* {@inheritdoc} + * + * @return void","$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,process,"* {@inheritDoc} + * + * @return void","$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,process,"* You can modify the container here before it is dumped to PHP code. + * + * @param ContainerBuilder $container + * + * @api + * + * @return void","$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,process,"* {@inheritDoc} + * + * @return void","$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,process,* @return void,"$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,getLanguage,* @return null,return null;,- +EmptyRequest,getActivePage,* @return null,return null;,- +MakeLoggerPublicPass,process,"* {@inheritdoc} + * + * @return void",$container->getAlias('logger')->setPublic(true);,- +SetChameleonHttpKernelPass,process,"* {@inheritDoc} + * + * @return void","$container->setAlias('http_kernel', 'chameleon_system_core.http_kernel'); + $container->getAlias('http_kernel')->setPublic(true);",- +SetCsrfTokenManagerFactoryPass,process,"* {@inheritDoc} + * + * @return void","$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,process,"* Replace the token storage service of Symfony as that one uses ""session"" directly - which does not work with our own session handling.","$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,__construct,* @deprecated 7.2 no longer used - use the standard symfony login event,$this->user = $user;,- +BackendLoginEvent,getUser,* @var TCMSUser,return $this->user;,- +BackendLogoutEvent,__construct,* @deprecated 7.2 no longer used - use the standard symfony logout event,$this->user = $user;,- +BackendLogoutEvent,getUser,* @var TCMSUser|null,return $this->user;,- +ChangeActiveDomainEvent,getNewActiveDomain,* @var TCMSPortalDomain|null,return $this->newActiveDomain;,- +ChangeActiveDomainEvent,getOldActiveDomain,* @var TCMSPortalDomain|null,return $this->oldActiveDomain;,- +ChangeActiveDomainEvent,__construct,* @return TCMSPortalDomain|null,"$this->oldActiveDomain = $oldActiveDomain; + $this->newActiveDomain = $newActiveDomain;",- +ChangeActiveLanguagesForPortalEvent,__construct,* @var TCMSPortal,"$this->portal = $portal; + $this->oldLanguages = $oldLanguages; + $this->newLanguages = $newLanguages;",- +ChangeActiveLanguagesForPortalEvent,getPortal,* @var string[],return $this->portal;,- +ChangeActiveLanguagesForPortalEvent,getOldLanguages,* @var string[],return $this->oldLanguages;,- +ChangeActiveLanguagesForPortalEvent,getNewLanguages,"* @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",return $this->newLanguages;,- +ChangeActivePageEvent,getNewActivePage,* @var TCMSActivePage,return $this->newActivePage;,- +ChangeActivePageEvent,getOldActivePage,* @var TCMSActivePage|null,return $this->oldActivePage;,- +ChangeActivePageEvent,__construct,* @return TCMSActivePage,"$this->newActivePage = $newActivePage; + $this->oldActivePage = $oldActivePage;",- +ChangeActivePortalEvent,getNewActivePortal,* @var TCMSPortal|null,return $this->newActivePortal;,- +ChangeActivePortalEvent,getOldActivePortal,* @var TCMSPortal|null,return $this->oldActivePortal;,- +ChangeActivePortalEvent,__construct,* @return TCMSPortal|null,"$this->oldActivePortal = $oldActivePortal; + $this->newActivePortal = $newActivePortal;",- +ChangeDomainEvent,__construct,* @var TdbCmsPortalDomains[],$this->changedDomains = $changedDomains;,- +ChangeDomainEvent,getChangedDomains,* @param TdbCmsPortalDomains[] $changedDomains,return $this->changedDomains;,- +ChangeNavigationTreeConnectionEvent,__construct,* @var TdbCmsTreeNode,$this->changedTreeConnection = $changedTreeConnection;,- +ChangeNavigationTreeConnectionEvent,getChangedTreeConnection,* @param TdbCmsTreeNode $changedTreeConnection,return $this->changedTreeConnection;,- +ChangeNavigationTreeNodeEvent,__construct,* @var \TdbCmsTree[],$this->changedTreeNodes = $changedTreeNodes;,- +ChangeNavigationTreeNodeEvent,getChangedTreeNodes,* @param \TdbCmsTree[] $changedTreeNodes,return $this->changedTreeNodes;,- +ChangeShopOrderStepEvent,__construct,* @var TdbShopOrderStep[],$this->changedShopOrderSteps = $changedShopOrderSteps;,- +ChangeShopOrderStepEvent,getChangedShopOrderSteps,* @param TdbShopOrderStep[] $changedShopOrderSteps,return $this->changedShopOrderSteps;,- +ChangeUseSlashInSeoUrlsForPortalEvent,__construct,* @var TCMSPortal,"$this->portal = $portal; + $this->oldValue = $oldValue; + $this->newValue = $newValue;",- +ChangeUseSlashInSeoUrlsForPortalEvent,getPortal,* @var bool,return $this->portal;,- +ChangeUseSlashInSeoUrlsForPortalEvent,isOldValue,* @var bool,return $this->oldValue;,- +ChangeUseSlashInSeoUrlsForPortalEvent,isNewValue,"* @param TCMSPortal $portal + * @param bool $oldValue + * @param bool $newValue",return $this->newValue;,- +DeleteMediaEvent,__construct,* @var string,$this->deletedMediaId = $deletedMediaId;,- +DeleteMediaEvent,getDeletedMediaId,* @param string $deletedMediaId,return $this->deletedMediaId;,- +DisplayListmanagerCellEvent,__construct,* Holds information on a single backend table cell. This information can be changed to alter display of the cell.,"$this->tableCell = $tableCell; + $this->rowData = $rowData; + $this->isHeader = $isHeader;",- +DisplayListmanagerCellEvent,getTableCell,* @var \TGroupTableField,return $this->tableCell;,- +DisplayListmanagerCellEvent,getRowData,* @var array,return $this->rowData;,- +DisplayListmanagerCellEvent,isHeader,* @var bool,return $this->isHeader;,- +DisplayListmanagerCellEvent,getAttributes,* @var array,return $this->attributes;,- +DisplayListmanagerCellEvent,setAttributes,* @var string,$this->attributes = $attributes;,- +DisplayListmanagerCellEvent,getOnclickEvent,* @var array,return $this->onclickEvent;,- +DisplayListmanagerCellEvent,setOnclickEvent,* @var string,$this->onclickEvent = $onclickEvent;,- +DisplayListmanagerCellEvent,getCssClasses,"* @param \TGroupTableField $tableCell + * @param array $rowData + * @param bool $isHeader",return $this->cssClasses;,- +DisplayListmanagerCellEvent,setCssClasses,* @return \TGroupTableField,$this->cssClasses = $cssClasses;,- +DisplayListmanagerCellEvent,getCellValue,* @return array,return $this->cellValue;,- +DisplayListmanagerCellEvent,setCellValue,* @return bool,$this->cellValue = $cellValue;,- +FilterContentEvent,__construct,* @var string,$this->content = $content;,- +HtmlIncludeEvent,__construct,* @var array,"if (null !== $data) { + $this->addData($data);",- +HtmlIncludeEvent,addData,"* 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","foreach ($data as $key => $content) { + if ($this->isInteger($key)) { + $key = md5($content);",- +HtmlIncludeEvent,getData,* @return array,return $this->data;,- +LocaleChangedEvent,__construct,* @var string|null,"$this->newLocal = $newLocal; + $this->originalLocal = $originalLocal;",- +LocaleChangedEvent,getNewLocal,* @var string|null,return $this->newLocal;,- +LocaleChangedEvent,getOriginalLocal,"* @param string|null $newLocal + * @param string|null $originalLocal",return $this->originalLocal;,- +RecordChangeEvent,__construct,* @var string,"$this->tableId = $tableId; + $this->recordId = $recordId;",- +RecordChangeEvent,getTableId,* @var string,return $this->tableId;,- +RecordChangeEvent,getRecordId,"* @param string $tableId + * @param string $recordId",return $this->recordId;,- +expects,__construct,"* @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.","if (null !== $content) { + $this->setContent($content);",- +expects,setContent,* @var array|string,$this->content = $content;,- +expects,getContent,* @param string|null $content,return $this->content;,- +AddAntispamIncludesListener,__construct,* @var RequestInfoServiceInterface,$this->requestInfoService = $requestInfoService;,- +AddAntispamIncludesListener,onGlobalHtmlFooterInclude,* @param RequestInfoServiceInterface $requestInfoService,"$includes = array(); + + if (!$this->requestInfoService->isCmsTemplateEngineEditMode()) { + $oAntiSpam = new \antiSpam(); + $includes[] = $oAntiSpam->PrintJSCode();",- +AddBackendToasterMessageListener,__construct,* @var string,"$this->message = $message; + $this->type = $type;",- +AddBackendToasterMessageListener,addMessage,* @var string,"if (!$event->isMainRequest()) { + return;",- +AddControllerIncludesListener,__construct,* @var RequestInfoServiceInterface,"$this->requestInfoService = $requestInfoService; + $this->backendController = $backendController; + $this->frontendController = $frontendController;",- +AddControllerIncludesListener,onGlobalHtmlHeaderInclude,* @var ChameleonController,"if ($this->requestInfoService->isBackendMode()) { + $event->addData($this->backendController->getHtmlHeaderIncludes());",- +AddControllerIncludesListener,onGlobalHtmlFooterInclude,* @var ChameleonController,"if ($this->requestInfoService->isBackendMode()) { + $event->addData($this->backendController->getHtmlFooterIncludes());",- +AddGlobalHeadIncludesListener,__construct,"* Class AddJqueryIncludeListener returns the resources configured in the root directory of the snippets. + * Those will be included no matter which modules are being loaded.",$this->viewRendererSnippetDirectory = $viewRendererSnippetDirectory;,- +AddGlobalHeadIncludesListener,onGlobalHtmlHeaderInclude,* @var \TPkgViewRendererSnippetDirectoryInterface,"$event->addData($this->viewRendererSnippetDirectory->getResourcesForSnippetPackage('')); + + $event->addData(array( + '', + '', + '', + ));",- +AddJqueryIncludeListener,onGlobalHtmlHeaderInclude,"* @param HtmlIncludeEventInterface $event + * + * @return void","if (true === TGlobal::IsCMSMode()) { + $jqueryInclude = ''; + $jqueryInclude .= ''; + + $event->addData([$jqueryInclude]);",- +AddModuleIncludesListener,__construct,* @var RequestInfoServiceInterface,"$this->requestInfoService = $requestInfoService; + $this->moduleLoader = $moduleLoader; + $this->userModuleLoader = $userModuleLoader;",- +AddModuleIncludesListener,onGlobalHtmlHeaderInclude,* @var \TModuleLoader,"if ($this->requestInfoService->isBackendMode()) { + $event->addData($this->moduleLoader->GetHtmlHeadIncludes());",- +AddModuleIncludesListener,onGlobalHtmlFooterInclude,* @var \TUserModuleLoader,"if ($this->requestInfoService->isBackendMode()) { + $event->addData($this->moduleLoader->GetHtmlFooterIncludes());",- +AllowEmbeddingForDifferentDomainListener,__construct,* Allow the calling domain to see this page (e.g. in an iframe).,$this->domainsDataAccess = $domainsDataAccess;,- +AllowEmbeddingForDifferentDomainListener,onKernelRequest,* @var CmsPortalDomainsDataAccessInterface,"$request = $event->getRequest(); + + if (false === $this->isPreviewMode($request)) { + return;",- +BackendBreadcrumbListener,"__construct( + RequestStack $requestStack, + RequestInfoServiceInterface $requestInfoService, + InputFilterUtilInterface $inputFilterUtil, + BackendBreadcrumbServiceInterface $backendBreadcrumbService + )",* @var RequestStack,"$this->requestStack = $requestStack; + $this->requestInfoService = $requestInfoService; + $this->inputFilterUtil = $inputFilterUtil; + $this->backendBreadcrumbService = $backendBreadcrumbService;",- +BackendBreadcrumbListener,onKernelRequest,* @var RequestInfoServiceInterface,"if (false === $event->isMainRequest()) { + return;",- +CaseInsensitivePortalExceptionListener,__construct,* @var CmsPortalDomainsDataAccessInterface,$this->cmsPortalDomainsDataAccess = $cmsPortalDomainsDataAccess;,- +CaseInsensitivePortalExceptionListener,onKernelException: void,"* 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","$exception = $event->getThrowable(); + + if (false === $exception instanceof NotFoundHttpException) { + return;",- +ChangeChameleonObjectsLocaleListener,__construct,* Class ChangeChameleonObjectsLocaleListener.,"$this->portalDomainService = $portalDomainService; + $this->languageService = $languageService;",- +ChangeChameleonObjectsLocaleListener,onLocaleChangedEvent,* @var PortalDomainServiceInterface,"$portal = $this->portalDomainService->getActivePortal(); + if (null !== $portal) { + $portal->SetLanguage($this->languageService->getActiveLanguageId()); + $portal->LoadFromRow($portal->sqlData);",- +CheckPortalDomainListener,__construct,* @var PortalDomainServiceInterface,"$this->portalDomainService = $portalDomainService; + $this->requestInfoService = $requestInfoService; + $this->forcePrimaryDomain = $forcePrimaryDomain;",- +CheckPortalDomainListener,onKernelRequest,* @var RequestInfoServiceInterface,"if (!$event->isMainRequest()) { + return;",- +CleanupBreadcrumbAfterDeleteListener,__construct,* @var BackendBreadcrumbServiceInterface,$this->breadcrumbService = $breadcrumbService;,- +ClearRoutingCacheListener,__construct,* @var ChameleonBaseRouter,$this->router = $router;,- +ClearRoutingCacheListener,clearRoutingCache,* @param ChameleonBaseRouter $router,$this->router->clearCache();,- +InitializeRequestListener,"__construct( + RequestInitializer $requestInitializer, + MaintenanceModeServiceInterface $maintenanceModeService, + RequestInfoServiceInterface $requestInfoService + )",* @var RequestInitializer,"$this->requestInitializer = $requestInitializer; + $this->maintenanceModeService = $maintenanceModeService; + $this->requestInfoService = $requestInfoService;",- +InitializeRequestListener,onKernelRequest,* @var MaintenanceModeServiceInterface,"if (!$event->isMainRequest()) { + return;",- +mimics,__construct,"* 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).",$this->requestStack = $requestStack;,- +mimics,migrateSession,* @var RequestStack,"$mainRequest = $this->requestStack->getMainRequest(); + if (null === $mainRequest || false === $mainRequest->hasSession()) { + return;",- +NoCacheForSecurePageListener,onChangeActivePage: void,"* 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","$pageIsProtected = true === $event->getNewActivePage()->fieldExtranetPage; + + if ($pageIsProtected) { + header('Cache-Control: no-cache, no-store, must-revalidate');",- +RedirectToSecurePageListener,"__construct( + RequestStack $requestStack, + UrlUtil $urlUtil, + ICmsCoreRedirect $redirect, + RequestInfoServiceInterface $requestInfoService + )",* @var RequestStack,"$this->requestStack = $requestStack; + $this->urlUtil = $urlUtil; + $this->redirect = $redirect; + $this->requestInfoService = $requestInfoService;",- +RedirectToSecurePageListener,onChangeActivePage: void,* @var UrlUtil,"$request = $this->requestStack->getCurrentRequest(); + + if (null === $request) { + throw new \RuntimeException('No request present during page change');",- +RehashBackendUserPasswordListener,__construct,"* 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.","$this->inputFilterUtil = $inputFilterUtil; + $this->passwordHashGenerator = $passwordHashGenerator; + $this->databaseConnection = $databaseConnection; + $this->global = $global;",- +RehashBackendUserPasswordListener,rehashPassword,* @var InputFilterUtilInterface,"$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,__construct,* @var ContainerInterface,"$this->container = $container; + $this->backendRequestType = $backendRequestType; + $this->frontendRequestType = $frontendRequestType; + $this->assetRequestType = $assetRequestType;",- +RequestTypeListener,onKernelRequest,* @var AbstractRequestType,"if (false === $event->isMainRequest()) { + return;",- +RequestTypeListener,setContainer,* @var AbstractRequestType,$this->container = $container;,- +TemplateEngineAccessListener,"__construct( + readonly private RequestInfoServiceInterface $requestInfoService, + readonly private SecurityHelperAccess $security + )","* 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.",,- +TemplateEngineAccessListener,onKernelRequest,* @return void,"if (!$event->isMainRequest()) { + return;",- +FieldTreeNodePortalSelect,GetHTML,"* Allows the selection of only the portal root tree nodes (level 1 of tree). + * + * {@inheritdoc}","$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,__construct,* @var DataAccessClassFromTableFieldProviderInterface,$this->dataAccessClassFromTableFieldProvider = $dataAccessClassFromTableFieldProvider;,- +ClassFromTableFieldProvider,getFieldClassNameFromTableField,* {@inheritdoc},"if ('id' === $tableField) { + return null;",- +ClassFromTableFieldProvider,getDictionaryFromTableField,* {@inheritdoc},"$fieldIdentifier = str_replace('`', '', $fieldIdentifier); + $tableConfIdSplit = explode('.', $fieldIdentifier); + + if (false === $tableConfIdSplit || 2 !== count($tableConfIdSplit)) { + return null;",- +ClassFromTableFieldProviderRequestLevelCacheDecorator,__construct,* @var ClassFromTableFieldProviderInterface,$this->subject = $subject;,- +ClassFromTableFieldProviderRequestLevelCacheDecorator,getFieldClassNameFromTableField,* @var array,"if (false === \array_key_exists($tableField, $this->fieldClassNameCache)) { + $this->fieldClassNameCache[$tableField] = $this->subject->getFieldClassNameFromTableField($tableField);",- +ClassFromTableFieldProviderRequestLevelCacheDecorator,getDictionaryFromTableField,* @var array,"if (false === \array_key_exists($fieldIdentifier, $this->dictionaryCache)) { + $this->dictionaryCache[$fieldIdentifier] = $this->subject->getDictionaryFromTableField($fieldIdentifier);",- +chameleon,boot,* @var int,"if (!array_key_exists('HTTP_HOST', $_SERVER)) { + echo 'no HTTP_HOST in chameleon.php'; + exit(0);",- +ActiveCmsUserPermission,hasPermissionToExportTranslationDatabase,* @return bool,"/** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + return $securityHelper->isGranted(CmsUserRoleConstants::CMS_USER);",- +TranslationExporterJSON,__construct,* @var TranslatorBagInterface,$this->translator = $translator;,- +TranslationExporterJSON,export,"* @param string $locale + * @param string $domain + * + * @return string","$messageArray = $this->getMessages($locale, $domain); + + return json_encode($messageArray);",- +JsTranslationController,"__construct( + TranslationDomainExportInterface $exporter, + ActiveCmsUserPermissionInterface $activeUserPermission + )",* @var TranslationDomainExportInterface,"$this->exporter = $exporter; + $this->activeUserPermission = $activeUserPermission;",- +JsTranslationController,__invoke,* @var ActiveCmsUserPermissionInterface,"if (false === $this->activeUserPermission->hasPermissionToExportTranslationDatabase()) { + throw new AccessDeniedException('chameleon_system_core.translation_exporter.error_not_logged_in');",- +Migrator,migrate,"* @param string $version + * + * @return void","switch ($version) { + case '6.2': + $migrator = new Migrator62(); + break; + default: + throw new InvalidArgumentException('Unsupported version:'.$version);",- +ComposerData,__construct,* @var string,"$this->filePath = $filePath; + $this->data = $data;",- +ComposerData,getFilePath,* @var array,return $this->filePath;,- +ComposerData,getData,"* @param string $filePath + * @param array $data",return $this->data;,- +ComposerData,setData,* @return string,$this->data = $data;,- +ComposerJsonModifier,getComposerData,"* 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.","return new ComposerData($path, json_decode(file_get_contents($path), true));",- +ComposerJsonModifier,saveComposerFile,"* @param string $path + * + * @return ComposerData","file_put_contents($composerData->getFilePath(), json_encode($composerData->getData(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));",- +ComposerJsonModifier,addAutoloadClassmap,"* @param ComposerData $composerData + * + * @return void","if (isset($composerData->getData()['autoload'])) { + $autoload = $composerData->getData()['autoload'];",- +ComposerJsonModifier,addRequire,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->addToSection($composerData, 'require', $newElements);",- +ComposerJsonModifier,addRequireDev,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->addToSection($composerData, 'require-dev', $newElements);",- +ComposerJsonModifier,addSuggest,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->addToSection($composerData, 'suggest', $newElements);",- +ComposerJsonModifier,addScripts,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->addToSection($composerData, 'scripts', $newElements);",- +ComposerJsonModifier,addConfig,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->addToSection($composerData, 'config', $newElements);",- +ComposerJsonModifier,addExtra,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->addToSection($composerData, 'extra', $newElements);",- +ComposerJsonModifier,removeRequire,"* @param ComposerData $composerData + * @param array $newElements + * + * @return void","$this->removeFromSection($composerData, 'require', $elementsToRemove);",- +ComposerJsonModifier,removeRequireDev,"* @param ComposerData $composerData + * @param string $section + * @param array $newElements + * @param bool $forceUpdate + * + * @return void","$this->removeFromSection($composerData, 'require-dev', $elementsToRemove);",- +ComposerJsonModifier,removeSuggest,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$this->removeFromSection($composerData, 'suggest', $elementsToRemove);",- +ComposerJsonModifier,removeScripts,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$this->removeFromSection($composerData, 'scripts', $elementsToRemove);",- +ComposerJsonModifier,removeConfig,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$this->removeFromSection($composerData, 'config', $elementsToRemove);",- +ComposerJsonModifier,removeExtra,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$this->removeFromSection($composerData, 'extra', $elementsToRemove);",- +ComposerJsonModifier,addPostInstallCommands,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$this->addScriptCommands($composerData, 'post-install-cmd', $elementsToAdd);",- +ComposerJsonModifier,addPostUpdateCommands,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$this->addScriptCommands($composerData, 'post-update-cmd', $elementsToAdd);",- +ComposerJsonModifier,removePostInstallCommands,"* @param ComposerData $composerData + * @param string $section + * @param array $elementsToRemove + * + * @return void","$this->removeScriptCommands($composerData, 'post-install-cmd', $elementsToRemove);",- +ComposerJsonModifier,removePostUpdateCommands,"* @param ComposerData $composerData + * @param array $elementsToAdd + * + * @return void","$this->removeScriptCommands($composerData, 'post-update-cmd', $elementsToRemove);",- +ComposerJsonModifier,addKey,"* @param ComposerData $composerData + * @param array $elementsToAdd + * + * @return void","$data = $composerData->getData(); + if (false === $forceOverwrite && isset($data[$key])) { + return;",- +ComposerJsonModifier,removeKey,"* @param ComposerData $composerData + * @param string $commandType + * @param array $elementsToAdd + * + * @return void","$data = $composerData->getData(); + unset($data[$key]); + $composerData->setData($data);",- +ComposerJsonModifier,removeRepository,"* @param ComposerData $composerData + * @param array $elementsToRemove + * + * @return void","$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,__construct,* @var Connection,"$this->connection = $connection; + $this->cache = $cache;",- +MaintenanceModeService,isActive: bool,* @var CacheInterface,"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,activate: void,* @throws MaintenanceModeErrorException,"try { + $this->connection->executeUpdate(""UPDATE `cms_config` SET `shutdown_websites` = '1'""); + + $this->cache->callTrigger('cms_config');",- +MaintenanceModeService,deactivate: void,* @throws MaintenanceModeErrorException,"$this->removeMarkerFile(); + + try { + $this->connection->executeUpdate(""UPDATE `cms_config` SET `shutdown_websites` = '0'""); + + $this->cache->callTrigger('cms_config');",- +Migrator62,__construct,* @var string,$this->baseDir = realpath(__DIR__.'/../../../../../../..');,- +Migrator62,migrate,* @return void,"$this->migrate62FileBase(); + $this->migrate62ComposerJson(); + $this->finish();",- +MapperLoader,__construct,* @var ServiceLocator,$this->serviceLocator = $serviceLocator;,- +MapperLoader,getMapper,* {@inheritdoc},"try { + $service = $this->serviceLocator->get($identifier);",- +ModuleExecutionStrategyInline,execute,* {@inheritdoc},"return $module->__invoke($request, $isLegacyModule);",- +ModuleExecutionStrategySubRequest,__construct,* @var CacheInterface,"$this->cache = $cache; + $this->kernel = $kernel;",- +ModuleExecutionStrategySubRequest,execute,* @var KernelInterface,"$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,__construct,* @var ContainerInterface,$this->container = $container;,- +ModuleResolver,getModule,* {@inheritdoc},"if (false === $this->container->has($name)) { + return null;",- +ModuleResolver,hasModule,* {@inheritdoc},return $this->container->has($name);,- +TCMSModelBase,ExecuteAjaxCall,"* returns true if the module may add its url to the history object. + * + * @return bool","$methodName = $this->global->GetUserData('_fnc'); + if (empty($methodName)) { + trigger_error('Ajax call made, but no function passed via _fnc', E_USER_ERROR);",- +TCMSModelBase,Execute,"* checks if the call was made via ajax. + * + * @return bool","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,GetHtmlHeadIncludes,* {@inheritdoc},"static $includes = null; + if (null !== $includes) { + return $includes;",- +TGlobal,GetWebuserLoginData,"* call it to find out if we are in the cms or on the webpage. + * + * @return bool","return array('loginName' => 'www', 'password' => 'www');",- +TGlobal,GetUserData,"* 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","if (self::MODE_BACKEND === self::$mode) { + $sFilterClass = '';",- +TGlobal,GetLanguageIdList,"* 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.","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,__construct,"* 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. + * +/*","$this->requestStack = $requestStack; + $this->inputFilterUtil = $inputFilterUtil; + $this->kernel = $kernel;",- +provides,__get,"* holds the state of portal based class transformation. + * + * @var bool","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,SetExecutingModulePointer,"* URL path to backend http resources. + * + * @var string",$this->oExecutingModuleObject = $oExecutingModuleObject;,- +provides,GetExecutingModulePointer,"* 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",return $this->oExecutingModuleObject;,- +provides,GetLanguageIdList,"* used to cache any data that may be needed globally + * (like a list of portals, etc). + * + * @var array","$oCMSConfig = TdbCmsConfig::GetInstance(); + return [$oCMSConfig->fieldTranslationBaseLanguageId];",- +provides,UserDataExists,"* holds the current executing module object. + * + * @var TModelBase","$request = $this->getRequest(); + + return null !== $request && null !== $request->get($name, null);",- +provides,GetUserData,"* config class of the HTMLPurifier XSS filter. + * + * @var HTMLPurifier_Config","$outputData = ''; + $request = $this->getRequest(); + if (null !== $request) { + if (null !== $name) { // get value for key + $outputData = $this->inputFilterUtil->getFilteredInput($name, '', false, $sFilterClass);",- +provides,GetRawUserData,@var RequestStack,"return $this->GetUserData($name, $excludeArray, TCMSUserInput::FILTER_NONE);",- +provides,SetUserData,* @var InputFilterUtilInterface,"$request = $this->getRequest(); + $request->query->set($sArrayKeyName, $Value);",- +provides,SetPurifierConfig,* @var KernelInterface,"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,OutputUserData,"* 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","return htmlspecialchars($this->GetUserData($name), ENT_QUOTES);",- +provides,getModuleRootPath,"* called by the controller to set the pointer to the currently executing module instance. + * + * @param TModelBase $oExecutingModuleObject","$bundlePath = self::instance()->resolveBundlePath($type); + if (null !== $bundlePath) { + return $bundlePath.'/objects/BackendModules/';",- +provides,_GetPagedefRootPath,"* return pointer to the currently executing module object. + * + * @return TModelBase","$bundlePath = $this->resolveBundlePath($sType); + if (null !== $bundlePath) { + return $bundlePath.'/Resources/BackendPageDefs/';",- +provides,GetPortals,"* return a pointer to the controller running the show. + * + * @return ChameleonControllerInterface + * + * @deprecated Use \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.chameleon_controller') instead","if (!array_key_exists('oPortals', $this->_dataCache)) { + $this->_dataCache['oPortals'] = new TCMSPortalList();",- +provides,SetRewriteParameter,"* returns the base URL of the current backend theme + * uses GetStaticURL to return optional static domain. + * + * @return string",$this->aRewriteParameter = $aParameter;,- +provides,GetRewriteParameter,"* 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",return $this->aRewriteParameter;,- +provides,__call,* @return string[]|string,"$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,isFrontendJSDisabled,"* @param string $sURL + * + * @return string","$bExclude = ($this->UserDataExists('esdisablefrontendjs') && 'true' == $this->GetUserData('esdisablefrontendjs')); + + return $bExclude;",- +provides,__sleep,"* 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","// avoid $requestStack being serialized + return array();",- +TModelBase,setController,"* the view template path to load (without .view.php ending). + * + * @var string",$this->controller = $controller;,- +TModelBase,__wakeup,"* array of module configuration data from pagedef. + * + * @var array","$this->bIsWakingUp = true; + $this->Init(); + $this->bIsWakingUp = false;",- +TModelBase,__sleep,"* name of the spot e.g. spota. + * + * @var string","return array('viewTemplate', 'aModuleConfig', 'sModuleSpotName');",- +TModelBase,__construct,* @var bool,,- +TModelBase,__get,"* the data that will be available to module template views. + * + * @var array","if ('global' === $name) { + @trigger_error('The property TModelBase::$global is deprecated.', E_USER_DEPRECATED); + + return ServiceLocator::get('chameleon_system_core.global');",- +TModelBase,__set,"* 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","if ('global' !== $name) { + throw new \LogicException('Invalid property: '.$name);",- +TModelBase,__isset,* @var $bool,return 'global' === $name;,- +TModelBase,Init,"* An array of all methods from the class which may be called via http requests. + * + * @var array",,- +TModelBase,Execute,"* this is set automatically when the class is restored from session. + * + * @var bool","$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,AllowAccessWithoutAuthenticityToken,"* 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",return 'ExecuteAjaxCall' === $sMethodName;,- +TModelBase,ExecuteAjaxCall,"* 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","$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,GetHtmlHeadIncludes,"* @param ChameleonControllerInterface $controller + * + * @deprecated Don't use this controller. Retrieve it through \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.chameleon_controller') instead",return array();,- +TModelBase,GetHtmlFooterIncludes,"* returns true if the class is currently waking up from the session. + * + * @return bool",return array();,- +TModelBase,_CallMethod,"* @param string $name + * + * @return object","if (true === $this->isMethodCallAllowed($sMethodName)) { + $functionResult = call_user_func_array(array($this, $sMethodName), $aMethodParameter); + + return $functionResult;",- +TModelBase,_GetModuleRootPath,"* @param string $name + * @param mixed $value","$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,GetPostRenderVariables,"* Called before any external functions get called, but after the constructor. + * @return void","return array( + 'sModuleSpotName' => TGlobal::OutHTML($this->sModuleSpotName), + );",- +TModelBase,_AllowCache,"* 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",return false;,- +TModelBase,_GetCacheParameters,"* 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","$parameters = $this->aModuleConfig; + $parameters['_class'] = __CLASS__; + + return $parameters;",- +TModelBase,_GetCacheTableInfos,* @return void,return array();,- +TModelBase,IsHTMLDivWrappingAllowed,"* 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.",return $this->bAllowHTMLDivWrapping;,- +TModelBase,InjectVirtualModuleSpots,"* 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[]",,- +TModelBase,__invoke,"* 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[]","$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,__toString,"* 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...)",return get_class($this);,- +TModuleLoader,"__construct( + RequestStack $requestStack, + ModuleResolverInterface $moduleResolver, + IViewPathManager $viewPathManager, + CacheInterface $cache, + TGlobalBase $global, + ModuleExecutionStrategyInterface $moduleExecutionStrategy, + RequestInfoServiceInterface $requestInfoService + )","* loads CMS backend modules. +/*","$this->requestStack = $requestStack; + $this->moduleResolver = $moduleResolver; + $this->viewPathManager = $viewPathManager; + $this->cache = $cache; + $this->global = $global; + $this->moduleExecutionStrategy = $moduleExecutionStrategy; + $this->requestInfoService = $requestInfoService;",- +TModuleLoader,getModuleCacheKeyDetails,* @var TModelBase[],return isset($this->aModuleCacheData[$sSpotName]['aKey']) ? $this->aModuleCacheData[$sSpotName]['aKey'] : null;,- +TModuleLoader,getModuleCacheTriggerDetails,* @var ChameleonControllerInterface,return isset($this->aModuleCacheData[$sSpotName]['aTrigger']) ? $this->aModuleCacheData[$sSpotName]['aTrigger'] : null;,- +TModuleLoader,allowCacheForModule,* @var bool,return isset($this->aModuleCacheData[$sSpotName]['bAllowCaching']) ? $this->aModuleCacheData[$sSpotName]['bAllowCaching'] : false;,- +TModuleLoader,SetEnableAutoFlush,* @var array,$this->bEnableAutoFlush = $bEnableAutoFlush;,- +TModuleLoader,LoadModules,* @var RequestStack,"$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,InitModules,* @var ModuleResolverInterface,"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,GetPermittedFunctions,* @var CacheInterface,"reset($this->modules); + $aFunctions = array(); + foreach ($this->modules as $spotName => $module) { + $aTmpFunctions = $this->modules[$spotName]->methodCallAllowed; + $aFunctions = array_merge($aFunctions, $aTmpFunctions);",- +TModuleLoader,GetHtmlHeadIncludes,* @var IViewPathManager,"$aHeadData = array(); + reset($this->modules); + foreach ($this->modules as $spotName => $module) { + $aModulHeadData = $this->modules[$spotName]->GetHtmlHeadIncludes(); + $aHeadData = array_merge($aHeadData, $aModulHeadData);",- +TModuleLoader,GetHtmlFooterIncludes,* @var TGlobalBase,"reset($this->modules); + $aFooterData = array(); + foreach ($this->modules as $spotName => $module) { + $aModuleFooterData = $this->modules[$spotName]->GetHtmlFooterIncludes(); + $aFooterData = array_merge($aFooterData, $aModuleFooterData);",- +TModuleLoader,hasModule,* @var ModuleExecutionStrategyInterface,"return array_key_exists($spotName, $this->modules);",- +TModuleLoader,GetModule,* @var RequestInfoServiceInterface,"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();",- +TPkgRunFrontendAction,runAction,@var $oAction IPkgRunFrontendAction*,"$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,isValid,* @return array,return $this->fieldExpireDate > date('Y-m-d H:i:s');,- +TPkgRunFrontendAction,onCreateActionHook,* @return bool,,- +TPkgRunFrontendAction,getUrlToRunAction,"* @param string $sClass + * @param string $sPortalId + * @param array $aParameter + * @param string $sLanguageId + * + * @return TdbPkgRunFrontendAction|null","$portal = $this->GetFieldCmsPortal(); + if (null === $portal) { + return '';",- +TCMSSmartURLHandler_PkgRunFrontendAction,GetPageDef,"* this method should parse the url and check which page matches + * it should convert url parts to GET parameters by using aCustomURLParameters.","$iPageId = false; + $oURLData = TCMSSmartURLData::GetActive(); + $aParts = explode('/', $oURLData->sRelativeURL); + $aParts = $this->CleanPath($aParts); + if (0 === count($aParts)) { + return $iPageId;",- +TPkgShopServiceType_Giftcard,FilterUserInput: void,"* 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","$aPermittedData = array('cardtext'); + $aKeys = array_keys($aUserInput); + foreach ($aKeys as $sKey) { + if (!in_array($sKey, $aPermittedData)) { + unset($aUserInput[$sKey]);",- +TPkgCmsRouteControllerCmsTplPage,getPage,* @var ChameleonControllerInterface,"if (null === $this->controller) { + throw new BadMethodCallException('No main controller has been set before calling getPage()');",- +TPkgCmsRouteControllerCmsTplPage,setMainController,* @var TreeNodeServiceInterface,$this->controller = $controller;,- +TPkgCmsRouteControllerCmsTplPage,setTreeNodeService,* @var TreeServiceInterface,$this->treeNodeService = $treeNodeService;,- +TPkgCmsRouteControllerCmsTplPage,setTreeService,* @var ICmsCoreRedirect,$this->treeService = $treeService;,- +TPkgCmsRouteControllerCmsTplPage,setRedirect,* @var RequestStack,$this->redirect = $redirect;,- +TPkgCmsRouteControllerCmsTplPage,setRequestStack,* @var PageServiceInterface,$this->requestStack = $requestStack;,- +TPkgCmsRouteControllerCmsTplPage,setPageService,"* @param Request $request + * @param string $pagePath + * + * @return Response + * + * @throws BadMethodCallException + * @throws NotFoundHttpException",$this->pageService = $pageService;,- +TCacheManager,SetCacheStorage,"* 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. +/*",$this->oCacheStorage = $oCacheStorage;,- +TCacheManager,GetCacheStorage,* @var ICacheManagerStorage,return $this->oCacheStorage;,- +TCMSBreadcrumbNavi,__construct,"* fetches breadcrumb navi. +/*","$this->pageId = $pageId; + if (!empty($nodeClass)) { + if (class_exists($nodeClass, false)) { + $this->nodeClass = $nodeClass;",- +TCMSBreadcrumbNavi,Render,"* name of the navigation item class. + * + * @var string","$nodeCount = 0; + $breadcrumb = ''; + foreach (array_keys($this->nodes) as $nodeId) { + /* @var $this->nodes[$nodeId] TCMSBreadcrumbNaviItem */ + $breadcrumb .= $this->nodes[$nodeId]->Render($nodeCount, $oCurrentDivisionObj); + ++$nodeCount;",- +TCMSBreadcrumbNavi,GetBreadcrumbNaviIds,"* page id. + * + * @var string|null","$returnArray = array(); + + foreach (array_keys($this->nodes) as $nodeId) { + $returnArray[] = $this->nodes[$nodeId]->id;",- +TCMSBreadcrumbNavi,LoadData,"* array of nodes 0=rootNode. + * + * @var array","if (!is_array($stopNodeArray)) { + $stopNodeArray = array($stopNodeArray);",- +TCMSBreadcrumbNavi,CreateNode,"* return tree ids from breadcrumb. + * + * @return array","$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,Render,"* holds the navigation item data. +/*","return '
DefineInterface(); + $returnVal = false; + if (in_array($sMethodName, $this->methodCallAllowed)) { + $returnVal = true;",- +TCMSField,GetReadOnly,"* value of the field. + * + * @var array|string","$this->bReadOnlyMode = true; + + $html = $this->_GetHiddenField(); + $html .= '
'; + $html .= '
'.TGlobal::OutHTML($this->data).'
'; + $html .= '
'; + + return $html;",- +TCMSField,GetDisplayType,"* the field name. + * + * @var string","$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,GetHTML,"* the table name. + * + * @var string","$this->_GetFieldWidth(); + + $html = $this->_GetHiddenField(); + $html .= 'FIELD TYPE NOT DEFINED'; + + return $html;",- +TCMSField,GetEditOnClick,"* record id. + * + * @var string","if ($this->IsEditOnClickOnEditMode()) { + $sHtml = $this->GetHTML();",- +TCMSField,GetCMSHtmlHeadIncludes,"* length of the field (maxlength). + * + * @var int",return array();,- +TCMSField,GetCMSHtmlFooterIncludes,"* the width in pixels of the field for CSS styling. + * + * @var int",return array();,- +TCMSField,_GetHTMLValue,"* indicates that this field has no title column + * and uses colcount=2 in field edit list.",return $this->_GetFieldValue();,- +TCMSField,GetSQL,"* pointer to the Table row. + * + * @var TCMSRecord",return $this->ConvertDataToFieldBasedData($this->ConvertPostDataToSQL());,- +TCMSField,GetSQLOnCopy,"* the definition class of the field. + * + * @var TdbCmsFieldConf",return $this->data;,- +TCMSField,ConvertDataToFieldBasedData,"* indicates that this is a MLT field. + * + * @var bool",return $sData;,- +TCMSField,GetDatabaseCopySQL,"* indicates that this is a Property field. + * + * @var bool",return $this->GetSQL();,- +TCMSField,ConvertPostDataToSQL,"* indicates if the button for switching to the connected record shows up. + * + * @var bool default true",return $this->data;,- +TCMSField,PreGetSQLHook,"* 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",return true;,- +TCMSField,PostSaveHook,"* the current record data (includes workflow data). + * + * @var TCMSRecord",,- +TCMSField,PostInsertHook,"* is set if ReadOnly method is called. + * + * @var bool",,- +TCMSField,ChangeFieldDefinition,* @var \Doctrine\DBAL\Connection,"if (true === $this->oDefinition->isVirtualField()) { + return;",- +TCMSField,CreateFieldDefinition,"* is set if the contained data are encrypted. + * + * @var bool","if (true === $this->oDefinition->isVirtualField()) { + return '';",- +TCMSField,ChangeFieldTypePreHook,* Sets methods that are allowed to be called via URL (ajax calls).,,- +TCMSField,ChangeFieldTypePostHook,"* Checks if method is listed in $this->methodCallAllowed array. + * + * @param string $sMethodName + * + * @return bool",,- +TCMSField,RemoveFieldIndex,"* Renders an input field of type ""hidden"", used in readonly mode. + * + * @return string","$fieldType = $this->oDefinition->GetFieldType(); + + if ('index' !== $fieldType->sqlData['indextype'] && 'unique' !== $fieldType->sqlData['indextype']) { + return;",- +TCMSField,CreateFieldIndex,"* Renders the read only view of the field. + * + * @return string","$inputFilterUtil = $this->getInputFilterUtil(); + + $oFieldType = null; + $cmsFieldTypeId = $inputFilterUtil->getFilteredInput('cms_field_type_id'); + + if (empty($cmsFieldTypeId)) { + $oFieldType = $this->oDefinition->GetFieldType();",- +TCMSField,_GetSQLDefinition,"* 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","$connection = $this->getDatabaseConnection(); + $inputFilterUtil = $this->getInputFilterUtil(); + + $lengthSet = ''; + $cmsFieldTypeId = ''; + $fieldDefaultValue = ''; + + if (null !== $fieldDefinition) { + if (isset($fieldDefinition['field_default_value'])) { + $fieldDefaultValue = $fieldDefinition['field_default_value'];",- +TCMSField,_GetSQLCharset,@var SecurityHelperAccess $securityHelper,return '';,- +TCMSField,DeleteFieldDefinition,"* renders the html of the field (overwrite this to write your own field type). + * + * @return string","if (true === $this->oDefinition->isVirtualField()) { + return;",- +TCMSField,DeleteRelatedTables,"* 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",,- +TCMSField,AllowCreateRelatedTablesAfterFieldSave,"* renders the html for the edit-on-click mode that opens a window with a field editor. + * + * @return string",return true;,- +TCMSField,AllowDeleteRelatedTablesBeforeFieldSave,"* Check if field is in edit-on-click mode. + * + * @return bool",return true;,- +TCMSField,AllowRenameRelatedTablesBeforeFieldSave,"* sets the inner width of the dialog window in editOnClick mode. + * + * @return string expression that will evaluate to a number when injected into JavaScript",return true;,- +TCMSField,RenameRelatedTables,"* sets the inner height of the dialog window in editOnClick mode. + * + * @return string expression that will evaluate to a number when injected into JavaScript","if ($returnDDL) { + return '';",- +TCMSField,CreateRelatedTables,"* 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","if ($returnDDL) { + return '';",- +TCMSField,_GetFieldValue,"* 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","$value = ''; + if (false !== $this->data && null !== $this->data) { + $value = $this->data;",- +TCMSField,_GetFieldWidth,"* return the fields value for HTML output. + * + * @return string","// max length + if ('0' != $this->oDefinition->sqlData['field_width']) { + if ($this->oDefinition->sqlData['field_width'] > 60) { + $this->fieldCSSwidth = '100%';",- +TCMSField,GetHTMLExport,"* returns the field value for database storage + * overwrite this method to modify data before save. + * + * @return mixed",return $this->data;,- +TCMSField,GetRTFExport,"* returns the field value for database storage + * overwrite this method to modify data on save. + * + * @return mixed",return $this->GetHTMLExport();,- +TCMSField,RenderFieldPropertyString,"* @param string $sData + * + * @return string","$viewParser = new TViewParser(); + $viewParser->bShowTemplatePathAsHTMLHint = false; + $data = $this->GetFieldWriterData(); + $viewParser->AddVarArray($data); + + return $viewParser->RenderObjectView('property', 'TCMSFields/TCMSField');",- +TCMSField,RenderFieldPostLoadString,"* 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","$viewParser = new TViewParser(); + $viewParser->bShowTemplatePathAsHTMLHint = false; + $data = $this->GetFieldWriterData(); + $viewParser->AddVarArray($data); + + return $viewParser->RenderObjectView('postload', 'TCMSFields/TCMSField');",- +TCMSField,RenderFieldPostWakeupString,"* this method converts post data like datetime (3 fields with date, hours, minutes in human readable format) + * to sql format. + * + * @return mixed",return '';,- +TCMSField,RenderFieldMethodsString,"* gets called in TCMSTableEditor::_WriteDataToDatabase before GetSQL + * the field will only be written to the database if this function returned true. + * + * + * @return bool",return '';,- +TCMSField,RenderFieldListMethodsString,"* 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",return '';,- +TCMSField,DataIsValid,"* called on each field when a record is inserted. + * + * @param string $iRecordId + * + * @return void","$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,HasContent,"* changes an existing field definition (alter table). + * + * @param string $oldName + * @param string $newName + * @param array|null $postData + * + * @return void","$hasContent = false; + $fieldDisplayType = $this->GetDisplayType(); + if ('readonly-if-filled' === $fieldDisplayType) { + $this->LoadCurrentDataFromDatabase(); + if (!empty($this->oRecordFromDB->sqlData[$this->name])) { + $hasContent = true;",- +TCMSField,HasDBContent,"* update default value of the field. + * + * @param string $fieldDefaultValue + * @param string $fieldName + * @param bool $updateExistingRecords + * + * @throws \Doctrine\DBAL\DBALException","$hasContent = false; + $this->LoadCurrentDataFromDatabase(); + if (!empty($this->oRecordFromDB->sqlData[$this->name])) { + $hasContent = true;",- +TCMSField,IsMandatoryField,"* update default value of a field with associated workflow. + * + * @param string $fieldDefaultValue + * @param string $fieldName + * @param bool $updateExistingRecords","$isMandatoryField = false; + if ('1' == $this->oDefinition->sqlData['isrequired']) { + $isMandatoryField = true;",- +TCMSField,GetContent,"* create a new field definition (alter table). + * + * @param bool $returnDDL + * @param TCMSField $oField + * + * @return string","$fieldDisplayType = $this->GetDisplayType(); + if ('readonly' === $fieldDisplayType || 'readonly' === $displayType) { + $content = $this->GetReadOnly();",- +TCMSField,PkgCmsFormDataIsValid,* called on the OLD field if the field type is changed (before deleting related tables or droping the index).,return $this->DataIsValid();,- +TCMSField,PkgCmsFormPreGetSQLHook,* called on the NEW field if the field type is changed (BEFORE anything else is done).,,- +TCMSField,PkgCmsFormPostSaveHook,* drops the field index.,,- +TCMSField,PkgCmsFormTransformFormDataBeforeSave,"* sets field index if the field type is indexable. + * + * @param bool $returnDDL - if true the SQL alter statement will be returned + * + * @return string|null",return $this->data;,- +TCMSField,"Render( + $bFieldHasError = false, + $bWrapFieldClassDiv = false, + $sViewName = 'standard', + $sViewType = 'Core', + $aAdditionalVars = array, + $sViewSubType = null + )","* generate the field definition part of the sql statement + * we assume that $oFieldDefinition holds the correct default value. + * + * @param array $fieldDefinition + * + * @return string","$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,getHtmlHeadIncludes,"* tries to fetch the length_set value of the field type. + * + * @param TCMSRecord $oFieldType + * @param array|null $aPostData + * + * @return string",return array();,- +TCMSField,getFrontendJavascriptInitMethodOnSubRecordLoad,"* 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",return '';,- +TCMSField,getOnSaveViaAjaxHookMethod,* drop a field definition (alter table).,,- +TCMSField,setDatabaseConnection,"* 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.",$this->databaseConnection = $connection;,- +TCMSField,accept,"* 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",return $visitor->visit($this);,- +TCMSField,toString,"* 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",return $this->data;,- +TCMSField,setBEncryptedData,"* 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",$this->bEncryptedData = $bEncryptedData;,- +TCMSField,getBEncryptedData,"* Renames existing related table. + * + * @param array $newFieldData + * @param bool $returnDDL + * + * @return string|null",return $this->bEncryptedData;,- +TCMSField,getMenuButtonsForFieldEditor,"* 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","$menuButtonItems = new TIterator(); + + $saveButton = $this->getSaveButton(); + if (null !== $saveButton) { + $menuButtonItems->AddItem($saveButton);",- +takes,ConvertDataToFieldBasedData,"* The class takes data and serializes it to db. + * +/*","$sData = parent::ConvertDataToFieldBasedData($sData); + $sData = serialize($sData); + + return $sData;",- +takes,ConvertPostDataToSQL,"* this method converts post data like datetime (3 fields with date, hours, minutes in human readable format) + * to sql format. + * + * @return mixed","$sData = parent::ConvertPostDataToSQL(); + $sData = unserialize($sData); + + return $sData;",- +takes,GetHTML,@var $oViewParser TViewParser,"$sOriginal = $this->data; + $this->data = print_r($this->data, true); + $sResponse = $this->GetReadOnly(); + $this->data = $sOriginal; + + return $sResponse;",- +TCMSFieldBoolean,GetOptions,* {inheritdoc}.,"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,GetHTML,* {@inheritdoc},"$this->GetOptions(); + + $checked = ''; + $disabled = ''; + if (true === $this->isChecked()) { + $checked = ' checked'; + $disabled = ' disabled';",- +TCMSFieldBoolean,GetReadOnly,* {@inheritdoc},"$checked = ''; + if (true === $this->isChecked()) { + $checked = ' checked';",- +TCMSFieldBoolean,RenderFieldPostLoadString,* {@inheritdoc},"$viewParser = new TViewParser(); + $viewParser->bShowTemplatePathAsHTMLHint = false; + $aData = $this->GetFieldWriterData(); + $viewParser->AddVarArray($aData); + + return $viewParser->RenderObjectView('postload', 'TCMSFields/TCMSFieldBoolean');",- +TCMSFieldBoolean,DataIsValid,* {@inheritdoc},"if (false === parent::DataIsValid()) { + return false;",- +TCMSFieldBoolean,HasContent,* {@inheritdoc},return '0' == $this->data || false === empty($this->data);,- +TCMSFieldBoolean,_GetSQLDefinition,* {@inheritdoc},"// 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,toString,* {@inheritdoc},"$this->GetOptions(); + + return $this->options[$this->data];",- +TCMSFieldClassParams,GetHTML,"* 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). + * +/*","parent::GetHTML(); + + $html = '\n""; + + return $html;",- +TCMSFieldExternalVideoCode,GetDisplayType,"* 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",return 'hidden';,- +TCMSFieldExternalVideoID,GetDisplayType,* {@inheritdoc},return 'hidden';,- +TCMSFieldGenderSelector,GetOptions,"* male or female. +/*","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,DataIsValid,* {@inheritdoc},"$dataIsValid = $this->CheckMandatoryField(); + if (false === $dataIsValid) { + return $dataIsValid;",- +TCMSFieldGMapCoordinate,GetSQL,* {@inheritdoc},"$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,GetHTML,* {@inheritdoc},"parent::GetHTML(); + + $this->fieldCSSwidth = 200; + + $aCoordinates = explode('|', $this->_GetFieldValue()); + $lat = ''; + $lng = ''; + + if (2 === count($aCoordinates)) { + $lat = $aCoordinates[0]; + $lng = $aCoordinates[1];",- +TCMSFieldGMapCoordinate,_GetHTMLValue,* {@inheritdoc},"$html = parent::_GetHTMLValue(); + $html = TGlobal::OutHTML($html); + + return $html;",- +TCMSFieldGMapCoordinate,DataIsValid,* {@inheritdoc},"$bDataIsValid = parent::DataIsValid(); + if ($bDataIsValid) { + $sSQLData = $this->ConvertPostDataToSQL(); + + if (!$this->IsMandatoryField() && ('|' == $sSQLData || '' == $sSQLData)) { + $bDataIsValid = true;",- +TCMSFieldGMapCoordinate,HasContent,* {@inheritdoc},"$bHasContent = false; + $sContent = $this->ConvertPostDataToSQL(); + if (!empty($sContent) || '|' == $sContent) { + $bHasContent = true;",- +TCMSFieldGMapCoordinate,RenderFieldMethodsString,* {@inheritdoc},"$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,GetCMSHtmlFooterIncludes,@var $oViewParser TViewParser,"$includes = parent::GetCMSHtmlFooterIncludes(); + $includes[] = ''; + $includes[] = ''; + + return $includes;",- +TCMSFieldLookup,toString,"* tries to load the connected record, returns record object or false if no record is connected or record is missing. + * + * @return bool|TCMSRecord","if (!$this->data) { + return '';",- +TCMSFieldLookupDirectory,GetHTML,"* 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 + * +/*","$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,ChangeFieldDefinition,* sets methods that are allowed to be called via URL (ajax call).,"parent::ChangeFieldDefinition($sOldName, $sNewName, $postData); + + $sComment = ''; + if (!is_null($postData) && is_array($postData)) { + $sComment = substr($postData['translation'].': '.$postData['049_helptext'], 0, 255);",- +TCMSFieldModuleInstance,_GetSQLCharset,* loads the module instance data.,return ' CHARACTER SET latin1 COLLATE latin1_general_ci';,- +TCMSFieldModuleInstance,DeleteFieldDefinition,@var $this->oModuleInstance TCMSTPLModuleInstance,"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,ChangeFieldTypePreHook,@var $oModule TCMSTPLModule,"$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,ChangeFieldTypePostHook,"* 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","$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,RenameInstance,"* changes an existing field definition (alter table). + * + * @param string $sOldName + * @param string $sNewName + * @param array $postData","$oTdbCmsTplModuleInstance = TdbCmsTplModuleInstance::GetNewInstance(); + $oTableConf = $oTdbCmsTplModuleInstance->GetTableConf(); + + $oTableEditor = new TCMSTableEditorModuleInstance(); + $oTableEditor->Init($oTableConf->id, $this->data); + + return $oTableEditor->RenameInstance();",- +TCMSFieldModuleInstance,CreateNewInstance,"* return the new charset latin1 so that we get more memory + * size for a record. + * + * @return string","$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,DeleteInstance,* drop a field definition (alter table).,"$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,PostSaveHook,* called on the OLD field if the field type is changed (before deleting related tables or droping the index).,"$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,RenderFieldMethodsString,* called on the NEW field if the field type is changed (BEFORE anything else is done).,"$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,_GetOpenWindowJS,"* picks a node from a tree, adds cms_portal_id to tree. +/*","$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,GetHTML,"* a number (int). +/*","$html = 'name).'"" name=""'.TGlobal::OutHTML($this->name).'"" value=""'.TGlobal::OutHTML($this->data).'"" />'; + + return $html;",- +TCMSFieldNumber,DataIsValid,"* 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","$bDataIsValid = parent::DataIsValid(); + if ($bDataIsValid) { + $iMaxFieldLength = $this->_GetFieldWidth(); + if (is_null($iMaxFieldLength) || empty($iMaxFieldLength)) { + $iMaxFieldLength = 20;",- +TCMSFieldNumber,HasContent,"* returns true if field data is not empty + * overwrite this method for mlt and property fields. + * + * @return bool","$bHasContent = false; + if ('' !== $this->data) { + $bHasContent = true;",- +TCMSFieldNumber,_GetFieldWidth,"* returns the length of a field + * sets field max-width and field CSS width. + * + * @return int","$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,GetHTML,"* an enum field. +/*","$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,CreateRelatedTables,"* indicates if GetHTML should render the form in read only mode. + * + * @var bool","$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,DeleteRelatedTables,"* SQL name of matrix table. + * + * @var string","// 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,GetSQL,"* 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","$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,GetReadOnly,"* 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.","$this->bReadOnlyMode = true; + $html = $this->GetHTML(); + + return $html;",- +TCMSFieldPortalLanguageMatrix,_GetHiddenField,"* render any methods for the auto list class for this field. + * + * @return string",return '';,- +TCMSFieldPortalLanguageMatrix,RenderFieldListMethodsString,"* changes an existing field definition (alter table). + * + * @param string $sOldName + * @param string $sNewName + * @param array|null $postData","$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,ChangeFieldDefinition,"* update default value of the field. + * + * @param string $sFieldDefaultValue + * @param string $sFieldName + * @param bool $bUpdateExistingRecords",,- +TCMSFieldPortalLanguageMatrix,CreateFieldDefinition,"* create a new field definition (alter table). + * + * @param bool $returnDDL + * @param TCMSField $oField + * + * @return string",return '';,- +TCMSFieldPortalLanguageMatrix,RemoveFieldIndex,* drops the field index.,,- +TCMSFieldPortalLanguageMatrix,CreateFieldIndex,"* sets field index if the field type is indexable. + * + * @param bool $returnDDL - if tre the SQL alter statement will be returned + * + * @return string","if ($returnDDL) { + return '';",- +TCMSFieldPortalLanguageMatrix,_GetSQLDefinition,"* generate the field definition part of the sql statement + * we assume that $oFieldDefinition holds the correct default value. + * + * @param array $fieldDefinition + * + * @return string",return '';,- +TCMSFieldPortalLanguageMatrix,HasContent,"* returns true if field data is not empty + * overwrite this method for mlt and property fields. + * + * @return bool","$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,GetHTML,"* std varchar text field (max 255 chars). +/*","$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,GetSQL,"* conf of the table holding the position field. + * + * @var TCMSTableConf","$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,DataIsValid,"* 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","$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,HasContent,"* returns true if field data is not empty + * overwrite this method for mlt and property fields. + * + * @return bool","$bHasContent = false; + if ('' != $this->data) { + $bHasContent = true;",- +TCMSFieldPropertyTable,__construct,"* 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).",$this->isPropertyField = true;,- +TCMSFieldPropertyTable,GetHTML,* view path for frontend.,"/** @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,GetPropertyTableName,@var TTableEditorListFieldState $stateContainer,"$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,DeleteFieldDefinition,"* generates the URL for the MLT iFrame List and returns the javascript method to open the iframe. + * + * @return string","$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,RenderFieldMethodsString,@var $oForeignTableConf TCMSTableConf,"$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,GetMatchingParentFieldName,"* returns the connected proprty table name. + * + * @return string","$sOwningField = $this->oDefinition->GetFieldtypeConfigKey('fieldNameInConnectedTable'); + if (null !== $sOwningField) { + return $sOwningField;",- +TCMSFieldPropertyTable,GetReadOnly,"* overwrite to delete the related items in the target table + * here we assume that $this->data is set!",return $this->GetHTML();,- +TCMSFieldPropertyTable,GetDisplayType,@var $oViewParser TViewParser,"$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,GetFieldNameForFieldFrontend,"* return the name of the matching parent field name in the target table. + * + * @return string",return TGlobal::OutHTML($oField->fieldTranslation);,- +TCMSFieldPropertyTable,PkgCmsFormPostSaveHook,"* 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","// ----------------------------------------------------------------------- + if (is_array($this->data) && array_key_exists('x', $this->data)) { + unset($this->data['x']);",- +TCMSFieldPropertyTable,GetPropertyTableNameFrontend,@var SecurityHelperAccess $securityHelper,"$sTableName = $this->oDefinition->GetFieldtypeConfigKey('connectedTableName'); + if (empty($sTableName)) { + if (!empty($this->oDefinition->sqlData['field_default_value'])) { + $sTableName = $this->oDefinition->sqlData['field_default_value'];",- +TCMSFieldPropertyTable,allowDeleteRecordReferences,@var SecurityHelperAccess $securityHelper,"$sPreventReferenceDeletion = $this->oDefinition->GetFieldtypeConfigKey('preventReferenceDeletion'); + $bAllowDeleteRecordReferences = true; + if ('true' === $sPreventReferenceDeletion) { + $bAllowDeleteRecordReferences = false;",- +TCMSFieldPropertyTable_CmsMedia,GetHTML,* {@inheritdoc},"$sImageControl = $this->GetImageControlButtons(); + + return $sImageControl.parent::GetHTML();",- +TCMSFieldPropertyTable_CmsMedia,ConfigShowCategorySelector,"* access via ConfigGetFieldMapping. + * + * @var array","$showCategorySelector = $this->oDefinition->GetFieldtypeConfigKey('bShowCategorySelector'); + + return '0' !== $showCategorySelector;",- +TCMSFieldPropertyTable_CmsMedia,ConfigGetDefaultCategoryId,"* access via GetDefaultValue. + * + * @var array",return $this->oDefinition->GetFieldtypeConfigKey('sDefaultCategoryId');,- +TCMSFieldPropertyTable_CmsMedia,_GetOpenUploadWindowJS,* max height of images uploaded in frontend.,"$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,GetCMSHtmlHeadIncludes,* max width of images uploaded in frontend.,"$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,ConnectImageObject,* view path for frontend.,"$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,PkgCmsFormPostSaveHook,* @return string,"if (is_array($this->data) && array_key_exists('x', $this->data)) { + unset($this->data['x']);",- +TCMSFieldPropertyTable_CmsMedia,PkgCmsFormDataIsValid,"* return true if the category selector should be shown. + * + * @return bool","static $bIsValid = null; + if (is_null($bIsValid)) { + if (is_array($this->data) && array_key_exists('x', $this->data)) { + unset($this->data['x']);",- +TCMSFieldPropertyTable_CmsMedia,PkgCmsFormTransformFormDataBeforeSave,"* return array mapping media fields to target table fields. + * + * @param string $sSourceField + * + * @return string|bool","$this->PkgCmsFormDataIsValid(); + if (is_array($this->data) && array_key_exists('x', $this->data)) { + unset($this->data['x']);",- +TCMSFieldPropertyTable_CmsMedia,UploadImage,"* @param string $sSourceField + * @param TCMSRecord $oSourceRecord + * + * @return string","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,GetHTML,"* varchar field with javascript to set the navigation url. +/*","parent::GetHTML(); + + $sourceFieldName = $this->oDefinition->GetFieldtypeConfigKey('sourcefieldname'); + + $html = parent::GetHTML(); + + if (!empty($sourceFieldName)) { + $html .= "" + '; + + return $aIncludes;",- +TCMSFieldVarchar,HasContent,* view path for frontend.,"$bHasContent = false; + if ('' != trim($this->data)) { + $bHasContent = true;",- +TCMSFieldVarcharUnique,GetSQLOnCopy,"* std varchar text field (max 255 chars and index unique). +/*","$sData = parent::GetSQLOnCopy().'_COPY'; + + return $sData;",- +TCMSFieldWYSIWYG,GetHTML,"* 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 + * + * /*","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,GetReadOnly,"* renders the read only view of the field. + * + * @return string","parent::GetReadOnly(); + $html = $this->GetHTML(); + + return $html;",- +TCMSFieldWYSIWYG,GetCMSHtmlHeadIncludes,* @return array,"$aIncludes = parent::GetCMSHtmlHeadIncludes(); + if (!is_array($aIncludes)) { + $aIncludes = array();",- +TCMSFieldWYSIWYG,_GetFieldWidth,* @return string,"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,__construct,* @return string,$this->isMLTField = true;,- +TCMSMLTField,getMltValues,* @return TCMSRecordList,"$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,"GetMLTTableName; + + /** + * @return TCMSRecordList + */ + abstract public function FetchMLTRecords; + + /** + *",* {@inheritdoc},@inheritdoc,- +TCMSMLTField,toString,"* @param string $tableName + * @param string $nameColumn + * + * @return string + * + * @throws ErrorException + * @throws TPkgCmsException_Log","if (!$this->data) { + return '';",- +TCMSMLTField,GetConnectedTableName,"* 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","$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,Rename,"* full image path. + * + * @var string","$sTarget = realpath($this->sDir.'/'.$sNewName); + + return $this->getFileManager()->move($this->sDir.'/'.$this->sFileName, $sTarget);",- +TCMSFile,GetURL,"* set to true if the file is on a remote server (ie http:// url is given). + * + * @var bool","$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,Load,"* return instance for file. + * + * @param string $sPath + * + * @return TCMSFile","$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,IsValidCMSImage,@var $oItem TCMSFile,"$allowedFileTypes = TCMSImage::GetAllowedMediaTypes(); + $bValidType = (in_array($this->sExtension, $allowedFileTypes)); + + if ($this->bIsHTTPResource) { + $bIsRGB = true;",- +TCMSFile,__construct,"* rename the file. + * + * @param string $sNewName + * + * @return bool",,- +TCMSFileList,Load,"* 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","$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,current: TCMSFile|bool,"* 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",return parent::Current();,- +TCMSFileList,next:TCMSFile|bool,"* return true if the string matches the pattern. + * + * @param string $sString + * @param string $sPattern - regex + * + * @return array|false",return parent::Next();,- +TCMSFileList,Previous,"* returns current item without moving the item pointer. + * + * @return TCMSFile",return parent::Previous();,- +TCMSFileList,Random,"* returns the current item in the list and advances the list pointer by 1. + * + * @return TCMSFile|false",return parent::Random();,- +TCMSGroupedStatistics,AddBlock,"* used to generate grouped statistics. +/*","$tRes = MySqlLegacySupport::getInstance()->query($sQuery); + $sMySqlError = MySqlLegacySupport::getInstance()->error(); + if (!empty($sMySqlError)) { + trigger_error('SQL Error: '.$sMySqlError, E_USER_WARNING);",- +TCMSGroupedStatistics,Render,@var $oView TViewParser,"$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,GetColumnNames,@var $oView TViewParser,"$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,GetTotalFor,"* init the object. + * + * @param string $sGroupTitle - name of the group + * @param string $sSubGroupColumn","if (array_key_exists($sColumnName, $this->aGroupTotals)) { + return $this->aGroupTotals[$sColumnName];",- +TCMSGroupedStatisticsGroup,GetGroupName,"* update the totals for the group. + * + * @param array $aDataRow",return $this->sGroupTitle;,- +TCMSGroupedStatisticsGroup,ReturnValueFor,"* add a column of data. + * + * @param array $aDataRow","if (array_key_exists($sColumnName, $this->aDataColumns)) { + return $this->aDataColumns[$sColumnName];",- +TCMSGroupedStatisticsGroup,GetMaxValue,"* returns the data columsn in the form array(array(field->val,field->val),array()..).",return max($this->aGroupTotals);,- +TCMSListManagerCMSUser,GetUserRestriction,* manages the webpage list (links to the template engine interface).,"$query = parent::GetUserRestriction(); + /** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + + if ($securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) { + return $query;",- +TCMSListManagerCMSUser,CallBackFunctionBlockDeleteButton,* show only records that belong to the user (if the table contains the user id).,"if (!$row['is_system']) { + return parent::CallBackFunctionBlockDeleteButton($id, $row);",- +TCMSListManagerCMSUser,callbackCmsUserWithImage: string,@var SecurityHelperAccess $securityHelper,"$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,_AddFunctionColumn,* add custom filter section.,,- +TCMSListManagerDocumentChooser,_GetRecordClickJavaScriptFunctionName,@var Request $request,return 'parent._SetDocument';,- +TCMSListManagerDocumentChooser,AddFields,* we need this to overwrite the standard function column.,"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,GetCustomRestriction,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","$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,AddTableGrouping,* add additional fields.,"$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,CallBackDocumentFileType,* restrict the list to show only images with given dimensions.,"$oFileDownload = new TCMSDownloadFile(); + /** @var $oFileDownload TCMSDownloadFile */ + $oFileDownload->Load($row['id']); + + $html = $oFileDownload->GetPlainFileTypeIcon(); + + return $html;",- +is,CreateTableObj,"* 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. +/*","parent::CreateTableObj(); + $this->tableObj->showRecordCount = 20;",- +is,_AddFunctionColumn,* overwrite table config.,,- +is,_GetRecordClickJavaScriptFunctionName,* we need this to overwrite the standard function column.,return 'parent.editFileDetails';,- +is,AddFields,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","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,GetCustomRestriction,* add additional fields.,"$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,GetHtmlHeadIncludes,@var BackendSessionInterface $backendSession,"$aIncludes = parent::GetHtmlHeadIncludes(); + $aIncludes[] = ''; + + return $aIncludes;",- +is,CallBackGenerateDownloadLink,"* any custom restrictions can be added to the query by overwriting this function. + * + * @param string $query","$oFile = new TCMSDownloadFile(); + /** @var $oFile TCMSDownloadFile */ + $oFile->Load($row['id']); + $sDownloadLink = $oFile->getDownloadHtmlTag(false, true, true); + + return $sDownloadLink;",- +is,CallBackDocumentSelectBox,"* returns a filetype icon that is linked with the download file. + * + * @param string $id + * @param array $row + * + * @return string","return ""tableObj->showRecordCount = 20;",- +is,_AddFunctionColumn,* overwrite table config.,,- +is,_GetRecordClickJavaScriptFunctionName,* we need this to overwrite the standard function column.,return 'parent.editFileDetails';,- +is,GetCustomRestriction,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","$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,AddFields,"* add MLT connection check. + * + * @param string $query","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,GetHtmlHeadIncludes,* add additional fields.,"$aIncludes = parent::GetHtmlHeadIncludes(); + $aIncludes[] = ''; + + return $aIncludes;",- +is,CallBackDocumentAssignedSelectBox,"* returns a checkbox field for assigned document file selection with javascript onlick. + * + * @param string $id + * @param array $row + * + * @return string","return ""Load($row['id']); + $sDownloadLink = $oFile->getDownloadHtmlTag(false, true, true); + + return $sDownloadLink;",- +used,Init,"* class used to display a list of a table. all list views must inherit from + * this class.",$this->oTableConf = $oTableConf;,- +used,IsMethodCallAllowed,"* table definition object. + * + * @var TdbCmsTblConf","$this->DefineInterface(); + $returnVal = false; + if (in_array($sMethodName, $this->methodCallAllowed)) { + $returnVal = true;",- +used,GetList,"* an iterator of the menu items for the table (new, export, etc). + * + * @var TIterator",return 'table';,- +used,CheckTableRights,"* set this to false if you want to prevent table list caching (session). + * + * @var bool","$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,FilterQuery,"* 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","// 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,ShowNewEntryButton,"* init the list class. + * + * @param TdbCmsTblConf $oTableConf",return true;,- +used,GetPortalRestriction,* sets methods that are allowed to be called via URL (ajax calls).,"$query = ''; + /** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + if (false === $securityHelper->isGranted(CmsUserRoleConstants::CMS_USER)) { + return false;",- +used,CreateRestriction,"* checks if method is listed in $this->methodCallAllowed array. + * + * @param string $sMethodName + * + * @return bool","return ""`{$this->oTableConf->sqlData['name']",- +used,GetUserRestriction,"* 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","$query = ''; + /** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + $userId = $securityHelper->getUser()?->getId(); + $userGroupIds = $securityHelper->getUser()?->getGroups(); + if (null === $userGroupIds) { + $userGroupIds = [];",- +used,GetCustomRestriction,"* checks if the user has the right to see the table list. + * + * @return bool","$query = ''; + + if (!empty($this->sRestrictionField) && !is_null($this->sRestriction)) { + $sourceID = $this->sRestriction; + $query .= $this->CreateRestriction($this->sRestrictionField, ""= '"".MySqlLegacySupport::getInstance()->real_escape_string($sourceID).""'"");",- +used,GetTableAlias,@var SecurityHelperAccess $securityHelper,"$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,GetMenuItems,"* generate the query for the current view. + * + * @return string","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,GetHtmlHeadIncludes,@var $oCustomRestriction TCMSTableConfRestriction,"$aIncludes = array(); + + return $aIncludes;",- +used,GetHiddenFieldsHook,"* Add Group By to the end of the query. + * + * @return string","$oGlobal = TGlobal::instance(); + $aAdditionalParameterData = array(); + $aAdditionalParameters = array('sRestrictionField', 'sRestriction', 'bIsLoadedFromIFrame'); + foreach ($aAdditionalParameters as $sKey) { + if ($oGlobal->UserDataExists($sKey)) { + $aAdditionalParameterData[$sKey] = $oGlobal->GetUserData($sKey);",- +TCMSListManagerExtendedLookup,_AddFunctionColumn,"* uses the TFullGroupTable to manage the list. +/*",,- +TCMSListManagerExtendedLookup,_GetRecordClickJavaScriptFunctionName,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","$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,ShowNewEntryButton,"* by returning false the ""new entry"" button in the list can be supressed. + * + * @return bool",return true;,- +TCMSListManagerExtendedLookupModuleInstance,_GetRecordClickJavaScriptFunctionName,"* 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",return 'selectModuleInstanceRecord';,- +TCMSListManagerFullGroupTable,Init,"* 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}","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,GetListCacheKey,"* holds the full group table object. + * + * @var TFullGroupTable",return TCacheManager::GetKey($this->GetCacheParameters());,- +TCMSListManagerFullGroupTable,GetList,"* Number of columns. + * + * @var int","$table = ''; + $table .= $this->tableObj->Display(); + + return $table;",- +TCMSListManagerFullGroupTable,CreateTableObj,* {@inheritdoc},"$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,getDisplayListFieldsConfig,* @return \Symfony\Component\HttpFoundation\Request,"$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,getDisplayListFieldConfig,"* returns a key that combines the different cache parameters to a unique key. + * + * @return string","$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,AddFields,"* returns the cache parameters needed for identification of the right cache object. + * + * @return array","$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,_AddFunctionColumn,@var SecurityHelperAccess $securityHelper,"++$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,AddTableGrouping,@var BackendSessionInterface $backendSession,"if (false === \property_exists($this->oTableConf, 'fieldListGroupField')) { + return;",- +TCMSListManagerFullGroupTable,AddSortInformation,"* returns the table as a HTML String. + * + * @return string","$oGlobal = TGlobal::instance(); + $postdata = $oGlobal->GetUserData(); + + $sListCacheKey = $this->GetListCacheKey(); + if (!array_key_exists('_listObjCache', $_SESSION)) { + $_SESSION['_listObjCache'] = array();",- +TCMSListManagerFullGroupTable,GetSortInfoAsString,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"$sSortOrder = ''; + $aOrderData = $this->tableObj->orderList; + foreach ($aOrderData as $field => $direction) { + if (!empty($sSortOrder)) { + $sSortOrder .= ', ';",- +TCMSListManagerFullGroupTable,CallBackLockingStatus,@var SecurityHelperAccess $securityHelper,"$userLock = TTools::IsRecordLocked($_SESSION['_tmpCurrentTableID'], $row['id']); + if (false === $userLock) { + return '';",- +TCMSListManagerFullGroupTable,CallBackFunctionBlock,* generates the tableobject assumes that all parameters are in post.,"$aFunctionItems = $this->getRowFunctionItems($id, $row); + + if (count($aFunctionItems) > 0) { + $returnValue = ' +
+
    + '; + + foreach ($aFunctionItems as $key => $item) { + if ('' === $item) { + continue;",- +TCMSListManagerFullGroupTable,CallBackFunctionBlockEditButton,@var BackendSessionInterface $backendSession,"$label = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.action.edit')); + + return '';",- +TCMSListManagerFullGroupTable,CallBackFunctionBlockCopyButton,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","$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,CallBackFunctionBlockDeleteButton,"* 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","$label = TGlobal::OutHTML(TGlobal::Translate('chameleon_system_core.action.delete')); + + return '';",- +TCMSListManagerFullGroupTable,CallBackImageWithZoom,"* 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","$oImage = new TCMSImage(); + /** @var $oImage TCMSImage */ + $oImage->Load($row['id']); + $image = ''; + + if ($oImage->IsExternalMovie()) { + $image = $oImage->renderImage(100, 75);",- +TCMSListManagerFullGroupTable,CallBackMediaSelectBox,* adds the field information of the table obj.,"$html = "" 25) { + $shortFilename = mb_substr($shortFilename, 0, 25).'...';",- +TCMSListManagerFullGroupTable,CallBackHumanRedableFileSize,* @var TCMSRecord $recordObject,"$fileSize = TCMSDownloadFile::GetHumanReadableFileSize($fileSize); + + return $fileSize;",- +TCMSListManagerFullGroupTable,CallBackDrawListItemSelectbox,* use this method to add field columns between the standard columns and the function column.,"$html = ''; + /** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + if ($securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->sqlData['name'])) { + $html = '';",- +TCMSListManagerFullGroupTable,CallBackRowStyling,"* 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",return '';,- +is,AddFields,"* 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. +/*","$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,GetCustomRestriction,* add the preview image.,"$query = ''; + $query .= parent::GetCustomRestriction(); + if (!empty($query)) { + $query .= ' AND ';",- +is,AddFields,"* 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. +/*","$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,GetCustomRestriction,* add the preview image.,"$query = parent::GetCustomRestriction(); + + if ('' !== $query) { + $query .= ' AND ';",- +is,AddFields,"* 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. +/*","$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,GetCustomRestriction,* add the preview image.,"$query = parent::GetCustomRestriction(); + if (!empty($query)) { + $query .= ' AND ';",- +is,_AddFunctionColumn,"* 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. +/*",,- +is,_GetRecordClickJavaScriptFunctionName,* we need this to overwrite the standard function column.,return 'parent.editFileDetails';,- +is,AddFields,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","++$this->columnCount; + $this->tableObj->AddHeaderField(array('id' => '#'), 'left', null, 1, false); + $this->tableObj->AddColumn('id', 'left', array($this, 'CallBackMediaSelectBox'), null, 1); + parent::AddFields();",- +TCMSListManagerMediaSelector,Init,"* default image for current position. + * + * @var TCMSImage","$this->oGlobal = TGlobal::instance(); + $this->oDefaultImage = $oImage; + + $tableConf = TdbCmsTblConf::GetNewInstance(); + $tableConf->LoadFromField('name', 'cms_media'); + + parent::Init($tableConf);",- +TCMSListManagerMediaSelector,CreateTableObj,"* TGlobal object. + * + * @var TGlobal","parent::CreateTableObj(); + + $this->tableObj->searchBoxContent = '';",- +TCMSListManagerMediaSelector,_AddFunctionColumn,* @param TCMSImage $oImage - the default image for the current selected position,,- +TCMSListManagerMediaSelector,_GetRecordClickJavaScriptFunctionName,* {@inheritdoc},return 'parent._SetImage';,- +TCMSListManagerMediaSelector,GetCacheParameters,* {@inheritdoc},"$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,GetCustomRestriction,* {@inheritdoc},"$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,AddTableGrouping,"* returns the cache parameters needed for identification of the right cache object. + * + * @return array","$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,CreateTableObj,"* uses the TFullGroupTable to manage the list. +/*","parent::CreateTableObj(); + $this->tableObj->showRecordCount = 10;",- +TCMSListManagerMLT,_AddFunctionColumn,"* Returns the name of the MLt field without source table name. + * Postfix _mlt was filtered. + * + * @return string","++$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,GetCustomRestriction,"* Returns the mlt table name. + * + * @return string","$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,CallBackMLTFunctionBlock,"* any custom restrictions can be added to the query by overwriting this function. + * + * @param string $query","return '';",- +TCMSListManagerMLT,AddSortInformation,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"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,IsCustomSort,"* displays the function icons (delete, copy, etc) for MLT table lists + * returns HTML. + * + * @param string $id + * @param array $row + * + * @return string","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,CreateTableObj,"* uses the TFullGroupTable to manage the list. +/*","parent::CreateTableObj(); + $this->tableObj->showRecordCount = 20;",- +TCMSListManagerMLTList,_AddFunctionColumn,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string",,- +TCMSListManagerMLTList,_GetRecordClickJavaScriptFunctionName,"* any custom restrictions can be added to the query by overwriting this function. + * + * @param string $query",return 'addMLTConnectionPassThrough';,- +TCMSListManagerMLTList,GetCustomRestriction,"* Returns the name of the MLt field without source table name. + * Postfix _mlt was filtered. + * + * @return string","$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,Init,"* array of allowed modules for the current spot. + * + * @var array","$tableConf = TdbCmsTblConf::GetNewInstance(); + $tableConf->LoadFromField('name', 'cms_tpl_module_instance'); + parent::Init($tableConf);",- +TCMSListManagerModuleInstanceEndPoint,_AddFunctionColumn,* {@inheritdoc},,- +TCMSListManagerModuleInstanceEndPoint,AddFields,"* by returning false the ""new entry"" button in the list can be supressed. + * + * @return bool","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,ShowNewEntryButton,"* Add custom joins to the query. + * + * @return string",return false;,- +TCMSListManagerModuleInstanceEndPoint,_GetRecordClickJavaScriptFunctionName,* any custom restrictions can be added to the query by overwriting this function.,return 'LoadCMSInstance';,- +TCMSListManagerModuleInstanceEndPoint,GetCustomRestriction,@var SecurityHelperAccess $securityHelper,"$query = parent::GetCustomRestriction(); + + /** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + + if (!empty($query)) { + $query .= ' AND ';",- +TCMSListManagerModuleInstanceEndPoint,CallBackTemplateEngineInstancePages,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"$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,GetPortalRestriction,"* manages the webpage list (links to the template engine interface). +/*","/** @var SecurityHelperAccess $securityHelper */ + $securityHelper = ServiceLocator::get(SecurityHelperAccess::class); + $portals = $securityHelper->getUser()?->getPortals(); + if (null === $portals) { + $portals = array();",- +TCMSListManagerPortalDomains,CallBackFunctionBlockDeleteButton,"* Allows deletion only if the domain is not the primary domain. + * + * @param string $id + * @param array $row + * + * @return string","if (false === $row['is_master_domain'] || '1' !== $row['is_master_domain']) { + return parent::CallBackFunctionBlockDeleteButton($id, $row);",- +TCMSListManagerTreeNode,_GetRecordClickJavaScriptFunctionName,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string",return 'openTreeNodeConnectionEditor';,- +TCMSListManagerTreeNode,GetHtmlHeadIncludes,"* 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","$aIncludes = parent::GetHtmlHeadIncludes(); + + if (is_null($this->sTreeNodeTableID)) { + $this->sTreeNodeTableID = TTools::GetCMSTableId('cms_tree_node');",- +TCMSListManagerTreeNode,CallBackActivationStatus,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"$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,AddSortInformation,@var SecurityHelperAccess $securityHelper,"parent::AddSortInformation(); + $this->tableObj->orderList['active'] = 'DESC'; + $this->tableObj->orderList['start_date'] = 'ASC';",- +TCMSListManagerWebpages,_AddFunctionColumn,"* manages the webpage list (links to the template engine interface). +/*","++$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,_GetRecordClickJavaScriptFunctionName,* overwrite the function column to use a class specific callback.,return 'OpenTemplateEngine';,- +is,_AddFunctionColumn,"* 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. +/*",,- +is,_GetRecordClickJavaScriptFunctionName,* we need this to overwrite the standard function column.,return 'parent.selectImage';,- +is,GetCustomRestriction,"* returns the name of the javascript function to be called when the user clicks on a + * record within the table. + * + * @return string","$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,AddTableGrouping,* add custom filter section.,"$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,__construct,"* holds memcache instance depending on what is available - for now only memcached. + * + * @var Memcached|null","$this->timeout = $timeout; + + $this->Init($memcacheClass); + + $serversToUseList = array(); + foreach ($serverList as $server) { + if (false !== $server['host']) { + $serversToUseList[] = $server;",- +TCMSMemcache,Init,"* enable or disable logging - log messages are written into normal log file (e.g. chameleon.log by default). + * + * @var bool",,- +TCMSMemcache,PostInit,"* 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","if (null === $this->oMemcache) { + trigger_error(""couldn't get memcached instance"", E_USER_ERROR);",- +TCMSMemcache,Set,* @var bool,"$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,setMulti,* @var int,"foreach ($aItems as $key => $item) { + $aItems[$key] = $this->processBeforeWrite($item);",- +TCMSMemcache,Replace,"* @param string $memcacheClass @deprecated since 6.2.0 - only Memcached is supported. + * @param int $timeout + * @param array $serverList","$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,Get,"* 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.","$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,Delete,"* 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.","$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,Flush,"* 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'","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,getDriver,"* returns a initialized TCMSMemcache object. + * + * @return TCMSMemcache + * + * @deprecated inject chameleon_system_cms_cache.memcache_cache instead",return $this->oMemcache;,- +TCMSMemcache,getLastGetRequestReturnedNoMatch,"* returns a initialized TCMSMemcache object. + * + * @return TCMSMemcache + * + * @deprecated inject chameleon_system_cms_cache.memcache_session instead",return $this->lastGetRequestReturnedNoMatch;,- +manages,AddMessage,"* 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 + * +/*","if (!array_key_exists($sConsumerName, $this->aMessages)) { + $this->aMessages[$sConsumerName] = new TIterator();",- +manages,ConsumeMessages,"* array of all messages. + * + * @var array","$oMessages = null; + if (array_key_exists($sConsumerName, $this->aMessages)) { + $oMessages = $this->aMessages[$sConsumerName]; + if ($bRemove) { + unset($this->aMessages[$sConsumerName]);",- +manages,RenderMessages,"* @param bool $bReload + * + * @return TCMSMessageManager + * + * @deprecated use the service chameleon_system_core.flash_messages instead","$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,ClearMessages,"* add a message code to the queue. + * + * @param string $sConsumerName + * @param string $sMessageCode + * @param array $aMessageCodeParameters","if (is_null($sConsumerName)) { + $this->aMessages = array();",- +manages,ConsumerHasMessages,@var $oMessage TdbCmsMessageManagerMessage,"$bHasMessages = false; + if ($this->ConsumerMessageCount($sConsumerName, $includeGlobal) > 0) { + $bHasMessages = true;",- +manages,ConsumerMessageCount,@var $oTmpTable TCMSRecordWritable,"$iMessageCount = 0; + if (true === $includeGlobal && array_key_exists(self::GLOBAL_CONSUMER_NAME, $this->aMessages)) { + $iMessageCount = $this->aMessages[self::GLOBAL_CONSUMER_NAME]->Length();",- +manages,TotalMessageCount,"* get description text for new created messages in the database. + * + * @param string $sConsumerName + * @param array $aMessageCodeParameters + * + * @return string","$iMessageCount = 0; + reset($this->aMessages); + foreach (array_keys($this->aMessages) as $sConsumer) { + $iMessageCount = $iMessageCount + $this->aMessages[$sConsumer]->Length();",- +manages,InjectMessageIntoString,"* get message text for new created messages in the database. + * + * @param string $sMessageCode + * + * @return string","// find out which items will be replaced + if (false === stripos($sText, '[{CMSMSG-')) { + return $sText;",- +manages,GetConsumerListWithMessages,"* add a message code to the queue of the backend message manager. + * + * @param string $sConsumerName + * @param string $sMessageCode + * @param array $aMessageCodeParameters",return array_keys($this->aMessages);,- +manages,GetClassesForConsumer,@var $oMessage TdbCmsMessageManagerBackendMessage,"$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,addBackendToasterMessage,@var $oTmpTable TCMSRecordWritable,"$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,"* 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","$oView = new TViewParser(); + + $sMessage = $this->GetMessageString(); + $oMessageType = TdbCmsMessageManagerMessageType::GetNewInstance(); + /** @var $oMessageType TdbCmsMessageManagerMessageType */ + if (!$oMessageType->Load($this->fieldCmsMessageManagerMessageTypeId)) { + $oMessageType = null;",- +TCMSMessageManagerBackendMessage,GetMessageString,@var $oMessageType TdbCmsMessageManagerMessageType,$matchString = '/\[\{(.*?)(:(string|number|date))*(:(.*?))*\,- +TCMSMessageManagerBackendMessage,SetMessageParameters,"* 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",$this->aMessageParameters = $aParameters;,- +TCMSMessageManagerBackendMessage,GetMessageParameters,"* return message string. + * + * @return string",return $this->aMessageParameters;,- +TCMSMessageManagerBackendMessage,__sleep,"* method called by the regex to replace the variables in the message string. + * + * @param unknown_type $aMatches + * + * @return unknown","return array('table', 'id', 'iLanguageId', 'aMessageParameters');",- +TCMSMessageManagerBackendMessage,__wakeup,"* an assoc array with parameters to be placed into the message. + * + * @param array $aParameters",$this->Load($this->id);,- +TCMSMessageManagerMessage,Render,"* optional variables that will be replaced in the message. + * + * @var array","$oView = new TViewParser(); + + $sMessage = $this->GetMessageString(); + $oMessageType = TdbCmsMessageManagerMessageType::GetNewInstance(); + /** @var $oMessageType TdbCmsMessageManagerMessageType */ + if (!$oMessageType->Load($this->fieldCmsMessageManagerMessageTypeId)) { + $oMessageType = null;",- +TCMSMessageManagerMessage,GetMessageString,"* 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","$sMessage = $this->fieldMessage; + $sMessage = nl2br($sMessage); + $matchString = '/\[\{(.*?)(:(string|number|date))*(:(.*?))*\",- +TCMSMessageManagerMessage,SetMessageParameters,@var $oMessageType TdbCmsMessageManagerMessageType,$this->aMessageParameters = $aParameters;,- +TCMSMessageManagerMessage,GetMessageParameters,"* 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",return $this->aMessageParameters;,- +TCMSMessageManagerMessage,__sleep,"* return message string. + * + * @return string","return array('table', 'id', 'iLanguageId', 'aMessageParameters');",- +TCMSMessageManagerMessage,__wakeup,"* method called by the regex to replace the variables in the message string. + * + * @param array $aMatches + * + * @return string",$this->Load($this->id);,- +AbstractTCMSMessageManagerMapper,GetRequirements,* {@inheritdoc},"$oRequirements->NeedsSourceObject('oMessageType', 'TdbCmsMessageManagerMessageType'); + $oRequirements->NeedsSourceObject('sMessage');",- +TCMSMessageManagerMapper,Accept,* {@inheritdoc},"/** @var $oMessageType TdbCmsMessageManagerMessageType */ + $oMessageType = $oVisitor->GetSourceObject('oMessageType'); + if ($oMessageType && $bCachingEnabled) { + $oCacheTriggerManager->addTrigger($oMessageType->table, $oMessageType->id);",- +TCMSMessageManagerMapper_Overlay,Accept,* {@inheritdoc},"$oVisitor->SetMappedValue('bShowAsOverlay', true);",- +TCMSSmartURLData,__isset,"* @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","$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,__get,"* 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","$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,GetCacheKeyParameters,"* all parameters generated via seo handler from the original url. + * + * @var array","$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,GetCacheTableInfos,"* 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","$aData = array(); + + $oPortal = $this->GetPortal(); + /** @var $oPortal TdbCmsPortal */ + if (!is_null($oPortal)) { + $aData[] = array('table' => 'cms_portal', 'id' => $oPortal->id);",- +TCMSSmartURLData,Init,"* returns an array of cache parameters to identify the object in cache. + * + * @return array",,- +TCMSSmartURLData,GetPortal,"* returns multidimensional array of tables and ids to use as cache delete triggers. + * + * @return array",return $this->getPortalDomainService()->getActivePortal();,- +TCMSSmartURLData,SetObjectInitializationCompleted,@var $oPortal TdbCmsPortal,$this->bObjectInitializationCompleted = $bObjectInitializationCompleted;,- +TCMSSmartURLData,IsObjectInitializationCompleted,"* get Portal or load Portal with portal id. + * + * return TdbCmsPortal|null + * + * @deprecated use chameleon_system_core.portal_domain_service::getActivePortal() instead",return $this->bObjectInitializationCompleted;,- +TCMSSmartURLData,getSeoURLParameters,"* return the user ip... (takes proxy forwarding into consideration). + * + * @return string + * + * @deprecated since 6.2.0 - use Request::getClientIp() instead.",return $this->seoURLParameters;,- +TCMSSmartURLData,setSeoURLParameters,"* set to true if all request processing has completed (ie. page is set, portal ist defined, language is defined, etc). + * + * @param bool $bObjectInitializationCompleted",$this->seoURLParameters = $seoURLParameters;,- +TCMSSmartURLHandler,"GetPageDef; + + /** + * @var Request + */ + private $request = null; + + /** + * @return Request + */ + protected function getRequest","* 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",return $this->request;,- +TCMSSmartURLHandler,setRequest,"* 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",$this->request = $request;,- +TCMSSmartURLHandler,__construct,"* 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",,- +TCMSSmartURLHandler_Document,GetPageDef,@var TdbCmsDocument $oDocument,"$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,GetPageDef,* @return PortalDomainServiceInterface,"$requestInfoService = \ChameleonSystem\CoreBundle\ServiceLocator::get('chameleon_system_core.request_info_service'); + + $requestURI = strtolower($requestInfoService->getPathInfoWithoutPortalAndLanguagePrefix()); + if ('/robots.txt' !== $requestURI) { + return false;",- +TCMSSpellcheck,Init,"* language object to us. + * + * @var TdbCmsLanguage",$this->oLanguage = self::getLanguageService()->getLanguage($iLanguageId);,- +TCMSSpellcheck,SuggestCorrection,"* return instance of spellchecker. + * + * @return TCMSSpellcheck","$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,DefineInterface,* set public methods here that may be called from outside.,"parent::DefineInterface(); + $this->methodCallAllowed[] = 'UpdateTranslationFields';",- +TCMSTableEditorCMSConfig,UpdateTranslationFields,* add table-specific buttons to the editor (add them directly to $this->oMenuItems).,"// 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,DefineInterface,"* add a menu item to switch to any user if the current user has that right. +/*","parent::DefineInterface(); + $externalFunctions = array('CopyUserRights', 'ActivateUser'); + $this->methodCallAllowed = array_merge($this->methodCallAllowed, $externalFunctions);",- +TCMSTableEditorCMSUser,AllowEdit,* change method so that the user name is not duplicated...,"// owner can always edit + if ($this->IsOwner($postData)) { + return true;",- +TCMSTableEditorCMSUser,CopyUserRights,* {@inheritdoc},"if (false === $this->isCopyPermissionsAllowed()) { + return;",- +TCMSTableEditorCMSUser,ActivateUser,* @return bool,"if (false === $this->isActivateUserAllowed()) { + return;",- +TCMSTableEditorCMSUser,GetHtmlHeadIncludes,@var SecurityHelperAccess $securityHelper,"$aIncludes = parent::GetHtmlHeadIncludes(); + $this->translator = $this->getTranslator(); + + $aIncludes[] = ""'; + $aIncludes[] = ''; + + $aIncludes[] = '