示例#1
0
 /**
  * issue title
  *
  * @param object $parameters
  * @param object $parentObject
  *
  * @return void
  */
 public function issueTitle(&$parameters, $parentObject)
 {
     $titleLength = $GLOBALS['BE_USER']->uc['titleLen'] ? $GLOBALS['BE_USER']->uc['titleLen'] : 30;
     $record = t3lib_BEfunc::getRecord($parameters['table'], $parameters['row']['uid']);
     $newTitle = $record['extension'] . ': ' . $record['inspection'];
     $parameters['title'] = htmlspecialchars(t3lib_div::fixed_lgd_cs($newTitle, $titleLength));
 }
示例#2
0
    /**
     * Main function
     *
     * @return	void
     */
    function main()
    {
        switch ((string) t3lib_div::_GET('cmd')) {
            case 'menuitem':
                echo '
				<img src="gfx/x_t3logo.png" width="61" height="16" hspace="3" alt="" />';
                $menuItems = array(array('title' => 'About TYPO3', 'xurl' => 'http://typo3.com/', 'subitems' => array(array('title' => 'License', 'xurl' => 'http://typo3.com/License.1625.0.html'), array('title' => 'Support', 'subitems' => array(array('title' => 'Mailing lists', 'xurl' => 'http://lists.netfielders.de/cgi-bin/mailman/listinfo'), array('title' => 'Documentation', 'xurl' => 'http://typo3.org/documentation/'), array('title' => 'Find consultancy', 'xurl' => 'http://typo3.com/Consultancies.1248.0.html'))), array('title' => 'Contribute', 'xurl' => 'http://typo3.org/community/participate/'), array('title' => 'Donate', 'xurl' => 'http://typo3.com/Donations.1261.0.html', 'icon' => '1'))), array('title' => 'Extensions', 'url' => 'mod/tools/em/index.php'), array('title' => 'Menu preferences and such things', 'onclick' => 'alert("A dialog is now shown which will allow user configuration of items in the menu");event.stopPropagation();', 'state' => 'checked'), array('title' => '--div--'), array('title' => 'Recent Items', 'id' => $this->id . '_recent', 'subitems' => array(), 'html' => $this->menuItemObject($this->id . '_recent', '
							fetched: false,
							onActivate: function() {
//								if (!this.fetched)	{
									//Element.update("' . $this->id . '_recent-layer","asdfasdf");
									getElementContent("' . $this->id . '_recent-layer", 0, "logomenu.php?cmd=recent")
									this.fetched = true;
//								}
							}
						')), array('title' => '--div--'), array('title' => 'View frontend', 'xurl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL')), array('title' => 'Log out', 'onclick' => "top.document.location='logout.php';"));
                echo $this->menuLayer($menuItems);
                break;
            case 'recent':
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_log.*, MAX(sys_log.tstamp) AS tstamp_MAX', 'sys_log,pages', 'pages.uid=sys_log.event_pid AND sys_log.userid=' . intval($GLOBALS['BE_USER']->user['uid']) . ' AND sys_log.event_pid>0 AND sys_log.type=1 AND sys_log.action=2 AND sys_log.error=0', 'tablename,recuid', 'tstamp_MAX DESC', 20);
                $items = array();
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                    $elRow = t3lib_BEfunc::getRecord($row['tablename'], $row['recuid']);
                    if (is_array($elRow)) {
                        $items[] = array('title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($row['tablename'], $elRow), $GLOBALS['BE_USER']->uc['titleLen']) . ' - ' . t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME'] - $row['tstamp_MAX']), 'icon' => array(t3lib_iconworks::getIcon($row['tablename'], $elRow), 'width="18" height="16"'), 'onclick' => 'content.' . t3lib_BEfunc::editOnClick('&edit[' . $row['tablename'] . '][' . $row['recuid'] . ']=edit', '', 'dummy.php'));
                    }
                }
                echo $this->menuItems($items);
                break;
        }
    }
 /**
  * Entry function that hooks into the main typo3/alt_clickmenu.php,
  * see ext_tables.php of this extension for more info
  *
  * @param $backRef		the clickMenu object
  * @param $menuItems	the menuItems as an array that are already filled from the main clickmenu 
  * @param $table	the table that is worked on (tx_dam_cat only)
  * @param $uid		the item UID that is worked on
  * @return unknown
  */
 function main(&$backRef, $menuItems, $table, $uid)
 {
     if ($table != 'tx_dam_cat') {
         return $menuItems;
     }
     $this->backRef =& $backRef;
     // Get record
     $this->rec = t3lib_BEfunc::getRecordWSOL($table, $uid);
     $menuItems = array();
     $root = !strcmp($uid, '0') ? true : false;
     if (is_array($this->rec) || $root) {
         $lCP = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages', $root ? tx_dam_db::getPid() : $this->rec['pid']));
         // Edit
         if (!$root && $GLOBALS['BE_USER']->isPSet($lCP, $table, 'edit') && !in_array('edit', $this->backRef->disabledItems)) {
             $menuItems['edit'] = $this->DAMcatEdit($table, $uid);
         }
         // New Category
         if (!in_array('new', $this->backRef->disabledItems) && $GLOBALS['BE_USER']->isPSet($lCP, $table, 'new')) {
             $menuItems['new'] = $this->DAMnewSubCat($table, $uid);
         }
         // Info
         if (!in_array('info', $this->backRef->disabledItems) && !$root) {
             $menuItems['info'] = $this->DAMcatInfo($table, $uid);
         }
         // Delete
         $elInfo = array(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table, $this->rec), $GLOBALS['BE_USER']->uc['titleLen']));
         if (!in_array('delete', $this->backRef->disabledItems) && !$root && $GLOBALS['BE_USER']->isPSet($lCP, $table, 'delete')) {
             $menuItems['spacer2'] = 'spacer';
             $menuItems['delete'] = $this->DAMcatDelete($table, $uid, $elInfo);
         }
     }
     return $menuItems;
 }
 function main(&$backRef, $menuItems, $tableID, $srcId)
 {
     $this->includeLocalLang();
     $this->backRef =& $backRef;
     /**
      * TODO
      *
      * FIXME
      * backpath will not work in global installations
      */
     if (($tableID == 'dragDrop_tt_news_cat' || $tableID == 'tt_news_cat_CM') && $srcId) {
         $table = 'tt_news_cat';
         $rec = t3lib_BEfunc::getRecordWSOL($table, $srcId);
         // fetch page record to get editing permissions
         $lCP = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages', $rec['pid']));
         $doEdit = $lCP & 16;
         //print_r( array($lCP));
         if ($doEdit && $tableID == 'dragDrop_tt_news_cat') {
             $this->backRef->backPath = '../../../';
             $dstId = intval(t3lib_div::_GP('dstId'));
             $menuItems['moveinto'] = $this->dragDrop_moveCategory($srcId, $dstId);
             $menuItems['copyinto'] = $this->dragDrop_copyCategory($srcId, $dstId);
         }
         if ($tableID == 'tt_news_cat_CM') {
             $this->backRef->backPath = '../../../../typo3/';
             $menuItems = array();
             if ($doEdit) {
                 $menuItems['edit'] = $this->DB_edit($table, $srcId);
                 $menuItems['new'] = $this->DB_new($table, $rec);
                 $menuItems['newsub'] = $this->DB_new($table, $rec, true);
             }
             $menuItems['info'] = $backRef->DB_info($table, $srcId);
             if ($doEdit) {
                 $menuItems['hide'] = $this->DB_hideUnhide($table, $rec, 'hidden');
                 $elInfo = array(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('tt_news_cat', $rec), $GLOBALS['BE_USER']->uc['titleLen']));
                 $menuItems['spacer2'] = 'spacer';
                 $menuItems['delete'] = $this->DB_delete($table, $srcId, $elInfo);
             }
         }
     }
     return $menuItems;
 }
	/**
	 * (non-PHPdoc)
	 * @see classes/preview/tx_templavoila_preview_type_text#getPreviewData($row)
	 */
	protected function getPreviewData($row) {
		if (isset($this->parentObj->modTSconfig['properties']['previewDataMaxLen'])) {
			$max = intval($this->parentObj->modTSconfig['properties']['previewDataMaxLen']);
		} else {
			$max = 2000;
		}
		$htmlBullets = '';
		$bulletsArr = explode ("\n", $this->preparePreviewData($row['bodytext']));
		if (is_array ($bulletsArr)) {
			foreach ($bulletsArr as $listItem) {
				$processedItem = t3lib_div::fixed_lgd_cs(trim(strip_tags($listItem)), $max);
				$max -= strlen($processedItem);
				$htmlBullets .= '<li>' . htmlspecialchars($processedItem) . '</li>';
				if (!$max) {
					break;
				}
			}
		}
		return '<ul>' . $htmlBullets . '</ul>';
	}
 /**
  * Renders the current page path
  *
  * @return string the rendered page path
  * @see template::getPagePath() Note: can't call this method as it's protected!
  */
 public function render()
 {
     $doc = $this->getDocInstance();
     $id = t3lib_div::_GP('id');
     $pageRecord = t3lib_BEfunc::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
     // Is this a real page
     if ($pageRecord['uid']) {
         $title = $pageRecord['_thePathFull'];
     } else {
         $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
     }
     // Setting the path of the page
     $pagePath = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path', 1) . ': <span class="typo3-docheader-pagePath">';
     // crop the title to title limit (or 50, if not defined)
     $cropLength = empty($GLOBALS['BE_USER']->uc['titleLen']) ? 50 : $GLOBALS['BE_USER']->uc['titleLen'];
     $croppedTitle = t3lib_div::fixed_lgd_cs($title, -$cropLength);
     if ($croppedTitle !== $title) {
         $pagePath .= '<abbr title="' . htmlspecialchars($title) . '">' . htmlspecialchars($croppedTitle) . '</abbr>';
     } else {
         $pagePath .= htmlspecialchars($title);
     }
     $pagePath .= '</span>';
     return $pagePath;
 }
