/**
  * Adds records to the export object for a specific page id.
  *
  * @param int $pid Page id for which to select records to add
  * @param array $tables Array of table names to select from
  * @return void
  */
 protected function addRecordsForPid($pid, array $tables)
 {
     foreach ($GLOBALS['TCA'] as $table => $value) {
         if ($table != 'pages' && (in_array($table, $tables) || in_array('_ALL', $tables))) {
             if ($GLOBALS['BE_USER']->check('tables_select', $table) && !$GLOBALS['TCA'][$table]['ctrl']['is_static']) {
                 $orderBy = $GLOBALS['TCA'][$table]['ctrl']['sortby'] ? 'ORDER BY ' . $GLOBALS['TCA'][$table]['ctrl']['sortby'] : $GLOBALS['TCA'][$table]['ctrl']['default_sortby'];
                 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'pid = ' . (int) $pid . BackendUtility::deleteClause($table), '', $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy));
                 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                     $this->export->export_addRecord($table, $row);
                 }
             }
         }
     }
 }
 /**
  * Adds records to the export object for a specific page id.
  *
  * @param int $k Page id for which to select records to add
  * @param array $tables Array of table names to select from
  * @param int $maxNumber Max amount of records to select
  * @return void
  */
 public function addRecordsForPid($k, $tables, $maxNumber)
 {
     if (!is_array($tables)) {
         return;
     }
     $db = $this->getDatabaseConnection();
     foreach ($GLOBALS['TCA'] as $table => $value) {
         if ($table != 'pages' && (in_array($table, $tables) || in_array('_ALL', $tables))) {
             if ($this->getBackendUser()->check('tables_select', $table) && !$GLOBALS['TCA'][$table]['ctrl']['is_static']) {
                 $res = $this->exec_listQueryPid($table, $k, MathUtility::forceIntegerInRange($maxNumber, 1));
                 while ($subTrow = $db->sql_fetch_assoc($res)) {
                     $this->export->export_addRecord($table, $subTrow);
                 }
                 $db->sql_free_result($res);
             }
         }
     }
 }
Example #3
0
 /**
  * Init the object
  *
  * @param bool $dontCompress If set, compression of t3d files is disabled
  * @return void
  */
 public function init($dontCompress = false)
 {
     parent::init();
     $this->dontCompress = $dontCompress;
     $this->mode = 'export';
 }
Example #4
0
 /**
  * Init the object
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->mode = 'import';
 }
 /**
  * Set up for set up the backend user, initialize the language object
  * and creating the ImportExport instance
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->import = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Impexp\\ImportExport');
     $this->import->init(0, 'import');
 }
 /**
  * Set up for initialization of the ImportExport instance
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->import = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\ImportExport::class);
     $this->import->init(0, 'import');
 }