/**
     * Action to create a list of records of a specific table and pid
     *
     * @param array $record sys_action record
     * @return string list of records
     */
    protected function viewRecordList($record)
    {
        $content = '';
        $this->id = (int) $record['t3_listPid'];
        $this->table = $record['t3_tables'];
        if ($this->id == 0) {
            $this->addMessage($this->getLanguageService()->getLL('action_notReady'), $this->getLanguageService()->getLL('action_error'), FlashMessage::ERROR);
            $content .= $this->renderFlashMessages();
            return $content;
        }
        // Loading current page record and checking access:
        $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->taskObject->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        // If there is access to the page, then render the list contents and set up the document template object:
        if ($access) {
            // Initialize the dblist object:
            $dblist = GeneralUtility::makeInstance(\TYPO3\CMS\SysAction\ActionList::class);
            $dblist->script = GeneralUtility::getIndpEnv('REQUEST_URI');
            $dblist->calcPerms = $this->getBackendUser()->calcPerms($this->pageinfo);
            $dblist->thumbs = $this->getBackendUser()->uc['thumbnailsByDefault'];
            $dblist->returnUrl = $this->taskObject->returnUrl;
            $dblist->allFields = 1;
            $dblist->localizationView = 1;
            $dblist->showClipboard = 0;
            $dblist->disableSingleTableView = 1;
            $dblist->pageRow = $this->pageinfo;
            $dblist->counter++;
            $dblist->MOD_MENU = array('bigControlPanel' => '', 'clipBoard' => '', 'localization' => '');
            $dblist->modTSconfig = $this->taskObject->modTSconfig;
            $dblist->dontShowClipControlPanels = !$this->taskObject->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current == 'normal' && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];
            // Initialize the listing object, dblist, for rendering the list:
            $this->pointer = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(GeneralUtility::_GP('pointer'), 0, 100000);
            $dblist->start($this->id, $this->table, $this->pointer, $this->taskObject->search_field, $this->taskObject->search_levels, $this->taskObject->showLimit);
            $dblist->setDispFields();
            // Render the list of tables:
            $dblist->generateList();
            // Add JavaScript functions to the page:
            $this->taskObject->getModuleTemplate()->addJavaScriptCode('ActionTaskInlineJavascript', '

				function jumpExt(URL,anchor) {
					var anc = anchor?anchor:"";
					window.location.href = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
					return false;
				}
				function jumpSelf(URL) {
					window.location.href = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
					return false;
				}

				function setHighlight(id) {
					top.fsMod.recentIds["web"]=id;
					top.fsMod.navFrameHighlightedID["web"]="pages"+id+"_"+top.fsMod.currentBank;	// For highlighting

					if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
						top.content.nav_frame.refresh_nav();
					}
				}

				' . $dblist->CBfunctions() . '
				function editRecords(table,idList,addParams,CBflag) {
					window.location.href="' . BackendUtility::getModuleUrl('record_edit', array('returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'))) . '&edit["+table+"]["+idList+"]=edit"+addParams;
				}
				function editList(table,idList) {
					var list="";

						// Checking how many is checked, how many is not
					var pointer=0;
					var pos = idList.indexOf(",");
					while (pos!=-1) {
						if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
							list+=idList.substr(pointer,pos-pointer)+",";
						}
						pointer=pos+1;
						pos = idList.indexOf(",",pointer);
					}
					if (cbValue(table+"|"+idList.substr(pointer))) {
						list+=idList.substr(pointer)+",";
					}

					return list ? list : idList;
				}
				T3_THIS_LOCATION = ' . GeneralUtility::quoteJSvalue(rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . ';

				if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int) $this->id . ';
			');
            // Setting up the context sensitive menu:
            $this->taskObject->getModuleTemplate()->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
            // Begin to compile the whole page
            $content .= '<form action="' . htmlspecialchars($dblist->listURL()) . '" method="post" name="dblistForm">' . $dblist->HTMLcode . '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" />
						</form>';
            // If a listing was produced, create the page footer with search form etc:
            // Making field select box (when extended view for a single table is enabled):
            if ($dblist->HTMLcode && $dblist->table) {
                $content .= $dblist->fieldSelectBox($dblist->table);
            }
        } else {
            // Not enough rights to access the list view or the page
            $this->addMessage($this->getLanguageService()->getLL('action_error-access'), $this->getLanguageService()->getLL('action_error'), FlashMessage::ERROR);
            $content .= $this->renderFlashMessages();
        }
        return $content;
    }