示例#7
0
    /**
     * Main function of the module. Write the content to $this->content
     *
     * @return void
     */
    public function main()
    {
        // Draw the header.
        $this->doc = t3lib_div::makeInstance('mediumDoc');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->form = '<form action="" method="post">';
        // JavaScript
        $this->doc->JScode = '
			<script language="javascript" type="text/javascript">
				script_ended = 0;
				function jumpToUrl(URL)	{
					document.location = URL;
				}
			</script>
		';
        $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
            if ($GLOBALS['BE_USER']->user['admin'] && !$this->id) {
                $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
            }
            $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);
            $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
            $this->content .= $this->doc->divider(5);
            // Render content
            $this->moduleContent();
            // Shortcut
            if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
                $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
            }
        }
        $this->content .= $this->doc->spacer(10);
    }
 /**
  * Returns the title for the input record. If blank, a "no title" labele (localized) will be returned.
  * Do NOT htmlspecialchar the string from this function - has already been done.
  *
  * @param	array		The input row array (where the key "title" is used for the title)
  * @param	integer		Title length (30)
  * @return	string		The title.
  */
 function getTitleStr($row, $titleLen = 30)
 {
     $conf['sys_language_uid'] = $this->langOvlUid;
     $row = tx_dam_db::getRecordOverlay($this->table, $row, $conf);
     $title = !strcmp(trim($row['title']), '') ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title', 1) . ']</em>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'], $titleLen));
     return $title;
 }
    /**
     * Do the file indexing
     * Read files from a directory index them and output a result table
     *
     * @return	string		HTML content
     */
    function checkUploads($indexSessionID)
    {
        global $LANG, $TYPO3_CONF_VARS;
        // makes sense? Was a hint on php.net
        ob_end_flush();
        // get session data - which might have left files stored
        $indexSession = $this->indexSessionFetch();
        $where = array();
        if ($age = intval($this->pObj->MOD_SETTINGS['tx_dam_tools_indexupdate.age'])) {
            $where['tstamp'] = 'tstamp<' . (time() - $age);
        }
        if ($indexSessionID == '' or !isset($indexSession['ID']) or !($indexSession['ID'] == $indexSessionID) or $indexSession['currentCount'] == 0) {
            $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_dam_file_tracking', '');
            $files = array();
            $files = $this->getFilesInDir(PATH_site . 'uploads/', true, $files);
            $countTotal = count($files);
            $indexSession = $this->indexSessionNew($countTotal, $files);
        }
        if (is_array($indexSession['data'])) {
            $damIndexing = t3lib_div::makeInstance('tx_dam_indexing');
            $damIndexing->init();
            $damIndexing->dryRun = TRUE;
            foreach ($indexSession['data'] as $key => $file) {
                // increase progress bar
                $indexSession['currentCount']++;
                $fileHash = tx_dam::file_calcHash($file);
                $fileInfo = tx_dam::file_compileInfo($file);
                $fields_values = array('tstamp' => time(), 'file_name' => $fileInfo['file_name'], 'file_path' => $fileInfo['file_path'], 'file_size' => $fileInfo['file_size'], 'file_ctime' => min($fileInfo['file_ctime'], $fileInfo['file_mtime']), 'file_hash' => $fileHash);
                $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_dam_file_tracking', $fields_values);
                $fileInfo = array_merge($fileInfo, $damIndexing->getFileMimeType($file));
                $fileInfo['media_type'] = tx_dam::convert_mediaType($fileInfo['file_mime_type']);
                $ctable = array();
                $ctable[] = '&nbsp;';
                $ctable[] = tx_dam::icon_getFileTypeImgTag($fileInfo, 'align="top"') . '&nbsp;' . htmlspecialchars(t3lib_div::fixed_lgd_cs($fileInfo['file_name'], 30));
                $ctable[] = htmlspecialchars(t3lib_div::fixed_lgd_cs($fileInfo['file_path'], -30));
                $this->indexing_addTableRow($ctable);
                $msg = $LANG->getLL('tx_dam_tools_indexupdate.updatedMessage', 1);
                $code = sprintf($msg, $indexSession['currentCount'], $indexSession['totalFilesCount']);
                $this->indexing_setMessage($code);
                $this->indexing_progressBar($indexSession['currentCount'], $indexSession['totalFilesCount']);
                $this->indexing_flushNow();
                $this->indexSessionWrite($indexSession);
                if ($this->indexEndtime < time() and $indexSession['currentCount'] < $indexSession['totalFilesCount']) {
                    $params = $this->pObj->addParams;
                    $params['indexSessionID'] = $indexSession['ID'];
                    echo '
						<script type="text/javascript">  window.location.href = unescape("' . t3lib_div::rawUrlEncodeJS(tx_dam_SCbase::linkThisScriptStraight($params)) . '"); </script>';
                    exit;
                }
            }
        } elseif ($indexSession['totalFilesCount'] == 0) {
            $code = $LANG->getLL('tx_dam_tools_indexupdate.no_files');
            $this->indexing_setMessage($code);
        }
        $this->indexing_finished();
        // finished - clear session
        $this->indexSessionClear();
    }
    /**
     * Main function, creating content in the frame
     *
     * @return	void
     */
    function main()
    {
        global $BE_USER, $LANG, $TCA;
        // By default, 5 groups are set
        $this->groupLabels = array(1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1);
        $shortCutGroups = $BE_USER->getTSConfig('options.shortcutGroups');
        if (is_array($shortCutGroups['properties']) && count($shortCutGroups['properties'])) {
            foreach ($shortCutGroups['properties'] as $k => $v) {
                if (strcmp('', $v) && strcmp('0', $v)) {
                    $this->groupLabels[$k] = (string) $v;
                } elseif ($BE_USER->isAdmin()) {
                    unset($this->groupLabels[$k]);
                }
            }
        }
        // List of global groups that will be loaded. All global groups have negative IDs.
        $globalGroups = -100;
        // Group -100 is kind of superglobal and can't be changed.
        if (count($this->groupLabels)) {
            $globalGroups .= ',' . implode(',', array_keys($this->groupLabels));
            $globalGroups = str_replace(',', ',-', $globalGroups);
            // Ugly hack to make the UIDs negative - is there any better solution?
        }
        // Fetching shortcuts to display for this user:
        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_be_shortcuts', '((userid=' . $BE_USER->user['uid'] . ' AND sc_group>=0) OR sc_group IN (' . $globalGroups . '))', '', 'sc_group,sorting');
        // Init vars:
        $this->lines = array();
        $this->linesPre = array();
        $this->editSC_rec = '';
        $this->selOpt = array();
        $formerGr = '';
        // Traverse shortcuts
        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
            $mParts = explode('|', $row['module_name']);
            $row['module_name'] = $mParts[0];
            $row['M_module_name'] = $mParts[1];
            $mParts = explode('_', $row['M_module_name'] ? $row['M_module_name'] : $row['module_name']);
            $qParts = parse_url($row['url']);
            if (!$BE_USER->isAdmin()) {
                // Check for module access
                if (!isset($LANG->moduleLabels['tabs_images'][implode('_', $mParts) . '_tab'])) {
                    // Nice hack to check if the user has access to this module - otherwise the translation label would not have been loaded :-)
                    continue;
                }
                $page_id = $this->getLinkedPageId($row['url']);
                if (t3lib_div::testInt($page_id)) {
                    // Check for webmount access
                    if (!$GLOBALS['BE_USER']->isInWebMount($page_id)) {
                        continue;
                    }
                    // Check for record access
                    $pageRow = t3lib_BEfunc::getRecord('pages', $page_id);
                    if (!$GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, $perms = 1)) {
                        continue;
                    }
                }
            }
            if ($this->editSC && $row['uid'] == $this->editSC) {
                $this->editSC_rec = $row;
            }
            $sc_group = $row['sc_group'];
            if ($sc_group && strcmp($formerGr, $sc_group)) {
                if ($sc_group != -100) {
                    if ($this->groupLabels[abs($sc_group)] && strcmp('1', $this->groupLabels[abs($sc_group)])) {
                        $label = $this->groupLabels[abs($sc_group)];
                    } else {
                        $label = $LANG->getLL('shortcut_group_' . abs($sc_group), 1);
                        if (!$label) {
                            $label = $LANG->getLL('shortcut_group', 1) . ' ' . abs($sc_group);
                        }
                        // Fallback label
                    }
                    if ($sc_group >= 0) {
                        $onC = 'if (confirm(' . $GLOBALS['LANG']->JScharCode($LANG->getLL('shortcut_delAllInCat')) . ')){window.location.href=\'alt_shortcut.php?deleteCategory=' . $sc_group . '\';}return false;';
                        $this->linesPre[] = '<td>&nbsp;</td><td class="bgColor5"><a href="#" onclick="' . htmlspecialchars($onC) . '" title="' . $LANG->getLL('shortcut_delAllInCat', 1) . '">' . $label . '</a></td>';
                    } else {
                        $label = $LANG->getLL('shortcut_global', 1) . ': ' . ($label ? $label : abs($sc_group));
                        // Fallback label
                        $this->lines[] = '<td>&nbsp;</td><td class="bgColor5">' . $label . '</td>';
                    }
                    unset($label);
                }
            }
            $bgColorClass = $row['uid'] == $this->editSC ? 'bgColor5' : ($row['sc_group'] < 0 ? 'bgColor6' : 'bgColor4');
            if ($row['description'] && $row['uid'] != $this->editSC) {
                $label = $row['description'];
            } else {
                $label = t3lib_div::fixed_lgd_cs(rawurldecode($qParts['query']), 150);
            }
            $titleA = $this->itemLabel($label, $row['module_name'], $row['M_module_name']);
            $editSH = $row['sc_group'] >= 0 || $BE_USER->isAdmin() ? 'editSh(' . intval($row['uid']) . ');' : "alert('" . $LANG->getLL('shortcut_onlyAdmin') . "')";
            $jumpSC = 'jump(unescape(\'' . rawurlencode($row['url']) . '\'),\'' . implode('_', $mParts) . '\',\'' . $mParts[0] . '\');';
            $onC = 'if (document.shForm.editShortcut_check && document.shForm.editShortcut_check.checked){' . $editSH . '}else{' . $jumpSC . '}return false;';
            if ($sc_group >= 0) {
                // user defined groups show up first
                $this->linesPre[] = '<td class="' . $bgColorClass . '"><a href="#" onclick="' . htmlspecialchars($onC) . '"><img src="' . $this->getIcon($row['module_name']) . '" title="' . htmlspecialchars($titleA) . '" alt="" /></a></td>';
            } else {
                $this->lines[] = '<td class="' . $bgColorClass . '"><a href="#" onclick="' . htmlspecialchars($onC) . '"><img src="' . $this->getIcon($row['module_name']) . '" title="' . htmlspecialchars($titleA) . '" alt="" /></a></td>';
            }
            if (trim($row['description'])) {
                $kkey = strtolower(substr($row['description'], 0, 20)) . '_' . $row['uid'];
                $this->selOpt[$kkey] = '<option value="' . htmlspecialchars($jumpSC) . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($row['description'], 50)) . '</option>';
            }
            $formerGr = $row['sc_group'];
        }
        ksort($this->selOpt);
        array_unshift($this->selOpt, '<option>[' . $LANG->getLL('shortcut_selSC', 1) . ']</option>');
        $this->editLoadedFunc();
        $this->editPageIdFunc();
        if (!$this->editLoaded && t3lib_extMgm::isLoaded('cms')) {
            $editIdCode = '<td nowrap="nowrap">' . $LANG->getLL('shortcut_editID', 1) . ': <input type="text" value="' . ($this->editError ? htmlspecialchars($this->editPage) : '') . '" name="editPage"' . $this->doc->formWidth(15) . ' onchange="submitEditPage(this.value);" />' . ($this->editError ? '&nbsp;<strong><span class="typo3-red">' . htmlspecialchars($this->editError) . '</span></strong>' : '') . (is_array($this->theEditRec) ? '&nbsp;<strong>' . $LANG->getLL('shortcut_loadEdit', 1) . ' \'' . t3lib_BEfunc::getRecordTitle('pages', $this->theEditRec, TRUE) . '\'</strong> (' . htmlspecialchars($this->editPath) . ')' : '') . ($this->searchFor ? '&nbsp;' . $LANG->getLL('shortcut_searchFor', 1) . ' <strong>\'' . htmlspecialchars($this->searchFor) . '\'</strong>' : '') . '</td>';
        } else {
            $editIdCode = '';
        }
        // Adding CSH:
        $editIdCode .= '<td>&nbsp;' . t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'shortcuts', $GLOBALS['BACK_PATH'], '', TRUE) . '</td>';
        // Compile it all:
        $this->content .= '

			<table border="0" cellpadding="0" cellspacing="0" width="99%">
				<tr>
					<td>
						<!--
							Shortcut Display Table:
						-->
						<table border="0" cellpadding="0" cellspacing="2" id="typo3-shortcuts">
							<tr>
							';
        if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) {
            $this->content .= implode('
								', $this->lines);
        }
        $this->content .= $editIdCode . '
							</tr>
						</table>
					</td>
					<td align="right">';
        if ($this->hasWorkspaceAccess()) {
            $this->content .= $this->workspaceSelector() . t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'workspaceSelector', $GLOBALS['BACK_PATH'], '', TRUE);
        }
        $this->content .= '
					</td>
				</tr>
			</table>
			';
        // Launch Edit page:
        if ($this->theEditRec['uid']) {
            $this->content .= $this->doc->wrapScriptTags('top.loadEditId(' . $this->theEditRec['uid'] . ');');
        }
        // Load alternative table/uid into editing form.
        if (count($this->alternativeTableUid) == 2 && isset($TCA[$this->alternativeTableUid[0]]) && t3lib_div::testInt($this->alternativeTableUid[1])) {
            $JSaction = t3lib_BEfunc::editOnClick('&edit[' . $this->alternativeTableUid[0] . '][' . $this->alternativeTableUid[1] . ']=edit', '', 'dummy.php');
            $this->content .= $this->doc->wrapScriptTags('function editArbitraryElement() { top.content.' . $JSaction . '; } editArbitraryElement();');
        }
        // Load search for something.
        if ($this->searchFor) {
            $firstMP = intval($GLOBALS['WEBMOUNTS'][0]);
            $this->content .= $this->doc->wrapScriptTags('jump(unescape("' . rawurlencode('db_list.php?id=' . $firstMP . '&search_field=' . rawurlencode($this->searchFor) . '&search_levels=4') . '"),"web_list","web");');
        }
    }
 /**
  * Prepare items from itemArray to be transferred to the TCEforms interface (as a comma list)
  *
  * @return	string
  * @see t3lib_transferdata::renderRecord()
  */
 function readyForInterface()
 {
     global $TCA;
     if (!is_array($this->itemArray)) {
         return false;
     }
     $output = array();
     $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
     // For use when getting the paths....
     $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
     foreach ($this->itemArray as $key => $val) {
         $theRow = $this->results[$val['table']][$val['id']];
         if ($theRow && is_array($TCA[$val['table']])) {
             $label = t3lib_div::fixed_lgd_cs(strip_tags(t3lib_BEfunc::getRecordTitle($val['table'], $theRow)), $titleLen);
             $label = $label ? $label : '[...]';
             $output[] = str_replace(',', '', $val['table'] . '_' . $val['id'] . '|' . rawurlencode($label));
         }
     }
     return implode(',', $output);
 }
