/**
  * (non-PHPdoc)
  * @see classes/preview/tx_templavoila_preview_type_text#getPreviewData($row)
  */
 protected function getPreviewData($row)
 {
     $extraInfo = $this->getExtraInfo($row);
     $this->parentObj = $ref;
     $info = htmlspecialchars($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type'])));
     $info .= $extraInfo ? ' – ' . $extraInfo : '';
     return $info;
 }
 /**
  * (non-PHPdoc)
  * @see classes/preview/tx_templavoila_preview_type_text#getPreviewData($row)
  */
 protected function getPreviewData($row)
 {
     return $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', $this->previewField, $row[$this->previewField]));
 }
Example #3
0
 /**
  * Creates the overview information based on which analysis topics were selected.
  *
  * @param	array		Array of analysis topics
  * @param	array		Array of the selected analysis topics (from session variable somewhere)
  * @param	boolean		If set, the full trees of pages/folders are printed.
  * @return	array		Array with accumulated HTML content.
  */
 function ext_printOverview($uInfo, $compareFlags, $printTrees = 0)
 {
     // Prepare for filemount and db-mount
     if ($printTrees) {
         // ... this is if we see the detailed view for a user:
         // Page tree object:
         $pagetree = t3lib_div::makeInstance(!$this->isAdmin() ? 'printAllPageTree_perms' : 'printAllPageTree', $this, $this->returnWebmounts());
         // Here, only readable webmounts are returned (1=1)
         $pagetree->addField('perms_user', 1);
         $pagetree->addField('perms_group', 1);
         $pagetree->addField('perms_everybody', 1);
         $pagetree->addField('perms_userid', 1);
         $pagetree->addField('perms_groupid', 1);
         $pagetree->addField('editlock', 1);
         // Folder tree object:
         $foldertree = t3lib_div::makeInstance('printAllFolderTree', $this, $this->returnFilemounts());
     } else {
         // Page tree object:
         $pagetree = t3lib_div::makeInstance('localPageTree', $this, $this->returnWebmounts('1=1'));
         // Here, ALL webmounts are returned (1=1)
         // Folder tree object:
         $foldertree = t3lib_div::makeInstance('localFolderTree', $this, $this->returnFilemounts());
     }
     // Names for modules:
     $modNames = array('web' => 'Web', 'web_layout' => 'Page', 'web_modules' => 'Modules', 'web_info' => 'Info', 'web_perms' => 'Access', 'web_func' => 'Func', 'web_list' => 'List', 'web_ts' => 'Template', 'file' => 'File', 'file_list' => 'List', 'file_images' => 'Images', 'doc' => 'Doc.', 'help' => 'Help', 'help_about' => 'About', 'help_quick' => 'User manual', 'help_welcome' => 'Welcome', 'user' => 'User', 'user_setup' => 'Setup', 'user_task' => 'Task center');
     // Traverse the enabled analysis topics:
     $out = array();
     foreach ($uInfo as $k => $v) {
         if ($compareFlags[$k]) {
             switch ($k) {
                 case 'filemounts':
                     $out[$k] = $foldertree->getBrowsableTree();
                     break;
                 case 'webmounts':
                     // Print webmounts:
                     $pagetree->addSelfId = 1;
                     $out[$k] = $this->ext_non_readAccessPages();
                     // Add HTML for non-readable webmounts (only shown when viewing details of a user - in overview/comparison ALL mounts are shown)
                     $out[$k] .= $pagetree->getBrowsableTree();
                     // Add HTML for readable webmounts.
                     $this->ext_pageIdsFromMounts = implode(',', array_unique($pagetree->ids));
                     // List of mounted page ids
                     break;
                 case 'tempPath':
                     $out[$k] = $GLOBALS['SOBE']->localPath($v);
                     break;
                 case 'pagetypes_select':
                     $pageTypes = explode(',', $v);
                     foreach ($pageTypes as &$vv) {
                         $vv = $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('pages', 'doktype', $vv));
                     }
                     $out[$k] = implode('<br />', $pageTypes);
                     break;
                 case 'tables_select':
                 case 'tables_modify':
                     $tables = explode(',', $v);
                     foreach ($tables as &$vv) {
                         if ($vv) {
                             $vv = '<span class="nobr">' . t3lib_iconWorks::getSpriteIconForRecord($vv, array()) . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$vv]['ctrl']['title']) . '</span>';
                         }
                     }
                     $out[$k] = implode('<br />', $tables);
                     break;
                 case 'non_exclude_fields':
                     $nef = explode(',', $v);
                     $table = '';
                     $pout = array();
                     foreach ($nef as $vv) {
                         if ($vv) {
                             list($thisTable, $field) = explode(':', $vv);
                             if ($thisTable != $table) {
                                 $table = $thisTable;
                                 t3lib_div::loadTCA($table);
                                 $pout[] = '<span class="nobr">' . t3lib_iconWorks::getSpriteIconForRecord($table, array()) . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']) . '</span>';
                             }
                             if ($GLOBALS['TCA'][$table]['columns'][$field]) {
                                 $pout[] = '<span class="nobr"> - ' . rtrim($GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label']), ':') . '</span>';
                             }
                         }
                     }
                     $out[$k] = implode('<br />', $pout);
                     break;
                 case 'groupList':
                 case 'firstMainGroup':
                     $uGroups = explode(',', $v);
                     $table = '';
                     $pout = array();
                     foreach ($uGroups as $vv) {
                         if ($vv) {
                             $uGRow = t3lib_BEfunc::getRecord('be_groups', $vv);
                             $pout[] = '<tr><td nowrap="nowrap">' . t3lib_iconWorks::getSpriteIconForRecord('be_groups', $uGRow) . '&nbsp;' . htmlspecialchars($uGRow['title']) . '&nbsp;&nbsp;</td><td width=1% nowrap="nowrap">' . $GLOBALS['SOBE']->elementLinks('be_groups', $uGRow) . '</td></tr>';
                         }
                     }
                     $out[$k] = '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . implode('', $pout) . '</table>';
                     break;
                 case 'modules':
                     $mods = explode(',', $v);
                     $mainMod = '';
                     $pout = array();
                     foreach ($mods as $vv) {
                         if ($vv) {
                             list($thisMod, $subMod) = explode('_', $vv);
                             if ($thisMod != $mainMod) {
                                 $mainMod = $thisMod;
                                 $pout[] = '<span class="nobr">' . ($modNames[$mainMod] ? $modNames[$mainMod] : $mainMod) . '</span>';
                             }
                             if ($subMod) {
                                 $pout[] = '<span class="nobr"> - ' . ($modNames[$mainMod . '_' . $subMod] ? $modNames[$mainMod . '_' . $subMod] : $mainMod . '_' . $subMod) . '</span>';
                             }
                         }
                     }
                     $out[$k] = implode('<br />', $pout);
                     break;
                 case 'userTS':
                     $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
                     // Defined global here!
                     $tmpl->tt_track = 0;
                     // Do not log time-performance information
                     $tmpl->fixedLgd = 0;
                     $tmpl->linkObjects = 0;
                     $tmpl->bType = '';
                     $tmpl->ext_expandAllNotes = 1;
                     $tmpl->ext_noPMicons = 1;
                     $out[$k] = $tmpl->ext_getObjTree($v, '', '', '', '', '1');
                     break;
                 case 'userTS_hl':
                     $tsparser = t3lib_div::makeInstance('t3lib_TSparser');
                     $tsparser->lineNumberOffset = 0;
                     $out[$k] = $tsparser->doSyntaxHighlight($v, 0, 1);
                     break;
                 case 'explicit_allowdeny':
                     // Explode and flip values:
                     $nef = array_flip(explode(',', $v));
                     $pout = array();
                     $theTypes = t3lib_BEfunc::getExplicitAuthFieldValues();
                     // Icons:
                     $icons = array('ALLOW' => t3lib_iconWorks::getSpriteIcon('status-dialog-ok'), 'DENY' => t3lib_iconWorks::getSpriteIcon('status-dialog-error'));
                     // Traverse types:
                     foreach ($theTypes as $tableFieldKey => $theTypeArrays) {
                         if (is_array($theTypeArrays['items'])) {
                             $pout[] = '<strong>' . $theTypeArrays['tableFieldLabel'] . '</strong>';
                             // Traverse options for this field:
                             foreach ($theTypeArrays['items'] as $itemValue => $itemContent) {
                                 $v = $tableFieldKey . ':' . $itemValue . ':' . $itemContent[0];
                                 if (isset($nef[$v])) {
                                     unset($nef[$v]);
                                     $pout[] = $icons[$itemContent[0]] . '[' . $itemContent[2] . '] ' . $itemContent[1];
                                 } else {
                                     $pout[] = '<em style="color: #666666;">' . $icons[$itemContent[0] == 'ALLOW' ? 'DENY' : 'ALLOW'] . '[' . $itemContent[2] . '] ' . $itemContent[1] . '</em>';
                                 }
                             }
                             $pout[] = '';
                         }
                     }
                     // Add remaining:
                     if (count($nef)) {
                         $pout = array_merge($pout, array_keys($nef));
                     }
                     // Implode for display:
                     $out[$k] = implode('<br />', $pout);
                     break;
                 case 'allowed_languages':
                     // Explode and flip values:
                     $nef = array_flip(explode(',', $v));
                     $pout = array();
                     // Get languages:
                     $items = t3lib_BEfunc::getSystemLanguages();
                     // Traverse values:
                     foreach ($items as $iCfg) {
                         if (isset($nef[$iCfg[1]])) {
                             unset($nef[$iCfg[1]]);
                             if (strpos($iCfg[2], '.gif') === FALSE) {
                                 $icon = t3lib_iconWorks::getSpriteIcon($iCfg[2]) . '&nbsp;';
                             } elseif (strlen($iCfg[2])) {
                                 $icon = '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/' . $iCfg[2]) . ' class="absmiddle" style="margin-right: 5px;" alt="" />';
                             } else {
                                 $icon = '';
                             }
                             $pout[] = $icon . $iCfg[0];
                         }
                     }
                     // Add remaining:
                     if (count($nef)) {
                         $pout = array_merge($pout, array_keys($nef));
                     }
                     // Implode for display:
                     $out[$k] = implode('<br />', $pout);
                     break;
                 case 'workspace_perms':
                     $out[$k] = implode('<br/>', explode(', ', t3lib_BEfunc::getProcessedValue('be_users', 'workspace_perms', $v)));
                     break;
                 case 'workspace_membership':
                     $out[$k] = implode('<br/>', $this->ext_workspaceMembership());
                     break;
                 case 'custom_options':
                     // Explode and flip values:
                     $nef = array_flip(explode(',', $v));
                     $pout = array();
                     // Initialize:
                     $customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'];
                     if (is_array($customOptions)) {
                         foreach ($customOptions as $coKey => $coValue) {
                             if (is_array($coValue['items'])) {
                                 // Traverse items:
                                 foreach ($coValue['items'] as $itemKey => $itemCfg) {
                                     $v = $coKey . ':' . $itemKey;
                                     if (isset($nef[$v])) {
                                         unset($nef[$v]);
                                         $pout[] = $GLOBALS['LANG']->sl($coValue['header']) . ' / ' . $GLOBALS['LANG']->sl($itemCfg[0]);
                                     }
                                 }
                             }
                         }
                     }
                     // Add remaining:
                     if (count($nef)) {
                         $pout = array_merge($pout, array_keys($nef));
                     }
                     // Implode for display:
                     $out[$k] = implode('<br />', $pout);
                     break;
             }
         }
     }
     return $out;
 }
    /**
     * 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']) {
            $infoArr = array();
            $this->getProcessedValue('tt_content', 'header_position,header_layout,header_link', $row, $infoArr);
            // If header layout is set to 'hidden', display an accordant note:
            if ($row['header_layout'] == 100) {
                $hiddenHeaderNote = ' <em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.hidden', true) . ']</em>';
            }
            $outHeader = ($row['date'] ? htmlspecialchars($this->itemLabels['date'] . ' ' . t3lib_BEfunc::date($row['date'])) . '<br />' : '') . '<strong>' . $this->linkEditContent($this->renderText($row['header']), $row) . $hiddenHeaderNote . '</strong><br />';
        }
        // Make content:
        $infoArr = array();
        $drawItem = true;
        // Hook: Render an own preview of a record
        $drawItemHooks =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'];
        if (is_array($drawItemHooks)) {
            foreach ($drawItemHooks as $hookClass) {
                $hookObject = t3lib_div::getUserObj($hookClass);
                if (!$hookObject instanceof tx_cms_layout_tt_content_drawItemHook) {
                    throw new UnexpectedValueException('$hookObject must implement interface tx_cms_layout_tt_content_drawItemHook', 1218547409);
                }
                $hookObject->preProcess($this, $drawItem, $outHeader, $out, $row);
            }
        }
        // Draw preview of the item depending on its CType (if not disabled by previous hook):
        if ($drawItem) {
            switch ($row['CType']) {
                case 'header':
                    if ($row['subheader']) {
                        $out .= $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->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                        }
                    }
                    if ($row['CType'] == 'textpic' || $row['CType'] == 'image') {
                        if ($row['image']) {
                            $out .= $this->thumbCode($row, 'tt_content', 'image') . '<br />';
                            if ($row['imagecaption']) {
                                $out .= $this->linkEditContent($this->renderText($row['imagecaption']), $row) . '<br />';
                            }
                        }
                    }
                    break;
                case 'bullets':
                case 'table':
                case 'mailform':
                    if ($row['bodytext']) {
                        $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                    }
                    break;
                case 'uploads':
                    if ($row['media']) {
                        $out .= $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 'splash':
                    if ($row['bodytext']) {
                        $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
                    }
                    if ($row['image']) {
                        $out .= $this->thumbCode($row, 'tt_content', 'image') . '<br />';
                    }
                    break;
                case 'menu':
                    if ($row['pages']) {
                        $out .= $this->linkEditContent($row['pages'], $row) . '<br />';
                    }
                    break;
                case 'shortcut':
                    if ($row['records']) {
                        $out .= $this->linkEditContent($row['shortcut'], $row) . '<br />';
                    }
                    break;
                case 'list':
                    $out .= $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 />';
                    $hookArr = array();
                    $hookOut = '';
                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$row['list_type']])) {
                        $hookArr = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info'][$row['list_type']];
                    } elseif (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'])) {
                        $hookArr = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['list_type_Info']['_DEFAULT'];
                    }
                    if (count($hookArr) > 0) {
                        $_params = array('pObj' => &$this, 'row' => $row, 'infoArr' => $infoArr);
                        foreach ($hookArr as $_funcRef) {
                            $hookOut .= t3lib_div::callUserFunction($_funcRef, $_params, $this);
                        }
                    }
                    if (strcmp($hookOut, '')) {
                        $out .= $hookOut;
                    } else {
                        $out .= $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content', 'select_key'), 1) . ' ' . $row['select_key'] . '<br />';
                    }
                    $out .= $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;
        }
    }
    /**
     * Creates the table with the content columns
     *
     * @param	array		Array with arrays of lines for each column
     * @param	array		Column position array
     * @return	string		HTML
     */
    function printRecordMap($lines, $colPosArray)
    {
        $row1 = '';
        $row2 = '';
        $count = t3lib_div::intInRange(count($colPosArray), 1);
        // Traverse the columns here:
        foreach ($colPosArray as $kk => $vv) {
            $row1 .= '<td align="center" width="' . round(100 / $count) . '%"><span class="uppercase"><strong>' . $this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $vv), 1), $vv) . '</strong></span></td>';
            $row2 .= '<td valign="top" nowrap="nowrap">' . implode('<br />', $lines[$kk]) . '</td>';
        }
        $table = '

		<!--
			Map of records in columns:
		-->
		<table border="0" cellpadding="0" cellspacing="1" id="typo3-ttContentList">
			<tr class="bgColor5">' . $row1 . '</tr>
			<tr>' . $row2 . '</tr>
		</table>

		';
        return $this->JSimgFunc('2') . $table;
    }
 /**
  *
  * @param array $row
  * @param string $table
  * @param string $output
  * @param boolean $alreadyRendered
  * @param object $ref
  * @return string
  */
 public function render_previewContent($row, $table, $output, $alreadyRendered, &$ref)
 {
     return '<strong>' . $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'CType', $row['CType'])) . '</strong>';
 }
 /**
  * Returns an HTMLized preview of a certain content element. If you'd like to register a new content type, you can easily use the hook
  * provided at the beginning of the function.
  *
  * @param	array		$row: The row of tt_content containing the content element record.
  * @return	string		HTML preview content
  * @access protected
  * @see		getContentTree(), render_localizationInfoTable()
  */
 function render_previewContent($row)
 {
     global $TYPO3_CONF_VARS, $LANG, $LANGPLUGIN, $TCA;
     $hookObjectsArr = $this->hooks_prepareObjectsArray('renderPreviewContentClass');
     $alreadyRendered = FALSE;
     $output = '';
     // ELIO@GOSIGN 13/08/09: For LFEditor Link
     $langFile = '';
     // Hook: renderPreviewContent_preProcess. Set 'alreadyRendered' to true if you provided a preview content for the current cType !
     reset($hookObjectsArr);
     while (list(, $hookObj) = each($hookObjectsArr)) {
         if (method_exists($hookObj, 'renderPreviewContent_preProcess')) {
             $output .= $hookObj->renderPreviewContent_preProcess($row, 'tt_content', $alreadyRendered, $this);
         }
     }
     if (!$alreadyRendered) {
         // Preview content for non-flexible content elements:
         switch ($row['CType']) {
             case 'table':
                 //	Table
                 $output = '<strong>' . $LANG->getLL($row['CType'] . '.field.text', 1) . '</strong>: <br />' . nl2br($row['bodytext']) . '<br />' . $this->getPiName($LANGPLUGIN->getLL('common_6_title'));
                 break;
             case 'splash':
                 //	Textbox
                 $thumbnail = '<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'image'), 1) . '</strong><br />';
                 $thumbnail .= t3lib_BEfunc::thumbCode($row, 'tt_content', 'image', $this->doc->backPath);
                 $text = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'bodytext'), 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs(trim(strip_tags($row['bodytext'])), 2000)), 'tt_content', $row['uid']);
                 $output = '<table><tr><td valign="top">' . $text . '</td><td valign="top">' . $thumbnail . '</td></tr></table>' . '<br />';
                 break;
             case 'list':
                 //	Insert Plugin
                 switch ($row['list_type']) {
                     case '9':
                         $html = $this->getTTNews($row);
                         break;
                     case 'rwe_feuseradmin_pi1':
                         $html = '<strong>' . $LANG->getLL($row['list_type'] . '.field.hinweis', 1) . '</strong>: <br />' . $LANG->getLL($row['list_type'] . '.field.hinweis.content', 1) . '<br />' . $this->getPiName($LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type'])));
                         break;
                     case 'th_mailformplus_pi1':
                         $html = '<strong>' . $LANG->getLL($row['list_type'] . '.field.hinweis', 1) . '</strong>: <br />' . $LANG->getLL($row['list_type'] . '.field.hinweis.content', 1) . '<br />' . '<br /><br /><strong style="margin:2px;padding:2px;border:1px solid #bfbfbf; background-color:#FFFFFF;">' . $LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type'])) . '</strong><br /><br />';
                         // ELIO@GOSIGN 13/08/09 START
                         // LFE-Link: we have to set the langfile like this for this plugin
                         $typoscript = $this->loadTS($row['pid']);
                         $langFile = $typoscript->setup['plugin.']['tx_thmailformplus_pi1.']['langFile'];
                         // ELIO@GOSIGN 13/08/09 END
                         break;
                 }
                 if ($html) {
                     $output = $this->link_edit($html, 'tt_content', $row['uid']) . '<br />';
                 } else {
                     $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'list_type')) . '</strong> ' . htmlspecialchars($LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type']))) . ' &ndash; ' . htmlspecialchars($extraInfo ? $extraInfo : $row['list_type']), 'tt_content', $row['uid']) . '<br />';
                 }
                 break;
             case 'div':
                 //	Divider
             //	Divider
             case 'templavoila_pi1':
                 //	Flexible Content Element: Rendered directly in getContentTree*()
                 switch ($row['tx_templavoila_to']) {
                     default:
                         // Render the Rest Flexform Elements
                         $html = $this->renderFlex($row);
                         break;
                 }
                 $output = $html;
                 break;
             default:
                 // Render the Rest CType Elements
                 $output = $this->renderPi($row);
         }
     }
     // ELIO@GOSIGN 13/08/09 START
     // Add LFEditor link
     if ($row['CType'] == 'list' && !empty($row['list_type'])) {
         //  if this is a plugin
         $output .= $this->addLFEditLink($row['list_type'], $langFile);
     } elseif ($row['CType'] != 'list') {
         // if this is a normal CType
         $output .= $this->addLFEditLink($row['CType'], $langFile);
     }
     // ELIO@GOSIGN 13/08/09 END
     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;
        }
    }
