当前位置: 首页>>代码示例>>PHP>>正文


PHP t3lib_BEfunc::getMovePlaceholder方法代码示例

本文整理汇总了PHP中t3lib_BEfunc::getMovePlaceholder方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::getMovePlaceholder方法的具体用法?PHP t3lib_BEfunc::getMovePlaceholder怎么用?PHP t3lib_BEfunc::getMovePlaceholder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t3lib_BEfunc的用法示例。


在下文中一共展示了t3lib_BEfunc::getMovePlaceholder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render_framework_singleSheet

    /**
     * Renders the display framework of a single sheet. Calls itself recursively
     *
     * @param	array		$contentTreeArr: DataStructure info array (the whole tree)
     * @param	string		$languageKey: Language key for the display
     * @param	string		$sheet: The sheet key of the sheet which should be rendered
     * @param	array		$parentPointer: Flexform pointer to parent element
     * @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_framework_singleSheet($contentTreeArr, $languageKey, $sheet, $parentPointer = array(), $parentDsMeta = array())
    {
        global $LANG, $TYPO3_CONF_VARS;
        $elementBelongsToCurrentPage = FALSE;
        $pid = $contentTreeArr['el']['table'] == 'pages' ? $contentTreeArr['el']['uid'] : $contentTreeArr['el']['pid'];
        if ($contentTreeArr['el']['table'] == 'pages' || $contentTreeArr['el']['pid'] == $this->rootElementUid_pidForContent) {
            $elementBelongsToCurrentPage = TRUE;
        } else {
            if ($contentTreeArr['el']['_ORIG_uid']) {
                $record = t3lib_BEfunc::getMovePlaceholder('tt_content', $contentTreeArr['el']['uid']);
                if (is_array($record) && $record['t3ver_move_id'] == $contentTreeArr['el']['uid']) {
                    $elementBelongsToCurrentPage = $this->rootElementUid_pidForContent == $record['pid'];
                    $pid = $record['pid'];
                }
            }
        }
        $calcPerms = $this->getCalcPerms($pid);
        $canEditElement = $GLOBALS['BE_USER']->isPSet($calcPerms, 'pages', 'editcontent');
        $canEditContent = $GLOBALS['BE_USER']->isPSet($this->calcPerms, 'pages', 'editcontent');
        $elementClass = 'tpm-container-element';
        $elementClass .= ' tpm-container-element-depth-' . $contentTreeArr['depth'];
        $elementClass .= ' tpm-container-element-depth-' . ($contentTreeArr['depth'] % 2 ? 'odd' : 'even');
        // Prepare the record icon including a content sensitive menu link wrapped around it:
        if (isset($contentTreeArr['el']['iconTag'])) {
            $recordIcon = $contentTreeArr['el']['iconTag'];
        } else {
            $recordIcon = '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, $contentTreeArr['el']['icon'], '') . ' border="0" title="' . htmlspecialchars('[' . $contentTreeArr['el']['table'] . ':' . $contentTreeArr['el']['uid'] . ']') . '" alt="" />';
        }
        $menuCommands = array();
        if ($GLOBALS['BE_USER']->isPSet($calcPerms, 'pages', 'new')) {
            $menuCommands[] = 'new';
        }
        if ($canEditContent) {
            $menuCommands[] = 'copy,cut,pasteinto,pasteafter,delete';
        } else {
            $menuCommands[] = 'copy';
        }
        $titleBarLeftButtons = $this->translatorMode ? $recordIcon : (count($menuCommands) == 0 ? $recordIcon : $this->doc->wrapClickMenuOnIcon($recordIcon, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], 1, '&amp;callingScriptId=' . rawurlencode($this->doc->scriptID), implode(',', $menuCommands)));
        $titleBarLeftButtons .= $this->getRecordStatHookValue($contentTreeArr['el']['table'], $contentTreeArr['el']['uid']);
        unset($menuCommands);
        // Prepare table specific settings:
        switch ($contentTreeArr['el']['table']) {
            case 'pages':
                $elementTitlebarClass = 'tpm-titlebar-page';
                $elementClass .= ' pagecontainer';
                $titleBarRightButtons = '';
                break;
            case 'tt_content':
                $elementTitlebarClass = $elementBelongsToCurrentPage ? 'tpm-titlebar' : 'tpm-titlebar-fromOtherPage';
                $elementClass .= ' tpm-content-element tpm-ctype-' . $contentTreeArr['el']['CType'];
                if ($contentTreeArr['el']['isHidden']) {
                    $elementClass .= ' tpm-hidden t3-page-ce-hidden';
                }
                if ($contentTreeArr['el']['CType'] == 'templavoila_pi1') {
                    //fce
                    $elementClass .= ' tpm-fce tpm-fce_' . intval($contentTreeArr['el']['TO']);
                }
                $languageUid = $contentTreeArr['el']['sys_language_uid'];
                $elementPointer = 'tt_content:' . $contentTreeArr['el']['uid'];
                $linkCopy = $this->clipboardObj->element_getSelectButtons($parentPointer, 'copy,ref');
                if (!$this->translatorMode) {
                    if ($canEditContent) {
                        $iconMakeLocal = t3lib_iconWorks::getSpriteIcon('extensions-templavoila-makelocalcopy', array('title' => $LANG->getLL('makeLocal')));
                        $linkMakeLocal = !$elementBelongsToCurrentPage && !in_array('makeLocal', $this->blindIcons) ? $this->link_makeLocal($iconMakeLocal, $parentPointer) : '';
                        $linkCut = $this->clipboardObj->element_getSelectButtons($parentPointer, 'cut');
                        if ($this->modTSconfig['properties']['enableDeleteIconForLocalElements'] < 2 || !$elementBelongsToCurrentPage || $this->global_tt_content_elementRegister[$contentTreeArr['el']['uid']] > 1) {
                            $iconUnlink = t3lib_iconWorks::getSpriteIcon('extensions-templavoila-unlink', array('title' => $LANG->getLL('unlinkRecord')));
                            $linkUnlink = !in_array('unlink', $this->blindIcons) ? $this->link_unlink($iconUnlink, $parentPointer, FALSE, FALSE, $elementPointer) : '';
                        } else {
                            $linkUnlink = '';
                        }
                    } else {
                        $linkMakeLocal = $linkCut = $linkUnlink = '';
                    }
                    if ($canEditElement && $GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $contentTreeArr['previewData']['fullRow'])) {
                        if (($elementBelongsToCurrentPage || $this->modTSconfig['properties']['enableEditIconForRefElements']) && !in_array('edit', $this->blindIcons)) {
                            $iconEdit = t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $LANG->getLL('editrecord')));
                            $linkEdit = $this->link_edit($iconEdit, $contentTreeArr['el']['table'], $contentTreeArr['el']['uid'], false, $contentTreeArr['el']['pid']);
                        } else {
                            $linkEdit = '';
                        }
                        $linkHide = !in_array('hide', $this->blindIcons) ? $this->icon_hide($contentTreeArr['el']) : '';
                        if ($canEditContent && $this->modTSconfig['properties']['enableDeleteIconForLocalElements'] && $elementBelongsToCurrentPage) {
                            $hasForeignReferences = tx_templavoila_div::hasElementForeignReferences($contentTreeArr['el'], $contentTreeArr['el']['pid']);
                            $iconDelete = t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => $LANG->getLL('deleteRecord')));
                            $linkDelete = !in_array('delete', $this->blindIcons) ? $this->link_unlink($iconDelete, $parentPointer, TRUE, $hasForeignReferences, $elementPointer) : '';
                        } else {
                            $linkDelete = '';
//.........这里部分代码省略.........
开发者ID:rod86,项目名称:t3sandbox,代码行数:101,代码来源:index.php

示例2: 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) {
		$positionPageMoveToRow = t3lib_BEfunc::getMovePlaceholder('pages', abs($positionPid));
		if (is_array($positionPageMoveToRow)) {
			$positionPid = ($positionPid > 0 ) ? $positionPageMoveToRow['uid'] : '-' . $positionPageMoveToRow['uid'];
		}

		$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');

		if (is_array($this->TCAdefaultOverride))	{
			$tce->setDefaultsFromUserTS($this->TCAdefaultOverride);
		}

		$tce->stripslashes_values=0;
		$tce->start($dataArr,array());
		$tce->process_datamap();

		return $tce->substNEWwithIDs['NEW'];
	}
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:39,代码来源:class.tx_templavoila_mod1_wizards.php

示例3: moveRecord_wsPlaceholders

 /**
  * Creates a move placeholder for workspaces.
  * USE ONLY INTERNALLY
  * Moving placeholder: Can be done because the system sees it as a placeholder for NEW elements like t3ver_state=1
  * Moving original: Will either create the placeholder if it doesn't exist or move existing placeholder in workspace.
  *
  * @param string $table Table name to move
  * @param integer $uid Record uid to move (online record)
  * @param integer $destPid Position to move to: $destPid: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
  * @param integer $wsUid UID of offline version of online record
  * @param t3lib_TCEmain $tcemainObj TCEmain object
  * @return void
  * @see moveRecord()
  */
 protected function moveRecord_wsPlaceholders($table, $uid, $destPid, $wsUid, t3lib_TCEmain $tcemainObj)
 {
     global $TCA;
     if ($plh = t3lib_BEfunc::getMovePlaceholder($table, $uid, 'uid')) {
         // If already a placeholder exists, move it:
         $tcemainObj->moveRecord_raw($table, $plh['uid'], $destPid);
     } else {
         // First, we create a placeholder record in the Live workspace that
         // represents the position to where the record is eventually moved to.
         $newVersion_placeholderFieldArray = array();
         if ($TCA[$table]['ctrl']['crdate']) {
             $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['crdate']] = $GLOBALS['EXEC_TIME'];
         }
         if ($TCA[$table]['ctrl']['cruser_id']) {
             $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['cruser_id']] = $tcemainObj->userid;
         }
         if ($TCA[$table]['ctrl']['tstamp']) {
             $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
         }
         if ($table == 'pages') {
             // Copy page access settings from original page to placeholder
             $perms_clause = $tcemainObj->BE_USER->getPagePermsClause(1);
             $access = t3lib_BEfunc::readPageAccess($uid, $perms_clause);
             $newVersion_placeholderFieldArray['perms_userid'] = $access['perms_userid'];
             $newVersion_placeholderFieldArray['perms_groupid'] = $access['perms_groupid'];
             $newVersion_placeholderFieldArray['perms_user'] = $access['perms_user'];
             $newVersion_placeholderFieldArray['perms_group'] = $access['perms_group'];
             $newVersion_placeholderFieldArray['perms_everybody'] = $access['perms_everybody'];
         }
         $newVersion_placeholderFieldArray['t3ver_label'] = 'MOVE-TO PLACEHOLDER for #' . $uid;
         $newVersion_placeholderFieldArray['t3ver_move_id'] = $uid;
         // Setting placeholder state value for temporary record
         $newVersion_placeholderFieldArray['t3ver_state'] = 3;
         // Setting workspace - only so display of place holders can filter out those from other workspaces.
         $newVersion_placeholderFieldArray['t3ver_wsid'] = $tcemainObj->BE_USER->workspace;
         $newVersion_placeholderFieldArray[$TCA[$table]['ctrl']['label']] = '[MOVE-TO PLACEHOLDER for #' . $uid . ', WS#' . $tcemainObj->BE_USER->workspace . ']';
         // moving localized records requires to keep localization-settings for the placeholder too
         if (array_key_exists('languageField', $GLOBALS['TCA'][$table]['ctrl']) && array_key_exists('transOrigPointerField', $GLOBALS['TCA'][$table]['ctrl'])) {
             $l10nParentRec = t3lib_BEfunc::getRecord($table, $uid);
             $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['languageField']] = $l10nParentRec[$GLOBALS['TCA'][$table]['ctrl']['languageField']];
             $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] = $l10nParentRec[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']];
             unset($l10nParentRec);
         }
         // Initially, create at root level.
         $newVersion_placeholderFieldArray['pid'] = 0;
         $id = 'NEW_MOVE_PLH';
         // Saving placeholder as 'original'
         $tcemainObj->insertDB($table, $id, $newVersion_placeholderFieldArray, FALSE);
         // Move the new placeholder from temporary root-level to location:
         $tcemainObj->moveRecord_raw($table, $tcemainObj->substNEWwithIDs[$id], $destPid);
         // Move the workspace-version of the original to be the version of the move-to-placeholder:
         // Setting placeholder state value for version (so it can know it is currently a new version...)
         $updateFields = array('t3ver_state' => 4);
         $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($wsUid), $updateFields);
     }
     // Check for the localizations of that element and move them as well
     $tcemainObj->moveL10nOverlayRecords($table, $uid, $destPid);
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:72,代码来源:class.tx_version_tcemain.php