示例#12
0
    /**
     * Showing the permissions in a tree ($this->edit = false)
     * (Adding content to internal content variable)
     *
     * @return	void
     */
    public function notEdit()
    {
        global $BE_USER, $LANG, $BACK_PATH;
        // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
        $beGroupKeys = $BE_USER->userGroupsUID;
        $beUserArray = t3lib_BEfunc::getUserNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $beUserArray = t3lib_BEfunc::blindUserNames($beUserArray, $beGroupKeys, 0);
        }
        $beGroupArray = t3lib_BEfunc::getGroupNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $beGroupArray = t3lib_BEfunc::blindGroupNames($beGroupArray, $beGroupKeys, 0);
        }
        // Length of strings:
        $tLen = $this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30;
        // Selector for depth:
        $code .= $LANG->getLL('Depth') . ': ';
        $code .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);
        $this->content .= $this->doc->section('', $code);
        $this->content .= $this->doc->spacer(5);
        // Initialize tree object:
        $tree = t3lib_div::makeInstance('t3lib_pageTree');
        $tree->init('AND ' . $this->perms_clause);
        $tree->addField('perms_user', 1);
        $tree->addField('perms_group', 1);
        $tree->addField('perms_everybody', 1);
        $tree->addField('perms_userid', 1);
        $tree->addField('perms_groupid', 1);
        $tree->addField('hidden');
        $tree->addField('fe_group');
        $tree->addField('starttime');
        $tree->addField('endtime');
        $tree->addField('editlock');
        // Creating top icon; the current page
        $HTML = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pageinfo);
        $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML);
        // Create the tree from $this->id:
        $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');
        // Make header of table:
        $code = '';
        if ($this->MOD_SETTINGS['mode'] == 'perms') {
            $code .= '
				<tr class="t3-row-header">
					<td colspan="2">&nbsp;</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td>' . $LANG->getLL('Owner', TRUE) . '</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('Group', TRUE) . '</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('Everybody', TRUE) . '</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td>
				</tr>
			';
        } else {
            $code .= '
				<tr class="t3-row-header">
					<td colspan="2">&nbsp;</td>
					<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center" nowrap="nowrap">' . $LANG->getLL('User', TRUE) . ': ' . htmlspecialchars($BE_USER->user['username']) . '</td>
					' . (!$BE_USER->isAdmin() ? '<td><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td align="center">' . $LANG->getLL('EditLock', TRUE) . '</td>' : '') . '
				</tr>';
        }
        // Traverse tree:
        foreach ($tree->tree as $data) {
            $cells = array();
            $pageId = $data['row']['uid'];
            // Background colors:
            $bgCol = $this->lastEdited == $pageId ? ' class="bgColor-20"' : '';
            $lE_bgCol = $bgCol;
            // User/Group names:
            $userName = $beUserArray[$data['row']['perms_userid']] ? $beUserArray[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? $data['row']['perms_userid'] : '');
            if ($data['row']['perms_userid'] && !$beUserArray[$data['row']['perms_userid']]) {
                $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)), false);
            } else {
                $userName = SC_mod_web_perm_ajax::renderOwnername($pageId, $data['row']['perms_userid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($userName, 20)));
            }
            $groupName = $beGroupArray[$data['row']['perms_groupid']] ? $beGroupArray[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? $data['row']['perms_groupid'] : '');
            if ($data['row']['perms_groupid'] && !$beGroupArray[$data['row']['perms_groupid']]) {
                $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)), false);
            } else {
                $groupName = SC_mod_web_perm_ajax::renderGroupname($pageId, $data['row']['perms_groupid'], htmlspecialchars(t3lib_div::fixed_lgd_cs($groupName, 20)));
            }
            // Seeing if editing of permissions are allowed for that page:
            $editPermsAllowed = $data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin();
            // First column:
            $cellAttrib = $data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '';
            $cells[] = '
					<td align="left" nowrap="nowrap"' . ($cellAttrib ? $cellAttrib : $bgCol) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . '&nbsp;</td>';
            // "Edit permissions" -icon
            if ($editPermsAllowed && $pageId) {
                $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . ($data['row']['_ORIG_uid'] ? $data['row']['_ORIG_uid'] : $pageId) . '&return_id=' . $this->id . '&edit=1';
                $cells[] = '
					<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '" title="' . $LANG->getLL('ch_permissions', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a></td>';
            } else {
                $cells[] = '
					<td' . $bgCol . '></td>';
            }
            // Rest of columns (depending on mode)
            if ($this->MOD_SETTINGS['mode'] == 'perms') {
                $cells[] = '
					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_user'], $pageId, 'user') . ' ' . $userName : '') . '</td>

					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_group'], $pageId, 'group') . ' ' . $groupName : '') . '</td>

					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($pageId ? ' ' . SC_mod_web_perm_ajax::renderPermissions($data['row']['perms_everybody'], $pageId, 'everybody') : '') . '</td>

					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'1\');" title="' . $LANG->getLL('EditLock_descr', 1) . '">' . t3lib_iconWorks::getSpriteIcon('status-warning-lock') . '</a></span>' : ($pageId === 0 ? '' : '<span id="el_' . $pageId . '" class="editlock"><a class="editlock" onclick="WebPermissions.toggleEditLock(\'' . $pageId . '\', \'0\');" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">[+]</a></span>')) . '</td>
				';
            } else {
                $cells[] = '
					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';
                $bgCol = $BE_USER->user['uid'] == $data['row']['perms_userid'] ? ' class="bgColor-20"' : $lE_bgCol;
                // FIXME $owner undefined
                $cells[] = '
					<td' . $bgCol . ' nowrap="nowrap" align="center">' . ($pageId ? $owner . SC_mod_web_perm_ajax::renderPermissions($BE_USER->calcPerms($data['row']), $pageId, 'user') : '') . '</td>
					' . (!$BE_USER->isAdmin() ? '
					<td' . $bgCol . ' class="center"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? t3lib_iconWorks::getSpriteIcon('status-warning-lock', array('title' => $LANG->getLL('EditLock_descr', TRUE))) : '') . '</td>
					' : '');
                $bgCol = $lE_bgCol;
            }
            // Compile table row:
            $code .= '
				<tr>
					' . implode('
					', $cells) . '
				</tr>';
        }
        // Wrap rows in table tags:
        $code = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">' . $code . '</table>';
        // Adding the content as a section:
        $this->content .= $this->doc->section('', $code);
        // CSH for permissions setting
        $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br />|');
        // Creating legend table:
        $legendText = '<strong>' . $LANG->getLL('1', 1) . '</strong>: ' . $LANG->getLL('1_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('16', 1) . '</strong>: ' . $LANG->getLL('16_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('2', 1) . '</strong>: ' . $LANG->getLL('2_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('4', 1) . '</strong>: ' . $LANG->getLL('4_t', 1);
        $legendText .= '<br /><strong>' . $LANG->getLL('8', 1) . '</strong>: ' . $LANG->getLL('8_t', 1);
        $code = '<table border="0" id="typo3-legendTable">
			<tr>
				<td valign="top">
					<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />
				</td>
				<td valign="top" nowrap="nowrap">' . $legendText . '</td>
			</tr>
		</table>';
        $code .= '<div id="perm-legend">' . $LANG->getLL('def', 1);
        $code .= '<br /><br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-granted') . ': ' . $LANG->getLL('A_Granted', 1);
        $code .= '<br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-denied') . ': ' . $LANG->getLL('A_Denied', 1);
        $code .= '</div>';
        // Adding section with legend code:
        $this->content .= $this->doc->spacer(20);
        $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1);
    }
    /**
     * Main Task center module
     *
     * @return	string		HTML content.
     */
    function main()
    {
        if ($id = t3lib_div::_GP('display')) {
            return $this->urlInIframe($this->backPath . t3lib_extMgm::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id, 1);
        } else {
            // Thumbnail folder and files:
            $tempDir = $this->userTempFolder();
            if ($tempDir) {
                $thumbnails = t3lib_div::getFilesInDir($tempDir, 'png,gif,jpg', 1);
            }
            $clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
            $usernames = t3lib_BEfunc::getUserNames();
            // Create preset links:
            $presets = $this->getPresets();
            $opt = array();
            $opt[] = '
			<tr class="bgColor5 tableheader">
				<td>Icon:</td>
				<td>Preset Title:</td>
				<td>Public</td>
				<td>Owner:</td>
				<td>Page:</td>
				<td>Path:</td>
				<td>Meta data:</td>
			</tr>';
            if (is_array($presets)) {
                foreach ($presets as $presetCfg) {
                    $configuration = unserialize($presetCfg['preset_data']);
                    $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
                    $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
                    $opt[] = '
					<tr class="bgColor4">
						<td>' . ($thumbnailFile ? '<img src="' . $this->backPath . '../' . substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile) . '" hspace="2" width="70" style="border: solid black 1px;" alt="" /><br />' : '&nbsp;') . '</td>
						<td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($title, 30)) . '</a>&nbsp;</td>
						<td>' . ($presetCfg['public'] ? 'Yes' : '&nbsp;') . '</td>
						<td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? 'Own' : '[' . $usernames[$presetCfg['user_uid']]['username'] . ']') . '</td>
						<td>' . ($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : '&nbsp;') . '</td>
						<td>' . htmlspecialchars($configuration['pagetree']['id'] ? t3lib_BEfunc::getRecordPath($configuration['pagetree']['id'], $clause, 20) : '[Single Records]') . '</td>
						<td>
							<strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />' . htmlspecialchars($configuration['meta']['description']) . ($configuration['meta']['notes'] ? '<br /><br /><strong>Notes:</strong> <em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>' : '') . '
						</td>
					</tr>';
                }
                $content = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">' . implode('', $opt) . '</table>';
            }
        }
        // Output:
        $theOutput .= $this->pObj->doc->spacer(5);
        $theOutput .= $this->pObj->doc->section('Export presets', $content, 0, 1);
        return $theOutput;
    }
 /**
  * Returns the content tree (based on the data structure) for a certain page or a flexible content element. In case of a page it will contain all the references
  * to content elements (and some more information) and in case of a FCE, references to its sub-elements.
  *
  * @param	string		$table: Table which contains the (XML) data structure. Only records from table 'pages' or flexible content elements from 'tt_content' are handled
  * @param	array		$row: Record of the root element where the tree starts (Possibly overlaid with workspace content)
  * @param	array		$tt_content_elementRegister: Register of used tt_content elements, don't mess with it! (passed by reference since data is built up)
  * @param	string		$prevRecList: comma separated list of uids, used internally for recursive calls. Don't mess with it!
  * @return	array		The content tree
  * @access	protected
  */
 function getContentTree_element($table, $row, &$tt_content_elementRegister, $prevRecList = '')
 {
     global $TCA, $LANG;
     $tree = array();
     $tree['el'] = array('table' => $table, 'uid' => $row['uid'], 'pid' => $row['pid'], '_ORIG_uid' => $row['_ORIG_uid'], 'title' => t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle($table, $row), 50), 'icon' => t3lib_iconWorks::getIcon($table, $row), 'sys_language_uid' => $row['sys_language_uid'], 'l18n_parent' => $row['l18n_parent'], 'CType' => $row['CType']);
     if ($this->includePreviewData) {
         $tree['previewData'] = array('fullRow' => $row);
     }
     // If element is a Flexible Content Element (or a page) then look at the content inside:
     if ($table == 'pages' || $table == $this->rootTable || $table == 'tt_content' && $row['CType'] == 'templavoila_pi1') {
         t3lib_div::loadTCA($table);
         $rawDataStructureArr = t3lib_BEfunc::getFlexFormDS($TCA[$table]['columns']['tx_templavoila_flex']['config'], $row, $table);
         $expandedDataStructureArr = $this->ds_getExpandedDataStructure($table, $row);
         switch ($table) {
             case 'pages':
                 $currentTemplateObject = $this->getContentTree_fetchPageTemplateObject($row);
                 break;
             case 'tt_content':
                 $currentTemplateObject = t3lib_beFunc::getRecordWSOL('tx_templavoila_tmplobj', $row['tx_templavoila_to']);
                 break;
             default:
                 $currentTemplateObject = FALSE;
         }
         if (is_array($currentTemplateObject)) {
             $templateMappingArr = unserialize($currentTemplateObject['templatemapping']);
         }
         $tree['ds_is_found'] = is_array($rawDataStructureArr);
         $tree['ds_meta'] = $rawDataStructureArr['meta'];
         $flexformContentArr = t3lib_div::xml2array($row['tx_templavoila_flex']);
         if (!is_array($flexformContentArr)) {
             $flexformContentArr = array();
         }
         // Respect the currently selected language, for both concepts - with langChildren enabled and disabled:
         $langChildren = intval($tree['ds_meta']['langChildren']);
         $langDisable = intval($tree['ds_meta']['langDisable']);
         $lKeys = $langDisable ? array('lDEF') : ($langChildren ? array('lDEF') : $this->allSystemWebsiteLanguages['all_lKeys']);
         $vKeys = $langDisable ? array('vDEF') : ($langChildren ? $this->allSystemWebsiteLanguages['all_vKeys'] : array('vDEF'));
         // Traverse each sheet in the FlexForm Structure:
         foreach ($expandedDataStructureArr as $sheetKey => $sheetData) {
             // Add some sheet meta information:
             $tree['sub'][$sheetKey] = array();
             $tree['contentFields'][$sheetKey] = array();
             $tree['meta'][$sheetKey] = array('title' => is_array($sheetData) && $sheetData['ROOT']['TCEforms']['sheetTitle'] ? $LANG->sL($sheetData['ROOT']['TCEforms']['sheetTitle']) : '', 'description' => is_array($sheetData) && $sheetData['ROOT']['TCEforms']['sheetDescription'] ? $LANG->sL($sheetData['ROOT']['TCEforms']['sheetDescription']) : '', 'short' => is_array($sheetData) && $sheetData['ROOT']['TCEforms']['sheetShortDescr'] ? $LANG->sL($sheetData['ROOT']['TCEforms']['sheetShortDescr']) : '');
             // Traverse the sheet's elements:
             if (is_array($sheetData) && is_array($sheetData['ROOT']['el'])) {
                 foreach ($sheetData['ROOT']['el'] as $fieldKey => $fieldData) {
                     // Compile preview data:
                     if ($this->includePreviewData) {
                         $tree['previewData']['sheets'][$sheetKey][$fieldKey] = array('TCEforms' => $fieldData['TCEforms'], 'type' => $fieldData['type'], 'section' => $fieldData['section'], 'data' => array(), 'subElements' => array(), 'isMapped' => is_array($templateMappingArr['MappingInfo']['ROOT']['el'][$fieldKey]));
                         foreach ($lKeys as $lKey) {
                             foreach ($vKeys as $vKey) {
                                 if (is_array($flexformContentArr['data'])) {
                                     $tree['previewData']['sheets'][$sheetKey][$fieldKey]['data'][$lKey][$vKey] = $flexformContentArr['data'][$sheetKey][$lKey][$fieldKey][$vKey];
                                 }
                             }
                             if ($fieldData['type'] == 'array') {
                                 $tree['previewData']['sheets'][$sheetKey][$fieldKey]['subElements'][$lKey] = $flexformContentArr['data'][$sheetKey][$lKey][$fieldKey]['el'];
                             }
                         }
                     }
                     // If the current field points to other content elements, process them:
                     if ($fieldData['TCEforms']['config']['type'] == 'group' && $fieldData['TCEforms']['config']['internal_type'] == 'db' && $fieldData['TCEforms']['config']['allowed'] == 'tt_content') {
                         foreach ($lKeys as $lKey) {
                             foreach ($vKeys as $vKey) {
                                 $listOfSubElementUids = $flexformContentArr['data'][$sheetKey][$lKey][$fieldKey][$vKey];
                                 $tree['sub'][$sheetKey][$lKey][$fieldKey][$vKey] = $this->getContentTree_processSubContent($listOfSubElementUids, $tt_content_elementRegister, $prevRecList);
                                 $tree['sub'][$sheetKey][$lKey][$fieldKey][$vKey]['meta']['title'] = $fieldData['TCEforms']['label'];
                             }
                         }
                     } elseif ($fieldData['type'] != 'array' && $fieldData['TCEforms']['config']) {
                         // If generally there are non-container fields, register them:
                         $tree['contentFields'][$sheetKey][] = $fieldKey;
                     }
                 }
             }
         }
     }
     // Add localization info for this element:
     $tree['localizationInfo'] = $this->getContentTree_getLocalizationInfoForElement($tree, $tt_content_elementRegister);
     return $tree;
 }
