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


PHP BackendUtility::getRecordPath方法代码示例

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


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

示例1: viewEditRecord

 /**
  * Action to edit records
  *
  * @param array $record sys_action record
  * @return string list of records
  */
 protected function viewEditRecord($record)
 {
     $content = '';
     $actionList = array();
     $dbAnalysis = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\RelationHandler');
     $dbAnalysis->setFetchAllFields(TRUE);
     $dbAnalysis->start($record['t4_recordsToEdit'], '*');
     $dbAnalysis->getFromDB();
     // collect the records
     foreach ($dbAnalysis->itemArray as $el) {
         $path = BackendUtility::getRecordPath($el['id'], $this->taskObject->perms_clause, $GLOBALS['BE_USER']->uc['titleLen']);
         $record = BackendUtility::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $title = BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $description = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], TRUE);
         // @todo: which information could be needful
         if (isset($record['crdate'])) {
             $description .= ' - ' . BackendUtility::dateTimeAge($record['crdate']);
         }
         $actionList[$el['id']] = array('title' => $title, 'description' => BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $GLOBALS['BACK_PATH'] . 'alt_doc.php?returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI')) . '&edit[' . $el['table'] . '][' . $el['id'] . ']=edit', 'icon' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], array('title' => htmlspecialchars($path))));
     }
     // Render the record list
     $content .= $this->taskObject->renderListMenu($actionList);
     return $content;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:30,代码来源:ActionTask.php