Example #9
0
    /**
     * Rendering the quick-edit view.
     *
     * @return	void
     */
    function renderQuickEdit()
    {
        global $LANG, $BE_USER, $BACK_PATH;
        // Alternative template
        $this->doc->setModuleTemplate('templates/db_layout_quickedit.html');
        // Alternative form tag; Quick Edit submits its content to tce_db.php.
        $this->doc->form = '<form action="' . htmlspecialchars($BACK_PATH . 'tce_db.php?&prErr=1&uPT=1') . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
        // Setting up the context sensitive menu:
        $this->doc->getContextMenuCode();
        // Set the edit_record value for internal use in this function:
        $edit_record = $this->edit_record;
        // If a command to edit all records in a column is issue, then select all those elements, and redirect to alt_doc.php:
        if (substr($edit_record, 0, 9) == '_EDIT_COL') {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND colPos=' . intval(substr($edit_record, 10)) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . t3lib_BEfunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'sorting');
            $idListA = array();
            while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                $idListA[] = $cRow['uid'];
            }
            $url = $BACK_PATH . 'alt_doc.php?edit[tt_content][' . implode(',', $idListA) . ']=edit&returnUrl=' . rawurlencode($this->local_linkThisScript(array('edit_record' => '')));
            t3lib_utility_Http::redirect($url);
        }
        // If the former record edited was the creation of a NEW record, this will look up the created records uid:
        if ($this->new_unique_uid) {
            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', 'userid=' . intval($BE_USER->user['uid']) . ' AND NEWid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->new_unique_uid, 'sys_log'));
            $sys_log_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
            if (is_array($sys_log_row)) {
                $edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid'];
            }
        }
        // Creating the selector box, allowing the user to select which element to edit:
        $opt = array();
        $is_selected = 0;
        $languageOverlayRecord = '';
        if ($this->current_sys_language) {
            list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid=' . intval($this->current_sys_language));
        }
        if (is_array($languageOverlayRecord)) {
            $inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid'];
            $is_selected += intval($edit_record == $inValue);
            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('editLanguageHeader', 1) . ' ]</option>';
        } else {
            $inValue = 'pages:' . $this->id;
            $is_selected += intval($edit_record == $inValue);
            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('editPageProperties', 1) . ' ]</option>';
        }
        // Selecting all content elements from this language and allowed colPos:
        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')) . t3lib_Befunc::deleteClause('tt_content') . t3lib_BEfunc::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting');
        $colPos = '';
        $first = 1;
        $prev = $this->id;
        // Page is the pid if no record to put this after.
        while ($cRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
            t3lib_BEfunc::workspaceOL('tt_content', $cRow);
            if (is_array($cRow)) {
                if ($first) {
                    if (!$edit_record) {
                        $edit_record = 'tt_content:' . $cRow['uid'];
                    }
                    $first = 0;
                }
                if (strcmp($cRow['colPos'], $colPos)) {
                    $colPos = $cRow['colPos'];
                    $opt[] = '<option value=""></option>';
                    $opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $colPos), 1) . ':__</option>';
                }
                $inValue = 'tt_content:' . $cRow['uid'];
                $is_selected += intval($edit_record == $inValue);
                $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($cRow['header'] ? $cRow['header'] : '[' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.no_title') . '] ' . strip_tags($cRow['bodytext']), $BE_USER->uc['titleLen'])) . '</option>';
                $prev = -$cRow['uid'];
            }
        }
        // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
        if (!$edit_record) {
            $edit_record = 'tt_content:new/' . $prev . '/' . $colPos;
            $inValue = 'tt_content:new/' . $prev . '/' . $colPos;
            $is_selected += intval($edit_record == $inValue);
            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $LANG->getLL('newLabel', 1) . ' ]</option>';
        }
        // If none is yet selected...
        if (!$is_selected) {
            $opt[] = '<option value=""></option>';
            $opt[] = '<option value="' . $edit_record . '"  selected="selected">[ ' . $LANG->getLL('newLabel', 1) . ' ]</option>';
        }
        // Splitting the edit-record cmd value into table/uid:
        $this->eRParts = explode(':', $edit_record);
        // Delete-button flag?
        $this->deleteButton = t3lib_div::testInt($this->eRParts[1]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & 4);
        // If undo-button should be rendered (depends on available items in sys_history)
        $this->undoButton = 0;
        $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->eRParts[0], 'sys_history') . ' AND recuid=' . intval($this->eRParts[1]), '', 'tstamp DESC', '1');
        if ($this->undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes)) {
            $this->undoButton = 1;
        }
        // Setting up the Return URL for coming back to THIS script (if links take the user to another script)
        $R_URL_parts = parse_url(t3lib_div::getIndpEnv('REQUEST_URI'));
        $R_URL_getvars = t3lib_div::_GET();
        unset($R_URL_getvars['popView']);
        unset($R_URL_getvars['new_unique_uid']);
        $R_URL_getvars['edit_record'] = $edit_record;
        $this->R_URI = $R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $R_URL_getvars);
        // Setting close url/return url for exiting this script:
        $this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1)));
        // Goes to 'Columns' view if close is pressed (default)
        if ($BE_USER->uc['condensedMode']) {
            $this->closeUrl = $BACK_PATH . 'alt_db_navframe.php';
        }
        if ($this->returnUrl) {
            $this->closeUrl = $this->returnUrl;
        }
        // Return-url for JavaScript:
        $retUrlStr = $this->returnUrl ? "+'&returnUrl='+'" . rawurlencode($this->returnUrl) . "'" : '';
        // Drawing the edit record selectbox
        $this->editSelect = '<select name="edit_record" onchange="' . htmlspecialchars('jumpToUrl(\'db_layout.php?id=' . $this->id . '&edit_record=\'+escape(this.options[this.selectedIndex].value)' . $retUrlStr . ',this);') . '">' . implode('', $opt) . '</select>';
        // Creating editing form:
        if ($BE_USER->check('tables_modify', $this->eRParts[0]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & 1)) {
            // Splitting uid parts for special features, if new:
            list($uidVal, $ex_pid, $ex_colPos) = explode('/', $this->eRParts[1]);
            // Convert $uidVal to workspace version if any:
            if ($uidVal != 'new') {
                if ($draftRecord = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $this->eRParts[0], $uidVal, 'uid')) {
                    $uidVal = $draftRecord['uid'];
                }
            }
            // Initializing transfer-data object:
            $trData = t3lib_div::makeInstance('t3lib_transferData');
            $trData->addRawData = TRUE;
            $trData->defVals[$this->eRParts[0]] = array('colPos' => intval($ex_colPos), 'sys_language_uid' => intval($this->current_sys_language));
            $trData->disableRTE = $this->MOD_SETTINGS['disableRTE'];
            $trData->lockRecords = 1;
            $trData->fetchRecord($this->eRParts[0], $uidVal == 'new' ? $this->id : $uidVal, $uidVal);
            // 'new'
            // Getting/Making the record:
            reset($trData->regTableItems_data);
            $rec = current($trData->regTableItems_data);
            if ($uidVal == 'new') {
                $new_unique_uid = uniqid('NEW');
                $rec['uid'] = $new_unique_uid;
                $rec['pid'] = intval($ex_pid) ? intval($ex_pid) : $this->id;
                $recordAccess = TRUE;
            } else {
                $rec['uid'] = $uidVal;
                // Checking internals access:
                $recordAccess = $BE_USER->recordEditAccessInternals($this->eRParts[0], $uidVal);
            }
            if (!$recordAccess) {
                // If no edit access, print error message:
                $content .= $this->doc->section($LANG->getLL('noAccess'), $LANG->getLL('noAccess_msg') . '<br /><br />' . ($BE_USER->errorMsg ? 'Reason: ' . $BE_USER->errorMsg . '<br /><br />' : ''), 0, 1);
            } elseif (is_array($rec)) {
                // If the record is an array (which it will always be... :-)
                // Create instance of TCEforms, setting defaults:
                $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
                $tceforms->backPath = $BACK_PATH;
                $tceforms->initDefaultBEMode();
                $tceforms->fieldOrder = $this->modTSconfig['properties']['tt_content.']['fieldOrder'];
                $tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
                $tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE'];
                $tceforms->enableClickMenu = TRUE;
                // Clipboard is initialized:
                $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
                // Start clipboard
                $tceforms->clipObj->initializeClipboard();
                // Initialize - reads the clipboard content from the user session
                if ($BE_USER->uc['edit_showFieldHelp'] != 'text' && $this->MOD_SETTINGS['showDescriptions']) {
                    $tceforms->edit_showFieldHelp = 'text';
                }
                // Render form, wrap it:
                $panel = '';
                $panel .= $tceforms->getMainFields($this->eRParts[0], $rec);
                $panel = $tceforms->wrapTotal($panel, $rec, $this->eRParts[0]);
                // Add hidden fields:
                $theCode = $panel;
                if ($uidVal == 'new') {
                    $theCode .= '<input type="hidden" name="data[' . $this->eRParts[0] . '][' . $rec['uid'] . '][pid]" value="' . $rec['pid'] . '" />';
                }
                $theCode .= '
					<input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
					<input type="hidden" name="_disableRTE" value="' . $tceforms->disableRTE . '" />
					<input type="hidden" name="edit_record" value="' . $edit_record . '" />
					<input type="hidden" name="redirect" value="' . htmlspecialchars($uidVal == 'new' ? t3lib_extMgm::extRelPath('cms') . 'layout/db_layout.php?id=' . $this->id . '&new_unique_uid=' . $new_unique_uid . '&returnUrl=' . rawurlencode($this->returnUrl) : $this->R_URI) . '" />
					' . t3lib_TCEforms::getHiddenTokenField('tceAction');
                // Add JavaScript as needed around the form:
                $theCode = $tceforms->printNeededJSFunctions_top() . $theCode . $tceforms->printNeededJSFunctions();
                // Add warning sign if record was "locked":
                if ($lockInfo = t3lib_BEfunc::isRecordLocked($this->eRParts[0], $rec['uid'])) {
                    $lockedMessage = t3lib_div::makeInstance('t3lib_FlashMessage', htmlspecialchars($lockInfo['msg']), '', t3lib_FlashMessage::WARNING);
                    t3lib_FlashMessageQueue::addMessage($lockedMessage);
                }
                // Add whole form as a document section:
                $content .= $this->doc->section('', $theCode);
            }
        } else {
            // If no edit access, print error message:
            $content .= $this->doc->section($LANG->getLL('noAccess'), $LANG->getLL('noAccess_msg') . '<br /><br />', 0, 1);
        }
        // Bottom controls (function menus):
        $q_count = $this->getNumberOfHiddenElements();
        $h_func_b = t3lib_BEfunc::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], 'db_layout.php', '', 'id="checkTt_content_showHidden"') . '<label for="checkTt_content_showHidden">' . (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE', 1)) : $LANG->getLL('hiddenCE', 1) . ' (' . $q_count . ')') . '</label>';
        $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[showPalettes]', $this->MOD_SETTINGS['showPalettes'], 'db_layout.php', '', 'id="checkShowPalettes"') . '<label for="checkShowPalettes">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPalettes', 1) . '</label>';
        if (t3lib_extMgm::isLoaded('context_help') && $BE_USER->uc['edit_showFieldHelp'] != 'text') {
            $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[showDescriptions]', $this->MOD_SETTINGS['showDescriptions'], 'db_layout.php', '', 'id="checkShowDescriptions"') . '<label for="checkShowDescriptions">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showDescriptions', 1) . '</label>';
        }
        if ($BE_USER->isRTE()) {
            $h_func_b .= '<br />' . t3lib_BEfunc::getFuncCheck($this->id, 'SET[disableRTE]', $this->MOD_SETTINGS['disableRTE'], 'db_layout.php', '', 'id="checkDisableRTE"') . '<label for="checkDisableRTE">' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.disableRTE', 1) . '</label>';
        }
        // Add the function menus to bottom:
        $content .= $this->doc->section('', $h_func_b, 0, 0);
        $content .= $this->doc->spacer(10);
        // Select element matrix:
        if ($this->eRParts[0] == 'tt_content' && t3lib_div::testInt($this->eRParts[1])) {
            $posMap = t3lib_div::makeInstance('ext_posMap');
            $posMap->backPath = $BACK_PATH;
            $posMap->cur_sys_language = $this->current_sys_language;
            $HTMLcode = '';
            // CSH:
            $HTMLcode .= t3lib_BEfunc::cshItem($this->descrTable, 'quickEdit_selElement', $BACK_PATH, '|<br />');
            $HTMLcode .= $posMap->printContentElementColumns($this->id, $this->eRParts[1], $this->colPosList, $this->MOD_SETTINGS['tt_content_showHidden'], $this->R_URI);
            $content .= $this->doc->spacer(20);
            $content .= $this->doc->section($LANG->getLL('CEonThisPage'), $HTMLcode, 0, 1);
            $content .= $this->doc->spacer(20);
        }
        // Finally, if comments were generated in TCEforms object, print these as a HTML comment:
        if (count($tceforms->commentMessages)) {
            $content .= '
	<!-- TCEFORM messages
	' . htmlspecialchars(implode(LF, $tceforms->commentMessages)) . '
	-->
	';
        }
        return $content;
    }