示例#15
0
    /**
     * Renders the hierarchical display for a Data Structure.
     * Calls itself recursively
     *
     * @param	array		Part of Data Structure (array of elements)
     * @param	boolean		If true, the Data Structure table will show links for mapping actions. Otherwise it will just layout the Data Structure visually.
     * @param	array		Part of Current mapping information corresponding to the $dataStruct array - used to evaluate the status of mapping for a certain point in the structure.
     * @param	array		Array of HTML paths
     * @param	array		Options for mapping mode control (INNER, OUTER etc...)
     * @param	array		Content from template file splitted by current mapping info - needed to evaluate whether mapping information for a certain level actually worked on live content!
     * @param	integer		Recursion level, counting up
     * @param	array		Accumulates the table rows containing the structure. This is the array returned from the function.
     * @param	string		Form field prefix. For each recursion of this function, two [] parts are added to this prefix
     * @param	string		HTML path. For each recursion a section (divided by "|") is added.
     * @param	boolean		If true, the "Map" link can be shown, otherwise not. Used internally in the recursions.
     * @return	array		Table rows as an array of <tr> tags, $tRows
     */
    function drawDataStructureMap($dataStruct, $mappingMode = 0, $currentMappingInfo = array(), $pathLevels = array(), $optDat = array(), $contentSplittedByMapping = array(), $level = 0, $tRows = array(), $formPrefix = '', $path = '', $mapOK = 1)
    {
        $bInfo = t3lib_div::clientInfo();
        $multilineTooltips = $bInfo['BROWSER'] == 'msie';
        // Data Structure array must be ... and array of course...
        if (is_array($dataStruct)) {
            foreach ($dataStruct as $key => $value) {
                if ($key == 'meta') {
                    // Do not show <meta> information in mapping interface!
                    continue;
                }
                if (is_array($value)) {
                    // The value of each entry must be an array.
                    // ********************
                    // Making the row:
                    // ********************
                    $rowCells = array();
                    // Icon:
                    if ($value['type'] == 'array') {
                        if (!$value['section']) {
                            $t = 'co';
                            $tt = 'Container: ';
                        } else {
                            $t = 'sc';
                            $tt = 'Sections: ';
                        }
                    } elseif ($value['type'] == 'attr') {
                        $t = 'at';
                        $tt = 'Attribute: ';
                    } else {
                        $t = 'el';
                        $tt = 'Element: ';
                    }
                    $icon = '<img src="item_' . $t . '.gif" width="24" height="16" border="0" alt="" title="' . $tt . $key . '" style="margin-right: 5px;" class="absmiddle" />';
                    // Composing title-cell:
                    if (preg_match('/^LLL:/', $value['tx_templavoila']['title'])) {
                        $translatedTitle = $GLOBALS['LANG']->sL($value['tx_templavoila']['title']);
                        $translateIcon = '<sup title="This title is translated!">*</sup>';
                    } else {
                        $translatedTitle = $value['tx_templavoila']['title'];
                        $translateIcon = '';
                    }
                    $this->elNames[$formPrefix . '[' . $key . ']']['tx_templavoila']['title'] = $icon . '<strong>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($translatedTitle, 30)) . '</strong>' . $translateIcon;
                    $rowCells['title'] = '<img src="clear.gif" width="' . $level * 16 . '" height="1" alt="" />' . $this->elNames[$formPrefix . '[' . $key . ']']['tx_templavoila']['title'];
                    // Description:
                    $this->elNames[$formPrefix . '[' . $key . ']']['tx_templavoila']['description'] = $rowCells['description'] = htmlspecialchars($value['tx_templavoila']['description']);
                    // In "mapping mode", render HTML page and Command links:
                    if ($mappingMode) {
                        // HTML-path + CMD links:
                        $isMapOK = 0;
                        if ($currentMappingInfo[$key]['MAP_EL']) {
                            // If mapping information exists...:
                            if (isset($contentSplittedByMapping['cArray'][$key])) {
                                // If mapping of this information also succeeded...:
                                $cF = implode(chr(10), t3lib_div::trimExplode(chr(10), $contentSplittedByMapping['cArray'][$key], 1));
                                if (strlen($cF) > 200) {
                                    $cF = t3lib_div::fixed_lgd_cs($cF, 90) . ' ' . t3lib_div::fixed_lgd_cs($cF, -90);
                                }
                                // Render HTML path:
                                list($pI) = $this->markupObj->splitPath($currentMappingInfo[$key]['MAP_EL']);
                                $rowCells['htmlPath'] = '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_ok2.gif" width="18" height="16" border="0" alt="" title="' . htmlspecialchars($cF ? 'Content found (' . strlen($contentSplittedByMapping['cArray'][$key]) . ' chars)' . ($multilineTooltips ? ':' . chr(10) . chr(10) . $cF : '') : 'Content empty.') . '" class="absmiddle" />' . '<img src="../html_tags/' . $pI['el'] . '.gif" height="9" border="0" alt="" hspace="3" class="absmiddle" title="---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($currentMappingInfo[$key]['MAP_EL'], -80)) . '" />' . ($pI['modifier'] ? $pI['modifier'] . ($pI['modifier_value'] ? ':' . ($pI['modifier'] != 'RANGE' ? $pI['modifier_value'] : '...') : '') : '');
                                //#
                                //### Mansoor Ahmad - Change of PHP 5.3 support
                                //#
                                $rowCells['htmlPath'] = '<a href="' . $this->linkThisScript(array('htmlPath' => $path . ($path ? '|' : '') . preg_replace('/\\/[^ ]*$/', '', $currentMappingInfo[$key]['MAP_EL']), 'showPathOnly' => 1)) . '">' . $rowCells['htmlPath'] . '</a>';
                                // CMD links, default content:
                                $rowCells['cmdLinks'] = '<span class="nobr"><input type="submit" value="Re-Map" name="_" onclick="document.location=\'' . $this->linkThisScript(array('mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path, 'mappingToTags' => $value['tx_templavoila']['tags'])) . '\';return false;" title="Map this DS element to another HTML element in template file." />' . '<input type="submit" value="Ch.Mode" name="_" onclick="document.location=\'' . $this->linkThisScript(array('mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path . ($path ? '|' : '') . $pI['path'], 'doMappingOfPath' => 1)) . '\';return false;" title="Change mapping mode, eg. from INNER to OUTER etc." /></span>';
                                // If content mapped ok, set flag:
                                $isMapOK = 1;
                            } else {
                                // Issue warning if mapping was lost:
                                $rowCells['htmlPath'] = '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_warning.gif" width="18" height="16" border="0" alt="" title="No content found!" class="absmiddle" />' . htmlspecialchars($currentMappingInfo[$key]['MAP_EL']);
                            }
                        } else {
                            // For non-mapped cases, just output a no-break-space:
                            $rowCells['htmlPath'] = '&nbsp;';
                        }
                        // CMD links; Content when current element is under mapping, then display control panel or message:
                        if ($this->mapElPath == $formPrefix . '[' . $key . ']') {
                            if ($this->doMappingOfPath) {
                                // Creating option tags:
                                $lastLevel = end($pathLevels);
                                $tagsMapping = $this->explodeMappingToTagsStr($value['tx_templavoila']['tags']);
                                $mapDat = is_array($tagsMapping[$lastLevel['el']]) ? $tagsMapping[$lastLevel['el']] : $tagsMapping['*'];
                                unset($mapDat['']);
                                if (is_array($mapDat) && !count($mapDat)) {
                                    unset($mapDat);
                                }
                                // Create mapping options:
                                $didSetSel = 0;
                                $opt = array();
                                foreach ($optDat as $k => $v) {
                                    list($pI) = $this->markupObj->splitPath($k);
                                    if ($value['type'] == 'attr' && $pI['modifier'] == 'ATTR' || $value['type'] != 'attr' && $pI['modifier'] != 'ATTR') {
                                        if ((!$this->markupObj->tags[$lastLevel['el']]['single'] || $pI['modifier'] != 'INNER') && (!is_array($mapDat) || $pI['modifier'] != 'ATTR' && isset($mapDat[strtolower($pI['modifier'] ? $pI['modifier'] : 'outer')]) || $pI['modifier'] == 'ATTR' && (isset($mapDat['attr']['*']) || isset($mapDat['attr'][$pI['modifier_value']])))) {
                                            if ($k == $currentMappingInfo[$key]['MAP_EL']) {
                                                $sel = ' selected="selected"';
                                                $didSetSel = 1;
                                            } else {
                                                $sel = '';
                                            }
                                            $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
                                        }
                                    }
                                }
                                // Finally, put together the selector box:
                                $rowCells['cmdLinks'] = '<img src="../html_tags/' . $lastLevel['el'] . '.gif" height="9" border="0" alt="" class="absmiddle" title="---' . htmlspecialchars(t3lib_div::fixed_lgd_cs($lastLevel['path'], -80)) . '" /><br />
									<select name="dataMappingForm' . $formPrefix . '[' . $key . '][MAP_EL]">
										' . implode('
										', $opt) . '
										<option value=""></option>
									</select>
									<br />
									<input type="submit" name="_save_data_mapping" value="Set" />
									<input type="submit" name="_" value="Cancel" />';
                                $rowCells['cmdLinks'] .= $this->cshItem('xMOD_tx_templavoila', 'mapping_modeset', $this->doc->backPath, '', FALSE, 'margin-bottom: 0px;');
                            } else {
                                $rowCells['cmdLinks'] = '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/icon_note.gif" width="18" height="16" border="0" alt="" class="absmiddle" /><strong>Click a tag-icon in the window below to map this element.</strong>';
                                $rowCells['cmdLinks'] .= '<br />
										<input type="submit" value="Cancel" name="_" onclick="document.location=\'' . $this->linkThisScript(array()) . '\';return false;" />';
                            }
                        } elseif (!$rowCells['cmdLinks'] && $mapOK && $value['type'] != 'no_map') {
                            $rowCells['cmdLinks'] = '
										<input type="submit" value="Map" name="_" onclick="document.location=\'' . $this->linkThisScript(array('mapElPath' => $formPrefix . '[' . $key . ']', 'htmlPath' => $path, 'mappingToTags' => $value['tx_templavoila']['tags'])) . '\';return false;" />';
                        }
                    }
                    // Display mapping rules:
                    $rowCells['tagRules'] = implode('<br />', t3lib_div::trimExplode(',', strtolower($value['tx_templavoila']['tags']), 1));
                    if (!$rowCells['tagRules']) {
                        $rowCells['tagRules'] = '(ALL)';
                    }
                    // Display edit/delete icons:
                    if ($this->editDataStruct) {
                        $editAddCol = '<a href="' . $this->linkThisScript(array('DS_element' => $formPrefix . '[' . $key . ']')) . '">' . '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/edit2.gif" width="11" height="12" hspace="2" border="0" alt="" title="Edit entry" />' . '</a>';
                        $editAddCol .= '<a href="' . $this->linkThisScript(array('DS_element_DELETE' => $formPrefix . '[' . $key . ']')) . '">' . '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/garbage.gif" width="11" height="12" hspace="2" border="0" alt="" title="DELETE entry" onclick=" return confirm(\'Are you sure to delete this Data Structure entry?\');" />' . '</a>';
                        $editAddCol = '<td nowrap="nowrap">' . $editAddCol . '</td>';
                    } else {
                        $editAddCol = '';
                    }
                    // Description:
                    if ($this->_preview) {
                        $rowCells['description'] = is_array($value['tx_templavoila']['sample_data']) ? t3lib_div::view_array($value['tx_templavoila']['sample_data']) : '[No sample data]';
                    }
                    // Put row together
                    if (!$this->mapElPath || $this->mapElPath == $formPrefix . '[' . $key . ']') {
                        $tRows[] = '

							<tr class="bgColor4">
							<td nowrap="nowrap" valign="top">' . $rowCells['title'] . '</td>
							' . ($this->editDataStruct ? '<td nowrap="nowrap">' . $key . '</td>' : '') . '
							<td>' . $rowCells['description'] . '</td>
							' . ($mappingMode ? '<td nowrap="nowrap">' . $rowCells['htmlPath'] . '</td>
								<td>' . $rowCells['cmdLinks'] . '</td>' : '') . '
							<td>' . $rowCells['tagRules'] . '</td>
							' . $editAddCol . '
						</tr>';
                    }
                    // Getting editing row, if applicable:
                    list($addEditRows, $placeBefore) = $this->drawDataStructureMap_editItem($formPrefix, $key, $value, $level);
                    // Add edit-row if found and destined to be set BEFORE:
                    if ($addEditRows && $placeBefore) {
                        $tRows[] = $addEditRows;
                    }
                    // Recursive call:
                    if ($value['type'] == 'array') {
                        $tRows = $this->drawDataStructureMap($value['el'], $mappingMode, $currentMappingInfo[$key]['el'], $pathLevels, $optDat, $contentSplittedByMapping['sub'][$key], $level + 1, $tRows, $formPrefix . '[' . $key . '][el]', $path . ($path ? '|' : '') . $currentMappingInfo[$key]['MAP_EL'], $isMapOK);
                    }
                    // Add edit-row if found and destined to be set AFTER:
                    if ($addEditRows && !$placeBefore) {
                        $tRows[] = $addEditRows;
                    }
                }
            }
        }
        return $tRows;
    }
 /**
  * Adds the foreign record elements to $dataAcc, if any
  *
  * @param	array		Array with numeric keys, containing values for the selector box, prepared for interface. We are going to add elements to this array as needed.
  * @param	array		The array of original elements - basically the field value exploded by ","
  * @param	array		Field configuration from TCA
  * @param	string		The field name
  * @param	array		TSconfig for the record
  * @param	array		The record
  * @param	array		The current table
  * @return	array		Modified $dataAcc array
  * @access private
  * @see renderRecord_selectProc()
  */
 function selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row, $table)
 {
     global $TCA;
     // Init:
     $recordList = array();
     // foreign_table
     $subres = t3lib_BEfunc::exec_foreign_table_where_query($fieldConfig, $field, $TSconfig);
     while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($subres)) {
         $recordList[$subrow['uid']] = t3lib_BEfunc::getRecordTitle($fieldConfig['config']['foreign_table'], $subrow);
     }
     // neg_foreign_table
     if (is_array($TCA[$fieldConfig['config']['neg_foreign_table']])) {
         $subres = t3lib_BEfunc::exec_foreign_table_where_query($fieldConfig, $field, $TSconfig, 'neg_');
         while ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($subres)) {
             $recordList[-$subrow['uid']] = t3lib_BEfunc::getRecordTitle($fieldConfig['config']['neg_foreign_table'], $subrow);
         }
     }
     // At this point all records that CAN be selected is found in $recordList
     // Now, get the data from loadDBgroup based on the input list of values.
     $dataIds = $this->getDataIdList($elements, $fieldConfig, $row, $table);
     if ($fieldConfig['config']['MM']) {
         $dataAcc = array();
     }
     // Reset, if MM (which cannot bear anything but real relations!)
     // After this we can traverse the loadDBgroup values and match values with the list of possible values in $recordList:
     foreach ($dataIds as $theId) {
         if (isset($recordList[$theId])) {
             $lPrefix = $this->sL($fieldConfig['config'][($theId > 0 ? '' : 'neg_') . 'foreign_table_prefix']);
             if ($fieldConfig['config']['MM'] || $fieldConfig['config']['foreign_field']) {
                 $dataAcc[] = rawurlencode($theId) . '|' . rawurlencode(t3lib_div::fixed_lgd_cs($lPrefix . strip_tags($recordList[$theId]), $GLOBALS['BE_USER']->uc['titleLen']));
             } else {
                 foreach ($elements as $eKey => $value) {
                     if (!strcmp($theId, $value)) {
                         $dataAcc[$eKey] = rawurlencode($theId) . '|' . rawurlencode(t3lib_div::fixed_lgd_cs($lPrefix . strip_tags($recordList[$theId]), $GLOBALS['BE_USER']->uc['titleLen']));
                     }
                 }
             }
         }
     }
     return $dataAcc;
 }
 /**
  * Performs a cleanup of the field values before they're passed into the preview
  *
  *.@param	string		$str: input usually taken from bodytext or any other field
  * @param	integer		$max: some items might not need to cover the full maximum
  * @param	boolean		$stripTags: HTML-blocks usually keep their tags
  * @return	string		the properly prepared string
  */
 protected function preparePreviewData($str, $max = null, $stripTags = true)
 {
     //Enable to omit that parameter
     if ($max === null) {
         if (isset($this->parentObj->modTSconfig['properties']['previewDataMaxLen'])) {
             $max = intval($this->parentObj->modTSconfig['properties']['previewDataMaxLen']);
         } else {
             $max = 2000;
         }
     }
     if ($stripTags) {
         //remove tags but avoid that the output is concatinated without spaces (#8375)
         $newStr = strip_tags(preg_replace('/(\\S)<\\//', '\\1 </', $str));
     } else {
         $newStr = $str;
     }
     if (isset($this->parentObj->modTSconfig['properties']['previewDataMaxWordLen'])) {
         $wordLen = intval($this->parentObj->modTSconfig['properties']['previewDataMaxWordLen']);
     } else {
         $wordLen = 75;
     }
     if ($wordLen) {
         $newStr = preg_replace('/(\\S{' . $wordLen . '})/', '\\1 ', $newStr);
     }
     return htmlspecialchars(t3lib_div::fixed_lgd_cs(trim($newStr), $max));
 }
示例#18
0
				/**
				 * Main function of the module. Write the content to $this->content
				 * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
				 *
				 * @return	[type]		...
				 */
				function main()	{
					global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;

					// Access check!
					// The page will show only if there is a valid page and if this page may be viewed by the user
					$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
					$access = is_array($this->pageinfo) ? 1 : 0;
				
							// Draw the header.
						$this->doc = t3lib_div::makeInstance('mediumDoc');
						$this->doc->backPath = $BACK_PATH;

						$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'
							. $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);

						$this->content.=$this->doc->startPage($LANG->getLL('title'));
						$this->content.=$this->doc->header($LANG->getLL('title'));
						$this->content.=$this->doc->divider(5);


						// Render content:
						$this->moduleContent();
				
				}
    /**
     * Generates the "edit panels" which can be shown for a page or records on a page when the Admin Panel is enabled for a backend users surfing the frontend.
     * With the "edit panel" the user will see buttons with links to editing, moving, hiding, deleting the element
     * This function is used for the cObject EDITPANEL and the stdWrap property ".editPanel"
     *
     * @param	string		A content string containing the content related to the edit panel. For cObject "EDITPANEL" this is empty but not so for the stdWrap property. The edit panel is appended to this string and returned.
     * @param	array		TypoScript configuration properties for the editPanel
     * @param	string		The "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW"
     * @param	array		Alternative data array to use. Default is $this->data
     * @return	string		The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned.
     * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=375&cHash=7d8915d508
     */
    public function editPanel($content, array $conf, $currentRecord = '', array $dataArr = array(), $table = '', $allow = '', $newUID = 0, array $hiddenFields = array())
    {
        // Special content is about to be shown, so the cache must be disabled.
        $GLOBALS['TSFE']->set_no_cache();
        $formName = 'TSFE_EDIT_FORM_' . substr($GLOBALS['TSFE']->uniqueHash(), 0, 4);
        $formTag = '<form name="' . $formName . '" id ="' . $formName . '" action="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" onsubmit="return TBE_EDITOR.checkSubmit(1);" style="margin: 0 0 0 0;">';
        $sortField = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
        $labelField = $GLOBALS['TCA'][$table]['ctrl']['label'];
        $hideField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
        $blackLine = $conf['line'] ? '<img src="clear.gif" width="1" height="' . intval($conf['line']) . '" alt="" title="" /><br /><table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="black" style="border: 0px;" summary=""><tr style="border: 0px;"><td style="border: 0px;"><img src="clear.gif" width="1" height="1" alt="" title="" /></td></tr></table><br />' : '';
        $theCmd = '';
        $TSFE_EDIT = $GLOBALS['BE_USER']->frontendEdit->TSFE_EDIT;
        if (is_array($TSFE_EDIT) && $TSFE_EDIT['record'] == $currentRecord && !$TSFE_EDIT['update_close']) {
            $theCmd = $TSFE_EDIT['cmd'];
        }
        switch ($theCmd) {
            case 'edit':
            case 'new':
                $finalOut = $this->editContent($formTag, $formName, $theCmd, $newUID, $dataArr, $table, $currentRecord, $blackLine);
                break;
            default:
                $panel = '';
                if (isset($allow['toolbar']) && $GLOBALS['BE_USER']->adminPanel instanceof tslib_AdminPanel) {
                    $panel .= $GLOBALS['BE_USER']->adminPanel->ext_makeToolBar() . '<img src="clear.gif" width="2" height="1" alt="" title="" />';
                }
                if (isset($allow['edit'])) {
                    $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/edit2.gif" width="11" height="12" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_editRecord') . '" align="top" alt="" />', $formName, 'edit', $dataArr['_LOCALIZED_UID'] ? $table . ':' . $dataArr['_LOCALIZED_UID'] : $currentRecord);
                }
                // Hiding in workspaces because implementation is incomplete
                if (isset($allow['move']) && $sortField && $GLOBALS['BE_USER']->workspace === 0) {
                    $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/button_up.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_moveUp') . '" align="top" alt="" />', $formName, 'up');
                    $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/button_down.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_moveDown') . '" align="top" alt="" />', $formName, 'down');
                }
                // Hiding in workspaces because implementation is incomplete, Hiding for localizations because it is unknown what should be the function in that case
                if (isset($allow['hide']) && $hideField && $GLOBALS['BE_USER']->workspace === 0 && !$dataArr['_LOCALIZED_UID']) {
                    if ($dataArr[$hideField]) {
                        $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/button_unhide.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_unhide') . '" align="top" alt="" />', $formName, 'unhide');
                    } else {
                        $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/button_hide.gif" width="11" height="10" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_hide') . '" align="top" alt="" />', $formName, 'hide', '', $GLOBALS['BE_USER']->extGetLL('p_hideConfirm'));
                    }
                }
                if (isset($allow['new'])) {
                    if ($table == 'pages') {
                        $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/new_page.gif" width="13" height="12" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_newSubpage') . '" align="top" alt="" />', $formName, 'new', $currentRecord, '', $nPid);
                    } else {
                        $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/new_record.gif" width="16" height="12" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_newRecordAfter') . '" align="top" alt="" />', $formName, 'new', $currentRecord, '', $nPid);
                    }
                }
                // Hiding in workspaces because implementation is incomplete, Hiding for localizations because it is unknown what should be the function in that case
                if (isset($allow['delete']) && $GLOBALS['BE_USER']->workspace === 0 && !$dataArr['_LOCALIZED_UID']) {
                    $panel .= $this->editPanelLinkWrap('<img src="' . TYPO3_mainDir . 'gfx/delete_record.gif" width="12" height="12" vspace="1" hspace="2" border="0" title="' . $GLOBALS['BE_USER']->extGetLL('p_delete') . '" align="top" alt="" />', $formName, 'delete', '', $GLOBALS['BE_USER']->extGetLL('p_deleteConfirm'));
                }
                //	Final
                $labelTxt = $this->cObj->stdWrap($conf['label'], $conf['label.']);
                foreach ((array) $hiddenFields as $name => $value) {
                    $hiddenFieldString .= '<input type="hidden" name="TSFE_EDIT[' . $name . ']" value="' . $value . '"/>' . LF;
                }
                $panel = '

							<!-- BE_USER Edit Panel: -->
							' . $formTag . $hiddenFieldString . '
								<input type="hidden" name="TSFE_EDIT[cmd]" value="" />
								<input type="hidden" name="TSFE_EDIT[record]" value="' . $currentRecord . '" />
								<table border="0" cellpadding="0" cellspacing="0" class="typo3-editPanel" summary="">
									<tr>
										<td nowrap="nowrap" bgcolor="#ABBBB4" class="typo3-editPanel-controls">' . $panel . '</td>' . ($labelTxt ? '<td nowrap="nowrap" bgcolor="#F6F2E6" class="typo3-editPanel-label"><font face="verdana" size="1" color="black">&nbsp;' . sprintf($labelTxt, htmlspecialchars(t3lib_div::fixed_lgd_cs($dataArr[$labelField], 50))) . '&nbsp;</font></td>' : '') . '
									</tr>
								</table>
							</form>';
                // wrap the panel
                if ($conf['innerWrap']) {
                    $panel = $this->cObj->wrap($panel, $conf['innerWrap']);
                }
                if ($conf['innerWrap.']) {
                    $panel = $this->cObj->stdWrap($panel, $conf['innerWrap.']);
                }
                // add black line:
                $panel .= $blackLine;
                // wrap the complete panel
                if ($conf['outerWrap']) {
                    $panel = $this->cObj->wrap($panel, $conf['outerWrap']);
                }
                if ($conf['outerWrap.']) {
                    $panel = $this->cObj->stdWrap($panel, $conf['outerWrap.']);
                }
                if ($conf['printBeforeContent']) {
                    $finalOut = $panel . $content;
                } else {
                    $finalOut = $content . $panel;
                }
                break;
        }
        if ($conf['previewBorder']) {
            if (!is_array($conf['previewBorder.'])) {
                $conf['previewBorder.'] = array();
            }
            $finalOut = $this->editPanelPreviewBorder($table, $dataArr, $finalOut, $conf['previewBorder'], $conf['previewBorder.']);
        }
        return $finalOut;
    }