示例4: version_clearWSID

 /**
  * Release version from this workspace (and into "Live" workspace but as an offline version).
  *
  * @param	string		Table name
  * @param	integer		Record UID
  * @param	boolean		If set, will completely delete element
  * @return	void
  */
 function version_clearWSID($table, $id, $flush = FALSE)
 {
     global $TCA;
     if ($errorCode = $this->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
         $this->newlog('Attempt to reset workspace for record failed: ' . $errorCode, 1);
     } elseif ($this->checkRecordUpdateAccess($table, $id)) {
         if ($liveRec = t3lib_BEfunc::getLiveVersionOfRecord($table, $id, 'uid,t3ver_state')) {
             // Clear workspace ID:
             $sArray = array();
             $sArray['t3ver_wsid'] = 0;
             $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($id), $sArray);
             // Clear workspace ID for live version AND DELETE IT as well because it is a new record!
             if ((int) $liveRec['t3ver_state'] == 1 || (int) $liveRec['t3ver_state'] == 2) {
                 $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($liveRec['uid']), $sArray);
                 $this->deleteEl($table, $liveRec['uid'], TRUE);
                 // THIS assumes that the record was placeholder ONLY for ONE record (namely $id)
             }
             // If "deleted" flag is set for the version that got released it doesn't make sense to keep that "placeholder" anymore and we delete it completly.
             $wsRec = t3lib_BEfunc::getRecord($table, $id);
             if ($flush || ((int) $wsRec['t3ver_state'] == 1 || (int) $wsRec['t3ver_state'] == 2)) {
                 $this->deleteEl($table, $id, TRUE, TRUE);
             }
             // Remove the move-placeholder if found for live record.
             if ((int) $TCA[$table]['ctrl']['versioningWS'] >= 2) {
                 if ($plhRec = t3lib_BEfunc::getMovePlaceholder($table, $liveRec['uid'], 'uid')) {
                     $this->deleteEl($table, $plhRec['uid'], TRUE, TRUE);
                 }
             }
         }
     } else {
         $this->newlog('Attempt to reset workspace for record failed because you do not have edit access', 1);
     }
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:41,代码来源:class.t3lib_tcemain.php


注:本文中的t3lib_BEfunc::getMovePlaceholder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。