/**
  * Builds a data map by adding column maps for all the configured columns in the $TCA.
  * It also resolves the type of values the column is holding and the typo of relation the column
  * represents.
  *
  * @param string $className The class name you want to fetch the Data Map for
  * @return Tx_Extbase_Persistence_Mapper_DataMap The data map
  */
 public function buildDataMap($className)
 {
     if (!class_exists($className)) {
         throw new Tx_Extbase_Persistence_Exception_InvalidClass('Could not find class definition for name "' . $className . '". This could be caused by a mis-spelling of the class name in the class definition.');
     }
     $recordType = NULL;
     $subclasses = array();
     $tableName = strtolower($className);
     $columnMapping = array();
     $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     $classSettings = $extbaseFrameworkConfiguration['persistence']['classes'][$className];
     if ($classSettings !== NULL) {
         if (isset($classSettings['subclasses']) && is_array($classSettings['subclasses'])) {
             $subclasses = $classSettings['subclasses'];
         }
         if (isset($classSettings['mapping']['recordType']) && strlen($classSettings['mapping']['recordType']) > 0) {
             $recordType = $classSettings['mapping']['recordType'];
         }
         if (isset($classSettings['mapping']['tableName']) && strlen($classSettings['mapping']['tableName']) > 0) {
             $tableName = $classSettings['mapping']['tableName'];
         }
         $classHierachy = array_merge(array($className), class_parents($className));
         foreach ($classHierachy as $currentClassName) {
             if (in_array($currentClassName, array('Tx_Extbase_DomainObject_AbstractEntity', 'Tx_Extbase_DomainObject_AbstractValueObject'))) {
                 break;
             }
             $currentTableName = strtolower($currentClassName);
             $currentClassSettings = $extbaseFrameworkConfiguration['persistence']['classes'][$currentClassName];
             if ($currentClassSettings !== NULL) {
                 if (isset($currentClassSettings['mapping']['columns']) && is_array($currentClassSettings['mapping']['columns'])) {
                     $columnMapping = t3lib_div::array_merge_recursive_overrule($columnMapping, $currentClassSettings['mapping']['columns'], 0, FALSE);
                     // FALSE means: do not include empty values form 2nd array
                 }
             }
         }
     }
     $dataMap = t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMap', $className, $tableName, $recordType, $subclasses);
     $dataMap = $this->addMetaDataColumnNames($dataMap, $tableName);
     // $classPropertyNames = $this->reflectionService->getClassPropertyNames($className);
     $tcaColumnsDefinition = $this->getColumnsDefinition($tableName);
     $tcaColumnsDefinition = t3lib_div::array_merge_recursive_overrule($tcaColumnsDefinition, $columnMapping);
     // TODO Is this is too powerful?
     foreach ($tcaColumnsDefinition as $columnName => $columnDefinition) {
         if (isset($columnDefinition['mapOnProperty'])) {
             $propertyName = $columnDefinition['mapOnProperty'];
         } else {
             $propertyName = Tx_Extbase_Utility_Extension::convertUnderscoredToLowerCamelCase($columnName);
         }
         // if (in_array($propertyName, $classPropertyNames)) { // TODO Enable check for property existance
         $columnMap = new Tx_Extbase_Persistence_Mapper_ColumnMap($columnName, $propertyName);
         $propertyMetaData = $this->reflectionService->getClassSchema($className)->getProperty($propertyName);
         $columnMap = $this->setRelations($columnMap, $columnDefinition['config'], $propertyMetaData);
         $dataMap->addColumnMap($columnMap);
         // }
     }
     // debug($dataMap);
     return $dataMap;
 }
 /**
  * Constructs the Property Mapper.
  */
 public function __construct()
 {
     // TODO Clean up this dependencies; inject the instance
     $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_Manager');
     $this->validatorResolver = t3lib_div::makeInstance('Tx_Extbase_Validation_ValidatorResolver');
     $this->validatorResolver->injectObjectManager($objectManager);
     $this->persistenceManager = Tx_Extbase_Dispatcher::getPersistenceManager();
     $this->queryFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QueryFactory');
 }
 /**
  * Constructs a new Repository
  *
  */
 public function __construct()
 {
     $this->identityMap = t3lib_div::makeInstance('Tx_Extbase_Persistence_IdentityMap');
     $this->addedObjects = new Tx_Extbase_Persistence_ObjectStorage();
     $this->removedObjects = new Tx_Extbase_Persistence_ObjectStorage();
     $this->queryFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QueryFactory');
     // singleton
     $this->persistenceManager = Tx_Extbase_Dispatcher::getPersistenceManager();
     $this->persistenceManager->registerRepositoryClassName($this->getRepositoryClassName());
     $this->objectType = str_replace(array('_Repository_', 'Repository'), array('_Model_', ''), $this->getRepositoryClassName());
 }
 /**
  * Constructor. Used to create an instance of tslib_cObj used by the render() method.
  *
  * @param tslib_cObj $contentObject injector for tslib_cObj (optional)
  * @param array $typoScriptSetup global TypoScript setup (optional)
  * @return void
  * @author Bastian Waidelich <*****@*****.**>
  */
 public function __construct($contentObject = NULL, array $typoScriptSetup = NULL)
 {
     $this->contentObject = $contentObject !== NULL ? $contentObject : t3lib_div::makeInstance('tslib_cObj');
     if ($typoScriptSetup !== NULL) {
         $this->typoScriptSetup = $typoScriptSetup;
     } else {
         $configurationManager = Tx_Extbase_Dispatcher::getConfigurationManager();
         $this->typoScriptSetup = $configurationManager->loadTypoScriptSetup();
     }
     if (TYPO3_MODE === 'BE') {
         // this is a hacky work around to enable this view helper for backend mode
         $GLOBALS['TSFE']->cObjectDepthCounter = 100;
     }
 }
 /**
  * Populate this proxy by asking the $population closure.
  *
  * @return object The instance (hopefully) returned
  */
 public function _loadRealInstance()
 {
     // this check safeguards against a proxy being activated multiple times
     // usually that does not happen, but if the proxy is held from outside
     // it's parent... the result would be weird.
     if ($this->parentObject->_getProperty($this->propertyName) instanceof Tx_Extbase_Persistence_LazyLoadingProxy) {
         $dataMapper = Tx_Extbase_Dispatcher::getPersistenceManager()->getBackend()->getDataMapper();
         $objects = $dataMapper->fetchRelated($this->parentObject, $this->propertyName, $this->fieldValue, FALSE, FALSE);
         $propertyValue = $dataMapper->mapResultToPropertyValue($this->parentObject, $this->propertyName, $objects);
         $this->parentObject->_setProperty($this->propertyName, $propertyValue);
         $this->parentObject->_memorizeCleanState($this->propertyName);
         return $propertyValue;
     } else {
         return $this->parentObject->_getProperty($this->propertyName);
     }
 }
 /**
  * Creates a query object working on the given class name
  *
  * @param string $className The class name
  * @return Tx_Extbase_Persistence_QueryInterface
  */
 public function create($className)
 {
     $persistenceManager = Tx_Extbase_Dispatcher::getPersistenceManager();
     $reflectionService = $persistenceManager->getBackend()->getReflectionService();
     $dataMapFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMapFactory');
     $dataMapFactory->injectReflectionService($reflectionService);
     $dataMapper = t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMapper');
     $dataMapper->injectIdentityMap($persistenceManager->getBackend()->getIdentityMap());
     $dataMapper->injectSession($persistenceManager->getSession());
     $dataMapper->injectReflectionService($reflectionService);
     $dataMapper->injectDataMapFactory($dataMapFactory);
     $querySettings = t3lib_div::makeInstance('Tx_Extbase_Persistence_Typo3QuerySettings');
     $query = t3lib_div::makeInstance('Tx_Extbase_Persistence_Query', $className);
     $query->injectPersistenceManager($persistenceManager);
     $query->injectDataMapper($dataMapper);
     $query->setQuerySettings($querySettings);
     return $query;
 }
 /**
  * @see Classes/MVC/Controller/Tx_Extbase_MVC_Controller_ActionController::initializeView()
  */
 protected function initializeView($view)
 {
     /* set the template and partial path
      * 
      * this was added due to a bug. If the default action (dispatcher) was called, it created
      * Tx_CzSimpleCal_View_EventIndex_Dispatch but did not set the templateRoot (only the
      * discarded Template view had it). So we do it here.
      */
     if ($view instanceof Tx_Fluid_View_TemplateViewInterface) {
         $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
         if (isset($extbaseFrameworkConfiguration['view']['templateRootPath']) && strlen($extbaseFrameworkConfiguration['view']['templateRootPath']) > 0) {
             $view->setTemplateRootPath(t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']));
         }
         if (isset($extbaseFrameworkConfiguration['view']['layoutRootPath']) && strlen($extbaseFrameworkConfiguration['view']['layoutRootPath']) > 0) {
             $view->setLayoutRootPath(t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['layoutRootPath']));
         }
         if (isset($extbaseFrameworkConfiguration['view']['partialRootPath']) && strlen($extbaseFrameworkConfiguration['view']['partialRootPath']) > 0) {
             $view->setPartialRootPath(t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['partialRootPath']));
         }
     }
     $view->assign('actionSettings', $this->actionSettings);
 }
 /**
  * Injects the Persistence Manager
  *
  * @param Tx_Extbase_Persistence_Manager An instance of the Persistence Manager
  * @return void
  */
 public function injectPersistenceManager(Tx_Extbase_Persistence_Manager $persistenceManager)
 {
     self::$persistenceManager = $persistenceManager;
 }
 /**
  * Get the name of the cache row identifier. Incorporates the extension name
  * and the plugin name so that all information which is needed for a single
  * plugin can be found in one cache row.
  *
  * @return string
  */
 protected function getCacheKey()
 {
     $frameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     return $frameworkConfiguration['extensionName'] . '_' . $frameworkConfiguration['pluginName'];
 }
 /**
  * Clear the TYPO3 page cache for the given record.
  * If the record lies on a page, then we clear the cache of this page.
  * If the record has no PID column, we clear the cache of the current page as best-effort.
  *
  * Much of this functionality is taken from t3lib_tcemain::clear_cache() which unfortunately only works with logged-in BE user.
  *
  * @param $tableName Table name of the record
  * @param $uid UID of the record
  * @return void
  */
 protected function clearPageCache($tableName, $uid)
 {
     $extbaseSettings = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     if (isset($extbaseSettings['persistence']['enableAutomaticCacheClearing']) && $extbaseSettings['persistence']['enableAutomaticCacheClearing'] === '1') {
     } else {
         // if disabled, return
         return;
     }
     $pageIdsToClear = array();
     $storagePage = NULL;
     $columns = $this->databaseHandle->admin_get_fields($tableName);
     if (array_key_exists('pid', $columns)) {
         $result = $this->databaseHandle->exec_SELECTquery('pid', $tableName, 'uid=' . intval($uid));
         if ($row = $this->databaseHandle->sql_fetch_assoc($result)) {
             $storagePage = $row['pid'];
             $pageIdsToClear[] = $storagePage;
         }
     } elseif (isset($GLOBALS['TSFE'])) {
         // No PID column - we can do a best-effort to clear the cache of the current page if in FE
         $storagePage = $GLOBALS['TSFE']->id;
         $pageIdsToClear[] = $storagePage;
     }
     if ($storagePage === NULL) {
         return;
     }
     if (!isset($this->pageTSConfigCache[$storagePage])) {
         $this->pageTSConfigCache[$storagePage] = t3lib_BEfunc::getPagesTSconfig($storagePage);
     }
     if (isset($this->pageTSConfigCache[$storagePage]['TCEMAIN.']['clearCacheCmd'])) {
         $clearCacheCommands = t3lib_div::trimExplode(',', strtolower($this->pageTSConfigCache[$storagePage]['TCEMAIN.']['clearCacheCmd']), 1);
         $clearCacheCommands = array_unique($clearCacheCommands);
         foreach ($clearCacheCommands as $clearCacheCommand) {
             if (t3lib_div::testInt($clearCacheCommand)) {
                 $pageIdsToClear[] = $clearCacheCommand;
             }
         }
     }
     // TODO check if we can hand this over to the Dispatcher to clear the page only once, this will save around 10% time while inserting and updating
     Tx_Extbase_Utility_Cache::clearPageCache($pageIdsToClear);
 }
 /**
  * Determine the storage page ID for a given NEW record
  *
  * This does the following:
  * - If there is a TypoScript configuration "classes.CLASSNAME.newRecordStoragePid", that is used to store new records.
  * - If there is no such TypoScript configuration, it uses the first value of The "storagePid" taken for reading records.
  *
  * @param Tx_Extbase_DomainObject_DomainObjectInterface $object
  * @return int the storage Page ID where the object should be stored
  */
 protected function determineStoragePageIdForNewRecord(Tx_Extbase_DomainObject_DomainObjectInterface $object = NULL)
 {
     $extbaseSettings = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     if ($object !== NULL) {
         $className = get_class($object);
         if (isset($extbaseSettings['persistence']['classes'][$className]) && !empty($extbaseSettings['persistence']['classes'][$className]['newRecordStoragePid'])) {
             return (int) $extbaseSettings['persistence']['classes'][$className]['newRecordStoragePid'];
         }
     }
     $storagePidList = t3lib_div::intExplode(',', $extbaseSettings['persistence']['storagePid']);
     return (int) $storagePidList[0];
 }
 /**
  * Initialize the flash message
  */
 protected function initialize()
 {
     if ($this->initialized) {
         return;
     }
     $frameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     $this->flashMessageStorageKey = 'Tx_Extbase_MVC_Controller_FlashMessages_messages_' . $frameworkConfiguration['extensionName'] . $frameworkConfiguration['pluginName'];
     $flashMessages = $this->loadFlashMessagesFromSession();
     if (is_array($flashMessages)) {
         $this->flashMessages = $flashMessages;
     }
     $this->initialized = TRUE;
 }
 /**
  * Initializes objects this class depends on
  *
  * @return void
  */
 protected function initializeObjects()
 {
     $this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_Manager');
     $this->arguments = t3lib_div::makeInstance('Tx_Extbase_MVC_Controller_Arguments');
     $this->arguments->injectPersistenceManager(Tx_Extbase_Dispatcher::getPersistenceManager());
     $this->arguments->injectQueryFactory(t3lib_div::makeInstance('Tx_Extbase_Persistence_QueryFactory'));
 }
 /**
  * Overwrites labels that are set via typoscript.
  * TS locallang labels have to be configured like:
  * plugin.tx_myextension._LOCAL_LANG.languageKey.key = value
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  * @author Bastian Waidelich <*****@*****.**>
  */
 protected function loadTypoScriptLabels($extensionName)
 {
     $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     if (!is_array($extbaseFrameworkConfiguration['_LOCAL_LANG'])) {
         return;
     }
     foreach ($extbaseFrameworkConfiguration['_LOCAL_LANG'] as $languageKey => $labels) {
         if (!is_array($labels)) {
             continue;
         }
         foreach ($labels as $labelKey => $labelValue) {
             if (is_string($labelValue)) {
                 self::$LOCAL_LANG[$extensionName][$languageKey][$labelKey] = $labelValue;
                 // For labels coming from the TypoScript (database) the charset is assumed to be "forceCharset" and if that is not set, assumed to be that of the individual system languages
                 if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) && strlen($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) > 0) {
                     self::$LOCAL_LANG_charset[$extensionName][$languageKey][$labelKey] = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
                 } elseif (is_object($GLOBALS['LANG'])) {
                     self::$LOCAL_LANG_charset[$extensionName][$languageKey][$labelKey] = $GLOBALS['LANG']->csConvObj->charSetArray[$languageKey];
                 } else {
                     self::$LOCAL_LANG_charset[$extensionName][$languageKey][$labelKey] = $GLOBALS['TSFE']->csConvObj->charSetArray[$languageKey];
                 }
             }
         }
     }
 }
 /**
  * Counts the elements in the storage array
  *
  * @return int The number of elements in the ObjectStorage
  */
 public function count()
 {
     $dataMapper = Tx_Extbase_Dispatcher::getPersistenceManager()->getBackend()->getDataMapper();
     $columnMap = $dataMapper->getDataMap(get_class($this->parentObject))->getColumnMap($this->propertyName);
     $numberOfElements = NULL;
     if ($columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY) {
         $numberOfElements = $dataMapper->countRelated($this->parentObject, $this->propertyName, $this->fieldValue);
     } else {
         $this->initialize();
         $numberOfElements = count($this->storage);
     }
     if (is_null($numberOfElements)) {
         throw new Tx_Extbase_Persistence_Exception('The number of elements could not be determined.', 1252514486);
     }
     return $numberOfElements;
 }
 /**
  * This function prepares and returns the Persistance Manager
  *
  * @return Tx_Extbase_Persistence_Manager A (singleton) instance of the Persistence Manager
  */
 public static function getPersistenceManager()
 {
     if (self::$persistenceManager === NULL) {
         $identityMap = t3lib_div::makeInstance('Tx_Extbase_Persistence_IdentityMap');
         $persistenceSession = t3lib_div::makeInstance('Tx_Extbase_Persistence_Session');
         // singleton
         $dataMapFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMapFactory');
         $dataMapFactory->injectReflectionService(self::$reflectionService);
         $dataMapper = t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMapper');
         // singleton
         $dataMapper->injectIdentityMap($identityMap);
         $dataMapper->injectSession($persistenceSession);
         $dataMapper->injectReflectionService(self::$reflectionService);
         $dataMapper->injectDataMapFactory($dataMapFactory);
         $storageBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3DbBackend', $GLOBALS['TYPO3_DB']);
         // singleton
         $storageBackend->injectDataMapper($dataMapper);
         $qomFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_QueryObjectModelFactory', $storageBackend);
         $dataMapper->setQomFactory($qomFactory);
         $persistenceBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Backend', $persistenceSession, $storageBackend);
         // singleton
         $persistenceBackend->injectDataMapper($dataMapper);
         $persistenceBackend->injectIdentityMap($identityMap);
         $persistenceBackend->injectReflectionService(self::$reflectionService);
         $persistenceBackend->injectQueryFactory(t3lib_div::makeInstance('Tx_Extbase_Persistence_QueryFactory'));
         $persistenceBackend->injectQomFactory($qomFactory);
         $objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_Manager');
         // singleton
         $persistenceManager = t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager');
         // singleton
         $persistenceManager->injectBackend($persistenceBackend);
         $persistenceManager->injectSession($persistenceSession);
         $persistenceManager->injectObjectManager($objectManager);
         self::$persistenceManager = $persistenceManager;
     }
     return self::$persistenceManager;
 }
 /**
  * Clear cache of current page on error. Needed because we want a re-evaluation of the data.
  * Better would be just do delete the cache for the error action, but that is not possible right now.
  *
  * @return void
  */
 protected function clearCacheOnError()
 {
     $extbaseSettings = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
     if (isset($extbaseSettings['persistence']['enableAutomaticCacheClearing']) && $extbaseSettings['persistence']['enableAutomaticCacheClearing'] === '1') {
         if (isset($GLOBALS['TSFE'])) {
             $pageUid = $GLOBALS['TSFE']->id;
             Tx_Extbase_Utility_Cache::clearPageCache(array($pageUid));
         }
     }
 }
 /**
  * Renders a record list as known from the TYPO3 list module
  * Note: This feature is experimental!
  *
  * @param string $tableName name of the database table
  * @param array $fieldList list of fields to be displayed. If empty, only the title column (configured in $TCA[$tableName]['ctrl']['title']) is shown
  * @param integer $storagePid by default, records are fetched from the storage PID configured in persistence.storagePid. With this argument, the storage PID can be overwritten
  * @param integer $levels corresponds to the level selector of the TYPO3 list module. By default only records from the current storagePid are fetched
  * @param string $filter corresponds to the "Search String" textbox of the TYPO3 list module. If not empty, only records matching the string will be fetched
  * @param integer $recordsPerPage amount of records to be displayed at once. Defaults to $TCA[$tableName]['interface']['maxSingleDBListItems'] or (if that's not set) to 100
  * @param string $sortField table field to sort the results by
  * @param boolean $sortDescending if TRUE records will be sorted in descending order
  * @param boolean $readOnly if TRUE, the edit icons won't be shown. Otherwise edit icons will be shown, if the current BE user has edit rights for the specified table!
  * @param boolean $enableClickMenu enables context menu
  * @param string $clickTitleMode one of "edit", "show" (only pages, tt_content), "info"
  * @param boolean $alternateBackgroundColors if set, rows will have alternate background colors
  * @return string the rendered record list
  * @see localRecordList
  */
 public function render($tableName, array $fieldList = array(), $storagePid = NULL, $levels = 0, $filter = '', $recordsPerPage = 0, $sortField = '', $sortDescending = FALSE, $readOnly = FALSE, $enableClickMenu = TRUE, $clickTitleMode = NULL, $alternateBackgroundColors = FALSE)
 {
     $pageinfo = t3lib_BEfunc::readPageAccess(t3lib_div::_GP('id'), $GLOBALS['BE_USER']->getPagePermsClause(1));
     $dblist = t3lib_div::makeInstance('localRecordList');
     $dblist->backPath = $GLOBALS['BACK_PATH'];
     $dblist->pageRow = $pageinfo;
     if ($readOnly === FALSE) {
         $dblist->calcPerms = $GLOBALS['BE_USER']->calcPerms($pageinfo);
     }
     $dblist->showClipboard = FALSE;
     $dblist->disableSingleTableView = TRUE;
     $dblist->clickTitleMode = $clickTitleMode;
     $dblist->alternateBgColors = $alternateBackgroundColors;
     $dblist->clickMenuEnabled = $enableClickMenu;
     if ($storagePid === NULL) {
         $frameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
         $storagePid = $frameworkConfiguration['persistence']['storagePid'];
     }
     $dblist->start($storagePid, $tableName, (int) t3lib_div::_GP('pointer'), $filter, $levels, $recordsPerPage);
     $dblist->allFields = TRUE;
     $dblist->dontShowClipControlPanels = TRUE;
     $dblist->displayFields = FALSE;
     $dblist->setFields = array($tableName => $fieldList);
     $dblist->noControlPanels = TRUE;
     $dblist->sortField = $sortField;
     $dblist->sortRev = $sortDescending;
     $dblist->script = $_SERVER['REQUEST_URI'];
     $dblist->generateList();
     return $dblist->HTMLcode;
 }