示例#20
0
文件: index.php 项目: rod86/t3sandbox
    /**
     * Renders a little table containing previews of translated version of the current content element.
     *
     * @param	array		$contentTreeArr: Part of the contentTreeArr for the element
     * @param	string		$parentPointer: Flexform pointer pointing to the current element (from the parent's perspective)
     * @param	array		$parentDsMeta: Meta array from parent DS (passing information about parent containers localization mode)
     * @return	string		HTML
     * @access protected
     * @see 	render_framework_singleSheet()
     */
    function render_localizationInfoTable($contentTreeArr, $parentPointer, $parentDsMeta = array())
    {
        global $LANG, $BE_USER;
        // LOCALIZATION information for content elements (non Flexible Content Elements)
        $output = '';
        if ($contentTreeArr['el']['table'] == 'tt_content' && $contentTreeArr['el']['sys_language_uid'] <= 0) {
            // Traverse the available languages of the page (not default and [All])
            $tRows = array();
            foreach ($this->translatedLanguagesArr as $sys_language_uid => $sLInfo) {
                if ($this->MOD_SETTINGS['langDisplayMode'] && $this->currentLanguageUid != $sys_language_uid) {
                    continue;
                }
                if ($sys_language_uid > 0) {
                    $l10nInfo = '';
                    $flagLink_begin = $flagLink_end = '';
                    switch ((string) $contentTreeArr['localizationInfo'][$sys_language_uid]['mode']) {
                        case 'exists':
                            $olrow = t3lib_BEfunc::getRecordWSOL('tt_content', $contentTreeArr['localizationInfo'][$sys_language_uid]['localization_uid']);
                            $localizedRecordInfo = array('uid' => $olrow['uid'], 'row' => $olrow, 'content' => $this->render_previewContent($olrow));
                            // Put together the records icon including content sensitive menu link wrapped around it:
                            $recordIcon_l10n = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $localizedRecordInfo['row']);
                            if (!$this->translatorMode) {
                                $recordIcon_l10n = $this->doc->wrapClickMenuOnIcon($recordIcon_l10n, 'tt_content', $localizedRecordInfo['uid'], 1, '&amp;callingScriptId=' . rawurlencode($this->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter');
                            }
                            $l10nInfo = $this->getRecordStatHookValue('tt_content', $localizedRecordInfo['row']['uid']) . $recordIcon_l10n . htmlspecialchars(t3lib_div::fixed_lgd_cs(strip_tags(t3lib_BEfunc::getRecordTitle('tt_content', $localizedRecordInfo['row'])), $this->previewTitleMaxLen));
                            $l10nInfo .= '<br/>' . $localizedRecordInfo['content'];
                            list($flagLink_begin, $flagLink_end) = explode('|*|', $this->link_edit('|*|', 'tt_content', $localizedRecordInfo['uid'], TRUE));
                            if ($this->translatorMode) {
                                $l10nInfo .= '<br/>' . $flagLink_begin . '<em>' . $LANG->getLL('clickToEditTranslation') . '</em>' . $flagLink_end;
                            }
                            // Wrap workspace notification colors:
                            if ($olrow['_ORIG_uid']) {
                                $l10nInfo = '<div class="ver-element">' . $l10nInfo . '</div>';
                            }
                            $this->global_localization_status[$sys_language_uid][] = array('status' => 'exist', 'parent_uid' => $contentTreeArr['el']['uid'], 'localized_uid' => $localizedRecordInfo['row']['uid'], 'sys_language' => $contentTreeArr['el']['sys_language_uid']);
                            break;
                        case 'localize':
                            if (isset($this->modTSconfig['properties']['hideCopyForTranslation'])) {
                                $showLocalizationLinks = 0;
                            } else {
                                if ($this->rootElementLangParadigm == 'free') {
                                    $showLocalizationLinks = !$parentDsMeta['langDisable'];
                                    // For this paradigm, show localization links only if localization is enabled for DS (regardless of Inheritance and Separate)
                                } else {
                                    $showLocalizationLinks = $parentDsMeta['langDisable'] || $parentDsMeta['langChildren'];
                                    // Adding $parentDsMeta['langDisable'] here means that the "Create a copy for translation" link is shown only if the parent container element has localization mode set to "Disabled" or "Inheritance" - and not "Separate"!
                                }
                            }
                            // Assuming that only elements which have the default language set are candidates for localization. In case the language is [ALL] then it is assumed that the element should stay "international".
                            if ((int) $contentTreeArr['el']['sys_language_uid'] === 0 && $showLocalizationLinks) {
                                // Copy for language:
                                if ($this->rootElementLangParadigm == 'free') {
                                    $sourcePointerString = $this->apiObj->flexform_getStringFromPointer($parentPointer);
                                    $onClick = "document.location='index.php?" . $this->link_getParameters() . '&source=' . rawurlencode($sourcePointerString) . '&localizeElement=' . $sLInfo['ISOcode'] . "'; return false;";
                                } else {
                                    $params = '&cmd[tt_content][' . $contentTreeArr['el']['uid'] . '][localize]=' . $sys_language_uid;
                                    $onClick = "document.location='" . $GLOBALS['SOBE']->doc->issueCommand($params) . "'; return false;";
                                }
                                $linkLabel = $LANG->getLL('createcopyfortranslation', 1) . ' (' . htmlspecialchars($sLInfo['title']) . ')';
                                $localizeIcon = t3lib_iconWorks::getSpriteIcon('actions-edit-copy', array('title' => $linkLabel));
                                $l10nInfo = '<a class="tpm-clipCopyTranslation" href="#" onclick="' . htmlspecialchars($onClick) . '">' . $localizeIcon . '</a>';
                                $l10nInfo .= ' <em><a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $linkLabel . '</a></em>';
                                $flagLink_begin = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">';
                                $flagLink_end = '</a>';
                                $this->global_localization_status[$sys_language_uid][] = array('status' => 'localize', 'parent_uid' => $contentTreeArr['el']['uid'], 'sys_language' => $contentTreeArr['el']['sys_language_uid']);
                            }
                            break;
                        case 'localizedFlexform':
                            // Here we want to show the "Localized FlexForm" information (and link to edit record) _only_ if there are other fields than group-fields for content elements: It only makes sense for a translator to deal with the record if that is the case.
                            // Change of strategy (27/11): Because there does not have to be content fields; could be in sections or arrays and if thats the case you still want to localize them! There has to be another way...
                            // if (count($contentTreeArr['contentFields']['sDEF']))	{
                            list($flagLink_begin, $flagLink_end) = explode('|*|', $this->link_edit('|*|', 'tt_content', $contentTreeArr['el']['uid'], TRUE));
                            $l10nInfo = $flagLink_begin . '<em>[' . $LANG->getLL('performTranslation') . ']</em>' . $flagLink_end;
                            $this->global_localization_status[$sys_language_uid][] = array('status' => 'flex', 'parent_uid' => $contentTreeArr['el']['uid'], 'sys_language' => $contentTreeArr['el']['sys_language_uid']);
                            // }
                            break;
                    }
                    if ($l10nInfo && $BE_USER->checkLanguageAccess($sys_language_uid)) {
                        $tRows[] = '
							<tr class="bgColor4">
								<td width="1%">' . $flagLink_begin . tx_templavoila_icons::getFlagIconForLanguage($sLInfo['flagIcon'], array('title' => $sLInfo['title'], 'alt' => $sLInfo['title'])) . $flagLink_end . '</td>
								<td width="99%">' . $l10nInfo . '</td>
							</tr>';
                    }
                }
            }
            $output = count($tRows) ? '
				<table border="0" cellpadding="0" cellspacing="1" width="100%" class="lrPadding tpm-localisation-info-table">
					<tr class="bgColor4-20">
						<td colspan="2">' . $LANG->getLL('element_localizations', 1) . ':</td>
					</tr>
					' . implode('', $tRows) . '
				</table>
			' : '';
        }
        return $output;
    }
    /**
     * Displays the edit page screen if the currently selected page is of the doktype "Sysfolder"
     *
     * @param	array		$pageRecord: The current page record
     * @return	mixed		HTML output from this submodule or FALSE if this submodule doesn't feel responsible
     * @access	public
     */
    function renderDoktype_254($pageRecord)
    {
        global $LANG, $BE_USER, $TYPO3_CONF_VARS;
        // Prepare the record icon including a content sensitive menu link wrapped around it:
        $pageTitle = htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages', $pageRecord), 50));
        $recordIcon = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord);
        $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => htmlspecialchars($LANG->sL('LLL:EXT:lang/locallang_mod_web_list.xml:editPage'))));
        $editButton = $this->pObj->link_edit($iconEdit, 'pages', $pageRecord['uid']);
        if ($this->userHasAccessToListModule()) {
            if (tx_templavoila_div::convertVersionNumberToInteger(TYPO3_version) < 4005000) {
                $listModuleURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'db_list.php?id=' . intval($this->pObj->id);
            } else {
                $listModuleURL = t3lib_BEfunc::getModuleUrl('web_list', array('id' => intval($this->pObj->id)), '');
            }
            $onClick = "top.nextLoadModuleUrl='" . $listModuleURL . "';top.fsMod.recentIds['web']=" . intval($this->pObj->id) . ";top.goToModule('web_list',1);";
            $listModuleLink = '<br /><br />' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '<strong><a href="#" onClick="' . $onClick . '">' . $LANG->getLL('editpage_sysfolder_switchtolistview', '', 1) . '</a></strong>
			';
        } else {
            $listModuleLink = $LANG->getLL('editpage_sysfolder_listview_noaccess', '', 1);
        }
        $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $LANG->getLL('editpage_sysfolder_intro', '', 1), '', t3lib_FlashMessage::INFO);
        $content = $flashMessage->render() . $listModuleLink;
        return $content;
    }
