本文整理汇总了PHP中t3lib_div::fixed_lgd_cs方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::fixed_lgd_cs方法的具体用法?PHP t3lib_div::fixed_lgd_cs怎么用?PHP t3lib_div::fixed_lgd_cs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_div
的用法示例。
在下文中一共展示了t3lib_div::fixed_lgd_cs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: issueTitle
/**
* 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: main
/**
* 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;
}
}
示例3: main
/**
* 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;
}
示例4: main
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;
}
示例5: getPreviewData
/**
* (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>';
}
示例6: render
/**
* 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: main
/**
* 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);
}
示例8: getTitleStr
/**
* 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;
}
示例9: checkUploads
/**
* 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[] = ' ';
$ctable[] = tx_dam::icon_getFileTypeImgTag($fileInfo, 'align="top"') . ' ' . 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();
}
示例10: main
/**
* 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> </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> </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
//.........这里部分代码省略.........
示例11: readyForInterface
/**
* 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: notEdit
/**
* 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"> </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"> </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)) . ' </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[] = '
//.........这里部分代码省略.........
示例13: main
/**
* 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 />' : ' ') . '</td>
<td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($title, 30)) . '</a> </td>
<td>' . ($presetCfg['public'] ? 'Yes' : ' ') . '</td>
<td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? 'Own' : '[' . $usernames[$presetCfg['user_uid']]['username'] . ']') . '</td>
<td>' . ($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : ' ') . '</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;
}
示例14: getContentTree_element
/**
* 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: drawDataStructureMap
/**
* 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'] = ' ';
}
// 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']);
//.........这里部分代码省略.........