Example #10
0
 /**
  * Returns an HTMLized preview of a certain content element. If you'd like to register a new content type, you can easily use the hook
  * provided at the beginning of the function.
  *
  * @param	array		$row: The row of tt_content containing the content element record.
  * @return	string		HTML preview content
  * @access protected
  * @see		getContentTree(), render_localizationInfoTable()
  */
 function render_previewContent($row)
 {
     global $TYPO3_CONF_VARS, $LANG;
     $hookObjectsArr = $this->hooks_prepareObjectsArray('renderPreviewContentClass');
     $alreadyRendered = FALSE;
     $output = '';
     // Hook: renderPreviewContent_preProcess. Set 'alreadyRendered' to true if you provided a preview content for the current cType !
     reset($hookObjectsArr);
     while (list(, $hookObj) = each($hookObjectsArr)) {
         if (method_exists($hookObj, 'renderPreviewContent_preProcess')) {
             $output .= $hookObj->renderPreviewContent_preProcess($row, 'tt_content', $alreadyRendered, $this);
         }
     }
     if (!$alreadyRendered) {
         // Preview content for non-flexible content elements:
         switch ($row['CType']) {
             case 'text':
                 //	Text
             //	Text
             case 'table':
                 //	Table
             //	Table
             case 'mailform':
                 //	Form
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'bodytext'), 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs(trim(strip_tags($row['bodytext'])), 2000)), 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'image':
                 //	Image
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'image'), 1) . '</strong><br /> ', 'tt_content', $row['uid']) . t3lib_BEfunc::thumbCode($row, 'tt_content', 'image', $this->doc->backPath) . '<br />';
                 break;
             case 'textpic':
                 //	Text w/image
             //	Text w/image
             case 'splash':
                 //	Textbox
                 $thumbnail = '<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'image'), 1) . '</strong><br />';
                 $thumbnail .= t3lib_BEfunc::thumbCode($row, 'tt_content', 'image', $this->doc->backPath);
                 $text = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'bodytext'), 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs(trim(strip_tags($row['bodytext'])), 2000)), 'tt_content', $row['uid']);
                 $output = '<table><tr><td valign="top">' . $text . '</td><td valign="top">' . $thumbnail . '</td></tr></table>' . '<br />';
                 break;
             case 'bullets':
                 //	Bullets
                 $htmlBullets = '';
                 $bulletsArr = explode("\n", t3lib_div::fixed_lgd_cs($row['bodytext'], 2000));
                 if (is_array($bulletsArr)) {
                     foreach ($bulletsArr as $listItem) {
                         $htmlBullets .= htmlspecialchars(trim(strip_tags($listItem))) . '<br />';
                     }
                 }
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'bodytext'), 1) . '</strong><br />' . $htmlBullets, 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'uploads':
                 //	Filelinks
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'media'), 1) . '</strong><br />' . str_replace(',', '<br />', htmlspecialchars(t3lib_div::fixed_lgd_cs(trim(strip_tags($row['media'])), 2000))), 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'multimedia':
                 //	Multimedia
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'multimedia'), 1) . '</strong><br />' . str_replace(',', '<br />', htmlspecialchars(t3lib_div::fixed_lgd_cs(trim(strip_tags($row['multimedia'])), 2000))), 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'menu':
                 //	Menu / Sitemap
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'menu_type')) . '</strong> ' . $LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'menu_type', $row['menu_type'])) . '<br />' . '<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'pages')) . '</strong> ' . $row['pages'], 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'list':
                 //	Insert Plugin
                 $extraInfo = $this->render_previewContent_extraPluginInfo($row);
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'list_type')) . '</strong> ' . htmlspecialchars($LANG->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'list_type', $row['list_type']))) . ' &ndash; ' . htmlspecialchars($extraInfo ? $extraInfo : $row['list_type']), 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'html':
                 //	HTML
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'bodytext'), 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs(trim($row['bodytext']), 2000)), 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'header':
                 // Header
                 $output = $this->link_edit('<strong>' . $LANG->sL(t3lib_BEfunc::getItemLabel('tt_content', 'header'), 1) . '</strong> ' . htmlspecialchars(t3lib_div::fixed_lgd_cs(trim(strip_tags($row['header'])), 2000)), 'tt_content', $row['uid']) . '<br />';
                 break;
             case 'search':
                 //	Search Box
             //	Search Box
             case 'login':
                 //	Login Box
             //	Login Box
             case 'shortcut':
                 //	Insert records
             //	Insert records
             case 'div':
                 //	Divider
             //	Divider
             case 'templavoila_pi1':
                 //	Flexible Content Element: Rendered directly in getContentTree*()
                 break;
             default:
                 // return CType name for unhandled CType
                 $output = '<strong>' . htmlspecialchars($row['CType']) . '</strong><br />';
         }
     }
     return $output;
 }
 /**
  * @return string
  */
 protected function getPreviewLabel()
 {
     return $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'CType', $this->previewField));
 }