示例#22
0
 /**
  * Generate the page path for docheader
  *
  * @param 	array	Current page
  * @return	string	Page path
  */
 protected function getPagePath($pageRecord)
 {
     // Is this a real page
     if ($pageRecord['uid']) {
         $title = substr($pageRecord['_thePathFull'], 0, -1);
         // remove current page title
         $pos = strrpos($title, '/');
         if ($pos !== FALSE) {
             $title = substr($title, 0, $pos) . '/';
         }
     } else {
         $title = '';
     }
     // Setting the path of the page
     $pagePath = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path', 1) . ': <span class="typo3-docheader-pagePath">';
     // crop the title to title limit (or 50, if not defined)
     $cropLength = empty($GLOBALS['BE_USER']->uc['titleLen']) ? 50 : $GLOBALS['BE_USER']->uc['titleLen'];
     $croppedTitle = t3lib_div::fixed_lgd_cs($title, -$cropLength);
     if ($croppedTitle !== $title) {
         $pagePath .= '<abbr title="' . htmlspecialchars($title) . '">' . htmlspecialchars($croppedTitle) . '</abbr>';
     } else {
         $pagePath .= htmlspecialchars($title);
     }
     $pagePath .= '</span>';
     return $pagePath;
 }
    /**
     * Showing the permissions in a tree ($this->edit = false)
     * (Adding content to internal content variable)
     *
     * @return	void
     */
    function notEdit()
    {
        global $BE_USER, $LANG, $BACK_PATH;
        // get ACL configuration
        $beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
        if ($beAclConfig['disableOldPermissionSystem']) {
            $disableOldPermissionSystem = 1;
        } else {
            $disableOldPermissionSystem = 0;
        }
        $LANG->includeLLFile('EXT:be_acl/res/locallang_perm.php');
        // Get usernames and groupnames: The arrays we get in return contains only 1) users which are members of the groups of the current user, 2) groups that the current user is member of
        $groupArray = $BE_USER->userGroupsUID;
        $be_user_Array = t3lib_BEfunc::getUserNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $be_user_Array = t3lib_BEfunc::blindUserNames($be_user_Array, $groupArray, 0);
        }
        $be_group_Array = t3lib_BEfunc::getGroupNames();
        if (!$GLOBALS['BE_USER']->isAdmin()) {
            $be_group_Array = t3lib_BEfunc::blindGroupNames($be_group_Array, $groupArray, 0);
        }
        // Length of strings:
        $tLen = $this->MOD_SETTINGS['mode'] == 'perms' ? 20 : 30;
        // Selector for depth:
        $code .= $LANG->getLL('Depth') . ': ';
        $code .= t3lib_BEfunc::getFuncMenu($this->id, 'SET[depth]', $this->MOD_SETTINGS['depth'], $this->MOD_MENU['depth']);
        $this->content .= $this->doc->section('', $code);
        $this->content .= $this->doc->spacer(5);
        // Initialize tree object:
        $tree = t3lib_div::makeInstance('t3lib_pageTree');
        $tree->init('AND ' . $this->perms_clause);
        $tree->addField('perms_user', 1);
        $tree->addField('perms_group', 1);
        $tree->addField('perms_everybody', 1);
        $tree->addField('perms_userid', 1);
        $tree->addField('perms_groupid', 1);
        $tree->addField('hidden');
        $tree->addField('fe_group');
        $tree->addField('starttime');
        $tree->addField('endtime');
        $tree->addField('editlock');
        // Creating top icon; the current page
        $HTML = t3lib_iconWorks::getIconImage('pages', $this->pageinfo, $BACK_PATH, 'align="top"');
        $tree->tree[] = array('row' => $this->pageinfo, 'HTML' => $HTML);
        // Create the tree from $this->id:
        $tree->getTree($this->id, $this->MOD_SETTINGS['depth'], '');
        // get list of ACL users and groups, and initialize ACLs
        $aclUsers = $this->acl_objectSelector(0, $displayUserSelector, $beAclConfig);
        $aclGroups = $this->acl_objectSelector(1, $displayGroupSelector, $beAclConfig);
        $this->buildACLtree($aclUsers, $aclGroups);
        $this->content .= $displayUserSelector;
        $this->content .= $displayGroupSelector;
        // Make header of table:
        $code = '';
        if ($this->MOD_SETTINGS['mode'] == 'perms') {
            $code .= '
				<tr>
					<td class="bgColor2" colspan="2">&nbsp;</td>';
            $code .= '
					<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';
            $tableCells = array();
            if (!$disableOldPermissionSystem) {
                $tableCells[] = '<b>' . $LANG->getLL('Owner', 1) . '</b>';
                $tableCells[] = '<b>' . $LANG->getLL('Group', 1) . '</b>';
                $tableCells[] = '<b>' . $LANG->getLL('Everybody', 1) . '</b>';
            }
            // $tableCells[] = '<b>'.$LANG->getLL('EditLock',1).'</b>'; // TODO: Editlock
            // ACL headers
            if (!empty($aclUsers)) {
                $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclUser') . '</b>';
                foreach ($aclUsers as $uid) {
                    $tableCells[] = $be_user_Array[$uid]['username'];
                }
            }
            if (!empty($aclGroups)) {
                $tableCells[] = '<b>' . $GLOBALS['LANG']->getLL('aclGroup') . '</b>';
                foreach ($aclGroups as $uid) {
                    $tableCells[] = $be_group_Array[$uid]['title'];
                }
            }
            $code .= $this->printTableHeader($tableCells);
            $code .= '</tr>';
        } else {
            $code .= '
				<tr>
					<td class="bgColor2" colspan="2">&nbsp;</td>
					<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td class="bgColor2" align="center" nowrap="nowrap"><b>' . $LANG->getLL('User', 1) . ':</b> ' . $BE_USER->user['username'] . '</td>
					' . (!$BE_USER->isAdmin() ? '<td class="bgColor2"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td class="bgColor2" align="center"><b>' . $LANG->getLL('EditLock', 1) . '</b></td>' : '') . '
				</tr>';
        }
        // Traverse tree:
        foreach ($tree->tree as $data) {
            $cells = array();
            // Background colors:
            //if ($this->lastEdited==$data['row']['uid'])	{$bgCol = ' class="bgColor-20"';} else {$bgCol = '';}
            $bgCol = '';
            $lE_bgCol = $bgCol;
            // User/Group names:
            $userN = $be_user_Array[$data['row']['perms_userid']] ? $be_user_Array[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>[' . $data['row']['perms_userid'] . ']!</i>' : '');
            $groupN = $be_group_Array[$data['row']['perms_groupid']] ? $be_group_Array[$data['row']['perms_groupid']]['title'] : ($data['row']['perms_groupid'] ? '<i>[' . $data['row']['perms_groupid'] . ']!</i>' : '');
            $groupN = t3lib_div::fixed_lgd_cs($groupN, 20);
            // Seeing if editing of permissions are allowed for that page:
            $editPermsAllowed = $data['row']['perms_userid'] == $BE_USER->user['uid'] || $BE_USER->isAdmin();
            // First column:
            $cells[] = '
					<td align="left" nowrap="nowrap"' . $bgCol . $this->generateTitleAttribute($data['row']['uid'], $be_user_Array, $be_group_Array) . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $tLen)) . '&nbsp;</td>';
            // "Edit permissions" -icon
            if ($editPermsAllowed && $data['row']['uid']) {
                $aHref = 'index.php?mode=' . $this->MOD_SETTINGS['mode'] . '&depth=' . $this->MOD_SETTINGS['depth'] . '&id=' . $data['row']['uid'] . '&return_id=' . $this->id . '&edit=1';
                $cells[] = '
					<td' . $bgCol . '><a href="' . htmlspecialchars($aHref) . '"><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/edit2.gif', 'width="11" height="12"') . ' border="0" title="' . $LANG->getLL('ch_permissions', 1) . '" align="top" alt="" /></a></td>';
            } else {
                $cells[] = '
					<td' . $bgCol . '></td>';
            }
            // Rest of columns (depending on mode)
            if ($this->MOD_SETTINGS['mode'] == 'perms') {
                if (!$disableOldPermissionSystem) {
                    $cells[] = '
						<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_user']) . ' ' . $userN : '') . '</td>

						<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? $this->printPerms($data['row']['perms_group']) . ' ' . $groupN : '') . '</td>

						<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($data['row']['perms_everybody']) : '') . '</td>';
                }
                /*$cells[] ='
                			<td'.$bgCol.'><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/line.gif','width="5" height="16"').' alt="" /></td>
                			<td'.$bgCol.' nowrap="nowrap">'.($data['row']['editlock']?'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning2.gif','width="22" height="16"').' title="'.$LANG->getLL('EditLock_descr',1).'" alt="" />':'').'</td>
                		';*/
                // TODO: Editlock
                // ACL rows
                if (!empty($aclUsers)) {
                    $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][0]) . '</td>';
                    foreach ($aclUsers as $uid) {
                        $tmpBg = $bgCol;
                        if (isset($this->aclList[$data['row']['uid']][0][$uid]['newAcl'])) {
                            if ($this->aclList[$data['row']['uid']][0][$uid]['recursive']) {
                                $tmpBg = ' class="bgColor5"';
                            } else {
                                $tmpBg = ' class="bgColor6"';
                            }
                        }
                        $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][0][$uid]['permissions']) : '') . '</td>';
                    }
                }
                if (!empty($aclGroups)) {
                    $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td><td' . $bgCol . '>' . $this->countAcls($this->aclList[$data['row']['uid']][1]) . '</td>';
                    foreach ($aclGroups as $uid) {
                        $tmpBg = $bgCol;
                        if (isset($this->aclList[$data['row']['uid']][1][$uid]['newAcl'])) {
                            if ($this->aclList[$data['row']['uid']][1][$uid]['recursive']) {
                                $tmpBg = ' class="bgColor5"';
                            } else {
                                $tmpBg = ' class="bgColor6"';
                            }
                        }
                        $cells[] = '<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
						<td' . $tmpBg . ' nowrap="nowrap">' . ($data['row']['uid'] ? ' ' . $this->printPerms($this->aclList[$data['row']['uid']][1][$uid]['permissions']) : '') . '</td>';
                    }
                }
            } else {
                $cells[] = '
					<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>';
                if ($BE_USER->user['uid'] == $data['row']['perms_userid']) {
                    $bgCol = ' class="bgColor-20"';
                } else {
                    $bgCol = $lE_bgCol;
                }
                $cells[] = '
					<td' . $bgCol . ' nowrap="nowrap" align="center">' . ($data['row']['uid'] ? $owner . $this->printPerms($BE_USER->calcPerms($data['row'])) : '') . '</td>
					' . (!$BE_USER->isAdmin() ? '
					<td' . $bgCol . '><img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/line.gif', 'width="5" height="16"') . ' alt="" /></td>
					<td' . $bgCol . ' nowrap="nowrap">' . ($data['row']['editlock'] ? '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/recordlock_warning2.gif', 'width="22" height="16"') . ' title="' . $LANG->getLL('EditLock_descr', 1) . '" alt="" />' : '') . '</td>
					' : '');
                $bgCol = $lE_bgCol;
            }
            // Compile table row:
            $code .= '
				<tr>
					' . implode('
					', $cells) . '
				</tr>';
        }
        // Wrap rows in table tags:
        $code = '<table border="0" cellspacing="0" cellpadding="0" id="typo3-permissionList">' . $code . '</table>';
        // Adding the content as a section:
        $this->content .= $this->doc->section('', $code);
        // CSH for permissions setting
        $this->content .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH'], '<br/>|');
        // Creating legend table:
        $legendText = '<b>' . $LANG->getLL('1', 1) . '</b>: ' . $LANG->getLL('1_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('16', 1) . '</b>: ' . $LANG->getLL('16_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('2', 1) . '</b>: ' . $LANG->getLL('2_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('4', 1) . '</b>: ' . $LANG->getLL('4_t', 1);
        $legendText .= '<br /><b>' . $LANG->getLL('8', 1) . '</b>: ' . $LANG->getLL('8_t', 1);
        if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) {
            $icon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/legend.gif', 'width="86" height="75"') . ' alt="" />';
        } else {
            $icon = '<img src="legend.gif" width="86" height="75" alt="" />';
        }
        $code = '<table border="0" id="typo3-legendTable">
			<tr>
				<td valign="top">' . $icon . '</td>
				<td valign="top" nowrap="nowrap">' . $legendText . '</td>
			</tr>
		</table>';
        $code .= '<br />' . $LANG->getLL('def', 1);
        if (t3lib_div::int_from_ver(TYPO3_version) >= 4004000) {
            // use sprites for Typo3 V4.4 or later
            $code .= '<br /><br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-granted') . ': ' . $LANG->getLL('A_Granted', 1);
            $code .= '<br />' . t3lib_iconWorks::getSpriteIcon('status-status-permission-denied') . ': ' . $LANG->getLL('A_Denied', 1);
        } else {
            $code .= '<br /><br /><span class="perm-allowed">*</span>: ' . $LANG->getLL('A_Granted', 1);
            $code .= '<br />      <span class="perm-denied" >x</span>: ' . $LANG->getLL('A_Denied', 1);
        }
        // Adding section with legend code:
        $this->content .= $this->doc->spacer(20);
        $this->content .= $this->doc->section($LANG->getLL('Legend') . ':', $code, 0, 1);
    }