示例2: generateDataArray

 /**
  * Generates grid list array from given versions.
  *
  * @param array $versions All available version records
  * @param string $filterTxt Text to be used to filter record result
  * @return void
  */
 protected function generateDataArray(array $versions, $filterTxt)
 {
     $workspaceAccess = $GLOBALS['BE_USER']->checkWorkspace($GLOBALS['BE_USER']->workspace);
     $swapStage = $workspaceAccess['publish_access'] & 1 ? \TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID : 0;
     $swapAccess = $GLOBALS['BE_USER']->workspacePublishAccess($GLOBALS['BE_USER']->workspace) && $GLOBALS['BE_USER']->workspaceSwapAccess();
     $this->initializeWorkspacesCachingFramework();
     // check for dataArray in cache
     if ($this->getDataArrayFromCache($versions, $filterTxt) === FALSE) {
         /** @var $stagesObj \TYPO3\CMS\Workspaces\Service\StagesService */
         $stagesObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Service\\StagesService');
         $defaultGridColumns = array(self::GridColumn_Collection => 0, self::GridColumn_CollectionLevel => 0, self::GridColumn_CollectionParent => '', self::GridColumn_CollectionCurrent => '', self::GridColumn_CollectionChildren => 0);
         foreach ($versions as $table => $records) {
             $hiddenField = $this->getTcaEnableColumnsFieldName($table, 'disabled');
             $isRecordTypeAllowedToModify = $GLOBALS['BE_USER']->check('tables_modify', $table);
             foreach ($records as $record) {
                 $origRecord = BackendUtility::getRecord($table, $record['t3ver_oid']);
                 $versionRecord = BackendUtility::getRecord($table, $record['uid']);
                 $combinedRecord = \TYPO3\CMS\Workspaces\Domain\Model\CombinedRecord::createFromArrays($table, $origRecord, $versionRecord);
                 $this->getIntegrityService()->checkElement($combinedRecord);
                 if ($hiddenField !== NULL) {
                     $recordState = $this->workspaceState($versionRecord['t3ver_state'], $origRecord[$hiddenField], $versionRecord[$hiddenField]);
                 } else {
                     $recordState = $this->workspaceState($versionRecord['t3ver_state']);
                 }
                 $isDeletedPage = $table == 'pages' && $recordState == 'deleted';
                 $viewUrl = \TYPO3\CMS\Workspaces\Service\WorkspaceService::viewSingleRecord($table, $record['uid'], $origRecord, $versionRecord);
                 $versionArray = array();
                 $versionArray['table'] = $table;
                 $versionArray['id'] = $table . ':' . $record['uid'];
                 $versionArray['uid'] = $record['uid'];
                 $versionArray['workspace'] = $versionRecord['t3ver_id'];
                 $versionArray = array_merge($versionArray, $defaultGridColumns);
                 $versionArray['label_Workspace'] = htmlspecialchars(BackendUtility::getRecordTitle($table, $versionRecord));
                 $versionArray['label_Live'] = htmlspecialchars(BackendUtility::getRecordTitle($table, $origRecord));
                 $versionArray['label_Stage'] = htmlspecialchars($stagesObj->getStageTitle($versionRecord['t3ver_stage']));
                 $tempStage = $stagesObj->getNextStage($versionRecord['t3ver_stage']);
                 $versionArray['label_nextStage'] = htmlspecialchars($stagesObj->getStageTitle($tempStage['uid']));
                 $tempStage = $stagesObj->getPrevStage($versionRecord['t3ver_stage']);
                 $versionArray['label_prevStage'] = htmlspecialchars($stagesObj->getStageTitle($tempStage['uid']));
                 $versionArray['path_Live'] = htmlspecialchars(BackendUtility::getRecordPath($record['livepid'], '', 999));
                 $versionArray['path_Workspace'] = htmlspecialchars(BackendUtility::getRecordPath($record['wspid'], '', 999));
                 $versionArray['workspace_Title'] = htmlspecialchars(\TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($versionRecord['t3ver_wsid']));
                 $versionArray['workspace_Tstamp'] = $versionRecord['tstamp'];
                 $versionArray['workspace_Formated_Tstamp'] = BackendUtility::datetime($versionRecord['tstamp']);
                 $versionArray['t3ver_wsid'] = $versionRecord['t3ver_wsid'];
                 $versionArray['t3ver_oid'] = $record['t3ver_oid'];
                 $versionArray['livepid'] = $record['livepid'];
                 $versionArray['stage'] = $versionRecord['t3ver_stage'];
                 $versionArray['icon_Live'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($table, $origRecord);
                 $versionArray['icon_Workspace'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconClass($table, $versionRecord);
                 $languageValue = $this->getLanguageValue($table, $versionRecord);
                 $versionArray['languageValue'] = $languageValue;
                 $versionArray['language'] = array('cls' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses($this->getSystemLanguageValue($languageValue, 'flagIcon')), 'title' => htmlspecialchars($this->getSystemLanguageValue($languageValue, 'title')));
                 $versionArray['allowedAction_nextStage'] = $isRecordTypeAllowedToModify && $stagesObj->isNextStageAllowedForUser($versionRecord['t3ver_stage']);
                 $versionArray['allowedAction_prevStage'] = $isRecordTypeAllowedToModify && $stagesObj->isPrevStageAllowedForUser($versionRecord['t3ver_stage']);
                 if ($swapAccess && $swapStage != 0 && $versionRecord['t3ver_stage'] == $swapStage) {
                     $versionArray['allowedAction_swap'] = $isRecordTypeAllowedToModify && $stagesObj->isNextStageAllowedForUser($swapStage);
                 } elseif ($swapAccess && $swapStage == 0) {
                     $versionArray['allowedAction_swap'] = $isRecordTypeAllowedToModify;
                 } else {
                     $versionArray['allowedAction_swap'] = FALSE;
                 }
                 $versionArray['allowedAction_delete'] = $isRecordTypeAllowedToModify;
                 // preview and editing of a deleted page won't work ;)
                 $versionArray['allowedAction_view'] = !$isDeletedPage && $viewUrl;
                 $versionArray['allowedAction_edit'] = $isRecordTypeAllowedToModify && !$isDeletedPage;
                 $versionArray['allowedAction_editVersionedPage'] = $isRecordTypeAllowedToModify && !$isDeletedPage;
                 $versionArray['state_Workspace'] = $recordState;
                 $versionArray = array_merge($versionArray, $this->getAdditionalColumnService()->getData($combinedRecord));
                 if ($filterTxt == '' || $this->isFilterTextInVisibleColumns($filterTxt, $versionArray)) {
                     $versionIdentifier = $versionArray['id'];
                     $this->dataArray[$versionIdentifier] = $versionArray;
                 }
             }
         }
         // Suggested slot method:
         // methodName(\TYPO3\CMS\Workspaces\Service\GridDataService $gridData, array &$dataArray, array $versions)
         $this->emitSignal(self::SIGNAL_GenerateDataArray_BeforeCaching, $this->dataArray, $versions);
         // Enrich elements after everything has been processed:
         foreach ($this->dataArray as &$element) {
             $identifier = $element['table'] . ':' . $element['t3ver_oid'];
             $element['integrity'] = array('status' => $this->getIntegrityService()->getStatusRepresentation($identifier), 'messages' => htmlspecialchars($this->getIntegrityService()->getIssueMessages($identifier, TRUE)));
         }
         $this->setDataArrayIntoCache($versions, $filterTxt);
     }
     // Suggested slot method:
     // methodName(\TYPO3\CMS\Workspaces\Service\GridDataService $gridData, array &$dataArray, array $versions)
     $this->emitSignal(self::SIGNAL_GenerateDataArray_PostProcesss, $this->dataArray, $versions);
     $this->sortDataArray();
     $this->resolveDataArrayDependencies();
 }
开发者ID:KarlDennisMatthaei1923,项目名称:PierraaDesign,代码行数:98,代码来源:GridDataService.php

示例3: ext_getTemplateHierarchyArr

    /**
     * [Describe function...]
     *
     * @param 	[type]		$arr: ...
     * @param 	[type]		$depthData: ...
     * @param 	[type]		$keyArray: ...
     * @param 	[type]		$first: ...
     * @return 	[type]		...
     * @todo Define visibility
     */
    public function ext_getTemplateHierarchyArr($arr, $depthData, $keyArray, $first = 0)
    {
        $keyArr = array();
        foreach ($arr as $key => $value) {
            $key = preg_replace('/\\.$/', '', $key);
            if (substr($key, -1) != '.') {
                $keyArr[$key] = 1;
            }
        }
        $a = 0;
        $c = count($keyArr);
        static $i = 0;
        foreach ($keyArr as $key => $value) {
            $HTML = '';
            $a++;
            $deeper = is_array($arr[$key . '.']);
            $row = $arr[$key];
            $PM = 'join';
            $LN = $a == $c ? 'blank' : 'line';
            $BTM = $a == $c ? 'top' : '';
            $PM = 'join';
            $HTML .= $depthData;
            $alttext = '[' . $row['templateID'] . ']';
            $alttext .= $row['pid'] ? ' - ' . BackendUtility::getRecordPath($row['pid'], $GLOBALS['SOBE']->perms_clause, 20) : '';
            $icon = substr($row['templateID'], 0, 3) == 'sys' ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_template', $row, array('title' => $alttext)) : \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('mimetypes-x-content-template-static', array('title' => $alttext));
            if (in_array($row['templateID'], $this->clearList_const) || in_array($row['templateID'], $this->clearList_setup)) {
                $urlParameters = array('id' => $GLOBALS['SOBE']->id, 'template' => $row['templateID']);
                $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
                $A_B = '<a href="' . htmlspecialchars($aHref) . '">';
                $A_E = '</a>';
                if (GeneralUtility::_GP('template') == $row['templateID']) {
                    $A_B = '<strong>' . $A_B;
                    $A_E .= '</strong>';
                }
            } else {
                $A_B = '';
                $A_E = '';
            }
            $HTML .= ($first ? '' : IconUtility::getSpriteIcon('treeline-' . $PM . $BTM)) . $icon . $A_B . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . $A_E . '&nbsp;&nbsp;';
            $RL = $this->ext_getRootlineNumber($row['pid']);
            $keyArray[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
							<td nowrap="nowrap">' . $HTML . '</td>
							<td align="center">' . ($row['root'] ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;</td>
							<td align="center">' . ($row['clConf'] ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;' . '</td>
							<td align="center">' . ($row['clConst'] ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;' . '</td>
							<td align="center">' . ($row['pid'] ?: '') . '</td>
							<td align="center">' . (strcmp($RL, '') ? $RL : '') . '</td>
							<td>' . ($row['next'] ? '&nbsp;' . $row['next'] . '&nbsp;&nbsp;' : '') . '</td>
						</tr>';
            if ($deeper) {
                $keyArray = $this->ext_getTemplateHierarchyArr($arr[$key . '.'], $depthData . ($first ? '' : IconUtility::getSpriteIcon('treeline-' . $LN)), $keyArray);
            }
        }
        return $keyArray;
    }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:65,代码来源:ExtendedTemplateService.php

示例4: viewEditRecord

 /**
  * Action to edit records
  *
  * @param array $record sys_action record
  * @return string list of records
  */
 protected function viewEditRecord($record)
 {
     $content = '';
     $actionList = array();
     $dbAnalysis = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\RelationHandler::class);
     $dbAnalysis->setFetchAllFields(true);
     $dbAnalysis->start($record['t4_recordsToEdit'], '*');
     $dbAnalysis->getFromDB();
     // collect the records
     foreach ($dbAnalysis->itemArray as $el) {
         $path = BackendUtility::getRecordPath($el['id'], $this->taskObject->perms_clause, $this->getBackendUser()->uc['titleLen']);
         $record = BackendUtility::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $title = BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
         $description = $this->getLanguageService()->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], true);
         // @todo: which information could be needful
         if (isset($record['crdate'])) {
             $description .= ' - ' . BackendUtility::dateTimeAge($record['crdate']);
         }
         $link = BackendUtility::getModuleUrl('record_edit', array('edit[' . $el['table'] . '][' . $el['id'] . ']' => 'edit', 'returnUrl' => $this->moduleUrl), false, true);
         $actionList[$el['id']] = array('uid' => 'record-' . $el['table'] . '-' . $el['id'], 'title' => $title, 'description' => BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $link, 'icon' => '<span title="' . htmlspecialchars($path) . '">' . $this->iconFactory->getIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], Icon::SIZE_SMALL)->render() . '</span>');
     }
     // Render the record list
     $content .= $this->taskObject->renderListMenu($actionList);
     return $content;
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:31,代码来源:ActionTask.php

