本文整理汇总了PHP中t3lib_BEfunc::getRecordWSOL方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::getRecordWSOL方法的具体用法?PHP t3lib_BEfunc::getRecordWSOL怎么用?PHP t3lib_BEfunc::getRecordWSOL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::getRecordWSOL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: buildRepresentationForNode
/**
* Builds a complete node including children
*
* @param \t3lib_tree_Node|\TYPO3\CMS\Backend\Tree\TreeNode $basicNode
* @param NULL|t3lib_tree_tca_DatabaseNode $parent
* @param integer $level
* @param bool $restriction
* @return t3lib_tree_tca_DatabaseNode node
*/
protected function buildRepresentationForNode(t3lib_tree_Node $basicNode, t3lib_tree_tca_DatabaseNode $parent = NULL, $level = 0, $restriction = FALSE)
{
/**@param $node t3lib_tree_tca_DatabaseNode */
$node = t3lib_div::makeInstance('t3lib_tree_tca_DatabaseNode');
$row = array();
if ($basicNode->getId() == 0) {
$node->setSelected(FALSE);
$node->setExpanded(TRUE);
$node->setLabel($GLOBALS['LANG']->sL($GLOBALS['TCA'][$this->tableName]['ctrl']['title']));
} else {
$row = t3lib_BEfunc::getRecordWSOL($this->tableName, $basicNode->getId(), '*', '', FALSE);
if ($this->getLabelField() !== '') {
$label = Tx_News_Service_CategoryService::translateCategoryRecord($row[$this->getLabelField()], $row);
$node->setLabel($label);
} else {
$node->setLabel($basicNode->getId());
}
$node->setSelected(t3lib_div::inList($this->getSelectedList(), $basicNode->getId()));
$node->setExpanded($this->isExpanded($basicNode));
$node->setLabel($node->getLabel());
}
$node->setId($basicNode->getId());
// Break to force single category activation
if ($parent != NULL && $level != 0 && $this->isSingleCategoryAclActivated() && !$this->isCategoryAllowed($node)) {
return NULL;
}
$node->setSelectable(!t3lib_div::inList($this->getNonSelectableLevelList(), $level) && !in_array($basicNode->getId(), $this->getItemUnselectableList()));
$node->setSortValue($this->nodeSortValues[$basicNode->getId()]);
$node->setIcon(t3lib_iconWorks::mapRecordTypeToSpriteIconClass($this->tableName, $row));
$node->setParentNode($parent);
if ($basicNode->hasChildNodes()) {
$node->setHasChildren(TRUE);
$childNodes = t3lib_div::makeInstance('t3lib_tree_SortedNodeCollection');
$foundSomeChild = FALSE;
foreach ($basicNode->getChildNodes() as $child) {
// Change in custom TreeDataProvider by adding the if clause
if ($restriction || $this->isCategoryAllowed($child)) {
$returnedChild = $this->buildRepresentationForNode($child, $node, $level + 1, TRUE);
if (!is_null($returnedChild)) {
$foundSomeChild = TRUE;
$childNodes->append($returnedChild);
} else {
$node->setParentNode(NULL);
$node->setHasChildren(FALSE);
}
}
// Change in custom TreeDataProvider end
}
if ($foundSomeChild) {
$node->setChildNodes($childNodes);
}
}
return $node;
}
示例3: main
/**
* MAIN function for page information of localization
*
* @return string Output HTML for the module.
*/
function main()
{
global $BACK_PATH, $LANG, $SOBE;
if ($this->pObj->id) {
$theOutput = '';
// Depth selector:
$h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
$h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[lang]', $this->pObj->MOD_SETTINGS['lang'], $this->pObj->MOD_MENU['lang'], 'index.php');
$theOutput .= $h_func;
// Add CSH:
$theOutput .= t3lib_BEfunc::cshItem('_MOD_web_info', 'lang', $GLOBALS['BACK_PATH'], '|<br/>');
// Showing the tree:
// Initialize starting point of page tree:
$treeStartingPoint = intval($this->pObj->id);
$treeStartingRecord = t3lib_BEfunc::getRecordWSOL('pages', $treeStartingPoint);
$depth = $this->pObj->MOD_SETTINGS['depth'];
// Initialize tree object:
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));
$tree->addField('l18n_cfg');
// Creating top icon; the current page
$HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"');
$tree->tree[] = array('row' => $treeStartingRecord, 'HTML' => $HTML);
// Create the tree from starting point:
if ($depth) {
$tree->getTree($treeStartingPoint, $depth, '');
}
#debug($tree->tree);
// Add CSS needed:
$css_content = '
TABLE#langTable {
margin-top: 10px;
}
TABLE#langTable TR TD {
padding-left : 2px;
padding-right : 2px;
white-space: nowrap;
}
TD.c-notvisible { background-color: red; }
TD.c-visible { background-color: #669966; }
TD.c-translated { background-color: #A8E95C; }
TD.c-nottranslated { background-color: #E9CD5C; }
TD.c-leftLine {border-left: 2px solid black; }
.bgColor5 { font-weight: bold; }
';
$marker = '/*###POSTCSSMARKER###*/';
$this->pObj->content = str_replace($marker, $css_content . chr(10) . $marker, $this->pObj->content);
// Render information table:
$theOutput .= $this->renderL10nTable($tree);
}
return $theOutput;
}
示例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: hasBasicEditRights
/**
* @param $table
* @param $record
* @return bool
*/
protected function hasBasicEditRights($table = null, array $record = null)
{
$hasEditRights = FALSE;
if ($table == null) {
$table = $this->rootElementTable;
}
if (empty($record)) {
$record = $this->rootElementRecord;
}
if ($GLOBALS['BE_USER']->isAdmin()) {
$hasEditRights = TRUE;
} else {
$id = $record[$table == 'pages' ? 'uid' : 'pid'];
$pageRecord = t3lib_BEfunc::getRecordWSOL('pages', $id);
$mayEditPage = $GLOBALS['BE_USER']->doesUserHaveAccess($pageRecord, 16);
$mayModifyTable = t3lib_div::inList($GLOBALS['BE_USER']->groupData['tables_modify'], $table);
$mayEditContentField = t3lib_div::inList($GLOBALS['BE_USER']->groupData['non_exclude_fields'], $table . ':tx_templavoila_flex');
$hasEditRights = $mayEditPage && $mayModifyTable && $mayEditContentField;
}
return $hasEditRights;
}
示例6: getStorageFolderPid
/**
* Returns the page uid of the selected storage folder from the context of the given page uid.
*
* @param integer $pageUid: Context page uid
* @return integer PID of the storage folder
* @access public
*/
function getStorageFolderPid($pageUid)
{
// Negative PID values is pointing to a page on the same level as the current.
if ($pageUid < 0) {
$pidRow = t3lib_BEfunc::getRecordWSOL('pages', abs($pageUid), 'pid');
$pageUid = $pidRow['pid'];
}
$row = t3lib_BEfunc::getRecordWSOL('pages', $pageUid);
$TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig('pages', $row);
return intval($TSconfig['_STORAGE_PID']);
}
示例7: dbFileIcons
/**
* 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 {
//.........这里部分代码省略.........
示例8: main
/**
* Creating the module output.
*
* @return void
* @todo provide position mapping if no position is given already. Like the columns selector but for our cascading element style ...
*/
function main()
{
global $LANG, $BACK_PATH;
if ($this->id && $this->access) {
// Creating content
$this->content = $this->doc->header($LANG->getLL('newContentElement'));
$this->content .= $this->doc->spacer(5);
$elRow = t3lib_BEfunc::getRecordWSOL('pages', $this->id);
$header = t3lib_iconWorks::getSpriteIconForRecord('pages', $elRow);
$header .= t3lib_BEfunc::getRecordTitle('pages', $elRow, 1);
$this->content .= $this->doc->section('', $header, 0, 1);
$this->content .= $this->doc->spacer(10);
// Wizard
$wizardCode = '';
$tableRows = array();
$wizardItems = $this->getWizardItems();
// Wrapper for wizards
$this->elementWrapper['sectionHeader'] = array('<h3 class="bgColor5">', '</h3>');
$this->elementWrapper['section'] = array('<table border="0" cellpadding="1" cellspacing="2">', '</table>');
$this->elementWrapper['wizard'] = array('<tr>', '</tr>');
$this->elementWrapper['wizardPart'] = array('<td>', '</td>');
// copy wrapper for tabs
$this->elementWrapperForTabs = $this->elementWrapper;
// Hook for manipulating wizardItems, wrapper, onClickEvent etc.
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['templavoila']['db_new_content_el']['wizardItemsHook'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['templavoila']['db_new_content_el']['wizardItemsHook'] as $classData) {
$hookObject = t3lib_div::getUserObj($classData);
if (!$hookObject instanceof cms_newContentElementWizardsHook) {
throw new UnexpectedValueException('$hookObject must implement interface cms_newContentElementWizardItemsHook', 1227834741);
}
$hookObject->manipulateWizardItems($wizardItems, $this);
}
}
if ($this->config['renderMode'] == 'tabs' && $this->elementWrapperForTabs != $this->elementWrapper) {
// restore wrapper for tabs if they are overwritten in hook
$this->elementWrapper = $this->elementWrapperForTabs;
}
// add document inline javascript
$this->doc->JScode = $this->doc->wrapScriptTags('
function goToalt_doc() { //
' . $this->onClickEvent . '
}
Event.observe(window, \'load\', function() {
if(top.refreshMenu) {
top.refreshMenu();
} else {
top.TYPO3ModuleMenu.refreshMenu();
}
if(top.shortcutFrame) {
top.shortcutFrame.refreshShortcuts();
}
});
');
// Traverse items for the wizard.
// An item is either a header or an item rendered with a title/description and icon:
$counter = 0;
foreach ($wizardItems as $k => $wInfo) {
if ($wInfo['header']) {
$menuItems[] = array('label' => htmlspecialchars($wInfo['header']), 'content' => $this->elementWrapper['section'][0]);
$key = count($menuItems) - 1;
} else {
$content = '';
// href URI for icon/title:
$newRecordLink = 'index.php?' . $this->linkParams() . '&createNewRecord=' . rawurlencode($this->parentRecord) . $wInfo['params'];
// Icon:
$iInfo = @getimagesize($wInfo['icon']);
$content .= $this->elementWrapper['wizardPart'][0] . '<a href="' . htmlspecialchars($newRecordLink) . '">
<img' . t3lib_iconWorks::skinImg($this->doc->backPath, $wInfo['icon'], '') . ' alt="" /></a>' . $this->elementWrapper['wizardPart'][1];
// Title + description:
$content .= $this->elementWrapper['wizardPart'][0] . '<a href="' . htmlspecialchars($newRecordLink) . '"><strong>' . htmlspecialchars($wInfo['title']) . '</strong><br />' . nl2br(htmlspecialchars(trim($wInfo['description']))) . '</a>' . $this->elementWrapper['wizardPart'][1];
// Finally, put it together in a container:
$menuItems[$key]['content'] .= $this->elementWrapper['wizard'][0] . $content . $this->elementWrapper['wizard'][1];
}
}
// add closing section-tag
foreach ($menuItems as $key => $val) {
$menuItems[$key]['content'] .= $this->elementWrapper['section'][1];
}
// Add the wizard table to the content, wrapped in tabs:
if ($this->config['renderMode'] == 'tabs') {
$this->doc->inDocStylesArray[] = '
.typo3-dyntabmenu-divs { background-color: #fafafa; border: 1px solid #000; width: 680px; }
.typo3-dyntabmenu-divs table { margin: 15px; }
.typo3-dyntabmenu-divs table td { padding: 3px; }
';
$code = $LANG->getLL('sel1', 1) . '<br /><br />' . $this->doc->getDynTabMenu($menuItems, 'new-content-element-wizard', false, false, 100);
} else {
$code = $LANG->getLL('sel1', 1) . '<br /><br />';
foreach ($menuItems as $section) {
$code .= $this->elementWrapper['sectionHeader'][0] . $section['label'] . $this->elementWrapper['sectionHeader'][1] . $section['content'];
}
}
//.........这里部分代码省略.........
示例9: main
/**
* Main function of class
*
* @return string HTML output
*/
function main()
{
global $LANG;
$menu = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[tsconf_parts]', $this->pObj->MOD_SETTINGS['tsconf_parts'], $this->pObj->MOD_MENU['tsconf_parts']);
$menu .= '<br /><label for="checkTsconf_alphaSort">' . $GLOBALS['LANG']->getLL('sort_alphabetic', true) . '</label> ' . t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[tsconf_alphaSort]', $this->pObj->MOD_SETTINGS['tsconf_alphaSort'], '', '', 'id="checkTsconf_alphaSort"');
$menu .= '<br /><br />';
if ($this->pObj->MOD_SETTINGS['tsconf_parts'] == 99) {
$TSparts = t3lib_BEfunc::getPagesTSconfig($this->pObj->id, '', 1);
$lines = array();
$pUids = array();
foreach ($TSparts as $k => $v) {
if ($k != 'uid_0') {
if ($k == 'defaultPageTSconfig') {
$pTitle = '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_default', 1) . '</strong>';
$editIcon = '';
} else {
$pUids[] = substr($k, 4);
$row = t3lib_BEfunc::getRecordWSOL('pages', substr($k, 4));
$pTitle = $this->pObj->doc->getHeader('pages', $row, '', 0);
$editIdList = substr($k, 4);
$params = '&edit[pages][' . $editIdList . ']=edit&columnsOnly=TSconfig';
$onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '');
$editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '</a>';
}
$TScontent = nl2br(htmlspecialchars(trim($v) . chr(10)));
$tsparser = t3lib_div::makeInstance('t3lib_TSparser');
$tsparser->lineNumberOffset = 0;
$TScontent = $tsparser->doSyntaxHighlight(trim($v) . LF, '', 0);
$lines[] = '
<tr><td nowrap="nowrap" class="bgColor5">' . $pTitle . '</td></tr>
<tr><td nowrap="nowrap" class="bgColor4">' . $TScontent . $editIcon . '</td></tr>
<tr><td> </td></tr>
';
}
}
if (count($pUids)) {
$params = '&edit[pages][' . implode(',', $pUids) . ']=edit&columnsOnly=TSconfig';
$onclickUrl = t3lib_BEfunc::editOnClick($params, $GLOBALS['BACK_PATH'], '');
$editIcon = '<a href="#" onclick="' . htmlspecialchars($onclickUrl) . '" title="' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-open') . '<strong>' . $GLOBALS['LANG']->getLL('editTSconfig_all', 1) . '</strong>' . '</a>';
} else {
$editIcon = '';
}
$theOutput .= $this->pObj->doc->section($LANG->getLL('tsconf_title'), t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_edit', $GLOBALS['BACK_PATH'], '|<br />') . $menu . '
<br /><br />
<!-- Edit fields: -->
<table border="0" cellpadding="0" cellspacing="1">' . implode('', $lines) . '</table><br />' . $editIcon, 0, 1);
} else {
$tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
// Defined global here!
$tmpl->tt_track = 0;
// Do not log time-performance information
$tmpl->fixedLgd = 0;
$tmpl->linkObjects = 0;
$tmpl->bType = '';
$tmpl->ext_expandAllNotes = 1;
$tmpl->ext_noPMicons = 1;
switch ($this->pObj->MOD_SETTINGS['tsconf_parts']) {
case '1':
$modTSconfig = t3lib_BEfunc::getModTSconfig($this->pObj->id, 'mod');
break;
case '1a':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_layout', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '1b':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_view', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '1c':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_modules', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '1d':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_list', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '1e':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_info', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '1f':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_func', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '1g':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('mod.web_ts', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '2':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '5':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEFORM', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '6':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TCEMAIN', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '3':
$modTSconfig = $GLOBALS['BE_USER']->getTSConfig('TSFE', t3lib_BEfunc::getPagesTSconfig($this->pObj->id));
break;
case '4':
//.........这里部分代码省略.........
示例10: displayWorkspaceOverview_allStageCmd
/**
* Links to stage change of a version
*
* @param string Table name
* @param array Offline record (version)
* @return string HTML content, mainly link tags and images.
*/
function displayWorkspaceOverview_allStageCmd()
{
$table = t3lib_div::_GP('table');
if ($table && $table != 'pages') {
$uid = t3lib_div::_GP('uid');
if ($rec_off = t3lib_BEfunc::getRecordWSOL($table, $uid)) {
$uid = $rec_off['_ORIG_uid'];
}
} else {
$table = '';
}
if ($table) {
if ($uid && $this->recIndex[$table][$uid]) {
$sId = $this->recIndex[$table][$uid];
switch ($sId) {
case 1:
$label = $GLOBALS['LANG']->getLL('commentForReviewer');
break;
case 10:
$label = $GLOBALS['LANG']->getLL('commentForPublisher');
break;
}
} else {
$sId = 0;
}
} else {
if (count($this->stageIndex[1])) {
// Review:
$sId = 1;
$color = '#666666';
$label = $GLOBALS['LANG']->getLL('sendItemsToReview') . $GLOBALS['LANG']->getLL('commentForReviewer');
$titleAttrib = $GLOBALS['LANG']->getLL('sendAllToReview');
} elseif (count($this->stageIndex[10])) {
// Publish:
$sId = 10;
$color = '#6666cc';
$label = $GLOBALS['LANG']->getLL('approveToPublish') . $GLOBALS['LANG']->getLL('commentForPublisher');
$titleAttrib = $GLOBALS['LANG']->getLL('approveAllToPublish');
} else {
$sId = 0;
}
}
if ($sId > 0) {
$issueCmd = '';
$itemCount = 0;
if ($table && $uid && $this->recIndex[$table][$uid]) {
$issueCmd .= '&cmd[' . $table . '][' . $uid . '][version][action]=setStage';
$issueCmd .= '&cmd[' . $table . '][' . $uid . '][version][stageId]=' . $this->recIndex[$table][$uid];
} else {
foreach ($this->stageIndex[$sId] as $table => $uidArray) {
$issueCmd .= '&cmd[' . $table . '][' . implode(',', $uidArray) . '][version][action]=setStage';
$issueCmd .= '&cmd[' . $table . '][' . implode(',', $uidArray) . '][version][stageId]=' . $sId;
$itemCount += count($uidArray);
}
}
$onClick = 'var commentTxt=window.prompt("' . sprintf($label, $itemCount) . '","");
if (commentTxt!=null) {window.location.href="' . $this->doc->issueCommand($issueCmd, $this->REQUEST_URI) . '&generalComment="+escape(commentTxt);}';
if (t3lib_div::_GP('sendToReview')) {
$onClick .= ' else {window.location.href = "' . $this->REQUEST_URI . '"}';
$actionLinks .= $this->doc->wrapScriptTags($onClick);
} else {
$onClick .= ' return false;';
$actionLinks .= '<input type="submit" name="_" value="' . htmlspecialchars($titleAttrib) . '" onclick="' . htmlspecialchars($onClick) . '" />';
}
} elseif (t3lib_div::_GP('sendToReview')) {
$onClick = 'window.location.href = "' . $this->REQUEST_URI . '";';
$actionLinks .= $this->doc->wrapScriptTags($onClick);
} else {
$actionLinks = '';
}
return $actionLinks;
}
示例11: getDisallowedTSconfigItemsByFieldName
/**
* Extract the disallowed TCAFORM field values of $fieldName given field
*
* @param integer $parentPageId
* @param string field name of TCAFORM
* @access private
* @return string comma seperated list of integer
*/
function getDisallowedTSconfigItemsByFieldName($positionPid, $fieldName)
{
$disallowPageTemplateItems = '';
$disallowPageTemplateList = array();
// Negative PID values is pointing to a page on the same level as the current.
if ($positionPid < 0) {
$pidRow = t3lib_BEfunc::getRecordWSOL('pages', abs($positionPid), 'pid');
$parentPageId = $pidRow['pid'];
} else {
$parentPageId = $positionPid;
}
// Get PageTSconfig for reduce the output of selectded template structs
$disallowPageTemplateStruct = t3lib_BEfunc::getModTSconfig(abs($parentPageId), 'TCEFORM.pages.' . $fieldName);
if (isset($disallowPageTemplateStruct['properties']['removeItems'])) {
$disallowedPageTemplateList = $disallowPageTemplateStruct['properties']['removeItems'];
}
$tmp_disallowedPageTemplateItems = array_unique(t3lib_div::intExplode(',', t3lib_div::expandList($disallowedPageTemplateList), TRUE));
return count($tmp_disallowedPageTemplateItems) ? implode(',', $tmp_disallowedPageTemplateItems) : '0';
}
示例12: renderTO_editProcessing
//.........这里部分代码省略.........
// Get BODY content for caching:
$contentSplittedByMapping=$this->markupObj->splitContentToMappingInfo($fileContent,$currentMappingInfo);
$templatemapping['MappingData_cached'] = $contentSplittedByMapping['sub']['ROOT'];
// Get HEAD content for caching:
list($html_header) = $this->markupObj->htmlParse->getAllParts($htmlParse->splitIntoBlock('head',$fileContent),1,0);
$this->markupObj->tags = $this->head_markUpTags; // Set up the markupObject to process only header-section tags:
$h_currentMappingInfo=array();
if (is_array($currentMappingInfo_head['headElementPaths'])) {
foreach($currentMappingInfo_head['headElementPaths'] as $kk => $vv) {
$h_currentMappingInfo['el_'.$kk]['MAP_EL'] = $vv;
}
}
$contentSplittedByMapping = $this->markupObj->splitContentToMappingInfo($html_header,$h_currentMappingInfo);
$templatemapping['MappingData_head_cached'] = $contentSplittedByMapping;
// Get <body> tag:
$reg='';
preg_match('/<body[^>]*>/i',$fileContent,$reg);
$templatemapping['BodyTag_cached'] = $currentMappingInfo_head['addBodyTag'] ? $reg[0] : '';
$TOuid = t3lib_BEfunc::wsMapId('tx_templavoila_tmplobj',$row['uid']);
$dataArr['tx_templavoila_tmplobj'][$TOuid]['templatemapping'] = serialize($templatemapping);
$dataArr['tx_templavoila_tmplobj'][$TOuid]['fileref_mtime'] = @filemtime($theFile);
$dataArr['tx_templavoila_tmplobj'][$TOuid]['fileref_md5'] = @md5_file($theFile);
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
$tce->stripslashes_values=0;
$tce->start($dataArr,array());
$tce->process_datamap();
unset($tce);
$flashMessage = t3lib_div::makeInstance(
't3lib_FlashMessage',
$GLOBALS['LANG']->getLL('msgMappingSaved'),
'',
t3lib_FlashMessage::OK
);
$msg[] .= $flashMessage->render();
$row = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj',$this->displayUid);
$templatemapping = unserialize($row['templatemapping']);
if (t3lib_div::_GP('_save_to_return')) {
header('Location: '.t3lib_div::locationHeaderUrl($this->returnUrl));
exit;
}
}
// Making the menu
$menuItems=array();
$menuItems[]='<input type="submit" name="_clear" value="' . $GLOBALS['LANG']->getLL('buttonClearAll') . '" title="' . $GLOBALS['LANG']->getLL('buttonClearAllMappingTitle') . '" />';
// Make either "Preview" button (body) or "Set" button (header)
if ($headerPart) { // Header:
$menuItems[] = '<input type="submit" name="_save_data_mapping" value="' . $GLOBALS['LANG']->getLL('buttonSet') . '" title="' . $GLOBALS['LANG']->getLL('buttonSetTitle') . '" />';
} else { // Body:
$menuItems[] = '<input type="submit" name="_preview" value="' . $GLOBALS['LANG']->getLL('buttonPreview') . '" title="' . $GLOBALS['LANG']->getLL('buttonPreviewMappingTitle') . '" />';
}
$menuItems[]='<input type="submit" name="_save_to" value="' . $GLOBALS['LANG']->getLL('buttonSave') . '" title="' . $GLOBALS['LANG']->getLL('buttonSaveTOTitle') . '" />';
if ($this->returnUrl) {
$menuItems[]='<input type="submit" name="_save_to_return" value="' . $GLOBALS['LANG']->getLL('buttonSaveAndReturn') . '" title="' . $GLOBALS['LANG']->getLL('buttonSaveAndReturnTitle') . '" />';
}
// If a difference is detected...:
if (
(serialize($templatemapping['MappingInfo_head']) != serialize($currentMappingInfo_head)) ||
(serialize($templatemapping['MappingInfo']) != serialize($currentMappingInfo))
) {
$menuItems[]='<input type="submit" name="_reload_from" value="' . $GLOBALS['LANG']->getLL('buttonRevert') . '" title="'.sprintf($GLOBALS['LANG']->getLL('buttonRevertTitle'), $headerPart ? 'HEAD' : 'BODY') . '" />';
$flashMessage = t3lib_div::makeInstance(
't3lib_FlashMessage',
$GLOBALS['LANG']->getLL('msgMappingIsDifferent'),
'',
t3lib_FlashMessage::INFO
);
$msg[] .= $flashMessage->render();
}
$content = '
<!--
Menu for saving Template Objects
-->
<table border="0" cellpadding="2" cellspacing="2" id="c-toMenu">
<tr class="bgColor5">
<td>'.implode('</td>
<td>',$menuItems).'</td>
</tr>
</table>
';
// @todo - replace with FlashMessage Queue
$content .= implode('', $msg);
return array($content, $headerPart ? $currentMappingInfo_head : $currentMappingInfo);
}
示例13: getMenuDefaultCode
/**
* Returns the code that the menu was mapped to in the HTML
*
* @param string "Field" from Data structure, either "field_menu" or "field_submenu"
* @return string
*/
function getMenuDefaultCode($field) {
// Select template record and extract menu HTML content
$toRec = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj',$this->wizardData['templateObjectId']);
$tMapping = unserialize($toRec['templatemapping']);
return $tMapping['MappingData_cached']['cArray'][$field];
}
示例14: getTable_tt_content
/**
* Renders Content Elements from the tt_content table from page id
*
* @param integer Page id
* @return string HTML for the listing
*/
function getTable_tt_content($id)
{
global $TCA;
$this->initializeLanguages();
// Initialize:
$RTE = $GLOBALS['BE_USER']->isRTE();
$lMarg = 1;
$showHidden = $this->tt_contentConfig['showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content');
$pageTitleParamForAltDoc = '&recTitle=' . rawurlencode(t3lib_BEfunc::getRecordTitle('pages', t3lib_BEfunc::getRecordWSOL('pages', $id), TRUE));
$GLOBALS['SOBE']->doc->getPageRenderer()->loadExtJs();
$GLOBALS['SOBE']->doc->getPageRenderer()->addJsFile($GLOBALS['BACK_PATH'] . 'sysext/cms/layout/js/typo3pageModule.js');
// Get labels for CTypes and tt_content element fields in general:
$this->CType_labels = array();
foreach ($TCA['tt_content']['columns']['CType']['config']['items'] as $val) {
$this->CType_labels[$val[1]] = $GLOBALS['LANG']->sL($val[0]);
}
$this->itemLabels = array();
foreach ($TCA['tt_content']['columns'] as $name => $val) {
$this->itemLabels[$name] = $GLOBALS['LANG']->sL($val['label']);
}
// Select display mode:
if (!$this->tt_contentConfig['single']) {
// MULTIPLE column display mode, side by side:
// Setting language list:
$langList = $this->tt_contentConfig['sys_language_uid'];
if ($this->tt_contentConfig['languageMode']) {
if ($this->tt_contentConfig['languageColsPointer']) {
$langList = '0,' . $this->tt_contentConfig['languageColsPointer'];
} else {
$langList = implode(',', array_keys($this->tt_contentConfig['languageCols']));
}
$languageColumn = array();
}
$langListArr = explode(',', $langList);
$defLanguageCount = array();
$defLangBinding = array();
// For EACH languages... :
foreach ($langListArr as $lP) {
// If NOT languageMode, then we'll only be through this once.
$showLanguage = $this->defLangBinding && $lP == 0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid=' . $lP;
$cList = explode(',', $this->tt_contentConfig['cols']);
$content = array();
$head = array();
// For EACH column, render the content into a variable:
foreach ($cList as $key) {
if (!$lP) {
$defLanguageCount[$key] = array();
}
// Select content elements from this column/language:
$queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos=' . intval($key) . $showHidden . $showLanguage);
$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
// If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script:
if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
$onClick = "window.location.href='db_new_content_el.php?id=" . $id . '&colPos=' . intval($key) . '&sys_language_uid=' . $lP . '&uid_pid=' . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')) . "';";
$theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick, $GLOBALS['LANG']->getLL('newPageContent'));
$content[$key] .= '<img src="clear.gif" width="1" height="5" alt="" /><br />' . $theNewButton;
}
// Traverse any selected elements and render their display code:
$rowArr = $this->getResult($result);
foreach ($rowArr as $rKey => $row) {
if (is_array($row) && (int) $row['t3ver_state'] != 2) {
$singleElementHTML = '';
if (!$lP) {
$defLanguageCount[$key][] = $row['uid'];
}
$editUidList .= $row['uid'] . ',';
$singleElementHTML .= $this->tt_content_drawHeader($row, $this->tt_contentConfig['showInfo'] ? 15 : 5, $this->defLangBinding && $lP > 0, TRUE);
$isRTE = $RTE && $this->isRTEforField('tt_content', $row, 'bodytext');
$singleElementHTML .= '<div ' . ($row['_ORIG_uid'] ? ' class="ver-element"' : '') . '>' . $this->tt_content_drawItem($row, $isRTE) . '</div>';
// NOTE: this is the end tag for <div class="t3-page-ce-body">
// because of bad (historic) conception, starting tag has to be placed inside tt_content_drawHeader()
$singleElementHTML .= '</div>';
$statusHidden = $this->isDisabled('tt_content', $row) ? ' t3-page-ce-hidden' : '';
$singleElementHTML = '<div class="t3-page-ce' . $statusHidden . '">' . $singleElementHTML . '</div>';
if ($this->defLangBinding && $this->tt_contentConfig['languageMode']) {
$defLangBinding[$key][$lP][$row[$lP ? 'l18n_parent' : 'uid']] = $singleElementHTML;
} else {
$content[$key] .= $singleElementHTML;
}
} else {
unset($rowArr[$rKey]);
}
}
// Add new-icon link, header:
$newP = $this->newContentElementOnClick($id, $key, $lP);
$head[$key] .= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content', 'colPos', $key), $this->doEdit && count($rowArr) ? '&edit[tt_content][' . $editUidList . ']=edit' . $pageTitleParamForAltDoc : '', $newP);
$editUidList = '';
}
// For EACH column, fit the rendered content into a table cell:
$out = '';
foreach ($cList as $k => $key) {
if (!$k) {
$out .= '
<td><img src="clear.gif" width="' . $lMarg . '" height="1" alt="" /></td>';
//.........这里部分代码省略.........
示例15: createPage
/**
* Performs the neccessary steps to creates a new page
*
* @param array $pageArray: array containing the fields for the new page
* @param integer $positionPid: location within the page tree (parent id)
* @return integer uid of the new page record
*/
function createPage($pageArray, $positionPid)
{
$dataArr = array();
$dataArr['pages']['NEW'] = $pageArray;
$dataArr['pages']['NEW']['pid'] = $positionPid;
if (is_null($dataArr['pages']['NEW']['hidden'])) {
$dataArr['pages']['NEW']['hidden'] = 0;
}
unset($dataArr['pages']['NEW']['uid']);
// If no data structure is set, try to find one by using the template object
if ($dataArr['pages']['NEW']['tx_templavoila_to'] && !$dataArr['pages']['NEW']['tx_templavoila_ds']) {
$templateObjectRow = t3lib_BEfunc::getRecordWSOL('tx_templavoila_tmplobj', $dataArr['pages']['NEW']['tx_templavoila_to'], 'uid,pid,datastructure');
$dataArr['pages']['NEW']['tx_templavoila_ds'] = $templateObjectRow['datastructure'];
}
$tce = t3lib_div::makeInstance('t3lib_TCEmain');
// set default TCA values specific for the user
$TCAdefaultOverride = $GLOBALS['BE_USER']->getTSConfigProp('TCAdefaults');
if (is_array($TCAdefaultOverride)) {
$tce->setDefaultsFromUserTS($TCAdefaultOverride);
}
$tce->stripslashes_values = 0;
$tce->start($dataArr, array());
$tce->process_datamap();
return $tce->substNEWwithIDs['NEW'];
}