示例#24
0
文件: index.php 项目: Gerberus/tscobj
    /**
     * Creates the page
     *
     * This function creates the basic page in which the module will
     * take place.
     *
     * @return		Void
     * @see			addStyles
     * @see			moduleContent
     */
    function main()
    {
        // Store variables from TCE
        $this->P = t3lib_div::_GP('P');
        // Draw the header.
        $this->doc = t3lib_div::makeInstance('bigDoc');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->form = '<form action="" method="POST">';
        // JavaScript
        $this->doc->JScode = '
			<script type="text/javascript" language="Javascript" charset="iso-8859-1">
				<!--
				script_ended = 0;
				function jumpToUrl(URL) {
					document.location = URL;
				}
				//-->
			</script>
			<script type="text/javascript" language="Javascript" charset="iso-8859-1">
				<!--
				// Function for swapping element classes
				function tx_tscobj_swapClasses(element) {
					if (document.getElementById) {
						liClass = document.getElementById(element).className;
						document.getElementById(element).className = (liClass == "open") ? "closed" : "open";
						document.getElementById(element + "-img").src = (liClass == "open") ? "' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/plusbullet.gif', '', 1) . '" : "' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/minusbullet.gif', '', 1) . '";
					}
				}
				// Function for expanding/collapsing all elements
				var expanded = 0;
				function tx_tscobj_expAll() {
					if (document.getElementsByTagName) {
						var listItems = document.getElementsByTagName("li");
						for (i = 0; i < listItems.length; i++) {
							listItems[i].className = (expanded) ? "closed" : "open";
							id = listItems[i].id;
							if (id.substr(id.length - 1,id.length) == ".") {
								var picture = id + "-img";
								document.getElementById(picture).src = (expanded) ? "' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/plusbullet.gif', '', 1) . '" : "' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/ol/minusbullet.gif', '', 1) . '";
							}
						}
						expanded = (expanded == 1) ? 0 : 1;
					}
				}
				-->
			</script>
		';
        // Add CSS styles for the module
        $this->doc->inDocStyles = $this->addStyles();
        // Access check
        $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
        $access = is_array($this->pageinfo) ? 1 : 0;
        if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
            // Admin user
            if ($GLOBALS['BE_USER']->user['admin'] && !$this->id) {
                $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0);
            }
            // Build current path
            $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);
            // Start page content
            $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
            $this->content .= $this->doc->spacer(5);
            $this->content .= $this->doc->divider(5);
            // Render content
            $this->moduleContent();
        }
        // Spacer
        $this->content .= $this->doc->spacer(10);
    }
    /**
     * Rendering the copy file form for a multiple items
     *
     * @return	string		HTML content
     */
    function renderFormMulti($items, $targetFolder)
    {
        global $BACK_PATH, $LANG, $TCA;
        $content = '';
        $references = 0;
        // FOLDER_INFO is missing due to missing param in current function - so we set it to nothing
        $this->pObj->markers['FOLDER_INFO'] = '';
        $titleNotExists = 'title="' . $GLOBALS['LANG']->getLL('fileNotExists', true) . '"';
        $iconNotExists = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' ' . $titleNotExists . ' valign="top" alt="" />';
        $referencedIcon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/is_referenced.gif', 'width="15" height="12"') . ' title="' . $LANG->getLL($this->langPrefix . 'messageReferencesUsed', 1) . '" alt="" />';
        // init table layout
        $tableLayout = array('table' => array('<table cellpadding="2" cellspacing="1" border="0" width="100%">', '</table>'), '0' => array('defCol' => array('<th nowrap="nowrap" class="bgColor5">', '</th>'), '0' => array('<th width="1%" class="bgColor5">', '</th>'), '1' => array('<th width="1%" class="bgColor5">', '</th>'), '3' => array('<th width="1%" class="bgColor5">', '</th>'), '4' => array('<th width="1%" class="bgColor5">', '</th>'), '5' => array('<th width="1%" class="bgColor5">', '</th>')), 'defRow' => array('defCol' => array('<td nowrap="nowrap" class="bgColor4">', '</td>'), '2' => array('<td class="bgColor4">', '</td>'), '3' => array('<td style="text-align:center" class="bgColor4">', '</td>'), '4' => array('<td style="padding:0 5px 0 5px" class="bgColor4">', '</td>'), '5' => array('<td style="text-align:center" class="bgColor4">', '</td>')));
        $cTable = array();
        $tr = 0;
        $td = 0;
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['title']['label'], 1);
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['file_path']['label'], 1);
        $tr++;
        foreach ($items as $id => $meta) {
            $filepath = tx_dam::file_absolutePath($meta);
            if ($meta['file_accessable']) {
                $checkbox = '<input type="checkbox" name="data[' . $this->copyOrMove . '][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '"  checked="checked" />';
            } else {
                $checkbox = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' title="' . $LANG->getLL('accessDenied', true) . '" alt="" />';
            }
            $title = $meta['title'] ? $meta['title'] : $meta['file_name'];
            $title = t3lib_div::fixed_lgd_cs($title, 50);
            $icon = tx_dam_guiFunc::icon_getFileTypeImgTag($meta, 'class="c-recicon"', false);
            if (!@file_exists($filepath)) {
                $icon .= $iconNotExists;
                $info = '';
            } else {
                $info = $GLOBALS['SOBE']->btn_infoFile($meta);
            }
            // Add row to table
            $td = 0;
            $cTable[$tr][$td++] = $checkbox;
            $cTable[$tr][$td++] = $icon;
            $cTable[$tr][$td++] = htmlspecialchars($title);
            $cTable[$tr][$td++] = htmlspecialchars(strtoupper($meta['file_type']));
            $cTable[$tr][$td++] = $info;
            $cTable[$tr][$td++] = htmlspecialchars(t3lib_div::fixed_lgd_cs($meta['file_path'], -15));
            $tr++;
        }
        $itemTable = $this->pObj->doc->table($cTable, $tableLayout);
        $targetFolderRel = tx_dam::path_makeRelative($targetFolder);
        $msg = array();
        $msg[] = '&nbsp;';
        $msg[] = $LANG->getLL('labelTargetFolder', 1) . ' <strong>' . htmlspecialchars($targetFolderRel) . '</strong>';
        $msg[] = '&nbsp;';
        $msg[] = htmlspecialchars(sprintf($LANG->getLL($this->langPrefix . 'message'), $targetFolderRel));
        $msg[] = '&nbsp;';
        $msg[] = $itemTable;
        $buttons = '
			<input type="hidden" name="data[' . $this->copyOrMove . '][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '" />
			<input type="hidden" name="data[' . $this->copyOrMove . '][' . $id . '][target]" value="' . htmlspecialchars($targetFolder) . '" />';
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            if ($this->copyOrMove == 'copy') {
                $buttons .= '
					<input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filecopy.submit', 1) . '" />
					<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
            } else {
                $buttons .= '
					<input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filemove.submit', 1) . '" />
					<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
            }
        }
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/clip_copy.gif') . ' title="' . $LANG->getLL($this->langPrefix . 'submit', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        return $content;
    }
    /**
     * Rendering the localization information table.
     *
     * @param	array		The Page tree data
     * @return	string		HTML for the localization information table.
     */
    function renderL10nTable(&$tree)
    {
        global $LANG;
        // Title length:
        $titleLen = $GLOBALS['BE_USER']->uc['titleLen'];
        // Put together the TREE:
        $output = '';
        $newOL_js = array();
        $langRecUids = array();
        //Init DDD
        $dao = t3lib_div::makeInstance('tx_languagevisibility_daocommon');
        if (version_compare(TYPO3_version, '4.3.0', '<')) {
            $elementfactory = new tx_languagevisibility_elementFactory($dao);
        } else {
            $elementfactory = t3lib_div::makeInstance('tx_languagevisibility_elementFactory', $dao);
        }
        $languageRep = t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
        $languageList = $languageRep->getLanguages();
        $visibility = t3lib_div::makeInstance('tx_languagevisibility_visibilityService');
        //traverse Tree:
        foreach ($tree->tree as $data) {
            $tCells = array();
            $element = $elementfactory->getElementForTable('pages', $data['row']['uid']);
            //first cell (tree):
            // Page icons / titles etc.
            $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' . $data['HTML'] . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'], $titleLen)) . (strcmp($data['row']['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') . '</td>';
            //language cells:
            foreach ($languageList as $language) {
                $info = '';
                $editUid = $data['row']['uid'];
                $params = '&edit[pages][' . $editUid . ']=edit';
                $langId = $language->getUid();
                if ($visibility->isVisible($language, $element)) {
                    $isVisible = TRUE;
                    $statusVis = 'c-visible';
                } else {
                    $isVisible = FALSE;
                    $statusVis = 'c-notvisible';
                }
                if ($element->hasTranslation($langId)) {
                    $statusTrans = 'c-translated';
                } else {
                    $statusTrans = 'c-nottranslated';
                }
                if ($language->getUid() == 0) {
                    //Default
                    //"View page" link is created:
                    $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'], $GLOBALS['BACK_PATH'], '', '', '', '&L=###LANG_UID###')) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_viewPage', '1') . '" border="0" alt="" />' . '</a>';
                    $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editDefaultLanguagePage', '1') . '" border="0" alt="" />' . '</a>';
                    $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=0"); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit_page.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editPage', '1') . '" border="0" alt="" />' . '</a>';
                    $info .= str_replace('###LANG_UID###', '0', $viewPageLink);
                    $info .= $data['row']['l18n_cfg'] & 1 ? '<span title="' . $LANG->sL('LLL:EXT:cms/locallang_tca.php:pages.l18n_cfg.I.1', '1') . '">D</span>' : '&nbsp;';
                    // Put into cell:
                    $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">' . $info . '</td>';
                    $tCells[] = '<td class="' . $statusTrans . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], 0) . '</td>';
                } else {
                    //Normal Language:
                    if ($element->hasTranslation($langId)) {
                        $status = 'c-ok';
                        $overLayRow = $element->getOverLayRecordForCertainLanguage($langId);
                        //add uid of overlay to list of editable records:
                        $langRecUids[$langId][] = $overLayRow['uid'];
                        $icon = t3lib_iconWorks::getIconImage('pages_language_overlay', $overLayRow, $GLOBALS['BACK_PATH'], 'align="top" class="c-recIcon"');
                        $info = $icon . htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['title'], $titleLen)) . (strcmp($overLayRow['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(t3lib_div::fixed_lgd_cs($overLayRow['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', '1') . '</div>' : '');
                        $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">' . $info . '</td>';
                        // Edit whole record:
                        $info = '';
                        $editUid = $overLayRow['uid'];
                        $params = '&edit[pages_language_overlay][' . $editUid . ']=edit';
                        $info .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editLanguageOverlayRecord', '1') . '" border="0" alt="" />' . '</a>';
                        $info .= '<a href="#" onclick="' . htmlspecialchars('top.loadEditId(' . intval($data['row']['uid']) . ',"&SET[language]=' . $langId . '"); return false;') . '">' . '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit_page.gif', 'width="12" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editPageLang', '1') . '" border="0" alt="" />' . '</a>';
                        $info .= str_replace('###LANG_UID###', $langId, $viewPageLink);
                        $tCells[] = '<td class="' . $statusTrans . '">' . $info . '</td>';
                        $tCells[] = '<td class="' . $statusTrans . '" title="' . $LANG->getLL('lang_renderl10n_CEcount', '1') . '" align="center">' . $this->getContentElementCount($data['row']['uid'], $langId) . '</td>';
                    } else {
                        $status = t3lib_div::hideIfNotTranslated($data['row']['l18n_cfg']) || $data['row']['l18n_cfg'] & 1 ? 'c-blocked' : 'c-fallback';
                        $tCells[] = '<td class="' . $statusTrans . ' c-leftLine">&nbsp;</td>';
                        $tCells[] = '<td class="' . $statusTrans . '">&nbsp;</td>';
                        //add to JS
                        $infoCell = '<input type="checkbox" name="newOL[' . $langId . '][' . $data['row']['uid'] . ']" value="1" />';
                        $newOL_js[$langId] .= '
								+(document.webinfoForm[\'newOL[' . $langId . '][' . $data['row']['uid'] . ']\'].checked ? \'&edit[pages_language_overlay][' . $data['row']['uid'] . ']=new\' : \'\')
							';
                        $tCells[] = '<td class="' . $statusTrans . '">' . $infoCell . '</td>';
                    }
                }
                //last cell show status
                $tCells[] = '<td class="' . $statusVis . '">' . $this->_getStatusImage($isVisible) . '</td>';
            }
            $output .= '
			<tr class="bgColor5">
				' . implode('
				', $tCells) . '
			</tr>';
        }
        //first ROW:
        //****************
        $firstRowCells[] = '<td>' . $LANG->getLL('lang_renderl10n_page', '1') . ':</td>';
        foreach ($languageList as $language) {
            $langId = $language->getUid();
            if ($this->pObj->MOD_SETTINGS['lang'] == 0 || (int) $this->pObj->MOD_SETTINGS['lang'] === (int) $langId) {
                $firstRowCells[] = '<td class="c-leftLine">' . $language->getTitle() . $language->getFlagImg() . '</td>';
                if ($langId == 0) {
                    $firstRowCells[] = '<td></td>';
                    $firstRowCells[] = '<td></td>';
                } else {
                    // Title:
                    // Edit language overlay records:
                    if (is_array($langRecUids[$langId])) {
                        $params = '&edit[pages_language_overlay][' . implode(',', $langRecUids[$langId]) . ']=edit&columnsOnly=title,nav_title,hidden';
                        $firstRowCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">
							<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_renderl10n_editLangOverlays', '1') . '" border="0" alt="" />
							</a></td>';
                    } else {
                        $firstRowCells[] = '<td>&nbsp;</td>';
                    }
                    // Create new overlay records:
                    $params = "'" . $newOL_js[$langId] . "+'&columnsOnly=title,hidden,sys_language_uid&defVals[pages_language_overlay][sys_language_uid]=" . $langId;
                    $firstRowCells[] = '<td><a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'])) . '">
						<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif', 'width="11" height="12"') . ' title="' . $LANG->getLL('lang_getlangsta_createNewTranslationHeaders', '1') . '" border="0" alt="" />
						</a></td>';
                    $firstRowCells[] = '<td></td>';
                }
            }
        }
        $output = '
			<tr class="bgColor4">
				' . implode('
				', $firstRowCells) . '
			</tr>' . $output;
        $output = '

		<table border="0" cellspacing="0" cellpadding="0" id="langTable">' . $output . '
		</table>';
        return $output;
    }
    /**
     * Prints the selector box form-field for the db/file/select elements (multiple)
     *
     * @param	string		Form element name
     * @param	string		Mode "db", "file" (internal_type for the "group" type) OR blank (then for the "select" type). Seperated with '|' a user defined mode can be set to be passed as param to the EB.
     * @param	string		Commalist of "allowed"
     * @param	array		The array of items. For "select" and "group"/"file" this is just a set of value. For "db" its an array of arrays with table/uid pairs.
     * @param	string		Alternative selector box.
     * @param	array		An array of additional parameters, eg: "size", "info", "headers" (array with "selector" and "items"), "noBrowser", "thumbnails"
     * @param	string		On focus attribute string
     * @param	string		$user_el_param Additional parameter for the EB
     * @return	string		The form fields for the selection.
     */
    function dbFileIcons($fName, $mode, $allowed, $itemArray, $selector = '', $params = array(), $onFocus = '', $userEBParam = '')
    {
        list($mode, $modeEB) = explode('|', $mode);
        $modeEB = $modeEB ? $modeEB : $mode;
        $disabled = '';
        if ($this->tceforms->renderReadonly || $params['readOnly']) {
            $disabled = ' disabled="disabled"';
        }
        // Sets a flag which means some JavaScript is included on the page to support this element.
        $this->tceforms->printNeededJS['dbFileIcons'] = 1;
        // INIT
        $uidList = array();
        $opt = array();
        $itemArrayC = 0;
        // Creating <option> elements:
        if (is_array($itemArray)) {
            $itemArrayC = count($itemArray);
            reset($itemArray);
            switch ($mode) {
                case 'db':
                    while (list(, $pp) = each($itemArray)) {
                        if ($pp['title']) {
                            $pTitle = $pp['title'];
                        } else {
                            if (function_exists('t3lib_BEfunc::getRecordWSOL')) {
                                $pRec = t3lib_BEfunc::getRecordWSOL($pp['table'], $pp['id']);
                            } else {
                                $pRec = t3lib_BEfunc::getRecord($pp['table'], $pp['id']);
                            }
                            $pTitle = is_array($pRec) ? $pRec[$GLOBALS['TCA'][$pp['table']]['ctrl']['label']] : NULL;
                        }
                        if ($pTitle) {
                            $pTitle = $pTitle ? t3lib_div::fixed_lgd_cs($pTitle, $this->tceforms->titleLen) : t3lib_BEfunc::getNoRecordTitle();
                            $pUid = $pp['table'] . '_' . $pp['id'];
                            $uidList[] = $pUid;
                            $opt[] = '<option value="' . htmlspecialchars($pUid) . '">' . htmlspecialchars($pTitle) . '</option>';
                        }
                    }
                    break;
                case 'folder':
                case 'file':
                    while (list(, $pp) = each($itemArray)) {
                        $pParts = explode('|', $pp);
                        $uidList[] = $pUid = $pTitle = $pParts[0];
                        $opt[] = '<option value="' . htmlspecialchars(rawurldecode($pParts[0])) . '">' . htmlspecialchars(rawurldecode($pParts[0])) . '</option>';
                    }
                    break;
                default:
                    while (list(, $pp) = each($itemArray)) {
                        $pParts = explode('|', $pp, 2);
                        $uidList[] = $pUid = $pParts[0];
                        $pTitle = $pParts[1] ? $pParts[1] : $pParts[0];
                        $opt[] = '<option value="' . htmlspecialchars(rawurldecode($pUid)) . '">' . htmlspecialchars(rawurldecode($pTitle)) . '</option>';
                    }
                    break;
            }
        }
        // Create selector box of the options
        $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC + 1, t3lib_div::intInRange($params['size'], 1), $params['autoSizeMax']) : $params['size'];
        if (!$selector) {
            $selector = '<select size="' . $sSize . '"' . $this->tceforms->insertDefStyle('group') . ' multiple="multiple" name="' . $fName . '_list" ' . $onFocus . $params['style'] . $disabled . '>' . implode('', $opt) . '</select>';
        }
        $icons = array('L' => array(), 'R' => array());
        if (!$params['readOnly']) {
            if (!$params['noBrowser']) {
                $aOnClick = 'setFormValueOpenBrowser(\'' . $modeEB . '\',\'' . ($fName . '|||' . $allowed . '|' . $userEBParam . '|') . '\'); return false;';
                $icons['R'][] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/insert3.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_browse_' . ($mode === 'file' ? 'file' : 'db'))) . ' />' . '</a>';
            }
            if (!$params['dontShowMoveIcons']) {
                if ($sSize >= 5) {
                    $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Top\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_totop.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_to_top')) . ' />' . '</a>';
                }
                $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Up\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/up.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_up')) . ' />' . '</a>';
                $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Down\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/down.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_down')) . ' />' . '</a>';
                if ($sSize >= 5) {
                    $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Bottom\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_tobottom.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_to_bottom')) . ' />' . '</a>';
                }
            }
            // todo Clipboard
            $clipElements = $this->tceforms->getClipboardElements($allowed, $mode);
            if (count($clipElements)) {
                $aOnClick = '';
                #			$counter = 0;
                foreach ($clipElements as $elValue) {
                    if ($mode === 'file' or $mode === 'folder') {
                        $itemTitle = 'unescape(\'' . rawurlencode(tx_dam::file_basename($elValue)) . '\')';
                    } else {
                        // 'db' mode assumed
                        list($itemTable, $itemUid) = explode('|', $elValue);
                        if (function_exists('t3lib_BEfunc::getRecordWSOL')) {
                            $rec = t3lib_BEfunc::getRecordWSOL($itemTable, $itemUid);
                        } else {
                            $rec = t3lib_BEfunc::getRecord($itemTable, $itemUid);
                        }
                        $itemTitle = $GLOBALS['LANG']->JScharCode(t3lib_BEfunc::getRecordTitle($itemTable, $rec));
                        $elValue = $itemTable . '_' . $itemUid;
                    }
                    $aOnClick .= 'setFormValueFromBrowseWin(\'' . $fName . '\',\'' . t3lib_div::slashJS(t3lib_div::rawUrlEncodeJS($elValue)) . '\',' . t3lib_div::slashJS($itemTitle) . ');';
                    #$aOnClick .= 'setFormValueFromBrowseWin(\''.$fName.'\',unescape(\''.rawurlencode(str_replace('%20', ' ', $elValue)).'\'),'.$itemTitle.');';
                    #				$counter++;
                    #				if ($params['maxitems'] && $counter >= $params['maxitems'])	{	break;	}	// Makes sure that no more than the max items are inserted... for convenience.
                }
                $aOnClick .= 'return false;';
                $icons['R'][] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/insert5.png', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib(sprintf($this->tceforms->getLL('l_clipInsert_' . ($mode === 'file' ? 'file' : 'db')), count($clipElements))) . ' />' . '</a>';
            }
            $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Remove\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_clear.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_remove_selected')) . ' />' . '</a>';
        }
        $str = '<table border="0" cellpadding="0" cellspacing="0" width="1">
			' . ($params['headers'] ? '
				<tr>
					<td>' . $this->tceforms->wrapLabels($params['headers']['selector']) . '</td>
					<td></td>
					<td></td>
					<td></td>
					<td>' . ($params['thumbnails'] ? $this->tceforms->wrapLabels($params['headers']['items']) : '') . '</td>
				</tr>' : '') . '
			<tr>
				<td valign="top">' . $selector . '<br />' . $this->tceforms->wrapLabels($params['info']) . '</td>
				<td valign="top">' . implode('<br />', $icons['L']) . '</td>
				<td valign="top">' . implode('<br />', $icons['R']) . '</td>
				<td style="height:5px;"><span></span></td>
				<td valign="top">' . $this->tceforms->wrapLabels($params['thumbnails']) . '</td>
			</tr>
		</table>';
        // Creating the hidden field which contains the actual value as a comma list.
        $str .= '<input type="hidden" name="' . $fName . '" value="' . htmlspecialchars(implode(',', $uidList)) . '" />';
        return $str;
    }
	/**
	 * Creates an HTML table row for a single redirect record.
	 *
	 * @param array $rec
	 * @return string
	 */
	protected function generateSingleRedirectContent(array $rec) {
		$output = '<td>'.
					'<a href="'.$this->linkSelf('&cmd=edit&uid=' . rawurlencode($rec['uid'])) .'">'.
					'<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/edit2.gif','width="11" height="12"').' title="Edit entry" alt="" />'.
					'</a>'.
					'<a href="'.$this->linkSelf('&cmd=delete&uid=' . rawurlencode($rec['uid'])) . '">'.
					'<img'.t3lib_iconWorks::skinImg($this->pObj->doc->backPath,'gfx/garbage.gif','width="11" height="12"').' title="Delete entry" alt="" />'.
					'</a>'.
				'</td>';
		$output .= sprintf( '<td><a href="%s" target="_blank">/%s</a></td>', htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_SITE_URL').$rec['url']), htmlspecialchars($rec['url']) );
		$destinationURL = $this->getDestinationRedirectURL($rec['destination']);
		$output .= sprintf('<td><a href="%1$s" target="_blank" title="%1$s">%2$s</a></td>', htmlspecialchars($destinationURL), htmlspecialchars(t3lib_div::fixed_lgd_cs($destinationURL, 30)));
		$output .= '<td>' . htmlspecialchars($this->getRedirectDomain($rec['domain_limit'])) . '</td>';
		$output .= '<td align="center">'.($rec['has_moved'] ? '+' : '&nbsp;').'</td>';
		$output .= '<td align="center">'.$rec['counter'].'</td>';

		if ($rec['tstamp']) {
			$output .= '<td>' . t3lib_BEfunc::dateTimeAge($rec['tstamp']) . '</td>';
		}
		else {
			$output .= '<td align="center">&mdash;</td>';
		}

		if ($rec['last_referer']) {
			$lastRef = htmlspecialchars($rec['last_referer']);
			$output .= sprintf('<td><a href="%s" target="_blank" title="%s">%s</a></td>', $lastRef, $lastRef, (strlen($rec['last_referer']) > 30) ? htmlspecialchars(substr($rec['last_referer'], 0, 30)) . '...' : $lastRef);
		}
		else {
			$output .= '<td>&nbsp;</td>';
		}

		// Error:
		$errorMessage = '';
		$pagesWithURL = array_keys($GLOBALS['TYPO3_DB']->exec_SELECTgetRows('page_id','tx_realurl_urlencodecache','content='.$GLOBALS['TYPO3_DB']->fullQuoteStr($rec['url'],'tx_realurl_urlencodecache'), '', '', '', '', 'page_id'));
		if (count($pagesWithURL) > 0) {
			$errorMessage.= $this->pObj->doc->icons(3).'Also a page URL: '.implode(',',array_unique($pagesWithURL));
		}
		$output .='<td>'.$errorMessage.'</td>';

		return $output;
	}