示例5: notifyStageChange


//.........这里部分代码省略.........
                    break;
                case 10:
                    $emails = $this->getEmailsForStageChangeNotification($workspaceRec['adminusers'], TRUE);
                    $emails = $this->getEmailsForStageChangeNotification($workspaceRec['reviewers']) + $emails;
                    $emails = $this->getEmailsForStageChangeNotification($workspaceRec['members']) + $emails;
                    break;
                default:
                    // Do nothing
            }
        } else {
            $emails = $notificationAlternativeRecipients;
        }
        // prepare and then send the emails
        if (count($emails)) {
            // Path to record is found:
            list($elementTable, $elementUid) = explode(':', $elementName);
            $elementUid = (int) $elementUid;
            $elementRecord = BackendUtility::getRecord($elementTable, $elementUid);
            $recordTitle = BackendUtility::getRecordTitle($elementTable, $elementRecord);
            if ($elementTable == 'pages') {
                $pageUid = $elementUid;
            } else {
                BackendUtility::fixVersioningPid($elementTable, $elementRecord);
                $pageUid = $elementUid = $elementRecord['pid'];
            }
            // fetch the TSconfig settings for the email
            // old way, options are TCEMAIN.notificationEmail_body/subject
            $TCEmainTSConfig = $tcemainObj->getTCEMAIN_TSconfig($pageUid);
            // new way, options are
            // pageTSconfig: tx_version.workspaces.stageNotificationEmail.subject
            // userTSconfig: page.tx_version.workspaces.stageNotificationEmail.subject
            $pageTsConfig = BackendUtility::getPagesTSconfig($pageUid);
            $emailConfig = $pageTsConfig['tx_version.']['workspaces.']['stageNotificationEmail.'];
            $markers = array('###RECORD_TITLE###' => $recordTitle, '###RECORD_PATH###' => BackendUtility::getRecordPath($elementUid, '', 20), '###SITE_NAME###' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'], '###SITE_URL###' => GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir, '###WORKSPACE_TITLE###' => $workspaceRec['title'], '###WORKSPACE_UID###' => $workspaceRec['uid'], '###ELEMENT_NAME###' => $elementName, '###NEXT_STAGE###' => $newStage, '###COMMENT###' => $comment, '###USER_REALNAME###' => $tcemainObj->BE_USER->user['realName'], '###USER_FULLNAME###' => $tcemainObj->BE_USER->user['realName'], '###USER_USERNAME###' => $tcemainObj->BE_USER->user['username']);
            // add marker for preview links if workspace extension is loaded
            if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('workspaces')) {
                $this->workspaceService = GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Service\WorkspaceService::class);
                // only generate the link if the marker is in the template - prevents database from getting to much entries
                if (GeneralUtility::isFirstPartOfStr($emailConfig['message'], 'LLL:')) {
                    $tempEmailMessage = $GLOBALS['LANG']->sL($emailConfig['message']);
                } else {
                    $tempEmailMessage = $emailConfig['message'];
                }
                if (strpos($tempEmailMessage, '###PREVIEW_LINK###') !== FALSE) {
                    $markers['###PREVIEW_LINK###'] = $this->workspaceService->generateWorkspacePreviewLink($elementUid);
                }
                unset($tempEmailMessage);
                $markers['###SPLITTED_PREVIEW_LINK###'] = $this->workspaceService->generateWorkspaceSplittedPreviewLink($elementUid, TRUE);
            }
            // Hook for preprocessing of the content for formmails:
            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'])) {
                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/version/class.tx_version_tcemain.php']['notifyStageChange-postModifyMarkers'] as $_classRef) {
                    $_procObj =& GeneralUtility::getUserObj($_classRef);
                    $markers = $_procObj->postModifyMarkers($markers, $this);
                }
            }
            // send an email to each individual user, to ensure the
            // multilanguage version of the email
            $emailRecipients = array();
            // an array of language objects that are needed
            // for emails with different languages
            $languageObjects = array($GLOBALS['LANG']->lang => $GLOBALS['LANG']);
            // loop through each recipient and send the email
            foreach ($emails as $recipientData) {
                // don't send an email twice
                if (isset($emailRecipients[$recipientData['email']])) {
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:67,代码来源:DataHandlerHook.php

示例6: render

 /**
  * Entry method
  *
  * @return array As defined in initializeResultArray() of AbstractNode
  */
 public function render()
 {
     $languageService = $this->getLanguageService();
     $backendUser = $this->getBackendUserAuthentication();
     $table = $this->data['tableName'];
     $row = $this->data['databaseRow'];
     $options = $this->data;
     if (empty($this->data['fieldListToRender'])) {
         $options['renderType'] = 'fullRecordContainer';
     } else {
         $options['renderType'] = 'listOfFieldsContainer';
     }
     $result = $this->nodeFactory->create($options)->render();
     $childHtml = $result['html'];
     $recordPath = '';
     // @todo: what is this >= 0 check for? wsol cases?!
     if ($this->data['effectivePid'] >= 0) {
         $permissionsClause = $backendUser->getPagePermsClause(1);
         $recordPath = BackendUtility::getRecordPath($this->data['effectivePid'], $permissionsClause, 15);
     }
     $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     $icon = '<span title="' . htmlspecialchars($recordPath) . '">' . $iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render() . '</span>';
     // @todo: Could this be done in a more clever way? Does it work at all?
     $tableTitle = $languageService->sL($this->data['processedTca']['ctrl']['title']);
     if ($this->data['command'] === 'new') {
         $newOrUid = ' <span class="typo3-TCEforms-newToken">' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.new', true) . '</span>';
         // @todo: There is quite some stuff do to for WS overlays ...
         $workspacedPageRecord = BackendUtility::getRecordWSOL('pages', $this->data['effectivePid'], 'title');
         $pageTitle = BackendUtility::getRecordTitle('pages', $workspacedPageRecord, true, false);
         if ($table === 'pages') {
             $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewPage', true);
             $pageTitle = sprintf($label, $tableTitle);
         } else {
             $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecord', true);
             if ($this->data['effectivePid'] === 0) {
                 $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecordRootLevel', true);
             }
             $pageTitle = sprintf($label, $tableTitle, $pageTitle);
         }
     } else {
         $icon = BackendUtility::wrapClickMenuOnIcon($icon, $table, $row['uid'], 1, '', '+copy,info,edit,view');
         $newOrUid = ' <span class="typo3-TCEforms-recUid">[' . htmlspecialchars($row['uid']) . ']</span>';
         // @todo: getRecordTitlePrep applies an htmlspecialchars here
         $recordLabel = BackendUtility::getRecordTitlePrep($this->data['recordTitle']);
         if ($table === 'pages') {
             $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editPage', true);
             $pageTitle = sprintf($label, $tableTitle, $recordLabel);
         } else {
             $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecord', true);
             $workspacedPageRecord = BackendUtility::getRecordWSOL('pages', $row['pid'], 'uid,title');
             $pageTitle = BackendUtility::getRecordTitle('pages', $workspacedPageRecord, true, false);
             if (empty($recordLabel)) {
                 $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordNoTitle', true);
             }
             if ($this->data['effectivePid'] === 0) {
                 $label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordRootLevel', true);
             }
             if (!empty($recordLabel)) {
                 // Use record title and prepend an edit label.
                 $pageTitle = sprintf($label, $tableTitle, $recordLabel, $pageTitle);
             } else {
                 // Leave out the record title since it is not set.
                 $pageTitle = sprintf($label, $tableTitle, $pageTitle);
             }
         }
     }
     $html = array();
     $html[] = '<h1>' . $pageTitle . '</h1>';
     $html[] = '<div class="typo3-TCEforms">';
     $html[] = $childHtml;
     $html[] = '<div class="help-block text-right">';
     $html[] = $icon . ' <strong>' . htmlspecialchars($tableTitle) . '</strong>' . ' ' . $newOrUid;
     $html[] = '</div>';
     $html[] = '</div>';
     $result['html'] = implode(LF, $html);
     return $result;
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:82,代码来源:OuterWrapContainer.php

示例7: recPath

 /**
  * Returns the path for a certain pid
  * The result is cached internally for the session, thus you can call
  * this function as much as you like without performance problems.
  *
  * @param int $pid The page id for which to get the path
  * @return mixed[] The path.
  */
 public function recPath($pid)
 {
     if (!isset($this->recPath_cache[$pid])) {
         $this->recPath_cache[$pid] = BackendUtility::getRecordPath($pid, $this->perms_clause, 20);
     }
     return $this->recPath_cache[$pid];
 }
开发者ID:CDRO,项目名称:TYPO3.CMS,代码行数:15,代码来源:DatabaseRecordList.php

示例8: main

    /**
     * Main Task center module
     *
     * @return string HTML content.
     * @todo Define visibility
     */
    public function main()
    {
        if ($id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('display')) {
            return $this->urlInIframe($this->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::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 = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($tempDir, 'png,gif,jpg', 1);
            }
            $clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
            $usernames = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
            // Create preset links:
            $presets = $this->getPresets();
            $opt = array();
            $opt[] = '
			<tr class="bgColor5 tableheader">
				<td>Icon:</td>
				<td>Preset Title:</td>
				<td>Public</td>
				<td>Owner:</td>
				<td>Page:</td>
				<td>Path:</td>
				<td>Meta data:</td>
			</tr>';
            if (is_array($presets)) {
                foreach ($presets as $presetCfg) {
                    $configuration = unserialize($presetCfg['preset_data']);
                    $thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
                    $title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
                    $opt[] = '
					<tr class="bgColor4">
						<td>' . ($thumbnailFile ? '<img src="' . $this->backPath . '../' . substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile) . '" hspace="2" width="70" style="border: solid black 1px;" alt="" /><br />' : '&nbsp;') . '</td>
						<td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($title, 30)) . '</a>&nbsp;</td>
						<td>' . ($presetCfg['public'] ? 'Yes' : '&nbsp;') . '</td>
						<td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? 'Own' : '[' . $usernames[$presetCfg['user_uid']]['username'] . ']') . '</td>
						<td>' . ($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : '&nbsp;') . '</td>
						<td>' . htmlspecialchars($configuration['pagetree']['id'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::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;
    }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:57,代码来源:ModuleFunctionController.php

示例9: getRecordPath

 /**
  * Returns the path for a record. Is the whole path for all records except pages - for these the last part is cut
  * off, because it contains the pagetitle itself, which would be double information
  *
  * The path is returned uncut, cutting has to be done by calling function.
  *
  * @param array $row The row
  * @param array $record The record
  * @return string The record-path
  */
 protected function getRecordPath(&$row, $uid)
 {
     $titleLimit = max($this->config['maxPathTitleLength'], 0);
     if (($this->mmForeignTable ? $this->mmForeignTable : $this->table) == 'pages') {
         $path = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($uid, '', $titleLimit);
         // For pages we only want the first (n-1) parts of the path,
         // because the n-th part is the page itself
         $path = substr($path, 0, strrpos($path, '/', -2)) . '/';
     } else {
         $path = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($row['pid'], '', $titleLimit);
     }
     return $path;
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:23,代码来源:SuggestDefaultReceiver.php

示例10: userManagement


//.........这里部分代码省略.........
         $filter = '1';
     }
     // Determine sort order. The default is "ASC" order.
     switch (strtoupper(GeneralUtility::_GP('mmforum_style'))) {
         case 'DESC':
             $orderBy = 'DESC';
             break;
         case 'ASC':
         default:
             $orderBy = 'ASC';
             break;
     }
     if (GeneralUtility::_GP('mmforum_sort') == 'username') {
         $order = 'username ' . $orderBy . '';
         $uOrder = $orderBy == 'ASC' ? 'DESC' : 'ASC';
         $aOrder = 'ASC';
     } elseif (GeneralUtility::_GP('mmforum_sort') == 'age') {
         $order = 'crdate ' . $orderBy . '';
         $aOrder = $orderBy == 'ASC' ? 'DESC' : 'ASC';
         $uOrder = 'ASC';
     } else {
         $order = 'username ' . $orderBy . '';
         $aOrder = 'ASC';
         $uOrder = 'DESC';
     }
     #$userGroup_query = "(".$this->confArr['userGroup']." IN (usergroup) OR ".$this->confArr['modGroup']." IN (usergroup) OR ".$this->confArr['adminGroup']." IN (usergroup))";
     $userGroup_query = "(FIND_IN_SET('" . $this->confArr['userGroup'] . "',usergroup) OR FIND_IN_SET('" . $this->confArr['modGroup'] . "',usergroup) OR FIND_IN_SET('" . $this->confArr['adminGroup'] . "',usergroup))";
     #$userGroup_query = "1";
     $res = $this->databaseHandle->exec_SELECTquery('count(*)', 'fe_users', "{$filter} and pid='" . $this->confArr['userPID'] . "' and " . $userGroup_query . " and deleted=0");
     $row = $this->databaseHandle->sql_fetch_row($res);
     $records = $row[0];
     $pages = ceil($records / $this->confArr['recordsPerPage']);
     $offset = intval($mmforum['offset']);
     // Page navigation
     $pb = $LANG->getLL('page.page') . ' <a href="index.php?mmforum[offset]=0' . $gp . '">[' . $LANG->getLL('page.first') . ']</a> ';
     $end = $offset + 6 >= $pages ? $pages : $offset + 6;
     $start = $offset - 5;
     if ($start < 0) {
         $start = 0;
     }
     if ($start > 0) {
         $pb .= '... ';
     }
     for ($i = $start; $i < $end; $i++) {
         $pb .= '<a href="index.php?mmforum[offset]=' . $i . $gp . '">' . ($i == $offset ? '<b>' . ($i + 1) . '</b>' : $i + 1) . '</a> ';
     }
     if ($offset + 11 < $pages) {
         $pb .= ' ... <a href="index.php?mmforum[offset]=' . ($pages - 1) . $gp . '">[' . $LANG->getLL('page.last') . ']</a> ';
     }
     // Generate header table
     if ($records < $this->confArr['recordsPerPage']) {
         $mDisp = $records;
     } else {
         $mDisp = $offset * $this->confArr['recordsPerPage'] + $this->confArr['recordsPerPage'];
     }
     $userString = sprintf($LANG->getLL('useradmin.usercount'), $offset * $this->confArr['recordsPerPage'] + 1, $mDisp, $records);
     $out = '<table width="733"><tr>';
     $out .= '<td width="420">' . $pb . '</td>';
     $out .= '<td width="120" align="center"><b>' . $userString . '</b></td>';
     $out .= '<td align="right">' . $LANG->getLL('useradmin.searchfor') . ': <input type="text" id="sword" size="20" name="mmforum[sword]" /></td>';
     $out .= '</tr></table>';
     if ($mmforum['sword'] || $mmforum['old_sword']) {
         $out .= '<p>' . $LANG->getLL('useradmin.filter') . ': ' . $mmforum['sword'] . '* <a href="index.php?mmforum[no_filter]=1&' . $this->linkParams($mmforum) . '">' . $LANG->getLL('useradmin.filter.clear') . '</a></p>';
         $out .= '<input type="hidden" name="mmforum[old_sword]" value="' . $mmforum['sword'] . '" />';
     }
     // Display userdata table
     // Execute database query
     $res = $this->databaseHandle->exec_SELECTquery('*', 'fe_users', "{$filter} and pid='" . $this->confArr['userPID'] . "' and deleted=0 AND " . $userGroup_query, '', $order, $offset * $this->confArr['recordsPerPage'] . "," . $this->confArr['recordsPerPage']);
     if ($res) {
         $marker = array('###USERS_LLL_TITLE###' => $LANG->getLL('users.title'), '###USERS_LLL_USERNAME###' => '<a href="index.php?mmforum_sort=username&mmforum_style=' . $uOrder . '">' . $LANG->getLL('useradmin.username') . '</a>', '###USERS_LLL_REGISTERED###' => '<a href="index.php?mmforum_sort=age&mmforum_style=' . $aOrder . '">' . $LANG->getLL('useradmin.age') . '</a>', '###USERS_LLL_GROUPS###' => $LANG->getLL('useradmin.usergroup'), '###USERS_LLL_OPTIONS###' => '&nbsp;');
         $i = 0;
         $uContent = '';
         while ($row = $this->databaseHandle->sql_fetch_assoc($res)) {
             // Display user groups
             $g = explode(',', $row['usergroup']);
             $outg = '';
             foreach ($g as $sg) {
                 $outg .= $ug[$sg] . ', ';
             }
             $iconAltText = BackendUtility::getRecordIconAltText($row, $table);
             $elementTitle = BackendUtility::getRecordPath($row['uid'], '1=1', 0);
             $elementTitle = GeneralUtility::fixed_lgd_cs($elementTitle, -$BE_USER->uc['titleLen']);
             $elementIcon = IconUtility::getIconImage($table, $row, $BACK_PATH, 'class="c-recicon" title="' . $iconAltText . '"');
             $params = '&edit[fe_users][' . $row['uid'] . ']=edit';
             $editOnClick = BackendUtility::editOnClick($params, $BACK_PATH);
             // Generate row item
             $class_suffix = $i++ % 2 == 0 ? '2' : '';
             $link = "index.php?mmforum[cid]=" . $row['uid'];
             $js = 'onmouseover="this.className=\'mm_forum-listrow_active\'; this.style.cursor=\'pointer\';" onmouseout="this.className=\'mm_forum-listrow' . $class_suffix . '\'" onclick="' . htmlspecialchars($editOnClick) . '"';
             $icon = '<img src="../icon_tx_mmforum_forums.gif" />';
             $hidden = $row['hidden'] == 1 ? '<span style="color:blue;">[' . $LANG->getLL('boardadmin.hidden') . ']</span> ' : '';
             $uMarker = array('###USER_USERNAME###' => htmlspecialchars($row['username']), '###USER_REGISTERED###' => BackendUtility::dateTimeAge($row['crdate'], 1), '###USER_GROUPS###' => substr($outg, -2) == ', ' ? substr($outg, 0, strlen($outg) - 2) : $outg, '###USER_OPTIONS###' => '<img src="img/edit.png" onclick="' . htmlspecialchars($editOnClick) . '" style="cursor:pointer;" />');
             $uContent .= tx_mmforum_BeTools::substituteMarkerArray($uTemplate, $uMarker);
         }
         $template = tx_mmforum_BeTools::substituteSubpart($template, '###USERS_LIST_ITEM###', $uContent);
         $template = tx_mmforum_BeTools::substituteMarkerArray($template, $marker);
         $out .= $template;
     }
     return $out;
 }
开发者ID:rabe69,项目名称:mm_forum,代码行数:101,代码来源:index.php

示例11: render

 /**
  * Resolve page id to page path string (with automatic cropping to maximum given length).
  *
  * @param integer $pid Pid of the page
  * @param integer $titleLimit Limit of the page title
  * @return string Page path string
  */
 public function render($pid, $titleLimit = 20)
 {
     return \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($pid, '', $titleLimit);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:11,代码来源:PagePathViewHelper.php

示例12: intval

 /**
  * shows user's info and categories
  *
  * @return	string		HTML showing user's info and the categories
  */
 function cmd_displayUserInfo()
 {
     $uid = intval(GeneralUtility::_GP('uid'));
     $indata = GeneralUtility::_GP('indata');
     $table = GeneralUtility::_GP('table');
     $mm_table = $GLOBALS["TCA"][$table]['columns']['module_sys_dmail_category']['config']['MM'];
     if (GeneralUtility::_GP('submit')) {
         $indata = GeneralUtility::_GP('indata');
         if (!$indata) {
             $indata['html'] = 0;
         }
     }
     switch ($table) {
         case 'tt_address':
         case 'fe_users':
             if (is_array($indata)) {
                 $data = array();
                 if (is_array($indata['categories'])) {
                     reset($indata['categories']);
                     foreach ($indata["categories"] as $recValues) {
                         $enabled = array();
                         while (list($k, $b) = each($recValues)) {
                             if ($b) {
                                 $enabled[] = $k;
                             }
                         }
                         $data[$table][$uid]['module_sys_dmail_category'] = implode(',', $enabled);
                     }
                 }
                 $data[$table][$uid]['module_sys_dmail_html'] = $indata['html'] ? 1 : 0;
                 /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
                 $tce = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
                 $tce->stripslashes_values = 0;
                 $tce->start($data, array());
                 $tce->process_datamap();
             }
             break;
     }
     switch ($table) {
         case 'tt_address':
             $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('tt_address.*', 'tt_address LEFT JOIN pages ON pages.uid=tt_address.pid', 'tt_address.uid=' . intval($uid) . ' AND ' . $this->perms_clause . BackendUtility::deleteClause('pages') . BackendUtility::BEenableFields('tt_address') . BackendUtility::deleteClause('tt_address'));
             break;
         case 'fe_users':
             $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('fe_users.*', 'fe_users LEFT JOIN pages ON pages.uid=fe_users.pid', 'fe_users.uid=' . intval($uid) . ' AND ' . $this->perms_clause . BackendUtility::deleteClause('pages') . BackendUtility::BEenableFields('fe_users') . BackendUtility::deleteClause('fe_users'));
             break;
     }
     $row = array();
     if ($res) {
         $row = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res);
         $GLOBALS["TYPO3_DB"]->sql_free_result($res);
     }
     $theOutput = "";
     if (is_array($row)) {
         $row_categories = '';
         $resCat = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('uid_foreign', $mm_table, 'uid_local=' . $row['uid']);
         while ($rowCat = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($resCat)) {
             $row_categories .= $rowCat['uid_foreign'] . ',';
         }
         $row_categories = rtrim($row_categories, ",");
         $GLOBALS["TYPO3_DB"]->sql_free_result($resCat);
         $Eparams = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
         $out = '';
         $out .= IconUtility::getSpriteIconForRecord($table, $row, array('title' => BackendUtility::getRecordPath($row['pid'], $this->perms_clause, 40))) . htmlspecialchars($row['name'] . ' <' . $row['email'] . '>');
         $out .= '&nbsp;&nbsp;<a href="#" onClick="' . BackendUtility::editOnClick($Eparams, $GLOBALS["BACK_PATH"], '') . '"><img' . IconUtility::skinImg($GLOBALS["BACK_PATH"], 'gfx/edit2.gif', 'width="12" height="12"') . ' alt="' . $GLOBALS["LANG"]->getLL("dmail_edit") . '" width="12" height="12" style="margin: 2px 3px; vertical-align:top;" title="' . $GLOBALS["LANG"]->getLL("dmail_edit") . '" /><b>' . $GLOBALS["LANG"]->getLL('dmail_edit') . '</b></a>';
         $theOutput = $this->doc->section($GLOBALS["LANG"]->getLL('subscriber_info'), $out);
         $out = '';
         $out_check = '';
         $this->categories = DirectMailUtility::makeCategories($table, $row, $this->sys_language_uid);
         foreach ($this->categories as $pKey => $pVal) {
             $out_check .= '<input type="hidden" name="indata[categories][' . $row['uid'] . '][' . $pKey . ']" value="0" /><input type="checkbox" name="indata[categories][' . $row['uid'] . '][' . $pKey . ']" value="1"' . (GeneralUtility::inList($row_categories, $pKey) ? ' checked="checked"' : '') . ' /> ' . htmlspecialchars($pVal) . '<br />';
         }
         $out_check .= '<br /><br /><input type="checkbox" name="indata[html]" value="1"' . ($row['module_sys_dmail_html'] ? ' checked="checked"' : '') . ' /> ';
         $out_check .= $GLOBALS["LANG"]->getLL('subscriber_profile_htmlemail') . '<br />';
         $out .= $out_check;
         $out .= '<input type="hidden" name="table" value="' . $table . '" /><input type="hidden" name="uid" value="' . $uid . '" /><input type="hidden" name="CMD" value="' . $this->CMD . '" /><br /><input type="submit" name="submit" value="' . htmlspecialchars($GLOBALS["LANG"]->getLL('subscriber_profile_update')) . '" />';
         $theOutput .= $this->doc->spacer(20);
         $theOutput .= $this->doc->section($GLOBALS["LANG"]->getLL('subscriber_profile'), $GLOBALS["LANG"]->getLL('subscriber_profile_instructions') . '<br /><br />' . $out);
     }
     return $theOutput;
 }
开发者ID:preinboth,项目名称:direct_mail,代码行数:85,代码来源:Statistics.php

示例13: getRecordPath

 /**
  * Return record path (visually formatted, using BackendUtility::getRecordPath() )
  *
  * @param string $table Table name
  * @param array $rec Record array
  * @return string The record path.
  * @see BackendUtility::getRecordPath()
  * @todo Define visibility
  */
 public function getRecordPath($table, $rec)
 {
     BackendUtility::fixVersioningPid($table, $rec);
     list($tscPID, $thePidValue) = $this->getTSCpid($table, $rec['uid'], $rec['pid']);
     if ($thePidValue >= 0) {
         return BackendUtility::getRecordPath($tscPID, $this->readPerms(), 15);
     }
     return '';
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:18,代码来源:FormEngine.php

示例14: func_delete

 /**
  * Deleting files and folders (action=4)
  *
  * @param array $cmds $cmds['data'] is the file/folder to delete
  * @return boolean Returns TRUE upon success
  * @todo Define visibility
  */
 public function func_delete($cmds)
 {
     $result = FALSE;
     if (!$this->isInit) {
         return $result;
     }
     // Example indentifier for $cmds['data'] => "4:mypath/tomyfolder/myfile.jpg"
     // for backwards compatibility: the combined file identifier was the path+filename
     $fileObject = $this->getFileObject($cmds['data']);
     // @todo implement the recycler feature which has been removed from the original implementation
     // checks to delete the file
     if ($fileObject instanceof File) {
         // check if the file still has references
         // Exclude sys_file_metadata records as these are no use references
         $refIndexRecords = $this->getDatabaseConnection()->exec_SELECTgetRows('*', 'sys_refindex', 'deleted=0 AND ref_table="sys_file" AND ref_uid=' . (int) $fileObject->getUid() . ' AND tablename != "sys_file_metadata"');
         if (count($refIndexRecords) > 0) {
             $shortcutContent = array();
             foreach ($refIndexRecords as $fileReferenceRow) {
                 if ($fileReferenceRow['tablename'] === 'sys_file_reference') {
                     $row = $this->transformFileReferenceToRecordReference($fileReferenceRow);
                     $shortcutRecord = BackendUtility::getRecord($row['tablename'], $row['recuid']);
                     $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord($row['tablename'], $shortcutRecord);
                     $onClick = 'Clickmenu.show("' . $row['tablename'] . '", "' . $row['recuid'] . '", "1", "+info,history,edit", "|", "");return false;';
                     $shortcutContent[] = '<a href="#" oncontextmenu="this.click();return false;" onclick="' . htmlspecialchars($onClick) . '">' . $icon . '</a>' . htmlspecialchars(BackendUtility::getRecordTitle($row['tablename'], $shortcutRecord) . '  [' . BackendUtility::getRecordPath($shortcutRecord['pid'], '', 80) . ']');
                 }
             }
             // render a message that the file could not be deleted
             $flashMessage = GeneralUtility::makeInstance('\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.description.fileNotDeletedHasReferences'), $fileObject->getName()) . '<br />' . implode('<br />', $shortcutContent), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.header.fileNotDeletedHasReferences'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, TRUE);
             $this->addFlashMessage($flashMessage);
         } else {
             try {
                 $result = $fileObject->delete();
                 // show the user that the file was deleted
                 $flashMessage = GeneralUtility::makeInstance('\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.description.fileDeleted'), $fileObject->getName()), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.header.fileDeleted'), \TYPO3\CMS\Core\Messaging\FlashMessage::OK, TRUE);
                 $this->addFlashMessage($flashMessage);
                 // Log success
                 $this->writelog(4, 0, 1, 'File "%s" deleted', array($fileObject->getIdentifier()));
             } catch (\TYPO3\CMS\Core\Resource\Exception\InsufficientFileAccessPermissionsException $e) {
                 $this->writelog(4, 1, 112, 'You are not allowed to access the file', array($fileObject->getIdentifier()));
             } catch (\TYPO3\CMS\Core\Resource\Exception\NotInMountPointException $e) {
                 $this->writelog(4, 1, 111, 'Target was not within your mountpoints! T="%s"', array($fileObject->getIdentifier()));
             } catch (\RuntimeException $e) {
                 $this->writelog(4, 1, 110, 'Could not delete file "%s". Write-permission problem?', array($fileObject->getIdentifier()));
             }
         }
     } else {
         try {
             /** @var $fileObject \TYPO3\CMS\Core\Resource\FolderInterface */
             if ($fileObject->getFileCount() > 0) {
                 // render a message that the folder could not be deleted because it still contains files
                 $flashMessage = GeneralUtility::makeInstance('\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.description.folderNotDeletedHasFiles'), $fileObject->getName()), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.header.folderNotDeletedHasFiles'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, TRUE);
                 $this->addFlashMessage($flashMessage);
             } else {
                 $result = $fileObject->delete(TRUE);
                 // notify the user that the folder was deleted
                 $flashMessage = GeneralUtility::makeInstance('\\TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.description.folderDeleted'), $fileObject->getName()), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:message.header.folderDeleted'), \TYPO3\CMS\Core\Messaging\FlashMessage::OK, TRUE);
                 $this->addFlashMessage($flashMessage);
                 // Log success
                 $this->writelog(4, 0, 3, 'Directory "%s" deleted', array($fileObject->getIdentifier()));
             }
         } catch (\TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException $e) {
             $this->writelog(4, 1, 123, 'You are not allowed to access the directory', array($fileObject->getIdentifier()));
         } catch (\TYPO3\CMS\Core\Resource\Exception\NotInMountPointException $e) {
             $this->writelog(4, 1, 121, 'Target was not within your mountpoints! T="%s"', array($fileObject->getIdentifier()));
         } catch (\RuntimeException $e) {
             $this->writelog(4, 1, 120, 'Could not delete directory! Write-permission problem? Is directory "%s" empty? (You are not allowed to delete directories recursively).', array($fileObject->getIdentifier()));
         }
     }
     return $result;
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:77,代码来源:ExtendedFileUtility.php

示例15: readPageAccess

 public function readPageAccess($id, $perms_clause)
 {
     if ((string) $id != '') {
         $id = intval($id);
         if (!$id) {
             if ($GLOBALS['BE_USER']->isAdmin()) {
                 $path = '/';
                 $pageinfo['_thePath'] = $path;
                 return $pageinfo;
             }
         } else {
             $pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $id, '*', $perms_clause ? ' AND ' . $perms_clause : '');
             if ($pageinfo['uid'] && $GLOBALS['BE_USER']->isInWebMount($id, $perms_clause)) {
                 \TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('pages', $pageinfo);
                 \TYPO3\CMS\Backend\Utility\BackendUtility::fixVersioningPid('pages', $pageinfo);
                 list($pageinfo['_thePath'], $pageinfo['_thePathFull']) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath(intval($pageinfo['uid']), $perms_clause, 15, 1000);
                 return $pageinfo;
             }
         }
     }
     return false;
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:22,代码来源:class.mslib_befe.php


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