/**
  * MAIN function for page information display (including hit statistics)
  *
  * @return	string		Output HTML for the module.
  */
 function main()
 {
     global $BACK_PATH, $LANG, $SOBE;
     $dblist = t3lib_div::makeInstance('tx_cms_layout');
     $dblist->descrTable = '_MOD_' . $GLOBALS['MCONF']['name'];
     $dblist->backPath = $BACK_PATH;
     $dblist->thumbs = 0;
     $dblist->script = 'index.php';
     $dblist->showIcon = 0;
     $dblist->setLMargin = 0;
     $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
     $dblist->pI_showUser = 1;
     $dblist->pI_showStat = 0;
     // PAGES:
     $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
     // ONLY for the sake of dblist module which uses this value.
     $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
     if ($this->pObj->MOD_SETTINGS['function'] == 'tx_cms_webinfo_hits') {
         $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[stat_type]', $this->pObj->MOD_SETTINGS['stat_type'], $this->pObj->MOD_MENU['stat_type'], 'index.php');
         if ($this->pObj->MOD_SETTINGS['stat_type'] == 1) {
             $dblist->stat_select_field = 'rl0';
         }
         if ($this->pObj->MOD_SETTINGS['stat_type'] == 2) {
             $dblist->stat_select_field = 'rl1';
         }
         // Timespan
         for ($a = 0; $a < 30; $a++) {
             $dblist->stat_codes[] = 'HITS_days:' . -$a;
         }
         $timespan_b = mktime(0, 0, 0);
         $timespan_e = mktime(0, 0, 0) - (30 - 1) * 3600 * 24 + 1;
         $header = '<br />' . sprintf($LANG->getLL('stat_period'), t3lib_BEfunc::date($timespan_b), t3lib_BEfunc::date($timespan_e)) . '<br />';
         //
         $dblist->start($this->pObj->id, 'pages', 0);
         $dblist->pages_noEditColumns = 1;
         $dblist->generateList();
         $theOutput .= $this->pObj->doc->section($LANG->getLL('hits_title'), t3lib_BEfunc::cshItem($dblist->descrTable, 'stat', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $header . $dblist->HTMLcode, 0, 1);
     } else {
         $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages'], 'index.php');
         $dblist->start($this->pObj->id, 'pages', 0);
         $dblist->generateList();
         // CSH
         $theOutput .= $this->pObj->doc->section($LANG->getLL('page_title'), t3lib_BEfunc::cshItem($dblist->descrTable, 'pagetree_overview', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $dblist->HTMLcode, 0, 1);
         // SYS_NOTES:
         if (t3lib_extMgm::isLoaded('sys_note')) {
             $dblist->start($this->pObj->id, 'sys_note', 0);
             $dblist->generateList();
             if ($dblist->HTMLcode) {
                 $theOutput .= $this->pObj->doc->spacer(10);
                 $theOutput .= $this->pObj->doc->section($LANG->getLL('page_sysnote'), $dblist->HTMLcode, 0, 1);
             }
         }
         // PAGE INFORMATION
         if ($this->pObj->pageinfo['uid']) {
             $theOutput .= $this->pObj->doc->spacer(10);
             $theOutput .= $this->pObj->doc->section($LANG->getLL('pageInformation'), $dblist->getPageInfoBox($this->pObj->pageinfo, $this->pObj->CALC_PERMS & 2), 0, 1);
         }
     }
     return $theOutput;
 }
    /**
     * Creates an info-box for the current page (identified by input record).
     *
     * @param	array		Page record
     * @param	boolean		If set, there will be shown an edit icon, linking to editing of the page properties.
     * @return	string		HTML for the box.
     */
    function getPageInfoBox($rec, $edit = 0)
    {
        global $LANG;
        // If editing of the page properties is allowed:
        if ($edit) {
            $params = '&edit[pages][' . $rec['uid'] . ']=edit';
            $editIcon = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->backPath)) . '" title="' . $GLOBALS['LANG']->getLL('edit', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
        } else {
            $editIcon = $this->noEditIcon('noEditPage');
        }
        // Setting page icon, link, title:
        $outPutContent = t3lib_iconWorks::getSpriteIconForRecord('pages', $rec, array('title' => t3lib_BEfunc::titleAttribForPages($rec))) . $editIcon . '&nbsp;' . htmlspecialchars($rec['title']);
        // Init array where infomation is accumulated as label/value pairs.
        $lines = array();
        // Owner user/group:
        if ($this->pI_showUser) {
            // User:
            $users = t3lib_BEfunc::getUserNames('username,usergroup,usergroup_cached_list,uid,realName');
            $groupArray = explode(',', $GLOBALS['BE_USER']->user['usergroup_cached_list']);
            $users = t3lib_BEfunc::blindUserNames($users, $groupArray);
            $lines[] = array($LANG->getLL('pI_crUser') . ':', htmlspecialchars($users[$rec['cruser_id']]['username']) . ' (' . $users[$rec['cruser_id']]['realName'] . ')');
        }
        // Created:
        $lines[] = array($LANG->getLL('pI_crDate') . ':', t3lib_BEfunc::datetime($rec['crdate']) . ' (' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $rec['crdate'], $this->agePrefixes) . ')');
        // Last change:
        $lines[] = array($LANG->getLL('pI_lastChange') . ':', t3lib_BEfunc::datetime($rec['tstamp']) . ' (' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $rec['tstamp'], $this->agePrefixes) . ')');
        // Last change of content:
        if ($rec['SYS_LASTCHANGED']) {
            $lines[] = array($LANG->getLL('pI_lastChangeContent') . ':', t3lib_BEfunc::datetime($rec['SYS_LASTCHANGED']) . ' (' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $rec['SYS_LASTCHANGED'], $this->agePrefixes) . ')');
        }
        // Spacer:
        $lines[] = '';
        // Display contents of certain page fields, if any value:
        $dfields = explode(',', 'alias,target,hidden,starttime,endtime,fe_group,no_cache,cache_timeout,newUntil,lastUpdated,subtitle,keywords,description,abstract,author,author_email');
        foreach ($dfields as $fV) {
            if ($rec[$fV]) {
                $lines[] = array($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages', $fV)), t3lib_BEfunc::getProcessedValue('pages', $fV, $rec[$fV]));
            }
        }
        // Page hits (depends on "sys_stat" extension)
        if ($this->pI_showStat && t3lib_extMgm::isLoaded('sys_stat')) {
            // Counting total hits:
            $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'sys_stat', 'page_id=' . intval($rec['uid']));
            if ($count) {
                // Get min/max
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('min(tstamp) AS min,max(tstamp) AS max', 'sys_stat', 'page_id=' . intval($rec['uid']));
                $rrow2 = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                $lines[] = '';
                $lines[] = array($LANG->getLL('pI_hitsPeriod') . ':', t3lib_BEfunc::date($rrow2[0]) . ' - ' . t3lib_BEfunc::date($rrow2[1]) . ' (' . t3lib_BEfunc::calcAge($rrow2[1] - $rrow2[0], $this->agePrefixes) . ')');
                $lines[] = array($LANG->getLL('pI_hitsTotal') . ':', $rrow[0]);
                // Last 10 days
                $nextMidNight = mktime(0, 0, 0) + 1 * 3600 * 24;
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*), FLOOR((' . $nextMidNight . '-tstamp)/(24*3600)) AS day', 'sys_stat', 'page_id=' . intval($rec['uid']) . ' AND tstamp>' . ($nextMidNight - 10 * 24 * 3600), 'day');
                $days = array();
                while ($rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
                    $days[$rrow[1]] = $rrow[0];
                }
                $headerH = array();
                $contentH = array();
                for ($a = 9; $a >= 0; $a--) {
                    $headerH[] = '
							<td class="bgColor5" nowrap="nowrap">&nbsp;' . date('d', $nextMidNight - ($a + 1) * 24 * 3600) . '&nbsp;</td>';
                    $contentH[] = '
							<td align="center">' . ($days[$a] ? intval($days[$a]) : '-') . '</td>';
                }
                // Compile first hit-table (last 10 days)
                $hitTable = '
					<table border="0" cellpadding="0" cellspacing="1" class="typo3-page-hits">
						<tr>' . implode('', $headerH) . '</tr>
						<tr>' . implode('', $contentH) . '</tr>
					</table>';
                $lines[] = array($LANG->getLL('pI_hits10days') . ':', $hitTable, 1);
                // Last 24 hours
                $nextHour = mktime(date('H'), 0, 0) + 3600;
                $hours = 16;
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*), FLOOR((' . $nextHour . '-tstamp)/3600) AS hours', 'sys_stat', 'page_id=' . intval($rec['uid']) . ' AND tstamp>' . ($nextHour - $hours * 3600), 'hours');
                $days = array();
                while ($rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
                    $days[$rrow[1]] = $rrow[0];
                }
                $headerH = array();
                $contentH = array();
                for ($a = $hours - 1; $a >= 0; $a--) {
                    $headerH[] = '
							<td class="bgColor5" nowrap="nowrap">&nbsp;' . intval(date('H', $nextHour - ($a + 1) * 3600)) . '&nbsp;</td>';
                    $contentH[] = '
							<td align="center">' . ($days[$a] ? intval($days[$a]) : '-') . '</td>';
                }
                // Compile second hit-table (last 24 hours)
                $hitTable = '
					<table border="0" cellpadding="0" cellspacing="1" class="typo3-page-stat">
						<tr>' . implode('', $headerH) . '</tr>
						<tr>' . implode('', $contentH) . '</tr>
					</table>';
                $lines[] = array($LANG->getLL('pI_hits24hours') . ':', $hitTable, 1);
            }
        }
        // Finally, wrap the elements in the $lines array in table cells/rows
        foreach ($lines as $fV) {
            if (is_array($fV)) {
                if (!$fV[2]) {
                    $fV[1] = htmlspecialchars($fV[1]);
                }
                $out .= '
				<tr>
					<td class="bgColor4" nowrap="nowrap"><strong>' . htmlspecialchars($fV[0]) . '&nbsp;&nbsp;</strong></td>
					<td class="bgColor4">' . $fV[1] . '</td>
				</tr>';
            } else {
                $out .= '
				<tr>
					<td colspan="2"><img src="clear.gif" width="1" height="3" alt="" /></td>
				</tr>';
            }
        }
        // Wrap table tags around...
        $outPutContent .= '



			<!--
				Page info box:
			-->
			<table border="0" cellpadding="0" cellspacing="1" id="typo3-page-info">
				' . $out . '
			</table>';
        // ... and return it.
        return $outPutContent;
    }
    /**
     * Rendering the table icons
     *
     * @return	string		HTML
     */
    function renderTableIcons()
    {
        if (is_array($GLOBALS['TCA'][$this->tableName])) {
            // Set the default:
            $this->testRecords = array();
            $this->testRecords[] = array();
            $tableCols = array();
            // Set hidden:
            if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['disabled'] && $this->optionsMatrix['Hidden']) {
                $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['disabled'] => 1));
                $tableCols['Hidden'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['disabled'];
            }
            // Set starttime:
            if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['starttime'] && $this->optionsMatrix['Starttime']) {
                $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['starttime'] => time() + 60));
                $tableCols['Starttime'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['starttime'];
            }
            // Set endtime:
            if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'] && $this->optionsMatrix['Endtime']) {
                $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'] => time() + 60));
                /*				$this->addTestRecordFields(array(
                					$GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'] => time() - 60
                				));
                	*/
                $tableCols['Endtime'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['endtime'];
            }
            // Set fe_group:
            if ($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['fe_group'] && $this->optionsMatrix['Access']) {
                $this->addTestRecordFields(array($GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['fe_group'] => 1));
                $tableCols['Access'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['enablecolumns']['fe_group'];
            }
            // If "pages" table, add "extendToSubpages"
            if ($this->tableName == 'pages' && $this->optionsMatrix['Incl.Sub']) {
                $this->addTestRecordFields(array('extendToSubpages' => 1));
                $tableCols['Incl.Sub'] = 'extendToSubpages';
            }
            // Set "delete" flag:
            if ($GLOBALS['TCA'][$this->tableName]['ctrl']['delete'] && $this->optionsMatrix['Del.']) {
                $this->testRecords[] = array($GLOBALS['TCA'][$this->tableName]['ctrl']['delete'] => 1);
                $tableCols['Del.'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['delete'];
            }
            // _NO_ICON_FOUND
            if ($this->optionsMatrix['_NO_ICON_FOUND']) {
                $this->testRecords[] = array('_NO_ICON_FOUND' => 1);
            }
            if ($this->tableName == 'pages') {
                $tempArray = array();
                if ($this->optionsMatrix['Doktype']) {
                    foreach ($GLOBALS['PAGES_TYPES'] as $doktype => $dat) {
                        if ($dat['icon']) {
                            foreach ($this->testRecords as $rec) {
                                $tempArray[] = array_merge($rec, array('doktype' => $doktype));
                            }
                        }
                    }
                    $tableCols['Doktype'] = 'doktype';
                }
                if ($this->optionsMatrix['Module']) {
                    foreach ($GLOBALS['ICON_TYPES'] as $module => $dat) {
                        if ($dat['icon']) {
                            foreach ($this->testRecords as $rec) {
                                $tempArray[] = array_merge($rec, array('module' => $module));
                            }
                        }
                    }
                    $tableCols['Module'] = 'module';
                }
                $this->testRecords = array_merge($tempArray, $this->testRecords);
            } elseif (is_array($GLOBALS['TCA'][$this->tableName]['ctrl']['typeicons']) && $this->optionsMatrix['TypeIcon']) {
                $tempArray = array();
                foreach ($GLOBALS['TCA'][$this->tableName]['ctrl']['typeicons'] as $typeVal => $dat) {
                    foreach ($this->testRecords as $rec) {
                        $tempArray[] = array_merge($rec, array($GLOBALS['TCA'][$this->tableName]['ctrl']['typeicon_column'] => $typeVal));
                    }
                }
                $tableCols['TypeIcon'] = $GLOBALS['TCA'][$this->tableName]['ctrl']['typeicon_column'];
                $this->testRecords = array_merge($tempArray, $this->testRecords);
            }
            // Render table:
            $tRows = array();
            $sortRows = array();
            // Draw header:
            $tCells = array();
            $tCells[] = 'Icon:';
            $tCells[] = 'Name:';
            foreach ($tableCols as $label => $field) {
                $tCells[] = $label . ':';
            }
            $tRows[] = '
				<tr class="bgColor5" style="font-weight: bold;">
					<td>' . implode('</td>
					<td>', $tCells) . '</td>
				</tr>';
            // Traverse fake records, render icons:
            foreach ($this->testRecords as $row) {
                $tCells = array();
                $icon = t3lib_iconWorks::getIconImage($this->tableName, $row, $GLOBALS['BACK_PATH']);
                $tCells[] = $icon;
                $attrib = t3lib_div::get_tag_attributes($icon);
                $fileName = substr($attrib['src'], strlen($GLOBALS['BACK_PATH']));
                $tCells[] = $fileName;
                $sortRows[] = $fileName;
                foreach ($tableCols as $label => $field) {
                    switch ($label) {
                        case 'Hidden':
                        case 'Access':
                        case 'Del.':
                        case 'Incl.Sub':
                            $tCells[] = $row[$field] ? 'YES' : '';
                            break;
                        case 'Endtime':
                        case 'Starttime':
                            $tCells[] = $row[$field] ? t3lib_BEfunc::date($row[$field]) : '';
                            break;
                        default:
                            $tCells[] = $row[$field];
                            break;
                    }
                }
                $tRows[] = '
					<tr class="bgColor4">
						<td>' . implode('</td>
						<td>', $tCells) . '</td>
					</tr>';
            }
            // Create table with icons:
            $output = $this->tableName . ':
				<table border="0" cellpadding="0" cellspacing="1">
					' . implode('', $tRows) . '
				</table>';
            // Show unique filenames involved:
            sort($sortRows);
            $sortRows = array_unique($sortRows);
            $output .= '<br /><p><strong>Unique icons:</strong></p>' . count($sortRows);
            $output .= '<br/><br/>';
            $output .= '<p><strong>Filenames:</strong></p>' . Tx_Extdeveval_Compatibility::viewArray($sortRows);
            // DEVELOPMENT purposes, do NOT rename if you don't know what you are doing!
            #$this->renameIconsInTypo3Temp();
        }
        return $output;
    }
    /**
     * Draws the preview content for a content element
     *
     * @param	string		Content element
     * @param	boolean		Set if the RTE link can be created.
     * @return	string		HTML
     */
    function tt_content_drawItem($row, $isRTE = FALSE)
    {
        global $TCA;
        $out = '';
        $outHeader = '';
        // Make header:
        if ($row['header'] && $row['header_layout'] != 100) {
            $infoArr = array();
            $this->getProcessedValue('tt_content', 'header_position,header_layout,header_link', $row, $infoArr);
            $outHeader = ($row['date'] ? htmlspecialchars($this->itemLabels['date'] . ' ' . t3lib_BEfunc::date($row['date'])) . '<br />' : '') . $this->infoGif($infoArr) . '<b>' . $this->linkEditContent($this->renderText($row['header']), $row) . '</b><br />';
        }
        // Make content:
        $infoArr = array();
        switch ($row['CType']) {
            case 'header':
                if ($row['subheader']) {
                    $this->getProcessedValue('tt_content', 'layout', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['subheader']), $row) . '<br />';
                }
                break;
            case 'text':
            case 'textpic':
            case 'image':
                if ($row['CType'] == 'text' || $row['CType'] == 'textpic') {
                    if ($row['bodytext']) {
                        $this->getProcessedValue('tt_content', 'text_align,text_face,text_size,text_color,text_properties', $row, $infoArr);
                        $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                    }
                }
                if ($row['CType'] == 'textpic' || $row['CType'] == 'image') {
                    if ($row['image']) {
                        $infoArr = array();
                        $this->getProcessedValue('tt_content', 'imageorient,imagecols,image_noRows,imageborder,imageheight,image_link,image_zoom,image_compression,image_effects,image_frames', $row, $infoArr);
                        $out .= $this->infoGif($infoArr) . $this->thumbCode($row, 'tt_content', 'image') . '<br />';
                        if ($row['imagecaption']) {
                            $infoArr = array();
                            $this->getProcessedValue('tt_content', 'imagecaption_position', $row, $infoArr);
                            $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['imagecaption']), $row) . '<br />';
                        }
                    }
                    ###########
                    if ($row['tx_damttcontent_files']) {
                        require_once PATH_txdam . 'lib/class.tx_dam_image.php';
                        require_once PATH_txdam . 'lib/class.tx_dam_tcefunc.php';
                        require_once PATH_txdam . 'lib/class.tx_dam_guifunc.php';
                        $config = $TCA['tt_content']['columns']['tx_damttcontent_files']['config'];
                        if ($GLOBALS['BE_USER']->workspace !== 0) {
                            $workspaceRecord = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, 'tt_content', $row['uid']);
                            if ($workspaceRecord) {
                                $row = $workspaceRecord;
                            }
                        }
                        $filesArray = tx_dam_db::getReferencedFiles('tt_content', $row['uid'], $config['MM_match_fields'], $config['MM'], 'tx_dam.*');
                        foreach ($filesArray['rows'] as $rowDAM) {
                            $caption = tx_dam_guiFunc::meta_compileInfoData($rowDAM, '_caption:truncate:100', 'value-string');
                            #$imgAttributes['title'] = tx_dam_guiFunc::meta_compileHoverText($rowDAM);
                            #$thumb = tx_dam_image::previewImgTag($rowDAM, '', $imgAttributes);
                            $thumb = tx_dam_guiFunc::thumbnail($rowDAM);
                            $thumb = '<div style="float:left;width:56px; overflow:auto; margin: 2px 5px 2px 0; padding: 5px; background-color:#fff; border:solid 1px #ccc;">' . $thumb . '</div>';
                            $thumb = '<div>' . $thumb . $caption . '</div><div style="clear:both"></div>';
                            $out .= $thumb;
                        }
                    }
                    #############
                }
                break;
            case 'bullets':
                if ($row['bodytext']) {
                    $this->getProcessedValue('tt_content', 'layout,text_align,text_face,text_size,text_color,text_properties', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                }
                break;
            case 'table':
                if ($row['bodytext']) {
                    $this->getProcessedValue('tt_content', 'table_bgColor,table_border,table_cellspacing,cols,layout,text_align,text_face,text_size,text_color,text_properties', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                }
                break;
            case 'uploads':
                if ($row['media']) {
                    $this->getProcessedValue('tt_content', 'media,select_key,layout,filelink_size,table_bgColor,table_border,table_cellspacing', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                }
                break;
            case 'multimedia':
                if ($row['multimedia']) {
                    $out .= $this->renderText($row['multimedia']) . '<br />';
                    $out .= $this->renderText($row['parameters']) . '<br />';
                }
                break;
            case 'mailform':
                if ($row['bodytext']) {
                    $this->getProcessedValue('tt_content', 'pages,subheader', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                }
                break;
            case 'splash':
                if ($row['bodytext']) {
                    $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                }
                if ($row['image']) {
                    $infoArr = array();
                    $this->getProcessedValue('tt_content', 'imagewidth', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->thumbCode($row, 'tt_content', 'image') . '<br />';
                }
                break;
            case 'menu':
                if ($row['pages']) {
                    $this->getProcessedValue('tt_content', 'menu_type', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($row['pages'], $row) . '<br />';
                }
                break;
            case 'shortcut':
                if ($row['records']) {
                    $this->getProcessedValue('tt_content', 'layout', $row, $infoArr);
                    $out .= $this->infoGif($infoArr) . $this->linkEditContent($row['shortcut'], $row) . '<br />';
                }
                break;
            case 'list':
                $this->getProcessedValue('tt_content', 'layout', $row, $infoArr);
                $out .= $this->infoGif($infoArr) . $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content', 'list_type'), 1) . ' ' . $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type']), 1) . '<br />';
                $out .= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content', 'select_key'), 1) . ' ' . $row['select_key'] . '<br />';
                $infoArr = array();
                $this->getProcessedValue('tt_content', 'recursive', $row, $infoArr);
                $out .= $this->infoGif($infoArr) . $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'pages', $row['pages']), 1) . '<br />';
                break;
            case 'script':
                $out .= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content', 'select_key'), 1) . ' ' . $row['select_key'] . '<br />';
                $out .= '<br />' . $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                $out .= '<br />' . $this->linkEditContent($this->renderText($row['imagecaption']), $row) . '<br />';
                break;
            default:
                if ($row['bodytext']) {
                    $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                }
                break;
        }
        // Wrap span-tags:
        $out = '
			<span class="exampleContent">' . $out . '</span>';
        // Add header:
        $out = $outHeader . $out;
        // Add RTE button:
        if ($isRTE) {
            $out .= $this->linkRTEbutton($row);
        }
        // Return values:
        if ($this->isDisabled('tt_content', $row)) {
            return $GLOBALS['TBE_TEMPLATE']->dfw($out);
        } else {
            return $out;
        }
    }