示例#29
0
 /**
  * [Describe function...]
  *
  * @return	[type]		...
  */
 function getPhashExternalDocs()
 {
     $recList[] = array($this->tableHead("Filename"), $this->tableHead("Size"), $this->tableHead("Words"), $this->tableHead("mtime"), $this->tableHead("Indexed"), $this->tableHead("Updated"), $this->tableHead("Parsetime"), $this->tableHead("#sec/gr/full"), $this->tableHead("#sub"), $this->tableHead("cHash"), $this->tableHead("phash"), $this->tableHead("Path"));
     // TYPO3 pages, unique
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'item_type!=\'0\'', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'item_type');
     while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         $cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : "";
         $grListRec = $this->getGrlistRecord($row["phash"]);
         $recList[] = array(htmlentities(t3lib_div::fixed_lgd_cs($row["item_title"], 30)), t3lib_div::formatSize($row["item_size"]), $this->getNumberOfWords($row["phash"]), t3lib_BEfunc::datetime($row["item_mtime"]), t3lib_BEfunc::datetime($row["crdate"]), $row["tstamp"] != $row["crdate"] ? t3lib_BEfunc::datetime($row["tstamp"]) : "", $row["parsetime"], $this->getNumberOfSections($row["phash"]) . "/" . $grListRec[0]["pcount"] . "/" . $this->getNumberOfFulltext($row["phash"]), $row["pcount"], $cHash, $row["phash"], htmlentities(t3lib_div::fixed_lgd_cs($row["data_filename"], 100)));
         if ($row["pcount"] > 1) {
             $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('index_phash.*', 'index_phash', 'phash_grouping=' . intval($row['phash_grouping']) . ' AND phash!=' . intval($row['phash']));
             while ($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)) {
                 $cHash = count(unserialize($row2["cHashParams"])) ? $this->formatCHash(unserialize($row2["cHashParams"])) : "";
                 $grListRec = $this->getGrlistRecord($row2["phash"]);
                 $recList[] = array("", "", $this->getNumberOfWords($row2["phash"]), "", t3lib_BEfunc::datetime($row2["crdate"]), $row2["tstamp"] != $row2["crdate"] ? t3lib_BEfunc::datetime($row2["tstamp"]) : "", $row2["parsetime"], $this->getNumberOfSections($row2["phash"]) . "/" . $grListRec[0]["pcount"] . "/" . $this->getNumberOfFulltext($row2["phash"]), "", $cHash, $row2["phash"], "");
             }
         }
         //		debug($row);
     }
     return $recList;
 }
    /**
     * Render list of files.
     *
     * @param	array		List of folder. See $this->getFolderInDir()
     * @param	string		If set a header with a folder icon and folder name are shown
     * @param	boolean		Whether to show thumbnails or not. If set, no thumbnails are shown.
     * @return	string		HTML output
     */
    function folderList($folder, $folderName = '', $noThumbs = 0)
    {
        global $LANG, $BACK_PATH;
        $out = '';
        // Listing the files:
        if (is_array($folder)) {
            // Create headline (showing number of files):
            $out .= $this->barheader(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:file_newfolder.php.folders') . ' (%s):', count($folder)));
            $titleLen = intval($GLOBALS['BE_USER']->uc['titleLen']);
            $folderIcon = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/_icon_webfolders.gif', 'width="18" height="16"');
            // todo: use modes?
            #			 $fileadminDir = PATH_site.$GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'];
            $fcount = count($folder);
            $folder = array_merge(array(md5($folderName) => $folderName), $folder);
            // Traverse the file list:
            $lines = array();
            foreach ($folder as $filepath) {
                $path_parts = t3lib_div::split_fileref($filepath);
                # $shortFilepath = preg_replace('#^'.preg_quote($fileadminDir).'#','', $filepath);
                $shortFilepath = preg_replace('#^' . preg_quote(PATH_site) . '#', '', $filepath);
                if (count($lines) == 0) {
                    $treeLine = '';
                } elseif (count($lines) < $fcount) {
                    $LN = 'join';
                    $treeLine = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/ol/' . $LN . '.gif', 'width="18" height="16"') . ' alt="" />';
                } else {
                    $LN = 'joinbottom';
                    $treeLine = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/ol/' . $LN . '.gif', 'width="18" height="16"') . ' alt="" />';
                }
                // Create folder icon:
                $icon = $folderIcon . ' title="' . htmlspecialchars($path_parts['file']) . '" class="absmiddle" alt="" />';
                // Create links for adding the file:
                if (strstr($filepath, ',') || strstr($filepath, '|')) {
                    // In case an invalid character is in the filepath, display error message:
                    $eMsg = $LANG->JScharCode(sprintf($LANG->getLL('invalidChar'), ', |'));
                    $ATag = $ATag_alt = "<a href=\"#\" onclick=\"alert(" . $eMsg . ");return false;\">";
                } else {
                    // If filename is OK, just add it:
                    $ATag = "<a href=\"#\" onclick=\"return insertElement('','" . t3lib_div::shortMD5($filepath) . "', 'file', '" . rawurlencode($shortFilepath) . "', unescape('" . rawurlencode($shortFilepath) . "'), '" . '' . "', '" . '' . "');\">";
                    $ATag_alt = substr($ATag, 0, -4) . ",'',1);\">";
                }
                $ATag_e = '</a>';
                // Combine the stuff:
                $filenameAndIcon = $ATag_alt . $icon . htmlspecialchars(t3lib_div::fixed_lgd_cs($path_parts['file'], $titleLen)) . $ATag_e;
                $lines[] = '
					<tr class="bgColor4">
						<td nowrap="nowrap">' . $treeLine . $filenameAndIcon . '&nbsp;</td>
						<td>' . $ATag . '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/plusbullet2.gif', 'width="18" height="16"') . ' title="' . $LANG->getLL('addToList', 1) . '" alt="" />' . $ATag_e . '</td>
					</tr>';
            }
            // Wrap all the rows in table tags:
            $out .= '



		<!--
			File listing
		-->
				<table border="0" cellpadding="0" cellspacing="1" id="typo3-fileList">
					' . implode('', $lines) . '
				</table>';
        }
        // Return accumulated content for filelisting:
        return $out;
    }